Skip to content

[Feature request] Add anubis check -policy-fname ... like nginx -t #1959

Open

Description

@Azshurith

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions