mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Make optional config fields fall back to defaults
Several settings were required at parse time even though they had a sensible default, causing the backend to panic on startup when omitted: - notifications.notify_when_not_seen_for now defaults to "1w" - the whole [networking] section is now optional (no mandatory fields) - scanner duration/timeout fields (ARP, mDNS, SSDP, SNMP) now fall back to their defaults when the section is present but the field is omitted. serde only applies a field default when marked #[serde(default)], so the per-field attributes were added and the Default impls now share the same default functions as the single source of truth. Updates the sample TOML and README accordingly and adds tests covering each defaulting case.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
[database]
|
||||
path = "/db/oott.db" # Database path. For the Docker image this must be "/db/oott.db" (the mounted volume); make sure it's writeable for the user running this process
|
||||
|
||||
# The whole [networking] section is optional; omit it to auto-detect the interface.
|
||||
[networking]
|
||||
# interface = "eno1" # Optional: network interface to use for scans. If not set, the first non-loopback connected interface is used.
|
||||
|
||||
@@ -36,7 +37,7 @@ enabled=true # Set to false to disable the DHCP scanner
|
||||
|
||||
[notifications]
|
||||
method="pushover" # For now just pushover, you can set this to "none" to avoid sending notifications (it will just log)
|
||||
notify_when_not_seen_for="1w" # Send a notification if a device comes back online after not being seen for this timeframe
|
||||
notify_when_not_seen_for="1w" # Send a notification if a device comes back online after not being seen for this timeframe. Defaults to "1w" if omitted
|
||||
|
||||
[notifications.pushover]
|
||||
token="" # Your pushover token goes here, just copy&paste from their website after creating the app
|
||||
|
||||
Reference in New Issue
Block a user