Files
BetterDesk/web-nodejs/scripts/write-installer-env-subst.js
UNITRONIX 6af0c5a65a feat(remote): add gated RDP/VNC dependency updates
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)
2026-10-04 00:56:07 +02:00

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 });