Skip to content

Configuration

CloakProbe is configured entirely through environment variables. No config files needed.

VariableDefaultDescription
PORT8080Port to bind the HTTP server
CLOAKPROBE_PRIVACY_MODEstrictPrivacy mode (strict or balanced)
CLOAKPROBE_ASN_DB_PATHdata/asn_db.binPath to ASN database
CLOAKPROBE_RIPE_DB_PATHdata/ripe_db.binPath to RIPE organization database
CLOAKPROBE_REGION(none)Optional region identifier shown in API
Terminal window
CLOAKPROBE_PRIVACY_MODE=strict
  • No logging of IP addresses
  • Minimal server information exposed
  • logs_retained: false in API response
Terminal window
CLOAKPROBE_PRIVACY_MODE=balanced
  • Standard logging enabled
  • Full server information
  • logs_retained: true in API response

Edit the service file to customize:

Terminal window
sudo nano /etc/systemd/system/cloakprobe.service

Example configuration:

[Unit]
Description=CloakProbe IP Information Service
After=network.target
[Service]
Type=simple
User=cloakprobe
Group=cloakprobe
WorkingDirectory=/opt/cloakprobe
# Environment variables
Environment=PORT=8080
Environment=CLOAKPROBE_PRIVACY_MODE=strict
Environment=CLOAKPROBE_ASN_DB_PATH=/opt/cloakprobe/data/asn_db.bin
Environment=CLOAKPROBE_RIPE_DB_PATH=/opt/cloakprobe/data/ripe_db.bin
Environment=CLOAKPROBE_REGION=eu-central
ExecStart=/opt/cloakprobe/cloakprobe
Restart=always
RestartSec=5
# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
ReadOnlyPaths=/opt/cloakprobe
[Install]
WantedBy=multi-user.target

After editing, reload and restart:

Terminal window
sudo systemctl daemon-reload
sudo systemctl restart cloakprobe

For testing or development:

Terminal window
./cloakprobe

The database path variables support:

  • Absolute paths: /opt/cloakprobe/data/asn_db.bin
  • Relative paths: ./data/asn_db.bin (relative to working directory)

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.

CloakProbe loads databases into memory for fast lookups:

DatabaseApproximate Size
ASN database~50-100 MB
RIPE database~20-40 MB

Ensure your server has sufficient RAM for the databases plus application overhead.