Open Ktzenjammer opened 6 days ago
We need the full server information and logs to help with anything.
The /media/
files are not being served correctly. If you have followed the docker setup guide, then your inventree-proxy
container should be serving these files.
inventree-proxy
container you should see some useful error messages404
messagesAdditionally:
I just checked my installation and it doesn't use the caddy proxy server because i'm on a Synology Nas and i want to use the native reverse proxy of the nas to access inventree. I tried to reinstall inventree with the proxy but i can't connect trought the nas reverse proxy (i get the "ERR_TOO_MANY_REDIRECTS" error)
According to this page : https://docs.inventree.org/en/stable/start/serving_files/ I tried to set the debug mode to True and when i started it again, my images just show up (that could be a solution, i don't know if it's safe to stay in debug mode)
So i discovered my real problem is that i don't know how to configure my caddy proxy correctly on a Synology Nas :/
I do not think we can guide you if you are not using the full stack; using multiple reverse proxies is introducing complexity.
An instance running in debug mode is leaking a lot of info and not enforcing many security measures (I suspect that those might be causing the issues in the redirection). If access to the host interface is only available to trusted environments and users it might be ok to run the server in debug mode. I have to stress that this is not the intended setup and the server is leaking a lot of info to unauthorised and less-privileged users; there are also performance penalties in various areas of up to 30% in CPU and RAM usage.
You could try the Server Access controls https://docs.inventree.org/en/stable/start/config/#server-access - especially INVENTREE_TRUSTED_ORIGINS and INVENTREE_COOKIE_SAMESITE
I recently started to look at Inventree again for home/personal use with the plan to run it on my Synology NAS and found the same thing. As mentioned above it will be to do with the Iventree reverse proxy and the Synology reverse proxy not working well together. I came up with a few potential ways to work around this,
Option 1. This might be possible to get working, but you will have to figure out how the Synology proxy works internally on DSM and likely modify the config via the command line. I think it uses Nginx, so the config might be straight forward as Inventree provide a Nginx example in their compose file. However, as you are modifying these files outside of the GUI there is a good chance they won't work after a reboot or DSM upgrade (found this out trying to bodge something else on DSM). For this reason, I discounted option 1.
Option 2. Probably the easiest option, but you're likely wanting to use a reverse proxy so you don't have to manage certificates and you don't have to remember port numbers on the end of your URL. Which is why I discounted this option.
Option 3. The most convoluted setup but was what I ended up using. The downside is putting a proxy in-front of another proxy may causes issues, as you have found out with the Synology proxy. The good news is if you have full control of the proxy, you can most likely fix the issue and you are not tied to Synology if you want to move your containers at a later date.
As a rough outline, this is what I have done.
Created a 'MACVLAN network' and a 'reverse proxy bridge network' in Docker to home my reverse proxy (Nginx Proxy Manager, aka NPM). This has the advantage of allowing NPM to not conflict with any ports Synology may use and have a static IP directly on my main network.
Deployed Inventree on Docker but modified the Inventree 'reverse-proxy' container to run Nginx not only on the default Inventree network, but also my reverse proxy network (hint: the reverse proxy network should be specified as external in docker compose to allow you to take spin up/down Inventree without affecting other services).
I used Nginx as I had odd things happen with Caddy, but I'm less familiar with it so that might have been me messing things up as I was trying various solutions. I also didn't expose the Inventree reverse-proxy container ports as there is no need since the new proxy can access it internally via Docker using the created 'reverse proxy' network. In NPM I didn't have to do anything special to get Inventree to work, as it seemed to pass the required information to the Inventree proxy out of the box.
I'm happy to go over this solution in more detail, including my full config files and how I'm also using Portainer to manage my config/deployments on Synology. However, I feel it might be best to move the conversation over to the 'Discussions' area so the developers can close this issue since it isn't really an issue with Inventree.
Lastly, for anyone reading this, please please be aware what I have done above is NOT supported by the Inventree team so you may have to fix any future issues with running double proxies and compose modifications etc. yourself.
Deployment Method
Steps to Reproduce
Describe the problem*
Hello there, hope you can help me...
Well, i think a screen capture will speak for itself :
Steps to Reproduce
I made a fresh install of inventree on my synology Nas via Docker Container Manager.
Relevant log output