clean up
This commit is contained in:
@@ -7,6 +7,7 @@ Dockerfile
|
||||
README.md
|
||||
*.example
|
||||
.env
|
||||
env
|
||||
labels
|
||||
subscriptions.json
|
||||
|
||||
|
||||
23
.env.example
23
.env.example
@@ -4,12 +4,15 @@
|
||||
# Generate using: npx web-push generate-vapid-keys
|
||||
VAPID_PUBLIC_KEY=
|
||||
VAPID_PRIVATE_KEY=
|
||||
VAPID_SUBJECT=mailto:mailto:admin@virtonline.eu # Contact email/URL for push service
|
||||
VAPID_SUBJECT=mailto:mailto:admin@virtonline.eu
|
||||
|
||||
# --- Server Configuration ---
|
||||
PORT=3000 # Internal port for the Node.js app
|
||||
SUBSCRIPTIONS_FILE=subscriptions.json # Path inside the container
|
||||
DEFAULT_BUTTON_NAME=game-button # Default button name to use when not specified
|
||||
# Internal port for the Node.js app
|
||||
PORT=3000
|
||||
# Path inside the container
|
||||
SUBSCRIPTIONS_FILE=/app/subscriptions.json
|
||||
# Default button name to use when not specified
|
||||
DEFAULT_BUTTON_NAME=game-button
|
||||
|
||||
# --- Authentication (Optional) ---
|
||||
# If both USERNAME and PASSWORD are set, Basic Auth will be enabled for:
|
||||
@@ -28,12 +31,16 @@ ALLOWED_METHODS=POST,GET,OPTIONS
|
||||
ALLOWED_HEADERS=Content-Type,Authorization
|
||||
|
||||
# --- Web Push Retry Configuration (Optional) ---
|
||||
MAX_NOTIFICATION_RETRIES=3 # Number of retries on failure (e.g., DNS issues)
|
||||
INITIAL_RETRY_DELAY_MS=1000 # Initial delay in milliseconds
|
||||
# Number of retries on failure (e.g., DNS issues)
|
||||
MAX_NOTIFICATION_RETRIES=3
|
||||
# Initial delay in milliseconds
|
||||
INITIAL_RETRY_DELAY_MS=1000
|
||||
|
||||
# --- Network Configuration (Optional) ---
|
||||
DNS_TIMEOUT_MS=5000 # Timeout for DNS lookups (ms)
|
||||
HTTP_TIMEOUT_MS=10000 # Timeout for outgoing HTTP requests (ms)
|
||||
# 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
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,7 +9,7 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.env
|
||||
|
||||
env
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
|
||||
@@ -291,7 +291,7 @@ app.get('/webhook/:click_type', authenticateBasic, async (req, res) => {
|
||||
logger.debug(` ${headerName}: ${req.headers[headerName]}`);
|
||||
});
|
||||
|
||||
logger.info(`Received GET webhook: Button=${buttonName}, Type=${click_type}, Battery=${batteryLevel}, Timestamp=${timestamp || 'N/A'}`);
|
||||
logger.info(`Received GET webhook: Button=${buttonName}, Type=${click_type}, Battery=${batteryLevel}%, Timestamp=${timestamp || 'N/A'}`);
|
||||
|
||||
// Basic validation
|
||||
if (!click_type) {
|
||||
|
||||
@@ -18,7 +18,7 @@ ExecStart=/usr/bin/env docker run \
|
||||
--name=virt-flic-webhook-webpush \
|
||||
--log-driver=none \
|
||||
--network=traefik \
|
||||
--env-file=${APP_PATH}/.env \
|
||||
--env-file=${APP_PATH}/env \
|
||||
--label-file=${APP_PATH}/labels \
|
||||
--mount type=bind,src=${APP_PATH}/subscriptions.json,dst=/app/subscriptions.json \
|
||||
flic-webhook-webpush
|
||||
|
||||
Reference in New Issue
Block a user