From: Alex Pooley (@zuedev) Date: Mon, 23 Mar 2026 11:04:23 +0000 (+0000) Subject: add caddy configuration X-Git-Url: http://git.zue.dev/?a=commitdiff_plain;h=059231cc06dd6913c52d88175c8e006534b8500a;p=git.zue.dev add caddy configuration --- diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..5fdfe48 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,7 @@ +{ + email certs@git.zue.dev +} + +https://git.zue.dev { + reverse_proxy localhost:8080 +} \ No newline at end of file diff --git a/cron/minutely.bash b/cron/minutely.bash index 6e69661..06e4865 100644 --- a/cron/minutely.bash +++ b/cron/minutely.bash @@ -15,6 +15,14 @@ fi # enter the repo cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"; exit 1; } +# replace Caddyfile if it has changed +if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/Caddyfile" <(git show HEAD:"Caddyfile"); then + echo "Caddyfile has changed. Updating local copy..." + git show HEAD:"Caddyfile" > "$DOCKER_COMPOSE_DIRECTORY/Caddyfile" +else + echo "Caddyfile has not changed. No action needed." +fi + # array of files to check for changes HTML_FILES_TO_CHECK=( "site_header.html" diff --git a/docker-compose.yaml b/docker-compose.yaml index c6b93d2..6d5edf8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,13 @@ services: + caddy: + image: caddy:2.8.4-alpine + ports: + - 80:80 + - 443:443 + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro + - caddy_data:/data + - caddy_config:/config gitweb: build: context: . @@ -18,7 +27,7 @@ services: echo "\$$feature{'remote_heads'}{'default'} = [1];" >> /etc/gitweb.conf && \ nginx -g 'daemon off;' ports: - - 6300:80 + - 8080:80 environment: - PROJECTS_LIST= volumes: