Quantum/caddy-to-quantum.json
RTSDA fd12f35e6c Implement core Caddy replacement functionality
- Add comprehensive HTTP/1.1 and HTTP/2 server support
- Implement reverse proxy with load balancing
- Add static file serving with proper MIME types
- Create multi-port server management
- Add TLS/HTTPS support with SNI and ACME
- Implement authentication middleware framework
- Add advanced routing and matchers system
- Create file sync service foundation
- Add metrics collection and health monitoring
- Implement simple configuration format
- Successfully tested with production-equivalent config

Core features working:
- Reverse proxy to localhost:3000 ✓
- Static file serving ✓
- Multi-port configuration ✓
- CORS headers and security ✓
- Simple config format detection ✓

Ready for production testing as Caddy replacement.
2025-08-17 20:02:04 -04:00

495 lines
17 KiB
JSON

{
"admin": {"listen": ":2019"},
"apps": {
"http": {
"servers": {
"api_server": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["api.rockvilletollandsda.church", "api.adventisthymnarium.app"]}],
"handle": [
{
"handler": "subroute",
"routes": [
{
"match": [{"path": ["/uploads/rtsda_android/*"]}],
"handle": [
{
"handler": "headers",
"response": {
"set": {
"Content-Type": ["application/vnd.android.package-archive"],
"Content-Disposition": ["attachment; filename=rtsda.apk"]
}
}
},
{
"handler": "file_server",
"root": "/opt/rtsda/church-api"
}
]
},
{
"match": [{"path": ["/uploads/*"]}],
"handle": [
{
"handler": "file_server",
"root": "/opt/rtsda/church-api"
}
]
},
{
"match": [{"path": ["/*"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:3002"}]
}
]
}
]
}
]
}
]
},
"stream_server": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["stream.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "subroute",
"routes": [
{
"match": [
{
"not": [
{"path": ["/admin*"]},
{"path": ["/_next/*"]},
{"path": ["/styles/*"]},
{"path": ["/api/*"]},
{"path": ["/hls/*"]}
]
}
],
"handle": [
{
"handler": "static_response",
"status_code": 301,
"headers": {
"Location": ["https://rockvilletollandsda.church/live"]
}
}
]
},
{
"match": [{"path": ["/admin*", "/_next/*", "/styles/*", "/api/*", "/hls/*"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:8080"}]
}
]
},
{
"handle": [
{
"handler": "file_server"
}
]
}
]
}
]
}
]
},
"contact_server": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["contact.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:3002"}]
}
]
}
]
},
"jellyfin_server": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["jellyfin.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:8096"}]
}
]
}
]
},
"pocketbase_server": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["pocketbase.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "subroute",
"routes": [
{
"match": [{"path": ["/api/files/rtsda_android_collection/legacy_update_bridge/current"]}],
"handle": [
{
"handler": "static_response",
"status_code": 302,
"headers": {
"Location": ["https://api.rockvilletollandsda.church/uploads/rtsda_android/rtsda-1.0.apk"]
}
}
]
},
{
"match": [{"path": ["/api/collections/rtsda_android/records"]}],
"handle": [
{
"handler": "static_response",
"status_code": 301,
"headers": {
"Location": ["https://api.rockvilletollandsda.church/api/collections/rtsda_android/records"]
}
}
]
},
{
"handle": [
{
"handler": "static_response",
"status_code": 410,
"body": "PocketBase has been migrated. Please update your app."
}
]
}
]
}
]
}
]
},
"static_servers": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["adventisthymnarium.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "file_server",
"root": "/media/archive/AdventistHymnarium-Assets"
}
]
},
{
"match": [{"hosts": ["privacy-policy.adventisthymnarium.app"]}],
"handle": [
{
"handler": "file_server",
"root": "/media/archive/AdventistHymnarium-Assets",
"try_files": ["{http.request.uri.path}", "/privacy-policy.html"]
}
]
},
{
"match": [{"hosts": ["privacy-policy.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "file_server",
"root": "/media/archive/AdventistHymnarium-Assets",
"try_files": ["{http.request.uri.path}", "/privacy-policy-rtsda.html"]
}
]
},
{
"match": [{"hosts": ["bible.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "file_server",
"root": "/media/archive/bibles"
}
]
},
{
"match": [{"hosts": ["quarterlies.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "headers",
"response": {
"set": {
"X-Content-Type-Options": ["nosniff"],
"X-Frame-Options": ["DENY"],
"X-XSS-Protection": ["1; mode=block"],
"Referrer-Policy": ["strict-origin-when-cross-origin"],
"Cache-Control": ["public, max-age=3600"]
}
}
},
{
"handler": "file_server",
"root": "/var/www/quarterlies"
}
]
},
{
"match": [{"hosts": ["schedule.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "headers",
"response": {
"set": {
"X-Content-Type-Options": ["nosniff"],
"X-Frame-Options": ["DENY"],
"X-XSS-Protection": ["1; mode=block"]
}
}
},
{
"handler": "file_server",
"root": "/var/www/schedule"
}
]
},
{
"match": [{"hosts": ["admin.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "headers",
"response": {
"set": {
"X-Content-Type-Options": ["nosniff"],
"X-Frame-Options": ["DENY"],
"X-XSS-Protection": ["1; mode=block"],
"Referrer-Policy": ["strict-origin-when-cross-origin"],
"Permissions-Policy": ["camera=(), microphone=(), geolocation=()"],
"Cache-Control": ["public, max-age=31536000, immutable"]
}
}
},
{
"handler": "file_server",
"root": "/var/www/admin",
"try_files": ["{http.request.uri.path}", "/index.html"]
}
]
}
]
},
"proxy_servers": {
"listen": [":443"],
"routes": [
{
"match": [{"hosts": ["openlp.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:4316"}]
}
]
},
{
"match": [{"hosts": ["obs.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:4455"}],
"headers": {
"request": {
"set": {
"X-Real-IP": ["{http.request.remote_host}"],
"X-Forwarded-For": ["{http.request.remote_host}"],
"Host": ["{http.request.host}"]
}
}
}
}
]
},
{
"match": [{"hosts": ["remote.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:8443"}]
}
]
},
{
"match": [{"hosts": ["syncthing.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:22000"}]
}
]
},
{
"match": [{"hosts": ["rockvilletollandsda.church", "rockvilletollandsda.org"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:4321"}]
}
]
},
{
"match": [{"hosts": ["webrtc.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:8081"}]
}
]
},
{
"match": [{"hosts": ["git.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:3000"}]
}
]
}
]
},
"special_servers": {
"listen": [":443", ":4317"],
"routes": [
{
"match": [{"hosts": ["openlp.rockvilletollandsda.church"]}, {"port": "4317"}],
"handle": [
{
"handler": "subroute",
"routes": [
{
"match": [{"path": ["/poll*", "/messages*"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:4318"}]
}
]
},
{
"match": [{"path": ["/"]}],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [{"dial": "localhost:4318"}]
}
]
}
]
}
]
},
{
"match": [{"hosts": ["events.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "static_response",
"status_code": 301,
"headers": {
"Location": ["https://rockvilletollandsda.church/events/submit"]
}
}
]
},
{
"match": [{"hosts": ["nominating.rockvilletollandsda.church"]}],
"handle": [
{
"handler": "subroute",
"routes": [
{
"match": [{"path": ["/admin*"]}],
"handle": [
{
"handler": "authentication",
"providers": {
"http_basic": {
"accounts": [
{
"username": "admin",
"password": "$2a$14$p4vzY.AzQynxA6BIRBBtF.pdiIMv7F9ooOtzznCZbm7HaHNX/vBJi"
}
]
}
}
},
{
"handler": "file_server",
"root": "/var/www/nmc"
}
]
},
{
"match": [{"path": ["/"]}],
"handle": [
{
"handler": "file_server",
"root": "/var/www/nmc",
"try_files": ["{http.request.uri.path}", "/index.html"]
}
]
}
]
}
]
}
]
}
}
},
"tls": {
"automation": {
"policies": [
{
"subjects": [
"api.rockvilletollandsda.church",
"api.adventisthymnarium.app",
"stream.rockvilletollandsda.church",
"contact.rockvilletollandsda.church",
"jellyfin.rockvilletollandsda.church",
"pocketbase.rockvilletollandsda.church",
"adventisthymnarium.rockvilletollandsda.church",
"privacy-policy.adventisthymnarium.app",
"privacy-policy.rockvilletollandsda.church",
"bible.rockvilletollandsda.church",
"openlp.rockvilletollandsda.church",
"obs.rockvilletollandsda.church",
"remote.rockvilletollandsda.church",
"syncthing.rockvilletollandsda.church",
"quarterlies.rockvilletollandsda.church",
"schedule.rockvilletollandsda.church",
"events.rockvilletollandsda.church",
"admin.rockvilletollandsda.church",
"rockvilletollandsda.church",
"rockvilletollandsda.org",
"webrtc.rockvilletollandsda.church",
"nominating.rockvilletollandsda.church",
"git.rockvilletollandsda.church"
],
"issuer": {
"module": "acme"
}
}
]
}
}
}
}