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

Automatically connect you Plex account to the container without SSH Port Forward or other tricks. #19

Closed XciD closed 8 years ago

XciD commented 8 years ago

Automatically connect you Plex account to the container without SSH Port Forward or other tricks.

Username and password are used to cat Plex.tv api to get an app token. Then add it to Preferences.xml and your Plex Media is Automatically linked to your account

ENV Variables to use : PLEX_USERNAME PLEX_PASSWORD

example :

docker run -d --name plex \ 
              -e PLEX_USERNAME=xcid  \
              -e PLEX_PASSWORD=password  \ 
              --restart=always \ 
              -v ~/plex-config:/config \ 
              -v ~/Movies:/media \ 
              -p 32400:32400 wernight/plex-media-server

If you are using a different external port than 32400, you will have to user PLEX_EXTERNALPORT

docker run -d --name plex \ 
              -e PLEX_USERNAME=xcid  \
              -e PLEX_PASSWORD=password  \ 
              -e PLEX_EXTERNALPORT=33400  \
              --restart=always \ 
              -v ~/plex-config:/config \ 
              -v ~/Movies:/media \ 
              -p 32400:32400 wernight/plex-media-server
JigSawFr commented 8 years ago

Nice ! <3

wernight commented 8 years ago

Very nice indeed. I'm thinking how to make it the most easy for users to use. I'm thinking to prompt users for username/password in case there is no existing preference.

XciD commented 8 years ago

Happy to help :). For me, I'm using it with Docker API to create container for my users.

JigSawFr commented 8 years ago

@XciD do you have some examples ?

XciD commented 8 years ago

It's a complex architecture (Java + AngularJS), I'm using this lib : https://github.com/docker-java/docker-java

I ask my users their login/pass in frontend, then I create the container in backend.

But, there is another ways, like php script invoking a bash script ... etc...

wernight commented 8 years ago

I'm updating upon this to support X_PLEX_TOKEN, normalize name (currently this uses PLEX_USERNAME while other parts use PLEXPASS_LOGIN), and more.