Monviech / os-caddy-plugin

Caddy Plugin with GUI for OPNsense
Other
38 stars 0 forks source link

Additional input validations to catch some user input errors which would fail Caddyfile validation #43

Closed Monviech closed 8 months ago

Monviech commented 9 months ago

Add additional input validation that prevents a few configurations where caddy would refuse to start.

Domain Validations

Handle Validations:

The input validation has to be solved with the model controller.

Example can be this: https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/models/OPNsense/Interfaces/VxLan.php

The model validation should only validate changed values so no save lockout is triggered. - EDIT: I actually can't do that since some validations have to validate the full model. Since this plugin is new, I can life with this since nobody has input any invalid data yet that can do a save or delete lockout. But it's theoretically possible to happen.

Monviech commented 9 months ago

https://github.com/Monviech/os-caddy-plugin/pull/47

Monviech commented 8 months ago

The input validation is a bit too aggressive on the handles.

should both be allowed to have an empty handle, but right now the input validation forbids that. Workaround is giving one of them /* as handle, that's essentially the same thing.

The input validation has to be made a little more lenient on there.