-
First Check
Homebox Versionv0.17.2 What is the issue you are experiencing?Homebox creates and immediately clears auth cookie resulting in logout after trying to view any internal page. I use rootless image of Homebox Many thanks. How can the maintainer reproduce the issue?
DeploymentDocker (Linux) OS Architechturex86_64 (AMD, Intel) Deployment DetailsDocker compose
.env
Env in the Homebox container
Version: v0.17.2 ~ Build: 44bdca8 Please let me know if you need any additional info |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 2 replies
-
Please format your docker-compose.yml as a multiline code. |
Beta Was this translation helpful? Give feedback.
-
Formatting fixed. Env vars passing - resolved. I've update the issue. Auth cookie problem still present. |
Beta Was this translation helpful? Give feedback.
-
I cannot seem to replicate the auth cookie myself either on demo, dev, nightly, my own Homebox instance or a fresh instance locally, I’m afraid… Can I get some more details about your current setup to try and narrow this down for you please? Presumably you’ve tried in private etc to rule out a cache issue? |
Beta Was this translation helpful? Give feedback.
-
For sure, I've tried private tab as well. In the dev console Application->Storage->Cookies I can literally see Auth cookie been set and immediately unset. Ok, I've tried to connect without reverse proxy (http://ip) and auth worked as expected. What headers should be passed through? Anyway that is a bit wired because auth works with https (https://domain) and reverse proxy, just self unsets. Maybe some CORS/Origin check in the code? Just for the sake of clarity I should mention that with software like Jellyfin, Immich and the same reverse proxy auth via https://domain works as expected that's why I haven't thought about reverse proxy factor at the first place. Hope my findings help with debugging. |
Beta Was this translation helpful? Give feedback.
-
Just in case I've enabled X-Real-IP and X-Forwarded-For but nothing changed. Anything else I can help with in terms of information gathering/testing? |
Beta Was this translation helpful? Give feedback.
-
The main header used for Authentication is the Authentication: header. If it's not getting passed to the backend API it's going to break things. |
Beta Was this translation helpful? Give feedback.
-
As I mentioned before, auth.token preserves on the client side only when accessing directly via http://ip. If accessing via https://domain, application unset (delete) auth.token from the client right after successful authorization. It looks like Homebox has some kind of origin check preventing frontend to preserve the auth.token after the first successful auth attempt. Maybe it could be configured somehow (via Env variable, for example)? |
Beta Was this translation helpful? Give feedback.
-
If I manually set auth.token cookies obtained from http://ip session in Firefox dev console I am able to login to Homebox and further work with it via https://domain/. Ok, I've played around with dev console a bit more:
From this error it is unclear which domain Homebox considers as valid. So the question is how to set my domain name for the Homebox. Is it possible to add my domain setting via Env var? If not, is it possible to implement such a thing (shouldn't be complicated)? |
Beta Was this translation helpful? Give feedback.
-
Anything else I could help with? Please let me know. I assume the issue might be relevant for other users who willing to setup Homebox with https and reverse proxy. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem with the hb.auth.token cookie. I use Bunkerweb (1.5.12) as a reverse proxy. Attached is a screenshot of the Firefox developer console showing the cookies. |
Beta Was this translation helpful? Give feedback.
-
I've attempted to replicate this with Nginx, Caddy, Apache and Traefik and I'm unable to do so. Without configuration details of the reverse proxy I don't think we'll be able to properly diagnose this issue. |
Beta Was this translation helpful? Give feedback.
-
Here is a excerpt from the bunkerweb (nginx config):
|
Beta Was this translation helpful? Give feedback.
Many thanks for the config listing! I've managed to figure it out just before I've seen your reply.
In order to make it work at least
proxy_set_header Host "homebox.domain.example"
andProxyPreserveHost Off
must be defined.My reverse proxy is build in the router's firmware so it is a bit of a blackbox in terms of seen the whole config listing, but it has a couple of CLI options, setting
host
,X-Real-IP
andX-Forwarded-For
headers among them.Would be glad if Homebox dev team could include such reverse proxy config example in the official docs. I believe it'll save many hours spent on debugging the issue.
Basically it is frontend configuration issue. I assume host should be configurable v…