From da604215c14b630a315a96ca96ca70e318161e5d Mon Sep 17 00:00:00 2001 From: Catherine Date: Fri, 19 Sep 2025 21:58:38 +0000 Subject: [PATCH] Adapt Caddyfile during the build. Until https://github.com/ss098/certmagic-s3/pull/25 is merged, this also uses a fork of certmagic-s3. --- conf/Caddyfile | 8 ++++---- conf/supervisord.conf | 2 +- nix/pkgs/image.nix | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/Caddyfile b/conf/Caddyfile index bfd5c9b..48ed556 100644 --- a/conf/Caddyfile +++ b/conf/Caddyfile @@ -15,10 +15,10 @@ } storage s3 { - host "{$S3_ENDPOINT}" - access_id "{$S3_ACCESS_KEY_ID}" - secret_key "{$S3_SECRET_ACCESS_KEY}" - bucket "{$S3_BUCKET}" + host "{env.S3_ENDPOINT}" + access_id "{env.S3_ACCESS_KEY_ID}" + secret_key "{env.S3_SECRET_ACCESS_KEY}" + bucket "{env.S3_BUCKET}" prefix "ssl" } diff --git a/conf/supervisord.conf b/conf/supervisord.conf index 0376005..2e0b9f8 100644 --- a/conf/supervisord.conf +++ b/conf/supervisord.conf @@ -12,5 +12,5 @@ autorestart = true command = /bin/git-pages [program:caddy] -command = /bin/caddy run +command = /bin/caddy run -c caddy.json depends_on = pages diff --git a/nix/pkgs/image.nix b/nix/pkgs/image.nix index 9f9ae9f..a70ad43 100644 --- a/nix/pkgs/image.nix +++ b/nix/pkgs/image.nix @@ -15,10 +15,10 @@ let caddy' = (caddy.withPlugins { plugins = [ - "github.com/ss098/certmagic-s3@v0.0.0-20250808023250-9788b7231c87" + "github.com/ss098/certmagic-s3=github.com/whitequark/certmagic-s3@v0.0.0-20250919212902-21ac26c15951" ]; - hash = "sha256-jZer6cBnE2Vo5/kMG+1vZBwWY8P/V1Lb33TA3Suz4pI="; + hash = "sha256-Mx+jSvjNt6y7mK4aP/YERmCPWx5UTGTyH2dbXUJ9+UY="; }).overrideAttrs (oldAttrs: { buildInputs = with pkgsStatic; [ @@ -49,7 +49,7 @@ dockerTools.buildImage { mkdir /bin cp ${self}/config.toml.example /app/config.toml - cp ${self}/conf/Caddyfile /app/Caddyfile + ${caddy'}/bin/caddy adapt --config ${self}/conf/Caddyfile >/app/caddy.json cp ${self}/conf/supervisord.conf /app/supervisord.conf cp ${caddy'}/bin/caddy /bin/caddy