feat: dukung SETTINGS_PATH (settings.json di direktori mount/persisten)

This commit is contained in:
oxpoe committed 2026-10-13 03:29:36 +07:00
1 parent f27c02309e
commit 6f97430e41
6 files changed
+12 -5

No files matched your search

+1 -1
View File
@@ -1318,7 +1318,7 @@ router.put('/api/servers/legacy', requireAdmin, express.json(), async (req, res)
if (clearPassword) currentSettings.genieacs_password = '';
else if (String(passwordInput || '').trim()) currentSettings.genieacs_password = String(passwordInput || '');
const settingsPath = path.join(__dirname, '../settings.json');
const settingsPath = require('../config/paths').settingsPath;
fs.writeFileSync(settingsPath, JSON.stringify(currentSettings, null, 2), 'utf8');
res.json({ success: true, message: 'Default ACS berhasil diperbarui.' });
+1 -1
View File
@@ -5234,7 +5234,7 @@ router.post('/api/genieacs/settings', requireAdmin, async (req, res) => {
// Save to file
const fs = require('fs');
const path = require('path');
const settingsPath = path.join(__dirname, '../settings.json');
const settingsPath = require('../config/paths').settingsPath;
fs.writeFileSync(settingsPath, JSON.stringify(currentSettings, null, 2), 'utf8');
// Log audit
+1 -1
View File
@@ -2190,7 +2190,7 @@ router.post('/app/admin/settings/update', requireAdminApiAuth, (req, res) => {
try {
const allowed = ['company_header', 'company_subheader', 'company_phone', 'company_address', 'timezone', 'qris_enabled', 'auto_isolate_enabled', 'webhook_secret'];
const updates = req.body || {};
const settingsPath = require('path').join(__dirname, '../settings.json');
const settingsPath = require('../config/paths').settingsPath;
const current = JSON.parse(require('fs').readFileSync(settingsPath, 'utf8'));
let changed = 0;
for (const key of allowed) {