first version
config CORS fixed key to one line helper prints clean up logs improved validations again validations fix rewritten flask and node.js solution added subscription route auth flow diagrams
This commit is contained in:
39
.env.example
Normal file
39
.env.example
Normal file
@@ -0,0 +1,39 @@
|
||||
# Flic to PWA WebPush Configuration
|
||||
|
||||
# --- VAPID Keys (Required) ---
|
||||
# Generate using: npx web-push generate-vapid-keys
|
||||
VAPID_PUBLIC_KEY=
|
||||
VAPID_PRIVATE_KEY=
|
||||
VAPID_SUBJECT=mailto:mailto:user@example.org
|
||||
|
||||
# --- Server Configuration ---
|
||||
# Internal port for the Node.js app
|
||||
PORT=3000
|
||||
SUBSCRIPTIONS_FILE=/app/subscriptions.json
|
||||
DEFAULT_BUTTON_NAME=game-button
|
||||
|
||||
# --- Authentication (Optional) ---
|
||||
# If both USERNAME and PASSWORD are set, Basic Auth will be enabled for:
|
||||
# - POST /subscribe
|
||||
# - GET /webhook
|
||||
# Leave blank to disable authentication.
|
||||
BASIC_AUTH_USERNAME=user12345
|
||||
BASIC_AUTH_PASSWORD=password
|
||||
|
||||
# --- Web Push Retry Configuration (Optional) ---
|
||||
# Number of retries on failure (e.g., DNS issues)
|
||||
NOTIFICATION_MAX_RETRIES=3
|
||||
# First retry delay in milliseconds (minimal delay for immediate retry)
|
||||
NOTIFICATION_FIRST_RETRY_DELAY_MS=10
|
||||
# Base delay in milliseconds for subsequent retries (used for exponential backoff)
|
||||
NOTIFICATION_SUBSEQUENT_RETRY_DELAY_MS=1000
|
||||
|
||||
# --- Network Configuration (Optional) ---
|
||||
# Timeout for DNS lookups (ms)
|
||||
DNS_TIMEOUT_MS=5000
|
||||
# Timeout for outgoing HTTP requests (ms)
|
||||
HTTP_TIMEOUT_MS=10000
|
||||
|
||||
# --- Logging ---
|
||||
# Controls log verbosity: error, warn, info, debug
|
||||
LOG_LEVEL=info
|
||||
Reference in New Issue
Block a user