This commit is contained in:
cpu
2025-03-28 19:18:32 +01:00
parent 058441b6e6
commit 4f76bae187
3 changed files with 3 additions and 4 deletions

View File

@@ -6,5 +6,4 @@ Dockerfile
.gitignore .gitignore
README.md README.md
*.example *.example
.env.example
.labels.example

View File

@@ -13,7 +13,7 @@ const port = process.env.PORT || 3000;
const vapidPublicKey = process.env.VAPID_PUBLIC_KEY; const vapidPublicKey = process.env.VAPID_PUBLIC_KEY;
const vapidPrivateKey = process.env.VAPID_PRIVATE_KEY; const vapidPrivateKey = process.env.VAPID_PRIVATE_KEY;
const vapidSubject = process.env.VAPID_SUBJECT; // mailto: or https: const vapidSubject = process.env.VAPID_SUBJECT; // mailto: or https:
const subscriptionsFilePath = process.env.SUBSCRIPTIONS_FILE || path.join(__dirname, 'subscriptions.json'); const subscriptionsFilePath = process.env.SUBSCRIPTIONS_FILE || path.join(__dirname, '/app/subscriptions.json');
const defaultButtonName = process.env.DEFAULT_BUTTON_NAME || 'game-button'; const defaultButtonName = process.env.DEFAULT_BUTTON_NAME || 'game-button';
// Basic Authentication Credentials // Basic Authentication Credentials
const basicAuthUsername = process.env.BASIC_AUTH_USERNAME; const basicAuthUsername = process.env.BASIC_AUTH_USERNAME;
@@ -291,7 +291,7 @@ app.get('/webhook/:click_type', authenticateBasic, async (req, res) => {
logger.debug(` ${headerName}: ${req.headers[headerName]}`); logger.debug(` ${headerName}: ${req.headers[headerName]}`);
}); });
logger.info(`Received GET webhook: Button=${buttonName}, Type=${click_type}, Timestamp=${timestamp || 'N/A'}`); logger.info(`Received GET webhook: Button=${buttonName}, Type=${click_type}, Battery=${batteryLevel}, Timestamp=${timestamp || 'N/A'}`);
// Basic validation // Basic validation
if (!click_type) { if (!click_type) {