From beaf379300873fcdefece9ba5d77e54b4270e33e Mon Sep 17 00:00:00 2001 From: djmil Date: Thu, 22 Aug 2024 20:58:42 +0200 Subject: [PATCH] Incorrect MIME type for *.js files This commit closes #3 Caddy server relies on Alpine's file type MIME discovery, which as of Alpine v3.20 is broken: $ file --mime-type -b simple.js > text/plain --- Caddyfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Caddyfile b/Caddyfile index 3f80830..3da8c01 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,9 +1,18 @@ +# caddy reload --config /etc/caddy/Caddyfile { order gitea before file_server } :3003 gitea { - token {$GITEA_ACCESS_TOKEN} # Settings > Applications > Generate Token - server {$GITEA_HOST} # https://yourgitea.yourdomain.com + token {$GITEA_ACCESS_TOKEN} # Settings > Applications > Generate Token + server {$GITEA_HOST} # https://yourgitea.yourdomain.com domain {$PAGES_DOMAIN} # pages.yourdomain.com } + +@js { + path *.js +} + +header @js { + Content-Type text/javascript # https://gitea.djmil.dev/djmil/gitea-pages/issues/3 +}