-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally disable caddy #84
Comments
This is a good, oft-requested feature. We need to make changes in CanastaWiki/Canasta and CanastaWiki/Canasta-DockerCompose + CanastaWiki/Canasta-Kubernetes. |
The right way to do this in Docker Compose is to use profiles. (Examples in StackOverflow thread). How should this be done in Kubernetes? Would we implement something using Charts and Helm? Is there a preferred best practice besides the "upstream" approach used in WMF operations? https://wikitech.wikimedia.org/wiki/Local-charts |
One 'hack' to disable Caddy would be the following in
_ hack provided by @cicalese _ |
Although a Note: Just a little nuance from the comment above; the implemented workaround in pull 46 still assigns the web ports to Caddy (not varnish), but since it's in an override file, the system administrator can manually disable it without altering the Canasta compose file. I'm sure there are many use cases where an existing infrastructure will have some other TLS termination. Or, the target host is either air-gapped or some virtual environment without public networking where Caddy fails to do its magic. This means that the Caddy service, although a valuable component of the Canasta Stack, should be optional. Caddy can be made optional by using the Docker Compose feature called 'profiles', part of the compose file version: '3.7'
### snip ####
caddy:
image: docker.io/library/caddy:2.4.6-alpine
profiles: ["tls"]
restart: unless-stopped
entrypoint: caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
environment:
- MW_SITE_FQDN=${MW_SITE_FQDN:-localhost}
volumes:
- caddy-data:/data
- ./config/Caddyfile:/etc/caddy/Caddyfile
### snip ### Then, either of the following would start the (optional) Caddy service.
Since all services without named profiles get started by default, maybe we could get fancy with a definition like # Uncomment the next line to disable the Caddy application server and TLS endpoint in favor of your own infrastructure
# CADDY_PROFILE=caddy_NOT_enabled This way, Caddy would be default ON (because the environment variable is undefined and thus the parameter is empty), but easy to disable by uncommenting a line in the .env |
It's worth mentioning that Caddy is extremely smart about providing HTTPS even for 'localhost' - by creating a self-signed certificate. So "my system is local" or "air gapped" isn't truly a problem for Caddy. The only true use case for making Caddy optional is that there will be people who already have some Application Distribution Controller (ADC) or Load Balancer product where they manage their TLS endpoint. |
We're moving wikiapiary back to WMCloud, but this means we'll be sitting behind WMCloud's reverse proxy that provides SSL termination. As a result, we don't need Caddy and would like to disable it.
For now, I have gotten around this by adding the following to
docker-compose.override.yml
:I've looked, but this is not a way to remove ports using the
override
file, so the startup looks like this:The text was updated successfully, but these errors were encountered: