Add standalone backup script and admin update-check banner

ops/backup.sh snapshots LDAP (slapcat), Redis (BGSAVE, dynamic RDB path
lookup), and ./config for standalone deployments, with retention. A
background service polls GitHub releases every 24h and surfaces an
admin-only banner in the UI when a newer version is published.
This commit is contained in:
2026-07-15 22:33:55 -04:00
parent b6766edd08
commit 4b0a9e9038
10 changed files with 280 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
'use strict';
const conf = require('@simpleworkjs/conf');
const updateCheck = require('../utils/update_check');
function updateCheckService(){
/**
* Update Check Service
*
* Periodically asks GitHub for the latest published release of this repo
* and compares it to the running version (nodejs/package.json). Never
* auto-updates anything -- just makes the result available via
* GET /api/update-check (see routes/update_check.js) so the admin UI can
* show a banner when a newer release exists.
*/
setTimeout(updateCheck.checkNow, conf.service.updateCheck.initial);
setInterval(updateCheck.checkNow, conf.service.updateCheck.interval);
console.log('Update check service initialized');
console.log(`- Checking ${updateCheck.REPO} releases: 30s after start, then every 24h`);
}
if(conf.service.updateCheck.enabled !== false) updateCheckService();
module.exports = {};