v0.3.0
This commit is contained in:
40
backend/src/routes/about.js
Normal file
40
backend/src/routes/about.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const fs = require('fs');
|
||||
|
||||
const ABOUT_FILE = '/app/data/about.json';
|
||||
|
||||
const DEFAULTS = {
|
||||
built_with: 'Node.js · Express · Socket.io · SQLite · React · Vite · Claude.ai',
|
||||
developer: 'Ricky Stretch',
|
||||
license: 'AGPL 3.0',
|
||||
license_url: 'https://www.gnu.org/licenses/agpl-3.0.html',
|
||||
description: 'Self-hosted, privacy-first team messaging.',
|
||||
};
|
||||
|
||||
// GET /api/about — public, no auth required
|
||||
router.get('/', (req, res) => {
|
||||
let overrides = {};
|
||||
try {
|
||||
if (fs.existsSync(ABOUT_FILE)) {
|
||||
const raw = fs.readFileSync(ABOUT_FILE, 'utf8');
|
||||
overrides = JSON.parse(raw);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('about.json parse error:', e.message);
|
||||
}
|
||||
|
||||
// Version always comes from the runtime env (same source as Settings window)
|
||||
const about = {
|
||||
...DEFAULTS,
|
||||
...overrides,
|
||||
version: process.env.JAMA_VERSION || process.env.TEAMCHAT_VERSION || 'dev',
|
||||
};
|
||||
|
||||
// Never expose docker_image — removed from UI
|
||||
delete about.docker_image;
|
||||
|
||||
res.json({ about });
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user