ansible/playbooks/apps/files/Caddyfile

318 lines
7 KiB
Text
Raw Permalink Normal View History

2024-10-10 22:25:30 +02:00
{
email gabriel@augendre.info
http_port 80
https_port 443
log {
format console
}
2024-10-10 22:25:30 +02:00
}
(common_headers) {
header * -Server
header * -X-Powered-By
header * Permissions-Policy interest-cohort=()
header * ?Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
header * ?Referrer-Policy "strict-origin-when-cross-origin"
header * ?X-Content-Type-Options "nosniff"
header * ?X-Frame-Options "DENY"
header * ?X-XSS-Protection "1; mode=block"
}
(internal) {
@blocked not client_ip private_ranges 2a01:e0a:325:a1c0::/64
respond @blocked "Access denied" 403 {
close
}
}
#########################################################
# PUBLIC SERVICES
#########################################################
2024-10-10 22:46:11 +02:00
## Static config
#########################################################
static.augendre.info {
import common_headers
header * Cache-Control "max-age=300"
file_server * {
root /mnt/data/caddy/static
hide .*
}
}
augendre.info {
import common_headers
respond * 200
}
## Reverse proxies (ports 8000-8999)
#########################################################
2024-10-10 22:25:30 +02:00
charasheet.augendre.info {
import common_headers
route {
file_server /media/* {
root /mnt/data/charasheet/data
}
reverse_proxy localhost:8001
}
}
checkout.augendre.info {
import common_headers
route {
file_server /media/* {
root /mnt/data/checkout
}
reverse_proxy localhost:8002
}
}
cloud.augendre.info {
import common_headers
reverse_proxy localhost:8003
}
2024-10-10 22:46:11 +02:00
gc.gabnotes.org, gc.augendre.info, static.gc.augendre.info, voyages.gc.coccomagnard.fr {
2024-10-10 22:25:30 +02:00
import common_headers
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:8005
2024-10-10 22:25:30 +02:00
}
git.augendre.info {
import common_headers
reverse_proxy localhost:8006
}
office.augendre.info {
import common_headers
reverse_proxy localhost:8007
}
reader.augendre.info {
import common_headers
reverse_proxy localhost:8008
}
wallabag.augendre.info {
import common_headers
header * ?Content-Security-Policy "default-src 'none'; img-src * data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src 'self'; connect-src 'self'; manifest-src 'self'"
reverse_proxy localhost:8009
}
bin.augendre.info, paste.augendre.info {
import common_headers
@bot header User-Agent PrivateBinDirectoryBot*
respond @bot "Access denied" 403 {
close
}
reverse_proxy localhost:8010
}
2024-10-10 22:46:11 +02:00
g4b.ovh {
import common_headers
reverse_proxy localhost:8011
}
manuels.augendre.info, fournitures.augendre.info {
import common_headers
reverse_proxy localhost:8012
}
tcl.augendre.info {
import common_headers
reverse_proxy localhost:8013
}
2024-11-06 16:31:28 +01:00
paperless.augendre.info {
import common_headers
reverse_proxy localhost:8014
}
2024-10-10 22:46:11 +02:00
## Ghost blogs (ports >=2368)
#########################################################
2024-10-10 22:25:30 +02:00
gabnotes.org {
import common_headers
header * Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline' https:; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' https://cdn.jsdelivr.net https://code.jquery.com https://*.gabnotes.org https://unpkg.com https://cdnjs.cloudflare.com; img-src 'self' https:; connect-src 'self' https://*.augendre.info https://unpkg.com https://*.gabnotes.org https://api.codapi.org; frame-ancestors https://*.augendre.info; base-uri 'self'; form-action 'self';"
reverse_proxy localhost:2368
}
ghost.augendre.info {
import common_headers
redir / /ghost/
2024-10-11 16:51:42 +02:00
reverse_proxy localhost:2368
2024-10-10 22:25:30 +02:00
}
voyages-lois.augendre.info {
import common_headers
header * X-Frame-Options "SAMEORIGIN"
reverse_proxy localhost:2369
}
voyages.coccomagnard.fr, voyages.augendre.info {
import common_headers
header * X-Frame-Options "SAMEORIGIN"
reverse_proxy localhost:2370
}
2024-10-10 22:46:11 +02:00
#########################################################
# PROXY TO EXTERNAL SERVICES
#########################################################
2024-10-10 22:25:30 +02:00
2024-10-10 22:46:11 +02:00
## At home
#########################################################
2024-10-10 22:25:30 +02:00
hass.augendre.info {
import common_headers
header * X-Frame-Options "SAMEORIGIN"
reverse_proxy http://192.168.0.9:8123
}
2024-10-10 22:46:11 +02:00
prusalink.augendre.info {
import internal
reverse_proxy http://192.168.0.12
}
## Outside
2024-10-10 22:25:30 +02:00
#########################################################
autoconfig.augendre.info {
import common_headers
reverse_proxy https://autoconfig.migadu.com
}
#########################################################
# INTERNAL SERVICES
#########################################################
2024-10-10 22:46:11 +02:00
## Static config
#########################################################
2024-10-10 22:25:30 +02:00
internal-static.augendre.info {
import common_headers
import internal
header * Cache-Control "max-age=300"
file_server * {
root /mnt/data/caddy/internal-static
hide .*
browse
}
}
2024-10-10 22:46:11 +02:00
## Reverse proxies (ports 9000-9999)
#########################################################
2024-10-10 22:25:30 +02:00
portainer.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy https://localhost:9001 {
2024-10-10 22:25:30 +02:00
transport http {
tls_insecure_skip_verify
}
}
}
code.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9002
2024-10-10 22:25:30 +02:00
}
2024-10-10 22:46:11 +02:00
plex.augendre.info {
import common_headers
import internal
reverse_proxy localhost:9003
}
2024-10-10 22:25:30 +02:00
transmission.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9004
2024-10-10 22:25:30 +02:00
}
sonarr.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9005
2024-10-10 22:25:30 +02:00
}
prowlarr.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9006
2024-10-10 22:25:30 +02:00
}
radarr.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9007
2024-10-10 22:25:30 +02:00
}
test.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9008
2024-10-10 22:25:30 +02:00
}
nextcloud-kibana.augendre.info {
import common_headers
import internal
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9009
2024-10-10 22:25:30 +02:00
}
display.augendre.info {
import common_headers
import internal
header Content-Security-Policy "default-src 'self' https://*.augendre.info; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; frame-ancestors https://*.augendre.info; connect-src 'self' https://*.augendre.info https://download.data.grandlyon.com"
2024-10-10 22:46:11 +02:00
reverse_proxy localhost:9010
2024-10-10 22:25:30 +02:00
}
2024-10-12 23:11:25 +02:00
aio.augendre.info {
import common_headers
import internal
reverse_proxy https://localhost:9011 {
transport http {
tls_insecure_skip_verify
}
}
}
2024-12-17 20:30:32 +01:00
stirlingpdf.augendre.info {
import common_headers
import internal
2024-12-17 20:30:32 +01:00
reverse_proxy localhost:9012
}
# ESP Home builder is in network mode host.
esphome.augendre.info {
import common_headers
import internal
reverse_proxy localhost:6052
}
2024-10-10 22:25:30 +02:00
#########################################################
# REDIRECTS
#########################################################
mariage.augendre.info {
import common_headers
2024-10-19 12:14:34 +02:00
redir https://cloud.augendre.info/s/bLcf3C8LzcSo8AR
2024-10-10 22:25:30 +02:00
}
mail.augendre.info {
import common_headers
redir https://webmail.migadu.com permanent
}
cv-gabriel.augendre.info {
import common_headers
2024-10-19 12:15:45 +02:00
redir https://cloud.augendre.info/s/LpcSwsygEFRsXFD/download permanent
2024-10-10 22:25:30 +02:00
}
blog.augendre.info gabriel.augendre.info www.gabnotes.org {
import common_headers
redir https://gabnotes.org{uri} permanent
}
qrcode.augendre.info qr.augendre.info {
import common_headers
redir https://static.augendre.info/qrcode-web/
}