gendesign/Caddyfile
lekss361 f1bc821c2b feat(preview): add static mockups behind basic auth at /preview/*
4 HTML mockups (landing/site-finder/analytics/monitoring) — alternative
designs для audit-review без замены существующих React-страниц.

- Caddy file_server на handle_path /preview/* (внутри gendsgn.ru block)
- Bind mount ./preview:/srv/preview:ro в caddy container
- basic auth: user=preview / pwd shared via private channel
- Static, isolated — не влияет на /, /site-finder, /analytics (Next.js routes)
2026-05-17 11:15:13 +03:00

102 lines
2.8 KiB
Caddyfile

# Caddy config.
#
# - gendsgn.ru — main production site, auto-TLS via Let's Encrypt.
# - www.gendsgn.ru — 301 redirect to apex (canonical URL).
# - :80 — fallback for raw IP access. Will be removed once everyone uses the domain.
#
# `handle /api/*` (NOT `handle_path`) — we keep the /api prefix because
# the FastAPI router is mounted at /api/v1/*.
gendsgn.ru {
encode zstd gzip
handle /api/* {
reverse_proxy backend:8000
}
handle /health {
reverse_proxy backend:8000
}
# Static HTML mockups для review (audit alternatives).
# Basic auth: user=preview / pwd выдан вне репо. Bcrypt hash в Caddyfile (publishing OK).
handle_path /preview/* {
root * /srv/preview
basicauth {
preview $2a$14$6yBnKYGKaiPK4de1qoa7DuKhQ7h8UJmEIvCToM5M1IvBprpkop.Fy
}
file_server browse
}
handle {
reverse_proxy frontend:3000
}
}
www.gendsgn.ru {
redir https://gendsgn.ru{uri} permanent
}
# Obsidian Self-hosted LiveSync (CouchDB backend).
# Auto-TLS Let's Encrypt. CORS уже включён на стороне CouchDB через bootstrap
# (см. scripts/setup-couchdb.sh). Basic-auth — на стороне CouchDB (admin user).
#
# DNS: A-record obsidian.gendsgn.ru → IP VPS.
# Клиенты Obsidian + Self-hosted LiveSync plugin указывают на этот URL.
obsidian.gendsgn.ru {
encode zstd gzip
reverse_proxy couchdb:5984 {
# Большие документы (vault attachments / images) — увеличиваем timeout
transport http {
response_header_timeout 120s
}
}
}
# GlitchTip — self-hosted error tracking (Sentry-compatible).
# DNS: A-record errors.gendsgn.ru → IP VPS.
errors.gendsgn.ru {
encode zstd gzip
reverse_proxy glitchtip-web:8080
log {
output file /var/log/caddy/errors.gendsgn.ru.log
}
}
# Forgejo — self-hosted git (migration 2026-05-16).
# DNS: A-record git.gendsgn.ru → IP VPS.
# Forgejo container из forgejo-migration/docker-compose.yml на shared
# gendesign_default network. HTTP port 3000 (default Forgejo).
# Был добавлен вручную при migration, потерян при первом auto-deploy после
# изменения Caddyfile (deploy.yml делает git reset --hard). См. fix issue.
git.gendsgn.ru {
encode zstd gzip
reverse_proxy forgejo:3000
log {
output file /var/log/caddy/git.gendsgn.ru.log
}
}
# Plain HTTP by IP — kept for ssh-tunnel / debugging.
# Caddy issues no TLS here (no hostname).
:80 {
encode zstd gzip
handle /api/* {
reverse_proxy backend:8000
}
handle /health {
reverse_proxy backend:8000
}
handle {
reverse_proxy frontend:3000
}
}
# Test deploy flow 2026-05-15T21:43:32Z