Added the kiosk_example.png. Updated the README.md. Implemented timer styles within style.css. Added kiosk output within info.js. Set default locale to 'en' for mail.js. Implemented KIOSK_ENABLED and KIOSK_VOUCHER_TYPE environment variables within variables.js. Added kiosk_bg.jpg. Updated navigation.ejs with kiosk link. Added kiosk.ejs template. Updated status.ejs and status.js with kiosk module status. Updated docker-compose.yml. Added /kiosk routes to server.js. Added kioskEnabled states to required routes in server.js

This commit is contained in:
Glenn de Haan
2025-03-14 19:18:07 +01:00
parent bd047558e5
commit 30ef63f277
13 changed files with 448 additions and 1 deletions

View File

@@ -106,6 +106,15 @@ module.exports = () => {
log.info(`[Email] Disabled!`);
}
/**
* Log kiosk status
*/
if(variables.kioskEnabled) {
const kioskType = types(variables.kioskVoucherType, true);
log.info('[Kiosk] Enabled!');
log.info(`[Kiosk][Type] ${time(kioskType.expiration)}, ${kioskType.usage === '1' ? 'single-use' : kioskType.usage === '0' ? 'multi-use (unlimited)' : `multi-use (${kioskType.usage}x)`}${typeof kioskType.upload === "undefined" && typeof kioskType.download === "undefined" && typeof kioskType.megabytes === "undefined" ? ', no limits' : `${typeof kioskType.upload !== "undefined" ? `, upload bandwidth limit: ${kioskType.upload} kb/s` : ''}${typeof kioskType.download !== "undefined" ? `, download bandwidth limit: ${kioskType.download} kb/s` : ''}${typeof kioskType.megabytes !== "undefined" ? `, quota limit: ${kioskType.megabytes} mb` : ''}`}`);
}
/**
* Log controller
*/

View File

@@ -47,7 +47,7 @@ module.exports = {
* @param language
* @return {Promise<unknown>}
*/
send: (to, voucher, language) => {
send: (to, voucher, language = 'en') => {
return new Promise(async (resolve, reject) => {
// Create new translator
const t = translation('email', language);

View File

@@ -40,6 +40,8 @@ module.exports = {
smtpSecure: config('smtp_secure') || (process.env.SMTP_SECURE === 'true') || false,
smtpUsername: config('smtp_username') || process.env.SMTP_USERNAME || '',
smtpPassword: config('smtp_password') || process.env.SMTP_PASSWORD || '',
kioskEnabled: config('kiosk_enabled') || (process.env.KIOSK_ENABLED === 'true') || false,
kioskVoucherType: config('kiosk_voucher_type') || process.env.KIOSK_VOUCHER_TYPE || '480,1,,,',
logLevel: config('log_level') || process.env.LOG_LEVEL || 'info',
translationDefault: config('translation_default') || process.env.TRANSLATION_DEFAULT || 'en',
translationDebug: config('translation_debug') || (process.env.TRANSLATION_DEBUG === 'true') || false,