synth.download/beeper/etc/caddy/Caddyfile

51 lines
No EOL
1.9 KiB
Caddyfile

# =============================================================================
# ╭────────────────────────────────╮
# │ commonly reused rules/snippets │
# ╰────────────────────────────────╯
# common settings - globally enables settings that are commonly used in every snippet
(common-settings) {
encode zstd gzip
}
# log - reused log settings
(log) {
log {
output file /var/log/caddy/{args[0]} {
roll_size 10MB
roll_keep 1
roll_keep_for 120h
}
}
}
# robots-txt - link /robots.txt to the same file
(robots-txt) {
handle_path /robots.txt {
root * /var/www/robots.txt
file_server
}
}
# =============================================================================
# ╭──────────────────────────╮
# │ main/general information │
# ╰──────────────────────────╯
{
email synth@synth.download
import log caddy
acme_dns porkbun {
api_key {env.PORKBUN_API_KEY}
api_secret_key {env.PORKBUN_API_SECRET_KEY}
}
}
# ╭───────────────────────────────────────────────────────────────────────────╮
# │ do an nginx and seperate snippets for sites into /etc/caddy/sites-enabled │
# ╰───────────────────────────────────────────────────────────────────────────╯
# to "disable" anything, just move the file to /etc/caddy/sites-disabled and reload caddy
import /etc/caddy/sites-enabled/*