os-caddy: Adding site-wise imports
I currently came across with an issue where the server prints caddy from Via headers due to the recent changes in Caddy 2.10 (Changelogs: https://github.com/caddyserver/caddy/releases/tag/v2.10.0)
Now, I wanted to change headers and configurations directly from the site blocks by force-setting headers with the header directive. There are already known ways to import global and top blocks, but there seems no way to import from within the side blocks. It looks like there is no way to support these from the plugin yet.
I've already checked https://github.com/opnsense/plugins/issues/3881 and this one only adds or removes the header under the proxies. It doesn't really help redacting headers that prints out from Caddy directly.
So, I would like to request a feature that adds imports on the side blocks as similar to the one in the below configuration.
The site-wise configuration path can be either /usr/local/etc/caddy/caddy.d/example1.tld/*.conf or import /usr/local/etc/caddy/caddy.d/example1.tld-*.conf.
# Global Options
{
...
import /usr/local/etc/caddy/caddy.d/*.global
}
# Reverse Proxy Configuration
example1.tld {
...
log {
...
}
...
handle {
...
}
import /usr/local/etc/caddy/caddy.d/example1.tld/*.conf
}
example2.tld {
...
log {
...
}
...
handle {
...
}
import /usr/local/etc/caddy/caddy.d/example2.tld/*.conf
}
import /usr/local/etc/caddy/caddy.d/*.conf
Thank you for creating an issue. Since the ticket doesn't seem to be using one of our templates, we're marking this issue as low priority until further notice.
For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.
The easiest option to gain traction is to close this ticket and open a new one using one of our templates.
Im not sure how much further this can be broken down. Essentially any missing option anywhere could result in a request for an import at exactly the correct spot.
Since the Caddyfile syntax is not very flexible when it comes to duplication, going fully manual in the scope of the current imports might be the best choice.
I would rather add something in the GUI that allows setting or removing headers where needed. This just needs a clear example and the missing directive from the caddy documentation.
This issue has been automatically timed-out (after 180 days of inactivity).
For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.
If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.