Skip to content

Commit

Permalink
Now you can add a templates/Caddyfile.local to append custom part to …
Browse files Browse the repository at this point in the history
…the Caddyfile
  • Loading branch information
root committed Apr 28, 2024
1 parent 9ebb9a8 commit ee2abbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/disk-*
/.env
/templates/Caddyfile.local
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ if [[ "$ACME_DNS" != "selfsigned" ]]; then
fi

# Configure Caddy
if [[ -f templates/Caddyfile.local ]]; then
caddyfile_local=$(<templates/Caddyfile.local)
fi
_template templates/Caddyfile /etc/caddy/Caddyfile -o root -g root -m 644

# Restart/reload caddy
Expand Down
1 change: 1 addition & 0 deletions templates/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ $([[ $ACME_DNS != "selfsigned" ]] || echo "#") tls /etc/caddy/vmtree.crt
to "{http.request.host.labels.$(echo ${DOMAIN//[!.]/} | wc -c)}.lxd:80"
}
}
${caddyfile_local:-}

0 comments on commit ee2abbe

Please sign in to comment.