Daemon Configuration
Configuration options for Scanopy daemons.
Configuration Priority
Scanopy daemons use the following priority order (highest to lowest):
- Command-line arguments (highest priority)
- Environment variables
- Configuration file
- Default values (lowest priority)
Later sources override earlier ones. For example, an environment variable overrides the config file but is overridden by a command-line argument.
Configuration Methods
Command-line arguments (also accepted by scanopy-daemon install, which persists them to the config file — see Running as a Service):
scanopy-daemon --server-url http://192.168.1.100:60072 --daemon-api-key YOUR_KEYEnvironment variables:
export SCANOPY_SERVER_URL=http://192.168.1.100:60072
export SCANOPY_DAEMON_API_KEY=YOUR_KEY
scanopy-daemonConfiguration file: where config.json lives depends on how the daemon runs. <name> is the daemon's install slot, scanopy-daemon for the first daemon on a host.
- Service (
scanopy-daemon install):/etc/scanopy/daemon/<name>/config.json - Run yourself (
install --no-serviceor a plainscanopy-daemon):~/.config/daemon/config.json, or~/.config/daemon/<name>/config.jsonfor a second daemon
A background service runs under a different profile than whoever installed it, so install writes the config to a system directory and points the service at it with --config-dir. The install command prints the config and log paths it used.
Use --config-dir to override the directory holding config.json.
The config file stores runtime state (daemon ID, host ID) alongside your settings. Command-line and environment variables take priority over the file.
Parameter Reference
| Parameter | CLI Flag | Environment Variable | Config File Key | Default | Description |
|---|---|---|---|---|---|
| Server URL | --server-url | SCANOPY_SERVER_URL | server_url | http://127.0.0.1:60072 | URL where the daemon can reach the server |
| API Key | --daemon-api-key | SCANOPY_DAEMON_API_KEY | daemon_api_key | Required | Authentication key for daemon (generated via UI) |
| Site ID | --site-id | SCANOPY_SITE_ID | site_id | None | UUID of the site to scan |
| Name | --name | SCANOPY_NAME | name | scanopy-daemon | Name for this daemon |
| Daemon Mode | --mode | SCANOPY_MODE | mode | daemon_poll | DaemonPoll: Daemon connects to server; works behind NAT/firewall without opening ports. ServerPoll: Server connects to daemon, for deployments where daemon cannot make outbound connections - requires providing Daemon URL |
| Daemon URL | --daemon-url | SCANOPY_DAEMON_URL | daemon_url | Required | Base URL where server can reach daemon |
| Port | --daemon-port | SCANOPY_DAEMON_PORT | daemon_port | 60073 | Port the daemon listens on. |
| Interfaces | --interfaces | SCANOPY_INTERFACES | interfaces | None | Restrict daemon to specific network interface(s). Comma-separated for multiple (e.g., eth0,eth1). Leave empty for all interfaces |
| Bind Address | --bind-address | SCANOPY_BIND_ADDRESS | bind_address | None | IP address to bind daemon to |
| Allow Self-Signed Certificates | --allow-self-signed-certs | SCANOPY_ALLOW_SELF_SIGNED_CERTS | allow_self_signed_certs | false | Allow self-signed certs for daemon -> server connections |
| Accept Invalid Scan Certificates | --accept-invalid-scan-certs | SCANOPY_ACCEPT_INVALID_SCAN_CERTS | accept_invalid_scan_certs | true | Accept invalid TLS certificates when scanning endpoints. Enabled by default since scanners probe arbitrary internal services. |
| Log Level | --log-level | SCANOPY_LOG_LEVEL | log_level | info | Logging verbosity |
| Log File | --log-file | SCANOPY_LOG_FILE | log_file | None | Path to log file. Defaults to platform-specific path. Set to "none" to disable file logging. |
| Heartbeat Interval | --heartbeat-interval | SCANOPY_HEARTBEAT_INTERVAL | heartbeat_interval | 30 | Seconds between heartbeat updates to the server |
Secrets from Files
Any SCANOPY_ variable can be read from a file instead: set SCANOPY_<NAME>_FILE to the file's path, for example SCANOPY_DAEMON_API_KEY_FILE=/run/secrets/daemon_api_key. A trailing newline is trimmed. Setting both forms of the same variable, or pointing _FILE at a file that can't be read, stops the daemon at startup with an error naming the variable.
SCANOPY_LOG_FILE is itself a setting (the log path), not a secret file. To read the log path from a file, use SCANOPY_LOG_FILE_FILE.
Trusted CA Certificates
--trusted-ca-bundle / SCANOPY_TRUSTED_CA_BUNDLE
A PEM file of CA certificates the daemon trusts in addition to its built-in public roots. It applies to the daemon's connection to the Scanopy server and to the UniFi controller and Proxmox VE integrations. Use it when any of them has a certificate from a private CA, such as a Proxmox VE cluster's own CA, so certificate verification stays on.
The path refers to a file on the daemon host. install saves it to the config file. If the file is missing or contains no usable CA certificate, the daemon does not start, and the error names the path.
Network scanning does not use the bundle. Probes of scanned hosts follow Accept Invalid Scan Certificates (SCANOPY_ACCEPT_INVALID_SCAN_CERTS).
Seeding Credentials at Registration
--credential-id / SCANOPY_CREDENTIAL_IDS
Seeds one or more credentials for the daemon to use on its first scan, so it collects everything a credential unlocks before you assign anything in the UI. Provide them as a repeatable --credential-id flag or as a comma-separated SCANOPY_CREDENTIAL_IDS environment variable.
Each entry is a credential ID, optionally targeted at specific IP addresses:
| Form | Applies the credential to |
|---|---|
<uuid> | The whole site (site default — tried on every host the daemon scans). |
<uuid>@<ip> | The host discovered at <ip>. |
<uuid>@<ip>+<ip> | Several specific hosts — join IPs with +. |
To target the daemon's own host — for example a local Docker or Podman socket credential — use its loopback address: <uuid>@127.0.0.1.
# CLI (repeatable)
scanopy-daemon --credential-id [email protected] --credential-id [email protected]
# Environment (comma-separated)
export SCANOPY_CREDENTIAL_IDS="[email protected],[email protected]"After the first scan, seeded credentials are auto-assigned to the matching hosts and used on every subsequent scan.
Seeded credentials are applied only at first registration. If the daemon is already registered, they are ignored and the daemon logs a reminder to manage its credentials in the Scanopy UI instead.
Logging
The daemon logs to stdout and stderr on all platforms; where that output lands depends on how you run it. For reading logs on each platform and capturing them to a file, see Checking Daemon Logs.
Set the log level with --log-level or SCANOPY_LOG_LEVEL:
| Level | Description |
|---|---|
error | Errors that prevent normal operation |
warn | Unexpected conditions that don't stop operation |
info | General operational messages (default) |
debug | Detailed diagnostic information |
trace | Very verbose output, including raw network data |
# CLI
scanopy-daemon --log-level debug
# Environment
export SCANOPY_LOG_LEVEL=debug