diff --git a/Dockerfile b/Dockerfile index 19a0424..8275e42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,5 @@ -FROM phusion/baseimage:0.9.16 +FROM linuxserver/baseimage MAINTAINER Stian Larsen -RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh -ENV DEBIAN_FRONTEND noninteractive -ENV HOME /root - # Use baseimage-docker's init system CMD ["/sbin/my_init"] @@ -11,8 +7,8 @@ CMD ["/sbin/my_init"] # Install Plex RUN apt-get -q update && \ -VERSION=$(curl https://raw.githubusercontent.com/linuxserver/misc-files/master/plex-version/public) && \ -apt-get install -qy dbus avahi-daemon gdebi-core wget && \ +VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4) && \ +apt-get install -qy dbus gdebi-core avahi-daemon wget && \ wget -P /tmp "http://downloads.plexapp.com/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb" && \ gdebi -n /tmp/plexmediaserver_${VERSION}_amd64.deb && \ rm -f /tmp/plexmediaserver_${VERSION}_amd64.deb && \ diff --git a/README.md b/README.md index 5373813..246bc8a 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ docker create \ --name=plex \ --net=host \ -e PLEXPASS=1 \ + -e VERSION="0.9.12.4.1192-9a47d21" \ -e PUID= -e PGID= \ -v :/config \ -v :/data/tvshows \ @@ -28,6 +29,7 @@ docker create \ * `-v /config` - Plex library location. *This can grow very large, 50gb+ is likely for a large collection.* * `-v /data/xyz` - Media goes here. Add as many as needed e.g. `/data/movies`, `/data/tv`, etc. * `-e PLEXPASS=1` - Set to 1 if you have a Plex Pass, if not don't specify it. +* `-e VERSION` - Set this to a full version number if you want to use a spesific version e.g. "0.9.12.4.1192-9a47d21" * `-e PGID` for for GroupID - see below for explanation * `-e PUID` for for UserID - see below for explanation @@ -47,4 +49,11 @@ Part of what makes our containers work so well is by allowing you to specify you * lonix * IronicBadger -Auto-updating Ubuntu (phusion) based Plex Media Server container, brought to you by LinuxServer.io \ No newline at end of file +Auto-updating Ubuntu (phusion) based Plex Media Server container, brought to you by LinuxServer.io + +## Changelog + ++ **18.07.2015:** Moved autoupdate to be hosted by linuxserver.io and implented bugfix thanks to ljm42. ++ **09.07.2015:** Now with ability to pick static versionnumber. ++ **08.07.2015:** Now with autoupdates. (Hosted by fanart.tv) ++ **03.07.2015:** Fixed a mistake that allowed plex to run as user plex rather than abc (99:100). Thanks to double16 for spotting this. diff --git a/init/11_new_user.sh b/init/11_new_user.sh new file mode 100644 index 0000000..b5ac305 --- /dev/null +++ b/init/11_new_user.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ "$(id -u abc)" != "$PUID" ]; then usermod -o -u "$PUID" abc ; fi +if [ "$(id -g abc)" != "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi + +echo " +----------------------------------- +Plex GID/UID +----------------------------------- +Plex uid: $(id -u abc) +Plex gid: $(id -g abc) +----------------------------------- +Plex will now continue to boot. +" +sleep 2 diff --git a/init/20_update_plex.sh b/init/20_update_plex.sh index e0d7749..e54eef7 100644 --- a/init/20_update_plex.sh +++ b/init/20_update_plex.sh @@ -1,10 +1,14 @@ #!/bin/bash export DEBIAN_FRONTEND=noninteractive INSTALLED=`dpkg-query -W -f='${Version}' plexmediaserver` -if [ "$PLEXPASS" == "1" ]; then - VERSION=$(curl https://raw.githubusercontent.com/linuxserver/misc-files/master/plex-version/plexpass) +if [ $VERSION ]; then + echo "Useing version: $VERSION from Manual" +elif [ "$PLEXPASS" == "1" ]; then + VERSION=$(curl -s https://tools.linuxserver.io/latest-plexpass.json | grep "version" | cut -d '"' -f 4) + echo "Useing version: $VERSION from Plexpass latest" else - VERSION=$(curl https://raw.githubusercontent.com/linuxserver/misc-files/master/plex-version/public) + VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4) + echo "Useing version: $VERSION from Public latest" fi if [ "$VERSION" == "$INSTALLED" ]; then exit 0; diff --git a/init/90_uid_gid_fix.sh b/init/90_uid_gid_fix.sh deleted file mode 100644 index 02e31ac..0000000 --- a/init/90_uid_gid_fix.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -if [ -n "$PUID" -a "$(id -u abc)" != "$PUID" ]; then usermod -u "$PUID" abc ; fi -if [ -n "$PGID" -a "$(id -g abc)" != "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi - -# There will be a lot of files in the config and searching through all of them will take a long time. -# Only Plex should modify these, so do a quick test to see if we need to search deeper. -if [ -n "$( find /config -maxdepth 2 -not \( -user abc -a -group abc \) )" ]; then - find /config -not \( -user abc -a -group abc \) -exec chown abc:abc {} + -fi - -echo " ------------------------------------ -Plex GID/UID ------------------------------------ -Plex uid: $(id -u abc) -Plex gid: $(id -g abc) ------------------------------------ -Plex will now continue to boot. -" -sleep 2 diff --git a/init/99_chown_plex_owned_files.sh b/init/99_chown_plex_owned_files.sh new file mode 100644 index 0000000..66a976e --- /dev/null +++ b/init/99_chown_plex_owned_files.sh @@ -0,0 +1,7 @@ +#!/bin/bash + + +if [ -d "/config/Library" ]; then +find /config/Library ! \( -user abc -a -group abc \) -exec chown -hv abc:abc {} \; +fi +