feat(config): wire runtime settings from env/config with sane defaults

This commit is contained in:
patrick committed 2026-02-10 22:01:17 -05:00
1 parent 6dac06c117
commit 461512f20a
6 files changed
+195 -20

No files matched your search

+16 -1
View File
@@ -36,7 +36,7 @@ threat-engine-agent/
├── agent.py # Main loop and heal orchestration
├── auditor.py # LAPI vs nft reconciliation and drift fingerprinting
├── reporter.py # Local state and heal history writer
├── config.yaml # Static config (currently not wired into runtime)
├── config.yaml # Runtime defaults (overridable by env)
├── systemd/ # Deployment configurations
│ └── threat-agent.service
└── logs/ # Runtime logs
@@ -49,6 +49,7 @@ threat-engine-agent/
```bash
mkdir -p /root/threat-engine-agent/logs
cd /root/threat-engine-agent
cp .env.example .env
```
2. Systemd Integration:
@@ -59,6 +60,20 @@ sudo systemctl daemon-reload
sudo systemctl enable --now threat-agent
```
### Configuration Precedence
1. Environment variables (from systemd environment and/or `.env`)
2. `config.yaml`
3. Built-in defaults in code
Supported env overrides:
- `SERVER_NAME`
- `CHECK_INTERVAL`
- `HEAL_VERIFY_DELAY`
- `HEAL_MIN_INTERVAL`
- `LOG_PATH`
- `STATE_FILE`
- `THREAT_AGENT_CONFIG`
3. Monitoring:
```bash