causefx / Organizr

HTPC/Homelab Services Organizer - Written in PHP
GNU General Public License v3.0
5.12k stars 290 forks source link

Unable to get docker install to recognise that I'm outside of local network. #1967

Closed smarthome-enthusiast closed 3 months ago

smarthome-enthusiast commented 7 months ago
Organizr Version: V 2.1.2460
Branch: Master
WebServer: Nginx-fpm:enabled
Operating System: Synology 7.2 + Official Docker Image

Problem Description:

TL;DR: I am unable to get Official Docker image to see that I am outside of local network and use Tab URL instead of local tab URL on Synology/DSM 7.2

I've set the local tab ip for internal 192.168.x.x and tab url to an accessible external address however when using Organizr from an external IP (100.x.x.x), none of the tabs work as it is using the Local Tab URLs to connect.

I have:

  1. set the Override Local IP or Subnet to match 192.168.x.x CIDR in Organizr Login Settings.
  2. checked the debug area and it shows that Local: true even though I am not on that subnet.
  3. checked the logs and it shows all activities are from 172.x.x.x .
  4. set the correct "Real Docker IP" range in default site config.
  5. tried the following fix from Pedro Lamas but it didn't work. Link: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/
  6. set Synology's Trusted Proxies setting to both Docker IP and Local IP of NAS
  7. allowed traffic to subnet on Firewall.
  8. used the test.php in issue #1836 and can not find the PHP Variables:

image

Originally posted by @causefx in https://github.com/causefx/Organizr/issues/1836#issuecomment-1133335598

Is there something I am missing or haven't enabled? Is the image already set up to forward IPs?

I am somewhat familiar with Docker and CLI, but not an expert. I am a complete novice at web servers so any help with instructions would be appreciated

HalianElf commented 7 months ago

That link you linked should be what you need. I would try going through that again since that's the only way you're going to get it to see the correct IP (and there's no way for Organizr to detect it when it's getting the wrong info).

smarthome-enthusiast commented 7 months ago

That link you linked should be what you need. I would try going through that again since that's the only way you're going to get it to see the correct IP (and there's no way for Organizr to detect it when it's getting the wrong info).

I took another look at the link (If I understood correctly, you are referring to no. 8?), and it seems like these are the only PHP HTTP Variables that I'm getting:

image

I can't seem to locate the HTTP_X_REAL_IP or HTTP_X_FORWARDED_FOR variables.

HalianElf commented 7 months ago

No this one with the iptables stuff: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/

It's getting the wrong IP because syno isn't properly NATing it so it's showing the from as the docker gateway

smarthome-enthusiast commented 7 months ago

No this one with the iptables stuff: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/

It's getting the wrong IP because syno isn't properly NATing it so it's showing the from as the docker gateway

Thanks for getting back to me so quickly! I went ahead and ran the script again, and now I can find the Variables:

image

But it is still showing that I am Local:

image

HalianElf commented 7 months ago

That definitely looks better. Are you setting an override for local IPs? 100.x.x.x should be considered remote

smarthome-enthusiast commented 7 months ago

Yes I've set the "Override Local IP or Subnet" to 192.x.x.x and 100.x.x.x should be considered as remote, but it still isn't. I've also noticed that it's still reporting my IP as 172.x.x.x, is this something I should be concerned about?

image

image

image

image

Edit: added screenshots and made original post clearer

smarthome-enthusiast commented 7 months ago

That definitely looks better. Are you setting an override for local IPs? 100.x.x.x should be considered remote

Am I supposed to fill in the WAN domain and Enable Local Address Forward when setting an override for local IPs?

HalianElf commented 7 months ago

You shouldn't be changing the override at all, it all ready contains all the RFC-1918 space and no you don't need do that, that's just for switching urls for Organizr when you're local.

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] commented 3 months ago

This issue has been closed due to lack of activity, if this issue still persists, please re-open it.