wernight / docker-plex-media-server

Dockerized Plex Media Server
https://registry.hub.docker.com/u/wernight/plex-media-server/
MIT License
128 stars 34 forks source link

Support for plex pass #3

Closed jkaberg closed 8 years ago

jkaberg commented 8 years ago

There's an update script here that supports plex pass.

Auto update on container start-up would be nice aswell, opt-in ofcourse (via arg or so)

UniverseXXX commented 8 years ago

+1 thank you

wernight commented 8 years ago

On Plex update it's possible to:

  1. and/or update the image (already done)
  2. and/or retrieves the latest version when it's started (however the provided script requires root so priviledges must be dropped later and users cannot use --user flag)
  3. and/or support plex upgrade (possibly using runit which would also solve the PID 1 zombie reaping problem)

As long as people don't always start from the container all sounds a decent improvements during ugprdes.

As for Plex Pass, I think it's also very much related:

jkaberg commented 8 years ago

@wernight I was under the assumption that "plex upgrade" only works on Windows hosts?

wernight commented 8 years ago

@jkaberg Normally it does work also on Linux but it might be from package manager.

wernight commented 8 years ago

About your PR:

Regarding the Plex Pass, I think the best would be two tags, one premium and one non premium. It does look like https://plex.tv/downloads?channel=plexpass requires people to log in so it makes me wonder even more about why/how tools.linuxserver.io would be allowed to bypass that check. I've premium so I could in theory get the latest link.

This goes back to the solution of auto-updating. I'll try to bring someone from Plex to discuss it here.

wernight commented 8 years ago

So in place auto-upgrade isn't supported on Linux by Plex. This leaves either:

Currently the first one was chosen, but it's possible to have both solutions (via environment variable) and the second solution allows Plex Pass via user/password and a bit faster update.

wernight commented 8 years ago

Looking more into it, it's impossible to auto-update on re-create/restart as we're not running as root (by purpose). It'd be possible to run as root and drop privileges but that would break --user=USER Docker flag and users relying on it.

Both versions seem to be identical most of the time but I'll definitely look into supporting the Pass version one way or another.

What plexupdate.sh does is very close to the current, it simply uses https://plex.tv/downloads?channel=plexpass and post PlexPass authentication form data.

wernight commented 8 years ago

See also https://forums.plex.tv/discussion/195263/premium-download-link

jkaberg commented 8 years ago

The most convenient approach would of course be to upgrade on container start, however that (as you pointed out) does require root permissions.

I personally will strive to achieve this, but I understand your reasons for not doing so.

jkaberg commented 8 years ago

Perhaps something like this for auto updating @wernight, https://github.com/aptalca/docker-plexrequests/blob/master/firstrun.sh

wernight commented 8 years ago

The PlexPass is frequently identical to the public but gets updated slightly earlier. This means that only people caring to get the very latest ASAP would really want this.

Therefor, I'll change so that there is another branch that auto-update on start, running as root initially, for people who prefer latest over slightly faster/secure,

wernight commented 8 years ago

Fixed by having a branch that runs the really latest on each start, supporting PlexPass users. It's still safe, and it's for users who want the really latest without disrupting users who want the simpler/more version controlled.

@jkaberg You should like that it does what you're trying to get.

See latest README for details.

wernight commented 8 years ago

I just cannot reproduce this issue via docker restart .... So weird.

jkaberg commented 8 years ago

@wernight don't know your setup but mine's

================================================================================
= OS/Debian information
================================================================================
Distributor ID: debian
Description: Debian GNU/Linux 7 (wheezy)
Release: 7.9
Codename: wheezy

================================================================================
= openmediavault information
================================================================================
Release: 2.1.20
Codename: Stone burner
================================================================================
= Locale
================================================================================
en_US.UTF-8

================================================================================
= System information
================================================================================
Linux dunder 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 GNU/Linux
joel@dunder:~$ sudo docker -v
Docker version 1.9.1, build a34a1d5
wernight commented 8 years ago

@jkaberg I could reproduce it when running Plex via docker-compose up -d ... but running it via docker and just doing docker restart my-container seems to always correctly fetch without your PR. I'll try some more.