Repository navigation
fix(compose): read Basic Auth users from an htpasswd file [5m] - #80
Merged
Merged
Conversation
Coolify does not interpolate variables in labels, so the basicauth.users
label reached Traefik as a literal ${...} string. Point the middleware at
an htpasswd file the Coolify proxy mounts instead, and attach it to the
https-0 router as well as http-0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom: Basic Auth does not protect the deployed RSSHub. Coolify does not interpolate variables in labels, so the running container's middleware label reads literally
basicauth.users=${RSSHUB_BASIC_AUTH:?}, which Traefik cannot use.Change:
docker-compose.custom.yml: thehyprrykhpm87vx88mwnlwrkt-rsshubmiddleware now usesbasicauth.usersfile=/traefik/rsshub.htpasswd. The middleware name is unchanged.https-0-…router as well as thehttp-0-…router./data/coolify/proxy/rsshub.htpasswdon the server, mounted into the Coolify proxy as/traefik), how it is made (htpasswd -nbB -C 12), and why a label variable does not work. No other reference toRSSHUB_BASIC_AUTHremains in the repository.To check after deploy:
/traefik/rsshub.htpasswd.docker inspectlabels of the new container with what Coolify generates. If Coolify also writes its ownmiddlewareslabel forhttp-0orhttps-0(for exampleredirect-to-httpsorgzip), the later label wins, and either Basic Auth or Coolify's middleware drops out. In that case list both in one label, for examplemiddlewares=gzip,hyprrykhpm87vx88mwnlwrkt-rsshub.https-0router, the new label defines a stray router without a host rule. Remove that line in that case.Verified:
yqparses the compose file and lists the four labels;oxfmt --checkis clean. Not deployed, and the Traefik behavior was not tested.An AI agent wrote this text in my name, on my instructions.