Skip to content

Strict validation demands web-auth fields even when the web UI is disabled #774

Description

@CybotTM

Turning on enable-strict-validation fails a config that does not use the web UI, because web-password-hash and web-secret-key are reported as required.

Reproduction

[global]
  enable-strict-validation = true

[job-local "hello"]
  schedule = @every 30s
  command = echo hi
$ ofelia validate --config=strict.ini
configuration validation failed:
  config validation error for field 'web-password-hash': is required (value: )
  config validation error for field 'web-secret-key': is required (value: )

No [global] enable-web is set, so there is no web UI and no reason to demand credentials for it.

Why it matters

It makes strict validation impractical to adopt: the operator most likely to turn it on — someone who wants their config checked — is met with errors about a feature they are not using. The workaround is to leave strict validation off, which is how the schedule problem in #773 stays invisible.

Note the two issues compound: strict validation is the thing that would catch an unparsable schedule, and this is a reason not to enable it.

Expected

The web-auth fields should be required only when the web UI is enabled and authentication is switched on.

Found while adding exit-code tests in #771.

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