optionally generate traefik files, set cors in config, and set trust proxy in config

This commit is contained in:
Milo Schwartz 2025-01-15 23:26:31 -05:00
parent cb87463a69
commit 1aec431c36
No known key found for this signature in database
13 changed files with 300 additions and 49 deletions

View file

@ -13,6 +13,11 @@ server:
session_cookie_name: p_session
resource_session_cookie_name: p_resource_session
resource_access_token_param: p_token
cors:
origins: ["https://{{.DashboardDomain}}"]
methods: ["GET", "POST", "PUT", "DELETE", "PATCH"]
headers: ["X-CSRF-Token", "Content-Type"]
credentials: false
traefik:
cert_resolver: letsencrypt

View file

@ -4,21 +4,6 @@ http:
redirectScheme:
scheme: https
permanent: true
cors:
headers:
accessControlAllowMethods:
- GET
- PUT
- POST
- DELETE
- PATCH
accessControlAllowHeaders:
- Content-Type
- X-CSRF-Token
accessControlAllowOriginList:
- https://{{.DashboardDomain}}
accessControlAllowCredentials: false
routers:
# HTTP to HTTPS redirect router
@ -29,7 +14,6 @@ http:
- web
middlewares:
- redirect-to-https
- cors
# Next.js router (handles everything except API and WebSocket paths)
next-router:
@ -37,8 +21,6 @@ http:
service: next-service
entryPoints:
- websecure
middlewares:
- cors
tls:
certResolver: letsencrypt
@ -48,8 +30,6 @@ http:
service: api-service
entryPoints:
- websecure
middlewares:
- cors
tls:
certResolver: letsencrypt
@ -59,8 +39,6 @@ http:
service: api-service
entryPoints:
- websecure
middlewares:
- cors
tls:
certResolver: letsencrypt
@ -68,9 +46,9 @@ http:
next-service:
loadBalancer:
servers:
- url: "http://pangolin:3002" # Next.js server
- url: "http://pangolin:{{.NEXT_PORT}}" # Next.js server
api-service:
loadBalancer:
servers:
- url: "http://pangolin:3000" # API/WebSocket server
- url: "http://pangolin:{{.EXTERNAL_PORT}}" # API/WebSocket server

View file

@ -4,7 +4,7 @@ api:
providers:
http:
endpoint: "http://pangolin:3001/api/v1/traefik-config"
endpoint: "http://pangolin:{{.INTERNAL_PORT}}/api/v1/traefik-config"
pollInterval: "5s"
file:
filename: "/etc/traefik/dynamic_config.yml"