MatthewCroughan / octobalena

Control your 3d-printer with octoprint + octoscreen via balena!
GNU General Public License v2.0
49 stars 22 forks source link

Octoprint not accessible with local network IP #15

Open nikil511 opened 4 years ago

nikil511 commented 4 years ago

works with balena public IP but not with local one. I guess it has to do with traefik settings

MatthewCroughan commented 4 years ago

Yes, this is how it is currently configured. It only allows traffic in if the host: header is *.balena-devices.com OR *.local OR *.localdomain OR *.lan.

As can be seen in the traefik.http.routers.<entrypoint/frontend>.rule definitions https://github.com/MatthewCroughan/octobalena/blob/0814becc7cd94c07f60e9160b7029f26a75755e6/docker-compose.yml#L20 https://github.com/MatthewCroughan/octobalena/blob/0814becc7cd94c07f60e9160b7029f26a75755e6/docker-compose.yml#L24 https://github.com/MatthewCroughan/octobalena/blob/0814becc7cd94c07f60e9160b7029f26a75755e6/docker-compose.yml#L28

So, port 80/443 is owned by traefik. Traefik says you only get forwarded/proxied into the octoprint container on port 5000 IF those names match, if not then 404.

TL;DR

If you go to the IP address on port 5000 you will bypass Traefik and get directly through to Octoprint.

https://github.com/MatthewCroughan/octobalena/blob/66436c1c894399079d46e4a6928fbbdfb5f7e161/docker-compose.yml#L12-L13