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

A few suggestions/wishlist #44

Open
jkaberg opened this issue Sep 18, 2024 · 9 comments
Open

A few suggestions/wishlist #44

jkaberg opened this issue Sep 18, 2024 · 9 comments

Comments

@jkaberg
Copy link

jkaberg commented Sep 18, 2024

First off, awesome work! I'm looking into self-hosting Stremio for myself and family, and I was wondering if you'd consider a few improvements?

  • Add the ability by environment variable to set the server url, eg SERVER_URL=https://stremio-server.domain.tld
  • Add the ability to install/activate custom plugins, eg torrentio, opensubtitles etc.
  • Look into proxing the server component so both web app and server sit behind the same port
@tsaridas
Copy link
Owner

hi

the first and last features can be achieved by settings up nginx infront of this container and settings everything up.
A good example of this is https://github.com/Zaarrg/stremio-docker-prefix
I could try to setup nginx inside the same container but then users would need more options like certificates etc which can get complicated. I think already having server and webplayer running on the same container is a bit too much but also convenient.

As for installing addons, this should be saved on your profile after you login. Not sure how else to achieve what you are asking or i'm not sure what exactly you have in mind.

@HVR88
Copy link

HVR88 commented Sep 28, 2024

I wouldn't recommend adding Nginx inside the container. Anyone who's interested in using FQDN is likely already running reverse proxy, whether it be via Nginx, Traefik, Caddy or something else.

Any specific advice beyond what's linked to get this working behind Nginx Proxy Manager https with wildcard cert?

I can successfully access the webUI and play video in the browser by hitting my server by IP at http. Setting the server to the same IP and port 11470 successfully goes Online. If I reverse proxy using https://FQDN I can use the webUI, but I can't get the server setting to go online. Tried http and https, IP, FQDN, etc. Always Error. Also tried with and without disabling CORS and using the NGINX config options at the link you posted above.

@tsaridas
Copy link
Owner

tsaridas commented Sep 29, 2024

I remember I did setup nginx as a proxy and it worked fine but it had issues with basic auth when trying to setup the server. Haven't tested in a while though and that nginx config that the repo provides looks solid. Maybe you can ping the owner of that repo to ask questions.

I'm happy to add it to the documentation if you got everything working.

Saying that, I'm not sure if having server go through a proxy is the best idea performance wise since you will have to transfer data through that proxy and we are talking about GBs of data which need to be loaded in memory from each application.

@HVR88
Copy link

HVR88 commented Sep 29, 2024

I had some help yesterday from the person who put together an Unraid deployment of your container.

The solution is to create two entries in the reverse proxy (NPM in my case). One pointing to IP:8080 for the webUI and another (with a different subdomain) pointing to IP:11470 for the server. Both can be set up with TLS using wildcard cert for secure access.

Then access the webUI using its FQDN and set the server to https with its different FQDN (no need to enter port number as that's taken care of by the reverse proxy config).

So long as the docker's network type is bridge (on a macvlan setup), using the host's IP, this works brilliantly and video will play back within the browser even on iOS devices. Very nice. 😊

@tsaridas
Copy link
Owner

can you post all information required to set this up please ?

@HVR88
Copy link

HVR88 commented Sep 30, 2024

OK, this is mainly from memory, hope I covered everything:

Self-hosted Stremio WebUI & Server
with Reverse Proxy & TLS/SSL on Own Domain Name

Prerequisites

Initial Stremio Account Setup

  • Login ID/account for Stremio created at Stremio web site
  • Your Stremio plugins installed via Stremio web site (Trakt, RD, etc.)

For access with your own domain name and secure HTTPS access

  • Valid and registered domain name
  • Reverse Proxy installed on your network running on unique IP address (Nginx Proxy Manager, Caddy, Traefik, HAProxy, etc...)
  • Wildcard certificate set up in reverse proxy for your domain name
  • Some DNS service/capability (server, resolver, forwarder, black-hole) installed on your network with ability to set DNS records or overrides - PiHole, AdGuard Home, Unbound, DNSMasq, etc.
    (even a hosts file on an individual test machine can work)

For remote access from outside your LAN

  • VPN such as Tailscale, Netbird, Wireguard, ZeroTier, etc. (installed on all systems/OS you'll use/access)
    Must be installed along-side the reverse proxy if you want remote access to any URLS handled by the proxy
  • Optional: Self-hosted Secure sign-on:: Authentik, Authelia, Keycloak, Zitadel, etc.

Container and Reverse Proxy Setup

  1. Install docker container on a Bridge network (uses host's IP with custom ports - usually default)
  2. Test local access with IP address in browser
    Example: access webUI http://10.10.1.200:8080 (use your specific IP)
  3. Log in using the ID you previously created for Stremio
    All your plugins should be loaded automatically - verify this
  4. Go to Settings and set Server address: http://10.10.1.200:11470 (always same IP but with server port 11470)
    Status must show "Online" after you enter the address
  5. Browse the Stremio library, select a movie, select a source and try playing it
    Video should queue up and start playing in the browser
  6. Create an entry in your reverse proxy for the webUI (example, "Proxy Hosts" in NPM)
    Domain name: stremio.yourdomain.tld
    Forward IP: 10.10.1.200 Forward port: 8080
    Force TLS/SSL and select the wildcard certificate for your domain name (*.yourdomain.tld)
  7. Create an entry in your reverse proxy for the server
    Domain name: stremio-server.yourdomain.tld
    Forward IP: 10.10.1.200 Forward port: 11470
    Force TLS/SSL and select the wildcard certificate for your domain name (*.yourdomain.tld)
  8. Create a DNS entry/override to point the two subdomains above to the IP of your reverse proxy
    Test local access via domain name in your browser
    Example: access webUI http://stremio-server.yourdomain.tld (don't use a port#, reverse proxy does that already)
    If reverse proxy is working and DNS entry correct, your browser will automatically be sent to webUI with https
  9. Log in using the ID you previously created for Stremio
    You have to log in every time you connect with a different URL or a different browser
  10. Go to Settings and set Server address: https://stremio-server.yourdomain.tld (note you don't need to include port#)
    Status must show "Online" after you enter the address
    This is important, as you have to set server address every time you use a new browser and AFTER logging in
  11. Browse the Stremio library, select a movie, select a source and try playing it
    Video should queue up and start playing in the browser

If you have set up a VPN like Tailscale, the above will also automatically work when you access your network remotely

@tsaridas
Copy link
Owner

I haven't tested myself but I do remember making it work with rewrite module in nginx.

example : https://github.com/psyb0t/safe-stremio/blob/master/nginx/default.conf

@rdzakson
Copy link

Hi, I have done this exact setup few days ago before I found this guide and can confirm it is reasonable and standard approach which works.

My question is about the point 10 and if there is a way to make the server address stick. Additionally I recall loosing all the plugins before but this was before I created the account so not sure if still a problem. Basically I wonder how to persist the settings, plugins and server url, or even better to have it declared in docker compose or other config.

Thank you. Awesome work!

@tsaridas
Copy link
Owner

the default url of the server is hardcoded in the wasm file and that cannot be changed on the fly by doing some sed.
only way I can see now to change that is by setting the url encoded param like

http://stremio:8080/?streamingServerUrl=http://stremio:11470

one could add this to their nginx configuration if they wanted

plugin are also hardcoded to the wasm file and they cannot be changed as well. I'm looking at the web player repo to see that maybe some settings can be set and default by changing this file : https://github.com/Stremio/stremio-web/blob/development/src/common/CONSTANTS.js before we build

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

No branches or pull requests

4 participants