mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:54:17 -04:00
Created variables.js to replace duplicate code. Moved more cache.js logs to debug level. Fixed incorrect internal authentication state on status page. Updated dependencies. Fixed incorrect type check on /api/voucher/:type for HA users
This commit is contained in:
36
modules/variables.js
Normal file
36
modules/variables.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Import own modules
|
||||
*/
|
||||
const config = require('./config');
|
||||
|
||||
/**
|
||||
* Exports all global variables used within the application
|
||||
*/
|
||||
module.exports = {
|
||||
unifiIp: config('unifi_ip') || process.env.UNIFI_IP || '192.168.1.1',
|
||||
unifiPort: config('unifi_port') || process.env.UNIFI_PORT || 443,
|
||||
unifiUsername: config('unifi_username') || process.env.UNIFI_USERNAME || 'admin',
|
||||
unifiPassword: config('unifi_password') || process.env.UNIFI_PASSWORD || 'password',
|
||||
unifiSiteId: config('unifi_site_id') || process.env.UNIFI_SITE_ID || 'default',
|
||||
voucherTypes: config('voucher_types') || process.env.VOUCHER_TYPES || '480,1,,,;',
|
||||
voucherCustom: config('voucher_custom') !== null ? config('voucher_custom') : process.env.VOUCHER_CUSTOM ? process.env.VOUCHER_CUSTOM !== 'false' : true,
|
||||
serviceWeb: process.env.SERVICE_WEB ? process.env.SERVICE_WEB !== 'false' : true,
|
||||
serviceApi: config('service_api') || (process.env.SERVICE_API === 'true') || false,
|
||||
authPassword: process.env.AUTH_PASSWORD || '0000',
|
||||
authToken: process.env.AUTH_TOKEN || '0000',
|
||||
authOidcIssuerBaseUrl: process.env.AUTH_OIDC_ISSUER_BASE_URL || '',
|
||||
authOidcAppBaseUrl: process.env.AUTH_OIDC_APP_BASE_URL || '',
|
||||
authOidcClientId: process.env.AUTH_OIDC_CLIENT_ID || '',
|
||||
authOidcClientType: process.env.AUTH_OIDC_CLIENT_TYPE || 'public',
|
||||
authOidcClientSecret: process.env.AUTH_OIDC_CLIENT_SECRET || '',
|
||||
authDisabled: (process.env.AUTH_DISABLE === 'true') || false,
|
||||
printerType: config('printer_type') || process.env.PRINTER_TYPE || '',
|
||||
printerIp: config('printer_ip') || process.env.PRINTER_IP || '192.168.1.1',
|
||||
smtpFrom: config('smtp_from') || process.env.SMTP_FROM || '',
|
||||
smtpHost: config('smtp_host') || process.env.SMTP_HOST || '',
|
||||
smtpPort: config('smtp_port') || process.env.SMTP_PORT || 25,
|
||||
smtpSecure: config('smtp_secure') || process.env.SMTP_SECURE || false,
|
||||
smtpUsername: config('smtp_username') || process.env.SMTP_USERNAME || '',
|
||||
smtpPassword: config('smtp_password') || process.env.SMTP_PASSWORD || '',
|
||||
logLevel: config('log_level') || process.env.LOG_LEVEL || 'info'
|
||||
};
|
||||
Reference in New Issue
Block a user