Configuration
CloakProbe is configured entirely through environment variables. No config files needed.
Environment Variables
Section titled “Environment Variables”| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Port to bind the HTTP server |
CLOAKPROBE_PRIVACY_MODE | strict | Privacy mode (strict or balanced) |
CLOAKPROBE_ASN_DB_PATH | data/asn_db.bin | Path to ASN database |
CLOAKPROBE_RIPE_DB_PATH | data/ripe_db.bin | Path to RIPE organization database |
CLOAKPROBE_REGION | (none) | Optional region identifier shown in API |
Privacy Modes
Section titled “Privacy Modes”Strict Mode (Default)
Section titled “Strict Mode (Default)”CLOAKPROBE_PRIVACY_MODE=strict- No logging of IP addresses
- Minimal server information exposed
logs_retained: falsein API response
Balanced Mode
Section titled “Balanced Mode”CLOAKPROBE_PRIVACY_MODE=balanced- Standard logging enabled
- Full server information
logs_retained: truein API response
Systemd Configuration
Section titled “Systemd Configuration”Edit the service file to customize:
sudo nano /etc/systemd/system/cloakprobe.serviceExample configuration:
[Unit]Description=CloakProbe IP Information ServiceAfter=network.target
[Service]Type=simpleUser=cloakprobeGroup=cloakprobeWorkingDirectory=/opt/cloakprobe
# Environment variablesEnvironment=PORT=8080Environment=CLOAKPROBE_PRIVACY_MODE=strictEnvironment=CLOAKPROBE_ASN_DB_PATH=/opt/cloakprobe/data/asn_db.binEnvironment=CLOAKPROBE_RIPE_DB_PATH=/opt/cloakprobe/data/ripe_db.binEnvironment=CLOAKPROBE_REGION=eu-central
ExecStart=/opt/cloakprobe/cloakprobe
Restart=alwaysRestartSec=5
# Security hardeningNoNewPrivileges=trueProtectSystem=strictProtectHome=truePrivateTmp=trueReadOnlyPaths=/opt/cloakprobe
[Install]WantedBy=multi-user.targetAfter editing, reload and restart:
sudo systemctl daemon-reloadsudo systemctl restart cloakprobeRunning Manually
Section titled “Running Manually”For testing or development:
./cloakprobePORT=3000 \CLOAKPROBE_PRIVACY_MODE=strict \CLOAKPROBE_ASN_DB_PATH=./data/asn_db.bin \CLOAKPROBE_RIPE_DB_PATH=./data/ripe_db.bin \CLOAKPROBE_REGION=us-east \./cloakprobedocker run -d \ -p 8080:8080 \ -e CLOAKPROBE_PRIVACY_MODE=strict \ -v ./data:/opt/cloakprobe/data:ro \ cloakprobe:latestDatabase Paths
Section titled “Database Paths”The database path variables support:
- Absolute paths:
/opt/cloakprobe/data/asn_db.bin - Relative paths:
./data/asn_db.bin(relative to working directory)
Region Identifier
Section titled “Region Identifier”The optional CLOAKPROBE_REGION variable appears in API responses:
{ "server": { "timestamp_utc": "2024-01-15T10:30:00Z", "region": "eu-central", "version": "0.1.0" }}Useful for multi-region deployments to identify which instance served the request.
Memory Usage
Section titled “Memory Usage”CloakProbe loads databases into memory for fast lookups:
| Database | Approximate Size |
|---|---|
| ASN database | ~50-100 MB |
| RIPE database | ~20-40 MB |
Ensure your server has sufficient RAM for the databases plus application overhead.