initial commit
3 files changed, 134 insertions(+), 0 deletions(-)
changed files
A Caddyfile
@@ -0,0 +1,77 @@ +{ + admin off + persist_config off + + http_port "{$SERVER_PORT:80}" + https_port "{$SERVER_TLS_PORT:443}" + + servers { + protocols h1 h2 + } + + cache { + ttl 1h + simplefs { + path /data/ + # size 100000 + # directory_size 1000MB + } + } + log { + format console + } + + acme_ca https://acme-api.actalis.com/acme/directory + acme_eab { + key_id {$EAB_KEY_ID} + mac_key {$EAB_MAC_KEY} + } + + storage redis { + host redis.alin.ovh + username default + db 1 + password "{$REDIS_PASSWORD}" + encryption_key "{$REDIS_ENCRYPTION_KEY}" + tls_enabled true + tls_insecure false + } +} + +(dns01) { + tls { + dns rfc2136 { + key_name caddy + key_alg hmac-sha512 + key {env.DDNS_TSIG_KEY} + server pdns.alin.ovh:53 + } + } +} + +(cache) { + cache + header -Server +} + +flynet-butterfly-1123.fly.dev { + respond "Hello, world!" +} + +www.alanpearce.eu, www.alin.ovh { + import cache + import dns01 + reverse_proxy https://homestead-homestead488.danubedata.run +} + +git.alin.ovh { + import cache + import dns01 + reverse_proxy https://smrk.alin.ovh +} + +go.alin.ovh { + import cache + import dns01 + reverse_proxy https://smrk.alin.ovh +}
A Dockerfile
@@ -0,0 +1,17 @@ +ARG CADDY_VERSION=2.11.2 + +FROM caddy:${CADDY_VERSION}-builder-alpine AS builder + +RUN xcaddy build \ + --with github.com/caddyserver/cache-handler \ + --with github.com/darkweak/storages/simplefs/caddy \ + --with github.com/pberkel/caddy-storage-redis \ + --with github.com/caddy-dns/rfc2136 + +FROM caddy:${CADDY_VERSION}-alpine AS runner + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy + +COPY Caddyfile . + +CMD [ "/usr/bin/caddy", "run" ]
A fly.toml
@@ -0,0 +1,40 @@ +# fly.toml app configuration file generated for flynet-butterfly-1123 on 2026-04-26T19:33:22+02:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'flynet-butterfly-1123' +primary_region = 'ams' + +[build] + +[env] + SERVER_PORT = 80 + SERVER_TLS_PORT = 443 + +[deploy] + release_command = "/usr/bin/caddy validate" + +[[vm]] + memory = '256mb' + cpus = 1 + memory_mb = 256 + +[[services]] + internal_port = 80 + protocol = "tcp" + + [[services.ports]] + port = 80 + +[[services]] + internal_port = 443 + protocol = "tcp" + + [[services.ports]] + port = 443 + +[mounts] + source = "data" + destination = "/data" + initial_size = "1gb"