linuxserver / docker-plex

GNU General Public License v3.0
1.15k stars 202 forks source link

Provide AllowedNetworks and FriendlyName through environment settings #324

Closed yvbeek closed 1 year ago

yvbeek commented 2 years ago

linuxserver.io


Desired Behavior

It would be very useful to be able to pass the following arguments for the first run:

Example:

---
version: "2.1"
services:
  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - VERSION=docker
      - PLEX_CLAIM=claim_abcdefghijkl
      - PLEX_SERVER_NAME=Atlas
      - PLEX_ALLOWED_NETWORKS=192.168.10.0/24
    volumes:
      - /path/to/library:/config
      - /path/to/tvseries:/tv
      - /path/to/movies:/movies
    restart: unless-stopped

Current Behavior

In /etc/cont-init.d/45-plex-claim the server name is hardcoded to PlexMediaServer. It would be great if we could use the PLEX_SERVER_NAME environment variable here. And then also write the server name as FriendlyName in Preferences.xml

There currently is no easy way to get it under a different name.

Alternatives Considered

For the server name I don't see an alternative. It is hard to edit 45-plex-claim.

To set the allowedNetworks, you would currently have to run the docker at least once. Then go into the Preferences.xml file and add allowedNetworks manually. This can be error prone and could make setup more complex.

github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 2 years ago

We prefer not to touch the preferences xml as we don't control the upstream and any changes they make to it would break our image.

With that said, I'm pretty sure the server name defaults to the container hostname (in bridge network), which you can set in your docker arguments.

If you use the Plex claim token, you don't need to set allowed networks. Once set up, you can edit them in the gui settings.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue is locked due to inactivity