Clean up footer: fix copyright, move GitHub link out of the nav (#41)
- Copyright was "© <year> <name>" where <name> is conf.name — an operator-configurable display name (e.g. whatever CFG_ORG is set to), not a real copyright holder. Changed to "© <year> theta42", matching the LICENSE file. Also dropped "All rights reserved", which contradicts the MIT license this project ships under; added an explicit MIT License link instead. - Moved the GitHub icon link out of the top nav (where it competed with actual navigation items) and into the footer, alongside the license link and version/build info. - Deduplicated the identical buildVersion/buildHash/buildYear computation that was copy-pasted in both routes/index.js and routes/oauth.js into a shared nodejs/utils/build_info.js. Verified by rendering top+bottom with the real ejs package: no template errors, GitHub link present exactly once (in the footer, not the nav), "All rights reserved" gone, MIT License link present. npm test failures (155) are pre-existing/environmental (no LDAP server here) — identical failure count with these changes stashed out.
This commit is contained in:
@@ -2,26 +2,21 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
const moment = require('moment');
|
||||
const {marked} = require('marked');
|
||||
const {InviteToken, PasswordResetToken} = require('./../models/token');
|
||||
const conf = require('@simpleworkjs/conf');
|
||||
const buildInfo = require('../utils/build_info');
|
||||
|
||||
const tosHtml = marked(fs.readFileSync(path.join(__dirname, '../../tos.md'), 'utf8'));
|
||||
const { version: buildVersion } = require('../package.json');
|
||||
let buildHash = 'unknown';
|
||||
try { buildHash = execSync('git rev-parse --short HEAD', { cwd: __dirname }).toString().trim(); } catch(_) {}
|
||||
|
||||
const values ={
|
||||
title: conf.environment !== 'production' ? `dev` : '',
|
||||
titleIcon: conf.environment !== 'production' ? `<i class="fa-brands fa-dev"></i>` : '',
|
||||
name: conf.name,
|
||||
buildVersion,
|
||||
buildHash,
|
||||
buildYear: new Date().getFullYear(),
|
||||
...buildInfo,
|
||||
}
|
||||
|
||||
// List of front end node modules to be served
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto');
|
||||
const { execSync } = require('child_process');
|
||||
const jwt = require('jsonwebtoken');
|
||||
const express = require('express');
|
||||
const conf = require('@simpleworkjs/conf');
|
||||
@@ -9,22 +8,17 @@ const { OAuthClient } = require('../models/oauth_client');
|
||||
const { OAuthCode, OAuthAccessToken, OAuthRefreshToken } = require('../models/oauth_code');
|
||||
const { User } = require('../models/user');
|
||||
const { Group } = require('../models/group_ldap');
|
||||
const buildInfo = require('../utils/build_info');
|
||||
|
||||
const oauthConf = conf.oauth || {};
|
||||
const issuer = oauthConf.issuer || `http://localhost:${conf.port || 3000}`;
|
||||
const jwtSecret = oauthConf.jwtSecret || 'change-me-in-secrets';
|
||||
|
||||
const { version: buildVersion } = require('../package.json');
|
||||
let buildHash = 'unknown';
|
||||
try { buildHash = execSync('git rev-parse --short HEAD', { cwd: __dirname }).toString().trim(); } catch(_) {}
|
||||
|
||||
const pageLocals = {
|
||||
title: conf.environment !== 'production' ? 'dev' : '',
|
||||
titleIcon: conf.environment !== 'production' ? '<i class="fa-brands fa-dev"></i>' : '',
|
||||
name: conf.name,
|
||||
buildVersion,
|
||||
buildHash,
|
||||
buildYear: new Date().getFullYear(),
|
||||
...buildInfo,
|
||||
};
|
||||
|
||||
// --- helpers ---
|
||||
|
||||
Reference in New Issue
Block a user