server-docker icon indicating copy to clipboard operation
server-docker copied to clipboard

Allow Enabling HTTPS with ENV Var

Open jaruba opened this issue 2 years ago • 8 comments

The server is able to create valid SSL certificates given a LAN IP, but there is no way to set this outside of the Stremio app settings. (when connected to the server)

I propose creating an env var (could be named "REMOTE_HTTPS") that should be set to the LAN IP address in order to provide an SSL certificate for it.

The HTTPS server uses the 12470 port, while the HTTP server uses the 11470. (only 11470 is currently being exposed in this docker image, I believe)

  • [x] Expose port 12470
  • [ ] Add env. variable for remote https ssl certificate

jaruba avatar Jun 06 '23 12:06 jaruba

I've already added the 12470 port to the Dockerfile, however, keep in mind that this is for documentation purposes, you still have to expose the port when running the container:

docker run --rm -d -p 11470:11470 -p 12470:12470 stremio/server:latest

See PR #13 https://github.com/Stremio/server-docker/blob/feat/multiplatform-builds/Dockerfile#L57-L58

elpiel avatar Jun 26 '23 06:06 elpiel

I get HTTPS: Request error Could not get a valid HTTPS certificate in the container logs (on a different computer on the same lan) whenever i hit reload in the webapp streaming settings.

damacchi avatar Jul 24 '23 23:07 damacchi

Is this issue a reason why connection to the server fails unless it is exposed publicly over https (ex: https://stremio.domain.com)?

Weird thing is when trying to set my server to point to 'http://192.168.1.2:11470' or 'https://192.168.1.2:12470' it fails to connect, but if I copy stream URL ( #19 ) and replace the malformed IP with aforementioned LAN IP video loads and plays,

vpetkovic avatar Sep 02 '23 04:09 vpetkovic

I get HTTPS: Request error Could not get a valid HTTPS certificate in the container logs (on a different computer on the same lan) whenever i hit reload in the webapp streaming settings.

@damacchi I am currently having the same issue, did you manage to fix it? Thank you very much

manueljishi avatar Mar 30 '24 17:03 manueljishi

I think there's an undocumented (or hard to find) endpoint that generates the certs or i think you need to just put self signed certs in the settings directory. PEM file, i think. proto://localhost:11470/get-https

kennyparsons avatar Aug 13 '24 02:08 kennyparsons

I think there's an undocumented (or hard to find) endpoint that generates the certs or i think you need to just put self signed certs in the settings directory. PEM file, i think. proto://localhost:11470/get-https

I had to ensure the ipAddress was set in the query string for this to work. e.g

http://<local docker host ip>:11470/get-https?ipAddress=<local docker host ip>

This then returned some json, e.g:

{
  ipAddress: "<local docker host ip>",
  domain: "<local docker host ip>.519b6502d940.stremio.rocks",
  port: 12470
}

And created a httpsCert.json in the data dir with matching details.

The domain it returns has an A record pointing to <local docker host ip>.

Accessing it in a browser redirects to app.strem.io with the correct streamingServer query string passed, and https certs all seem to be working

tompipe avatar Sep 07 '24 18:09 tompipe