mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:54:17 -04:00
Moved build info to variables.js. Simplified info.js build readout. Added versions to user dropdown
This commit is contained in:
@@ -38,11 +38,7 @@ module.exports = () => {
|
|||||||
/**
|
/**
|
||||||
* Output build version
|
* Output build version
|
||||||
*/
|
*/
|
||||||
if(fs.existsSync('/etc/unifi_voucher_site_build')) {
|
log.info(`[Version] Git: ${variables.gitTag}, Build: ${variables.gitBuild}`);
|
||||||
log.info(`[Version] Git: ${variables.gitTag}, Build: ${fs.readFileSync('/etc/unifi_voucher_site_build', 'utf-8')}`);
|
|
||||||
} else {
|
|
||||||
log.info(`[Version] Git: ${variables.gitTag}, Build: **DEVELOPMENT**`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log external config
|
* Log external config
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* Import base packages
|
||||||
|
*/
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import own modules
|
* Import own modules
|
||||||
*/
|
*/
|
||||||
@@ -36,5 +41,6 @@ module.exports = {
|
|||||||
smtpUsername: config('smtp_username') || process.env.SMTP_USERNAME || '',
|
smtpUsername: config('smtp_username') || process.env.SMTP_USERNAME || '',
|
||||||
smtpPassword: config('smtp_password') || process.env.SMTP_PASSWORD || '',
|
smtpPassword: config('smtp_password') || process.env.SMTP_PASSWORD || '',
|
||||||
logLevel: config('log_level') || process.env.LOG_LEVEL || 'info',
|
logLevel: config('log_level') || process.env.LOG_LEVEL || 'info',
|
||||||
gitTag: process.env.GIT_TAG || 'master'
|
gitTag: process.env.GIT_TAG || 'master',
|
||||||
|
gitBuild: fs.existsSync('/etc/unifi_voucher_site_build') ? fs.readFileSync('/etc/unifi_voucher_site_build', 'utf-8') : 'Development'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -367,6 +367,7 @@ if(variables.serviceWeb) {
|
|||||||
res.render('voucher', {
|
res.render('voucher', {
|
||||||
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
||||||
gitTag: variables.gitTag,
|
gitTag: variables.gitTag,
|
||||||
|
gitBuild: variables.gitBuild,
|
||||||
user: user,
|
user: user,
|
||||||
userIcon: req.oidc ? crypto.createHash('sha256').update(user.email).digest('hex') : '',
|
userIcon: req.oidc ? crypto.createHash('sha256').update(user.email).digest('hex') : '',
|
||||||
authDisabled: variables.authDisabled,
|
authDisabled: variables.authDisabled,
|
||||||
@@ -414,6 +415,7 @@ if(variables.serviceWeb) {
|
|||||||
res.render('status', {
|
res.render('status', {
|
||||||
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
||||||
gitTag: variables.gitTag,
|
gitTag: variables.gitTag,
|
||||||
|
gitBuild: variables.gitBuild,
|
||||||
user: user,
|
user: user,
|
||||||
userIcon: req.oidc ? crypto.createHash('sha256').update(user.email).digest('hex') : '',
|
userIcon: req.oidc ? crypto.createHash('sha256').update(user.email).digest('hex') : '',
|
||||||
authDisabled: variables.authDisabled,
|
authDisabled: variables.authDisabled,
|
||||||
|
|||||||
@@ -65,6 +65,9 @@
|
|||||||
Logout
|
Logout
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<div class="px-4 py-1 text-xs text-center text-gray-600 dark:text-gray-400">
|
||||||
|
Git: <%= gitTag %> - Build: <%= gitBuild %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user