.tmp + chown www-data * + chmod 600 (so PHP can edit the temp). * 2. fopen('w') and fwrite the rebuilt INI text into the temp. * 3. sudo mount -o remount,rw / + sudo install -m 644 -o root -g * root temp -> /etc/dapnetgateway + sudo mount -o remount,ro / to * seal the rootfs again. (See edit_mmdvmhost.php for the full * rationale on the install vs cp+chmod+chown migration.) * 4. sudo systemctl restart dapnetgateway.service to pick up the change. * * Admin-only access; the dashboard's Apache basic-auth gate is the * sole protection. The validation is what's in the form (none, in * effect — operator-typed values are written raw). Treat with care. */ require_once($_SERVER['DOCUMENT_ROOT'].'/config/security_headers.php'); require_once($_SERVER['DOCUMENT_ROOT'].'/config/csrf.php'); require_once($_SERVER['DOCUMENT_ROOT'].'/config/banner_warnings.inc'); setSecurityHeaders(); // CSRF protection — see config/csrf.php for the full rationale. // Must run BEFORE any output: bootstraps the session on GET (so // Set-Cookie ships) and rejects forged POSTs cleanly with 403 // before any state change (sed-i, fopen+fwrite, sudo cp, etc.). csrf_verify(); // Layer 2 of the default-password protection — see config/banner_warnings.inc. // MUST run BEFORE any output so header('Location: ...') works. pistar_warnings_enforce_redirect(); // Load the language support require_once('../config/language.php'); //Load the Pi-Star Release file $pistarReleaseConfig = '/etc/pistar-release'; $configPistarRelease = array(); $configPistarRelease = parse_ini_file($pistarReleaseConfig, true); //Load the Version Info require_once('../config/version.php'); ?>