Skip to content

fix(compose): read Basic Auth users from an htpasswd file [5m] - #80

Merged
Gl4dr3x merged 1 commit into
masterfrom
fix/compose-basic-auth-usersfile
Nov 17, 2026
Merged

Gl4dr3x merged 1 commit into
masterfrom
fix/compose-basic-auth-usersfile

Conversation

@Gl4dr3x

@Gl4dr3x Gl4dr3x commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

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: the hyprrykhpm87vx88mwnlwrkt-rsshub middleware now uses basicauth.usersfile=/traefik/rsshub.htpasswd. The middleware name is unchanged.
  • The middleware is attached to the https-0-… router as well as the http-0-… router.
  • The label comments now say where the file lives (/data/coolify/proxy/rsshub.htpasswd on 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 to RSSHUB_BASIC_AUTH remains in the repository.

To check after deploy:

  • The proxy must be able to read the file at /traefik/rsshub.htpasswd.
  • Compare docker inspect labels of the new container with what Coolify generates. If Coolify also writes its own middlewares label for http-0 or https-0 (for example redirect-to-https or gzip), the later label wins, and either Basic Auth or Coolify's middleware drops out. In that case list both in one label, for example middlewares=gzip,hyprrykhpm87vx88mwnlwrkt-rsshub.
  • If the domain is plain http and Coolify creates no https-0 router, the new label defines a stray router without a host rule. Remove that line in that case.

Verified: yq parses the compose file and lists the four labels; oxfmt --check is clean. Not deployed, and the Traefik behavior was not tested.

An AI agent wrote this text in my name, on my instructions.

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]>
@Gl4dr3x Gl4dr3x self-assigned this Nov 17, 2026
@Gl4dr3x
Gl4dr3x merged commit a8eb13b into master Nov 17, 2026
27 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant