Skip to content

Commit

Permalink
Caddyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
webees committed Nov 16, 2024
1 parent 60ccc5b commit 3481636
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# If you don't have your own domain (highly recommended)
# comment this out for first deployment, add your fly.dev domain here
# then reset your secrets and redeploy your app (untested)
CADDY_DOMAIN=domain.name.com
DOMAIN_NAME=domain.name.com

###################
# E-mail settings #
Expand Down
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ ARG SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.

ENV TZ="Asia/Shanghai" \

CADDY_DOMAIN= \
CADDY_PORT=80 \
GOTIFY_SERVER_PORT=8080 \
DOMAIN_NAME= \

OVERMIND_CAN_DIE=caddy,crontab \
OVERMIND_PROCFILE=/Procfile \
Expand All @@ -29,8 +27,8 @@ ENV TZ="Asia/Shanghai" \

COPY config/crontab \
config/Procfile \
config/Caddyfile \
scripts/restic.sh \
scripts/caddy.sh \
/

RUN apt update && apt install -y --no-install-recommends \
Expand Down Expand Up @@ -65,7 +63,6 @@ RUN apt update && apt install -y --no-install-recommends \

&& chmod +x /usr/local/bin/supercronic \
&& chmod +x /usr/local/bin/overmind \
&& chmod +x /restic.sh \
&& chmod +x /caddy.sh
&& chmod +x /restic.sh

ENTRYPOINT ["overmind", "start"]
45 changes: 45 additions & 0 deletions config/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
# HTTPS/TLS is handled by Fly or on your domain (eg: Cloudflare)
auto_https off
admin off
persist_config off

log {
output stdout
format console
}
}

{$DOMAIN_NAME}:80 {
encode zstd gzip

header / {
# Enable HTTP Strict Transport Security (HSTS)
Strict-Transport-Security "max-age=31536000;"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "DENY"
# Prevent search engines from indexing
X-Robots-Tag "noindex, nofollow"
# Disallow sniffing of X-Content-Type-Options
X-Content-Type-Options "nosniff"
# Server name removing
-Server
# Remove X-Powered-By though this shouldn't be an issue, better opsec to remove
-X-Powered-By
# Remove Last-Modified because etag is the same and is as effective
-Last-Modified
}

route /health {
respond "Hello, world!"
}

reverse_proxy localhost:8080 {
# Send the true remote IP to Rocket, so that vaultwarden can put this in the log
@cloudflare header Cf-Connecting-Ip *
header_up @cloudflare X-Real-IP {http.request.header.Cf-Connecting-Ip}
header_up !@cloudflare X-Real-IP {remote_host}
}
}
2 changes: 1 addition & 1 deletion config/Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gotify: cd /app && ./gotify-app
caddy: /caddy.sh
caddy: caddy run --config /Caddyfile
crontab: supercronic /crontab
44 changes: 0 additions & 44 deletions scripts/caddy.sh

This file was deleted.

0 comments on commit 3481636

Please sign in to comment.