[Feature request] Add `anubis check -policy-fname ...` like `nginx -t`
Is your feature request related to a problem? Please describe.
I am always frustrated when editing gitea.botPolicies.yaml there is no safe way to validate it before rc-service anubis.gitea restart.
Anubis v1.25.0 (OpenRC, anubis --help has no check/test command) only validates on startup. A bad YAML / user_agent_regex / path_regex / CEL expression / remote_addresses CIDR / bad (data)/ import takes the running service down on restart:
can't parse policy file: ... error parsing regexp ... can't compile CEL program ...
Solution you would like.
A validate-only mode that loads + validates the policy and exits, without binding ports:
anubis check -policy-fname /etc/anubis/gitea.botPolicies.yaml or: anubis -t -policy-fname ...
exit 0 = valid, exit 1 + reason = invalid (YAML, imports, regex, CEL, CIDR, thresholds, required fields).
Current workaround is fragile:
timeout 5 anubis -policy-fname ... -bind 127.0.0.1:18923 -metrics-bind 127.0.0.1:18924 -target http://localhost:3923
Needs free ports, lives 5s, confusing in prod. A native `check` would also allow `extra_commands="check"` in OpenRC `anubis.initd`.Describe alternatives you have considered.
No response
Additional context
No response
Source: TecharoHQ/anubis