Closed haath closed 4 months ago
+1
I ran into the same as well, when connecting from different network devices.
I did some preliminary work on getting this done in branch feature/#380. I can't seem to get the environment variables to pass from docker into the production build though.
If someone is familiar with this process can they take a look?
Given that Dockerized NGINX supports templating, what's probably the easiest solution is to just have the web version serve an additional JavaScript file, generated by NGINX template itself.
location ${PUBLIC_PATH}/settings.js {
add_header Content-Type application/javascript;
return '"use strict";window.SERVER_URL="${SERVER_URL}";'
}
You could then tweak the index.ejs
file to include this script first for web builds (and then use process.env.SERVER_URL
, and fallback to window.SERVER_URL
)
I started working on this feature on my own a short while ago and left it somewhat hung. I have days off work this week and i will look into it. But the solution @kgarner7 proposes seems reasonable. its just matter of setting the docker image to replace envs with those passed to the container. Might also look into possible alternatives. Expect a PR related to this soonish.
If you are using Nginx as a reverse proxy in front of everything, you can do something real simple to do this.
location = /renderer.js { sub_filter_once on; sub_filter_types *; sub_filter '({initialValues:{legacyAuth:!1,name:"",password:"",savePassword:!1,type:v.ServerType.JELLYFIN,url:"http://",username:""}})' '({initialValues:{legacyAuth:!1,name:"My Music",password:"",savePassword:!1,type:v.ServerType.JELLYFIN,url:"https://example.co.uk",username:""}})'; proxy_set_header Forwarded $proxy_add_forwarded; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://<IP>:9180/renderer.js; }
location = /renderer.js { sub_filter_once on; sub_filter_types *; sub_filter '({initialValues:{legacyAuth:!1,name:"",password:"",savePassword:!1,type:v.ServerType.JELLYFIN,url:"http://",username:""}})' '({initialValues:{legacyAuth:!1,name:"My Music",password:"",savePassword:!1,type:v.ServerType.JELLYFIN,url:"https://example.co.uk",username:""}})'; proxy_set_header Forwarded $proxy_add_forwarded; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://
:9180/renderer.js; }
where would i add this in the ngnix configs??
in the configs you use for feishin. feel free to reach out to me on discord if you need help!
Hey all,
To make it easier for my users, I'd like to set up a Feishin front-end that is configured to already have the URL of my Jellyfin server. Then users visiting the Feishin web app would only be prompted to enter their Jellyfin credentials and log in.
In my opinion the current
Open Menu > Manage servers
flow is a bit redundant, and could be streamlined away when the intent is just to use one frontend with one backend.On the Docker side, this could easily be configured by setting some
JELLYFIN_URL
orNAVIDROME_URL
environment variable.