flow diagrams

This commit is contained in:
cpu
2025-03-27 20:17:35 +01:00
parent c89eaacd42
commit 2da6061795
14 changed files with 479 additions and 271 deletions

View File

@@ -1,33 +1,39 @@
# --- Application Configuration ---
# Flic to PWA WebPush Configuration
# --- VAPID Keys (REQUIRED for Web Push) ---
# Generate these once using npx web-push generate-vapid-keys (or other tools)
# Keep the private key SECRET!
# --- VAPID Keys (Required) ---
# Generate using: npx web-push generate-vapid-keys
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_SUBJECT=mailto:mailto:user@example.org
# Subject claim for VAPID. Use a 'mailto:' URI or an 'https:' URL identifying your application.
# Example: mailto:admin@yourdomain.com or https://yourdomain.com/contact
VAPID_SUBJECT=mailto:admin@virtonline.eu
# --- Server Configuration ---
# Internal port for the Node.js app
PORT=3000
SUBSCRIPTIONS_FILE=/app/subscriptions.json
DEFAULT_BUTTON_NAME=game-button
# Flic Button Configuration
FLIC_BUTTON1_SERIAL=your_button1_serial
FLIC_BUTTON2_SERIAL=your_button2_serial
FLIC_BUTTON3_SERIAL=your_button3_serial
# --- 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
# Subscription Storage
SUBSCRIPTIONS_FILE=subscriptions.json
# --- 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
# CORS
ALLOWED_ORIGINS=https://game-timer.virtonline.eu
ALLOWED_METHODS=POST,OPTIONS,GET
ALLOWED_HEADERS=Content-Type,Authorization
# --- Network Configuration (Optional) ---
# Timeout for DNS lookups (ms)
DNS_TIMEOUT_MS=5000
# Timeout for outgoing HTTP requests (ms)
HTTP_TIMEOUT_MS=10000
# Logging Configuration
LOG_LEVEL=INFO
# --- Security (Optional) ---
# If you want to add a simple security layer between Flic and this app.
# If set, configure Flic's HTTP request to include an "Authorization: Bearer YOUR_SECRET_VALUE" header.
# use e.g.: openssl rand -hex 32
FLIC_SECRET=
# --- Logging ---
# Controls log verbosity: error, warn, info, debug
LOG_LEVEL=info