mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-10-26 14:30:19 +00:00
6af0c5a65a
Pin the upstream gateway source, verify checksums and licenses in CI, and prepare reviewed dependency update PRs. Keep runtime activation fail-closed while the VNC GPL dependency remains outside the project policy. Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow)
32 lines
945 B
JavaScript
32 lines
945 B
JavaScript
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
/**
|
|
* Write JSON substitution file for merge-env.js (safe for special chars in passwords/paths).
|
|
* Reads BD_SUBST_* environment variables set by betterdesk.sh / betterdesk.ps1.
|
|
*
|
|
* Usage: node write-installer-env-subst.js /path/to/subst.json
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
|
|
const KEYS = [
|
|
'RUSTDESK_DIR', 'PUB_KEY_PATH', 'API_KEY_PATH', 'DB_TYPE', 'DB_PATH', 'DATABASE_URL',
|
|
'DATA_DIR', 'GO_API_PORT', 'HBBS_API_URL', 'BETTERDESK_API_URL', 'API_PORT',
|
|
'DEFAULT_ADMIN_PASSWORD', 'SESSION_SECRET', 'REMOTE_TARGET_VAULT_KEY',
|
|
'GUACD_ADDRESS', 'SSL_CERT_PATH', 'SSL_KEY_PATH'
|
|
];
|
|
|
|
const outPath = process.argv[2];
|
|
if (!outPath) {
|
|
console.error('Usage: node write-installer-env-subst.js OUTPUT.json');
|
|
process.exit(2);
|
|
}
|
|
|
|
const subs = {};
|
|
for (const key of KEYS) {
|
|
subs[key] = process.env[`BD_SUBST_${key}`] || '';
|
|
}
|
|
|
|
fs.writeFileSync(outPath, JSON.stringify(subs), { mode: 0o600 });
|