feat(security): harden gateway boundaries and usage policies

Consolidate subscription usage policy enforcement, privacy-safe persistence, and gateway security hardening into one reviewable change.

Includes bounded HTTP and execution envelopes, header and protocol guards, DNS and relay validation, authentication and secret projection hardening, secure backup/install paths, and regression coverage.
This commit is contained in:
elky
2026-09-04 03:45:52 +08:00
parent ddcbeb3ae9
commit 579f2c7cc1
1019 changed files with 190437 additions and 26080 deletions
+2 -9
View File
@@ -200,11 +200,11 @@ impl App {
Field {
label: "Allow Private Targets",
key: "allow_private_targets",
value: "true".into(),
value: "false".into(),
kind: FieldKind::Bool,
required: false,
help:
"Allow proxying private/reserved upstream IPs by default; takes effect after restart",
"Allow proxying private/reserved upstream IPs; disabled by default and takes effect after restart",
},
Field {
label: "Heartbeat Interval",
@@ -450,13 +450,6 @@ impl App {
fn save(&mut self) -> anyhow::Result<()> {
let cfg = self.to_config()?;
cfg.save(&self.config_path)?;
// Restrict config file permissions to owner-only (contains management token).
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
let _ =
std::fs::set_permissions(&self.config_path, std::fs::Permissions::from_mode(0o600));
}
self.modified = false;
self.saved_once = true;
self.message = Some((