jfroment / seedbox

A Docker-powered seedbox with persistent data and more cool stuff.
MIT License
324 stars 46 forks source link

Problem with adding the service ( Jellyfin ) - rejected ports #52

Open Qbaakr opened 10 months ago

Qbaakr commented 10 months ago

Hello I would like to replace Plex with Jellyfin I made some corrections in the config.yaml file:

Jellyfin

and I added yaml in custom: version: '3.5' services: jellyfin: image: jellyfin/jellyfin container_name: jellyfin restart: always network_mode: host ports:

volumes: configjellyfin: driver: local-persist driver_opts: mountpoint: $HOST_CONFIG_PATH/jellyfin

I did the same thing as configuring Plex, but I still get an error: ! jellyfin Published ports are discarded when using host network mode Anyone have an idea where I made a mistake? Regards

tblaudez commented 9 months ago

Hey there,

When it comes to Docker, you have two choices regarding port mapping :

  1. You use the network_mode: host to publish every ports used by the container on your host system
  2. You use the ports config to publish only the ports you believe are necessary

@jfroment made his choice in the dev branch regarding Plex, he chose to use network_mode: host and removed all the lines regarding the specific ports (https://github.com/jfroment/seedbox/commit/26909f2a7edc8b18cdbd986b462f6d50a2de295a) I chose to do the opposite and I explicitely published all the ports needed by Plex. Both work fine.

I assume the same logic can be applied to Jellyfin. You didn't explain what kind of error you encounter, can you give more details ?

Qbaakr commented 9 months ago

Hello ;) Thanks for the answer Even if I remove the ports from custom.yaml and leave the "host" alone, it starts but - "BAD GETEWAY" If necessary, I can post the log from the container. p.s.

tblaudez commented 9 months ago

I see you added the line httpOnly: true in your Jellyfin configuration inside the config.yaml, is that intended ? The BAD GATEWAY error seems to indicate that the Traefik container is failing to connect to the Jellyfin container.

Qbaakr commented 9 months ago

Hi Yes, httpOnly: true is correct because I have a problem with generating certificates - which was discussed in an earlier topic, and due to lack of knowledge and skills, I abandoned this topic :( If I understood correctly, I should set network_mode in config Jellyfin yaml: traefik_network? because at this point there is a host - and in fact after entering http://localhost:8096 it connects to the server. But would it be correct if I added the ports to traefik in config/ports or just to the Jellyfin yaml?

jfroment commented 8 months ago

I'm not quite sure I understood the issue. With docker, there are two modes for networking (in fact there's more but that's irrelevant for this issue):

Concerning the httpOnly, this is only to tell Traefik to listen on port 80 to bypass certificate generation and be able to access the service without TLS via Traefik. But Traefik is used only when you access the service using a hostname. (something.yourdomain.com). If you access it via IP:port, you bypass Traefik, so httpOnly is irrelevant here. Bridge/Host considerations are completely separate from this topic. So you have a total of 4 choices to access your services:

Qbaakr commented 8 months ago

Hello As I wrote earlier, unfortunately I have a problem with certificates and I don't know how to deal with it - that's why I use httpOnly. Therefore, the first and third options are out of the question for now. In Host mode it works correctly - after the ip address :port I wanted to run it in the second option. In bridge mode, it displays a "bad gateway" error In the /service/customs/jellyfin.yaml file network_mode: bridge ports:

p.s. I know I'm doing something wrong with port forwarding because after changing the httpAuth: to true configuration, it normally requests username and password even though it doesn't display the page...