Skip to content
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

Can't setup reverse proxy with custom domain #15

Closed
diamant-x opened this issue Apr 25, 2024 · 7 comments · Fixed by #16
Closed

Can't setup reverse proxy with custom domain #15

diamant-x opened this issue Apr 25, 2024 · 7 comments · Fixed by #16

Comments

@diamant-x
Copy link

Hi again,

I'm playing around with the tool, and trying to set it up in my own nginx reverse proxy where i handle all my subdomains. However, trying to point to the container port, while the favicon and page title seems to work (so the proxy itself is correctly setup) seems like the container is blocking the connection, I get a white page. Dev console just shows a 'SyntaxError: Unexpected end of JSON input'

  • Could you make it so that ingress can be enabled/disabled so that custom proxys can work?

The reason why i don't like ingress is because if i need to store usernames/passwords, like in ghostfolio, then my passwords managers just show it always that i am in home-assistant.

Also, i think due to this, whenever i 'log out' form my account in ghostfolio, it also logs me out from Home Assistant.

  • Could you take a look at it as well?

Thanks.

@lildude
Copy link
Owner

lildude commented Apr 25, 2024

  • Could you make it so that ingress can be enabled/disabled so that custom proxys can work?

Yeah, I think I know what's causing this:

https://github.com/lildude/ha-addon-ghostfolio/blob/e002ff78da1092f7f54c6645feaf5731cdf6b989/rootfs/etc/services.d/ghostfolio/run#L54C1-L57C3

If I'm right, I just need to put this behind a check to see if you've enabled the port option. I can probably also not start Nginx in this case too to save on resources.

I'll take a look at this in the next few days.

Also, i think due to this, whenever i 'log out' form my account in ghostfolio, it also logs me out from Home Assistant.

This shouldn't be the case as I've not integrated the Ghostfolio auth with the Home Assistant auth. I do know you'll get a 404 as the redirect from the logout still needs some work when using ingress as it redirects to a path that isn't accessible.

@diamant-x
Copy link
Author

If I'm right, I just need to put this behind a check to see if you've enabled the port option.

It would be better to have it as a separate addon config option. Because my nginx reverse proxy sits in the same docker instance as ghostfolio, i can point it to the docker container name and internal port without the need to expose it through the home-assistance instance. This means i do NOT configure any port in the addon config screen for proxy to work.

@lildude
Copy link
Owner

lildude commented Apr 25, 2024

Are you able to share your reverse proxy config so I can test it to be sure?

@diamant-x
Copy link
Author

Are you able to share your reverse proxy config so I can test it to be sure?

I use https://github.com/hassio-addons/addon-nginx-proxy-manager
Then in the GUI, i set up a proxy like:
image
where the hostname matches the container ID found when running the addon:
image

@lildude
Copy link
Owner

lildude commented Apr 27, 2024

Things should now work with the latest release. As noted in the PR body, you will need to enable and set the port mapping as it's a security risk exposing direct access to a port and I don't want to be responsible for the ill-informed shooting themselves in the foot.

@lildude
Copy link
Owner

lildude commented Apr 28, 2024

An even better fix is in #18 and removes all the hacking I was doing before.

#19 fixes the logout taking you to an invalid page and signing you out of HA.

@diamant-x
Copy link
Author

Thanks! V1.4.1 works great and reverse proxy is perfect. Thank you.

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 a pull request may close this issue.

2 participants