updated CORS config

This commit is contained in:
cpu
2025-03-30 21:15:27 +02:00
parent 675c0a2d87
commit 81e11c155e
2 changed files with 5 additions and 7 deletions

View File

@@ -9,9 +9,7 @@ VAPID_SUBJECT=mailto:mailto:user@example.org
# --- Server Configuration --- # --- Server Configuration ---
# Internal port for the Node.js app # Internal port for the Node.js app
PORT=3000 PORT=3000
# Path inside the container
SUBSCRIPTIONS_FILE=/app/subscriptions.json SUBSCRIPTIONS_FILE=/app/subscriptions.json
# Default button name to use when not specified
DEFAULT_BUTTON_NAME=game-button DEFAULT_BUTTON_NAME=game-button
# --- Authentication (Optional) --- # --- Authentication (Optional) ---
@@ -26,9 +24,9 @@ BASIC_AUTH_PASSWORD=password
# Comma-separated list of allowed origins for requests (e.g., your PWA frontend URL) # Comma-separated list of allowed origins for requests (e.g., your PWA frontend URL)
# If blank or not set, CORS might block browser requests (like from a setup page). # If blank or not set, CORS might block browser requests (like from a setup page).
# Use '*' carefully, preferably list specific domains. # Use '*' carefully, preferably list specific domains.
ALLOWED_ORIGINS=https://game-timer.virtonline.eu ALLOWED_ORIGINS=https://game-timer.virtonline.eu,http://localhost
ALLOWED_METHODS=POST,GET,OPTIONS ALLOWED_METHODS=POST,GET
ALLOWED_HEADERS=Content-Type,Authorization ALLOWED_HEADERS=Content-Type,Authorization,button-name,button-battery-level,timestamp
# --- Web Push Retry Configuration (Optional) --- # --- Web Push Retry Configuration (Optional) ---
# Number of retries on failure (e.g., DNS issues) # Number of retries on failure (e.g., DNS issues)

View File

@@ -17,9 +17,9 @@ traefik.http.routers.flic-webhook-webpush.service=flic-webhook-webpush
traefik.http.services.flic-webhook-webpush.loadbalancer.server.port=3000 traefik.http.services.flic-webhook-webpush.loadbalancer.server.port=3000
# Middleware CORS # Middleware CORS
traefik.http.middlewares.cors-headers.headers.accesscontrolallowmethods=POST,GET,OPTIONS traefik.http.middlewares.cors-headers.headers.accesscontrolallowmethods=POST,GET
traefik.http.middlewares.cors-headers.headers.accesscontrolalloworiginlist=https://game-timer.virtonline.eu traefik.http.middlewares.cors-headers.headers.accesscontrolalloworiginlist=https://game-timer.virtonline.eu
traefik.http.middlewares.cors-headers.headers.accesscontrolallowheaders=Content-Type,Authorization traefik.http.middlewares.cors-headers.headers.accesscontrolallowheaders=Content-Type,Authorization,button-name,button-battery-level,timestamp
traefik.http.middlewares.cors-headers.headers.accesscontrolallowcredentials=true traefik.http.middlewares.cors-headers.headers.accesscontrolallowcredentials=true
traefik.http.middlewares.cors-headers.headers.accesscontrolmaxage=600 traefik.http.middlewares.cors-headers.headers.accesscontrolmaxage=600
traefik.http.middlewares.cors-headers.headers.addvaryheader=true traefik.http.middlewares.cors-headers.headers.addvaryheader=true