commit 44688b81ed53332a960214b996d2fa47de92cd3e Author: sparklyballs Date: Fri Oct 16 12:07:15 2015 +0100 test up new build dependencies and app from pip diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..01f6be7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM linuxserver/baseimage.python +MAINTAINER smdion ,Sparklyballs + +ENV BEETSDIR /config +ENV APTLIST="ffmpeg lame libav-tools libchromaprint-tools libyaml-dev mp3gain wget" + +RUN add-apt-repository ppa:kirillshkrogalev/ffmpeg-next && \ +apt-get update -q && \ +apt-get install $APTLIST -qy && \ +pip install -U pyacoustid && \ +pip install -U pylast && \ +pip install -U flask && \ +pip install -U beets && \ +apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* + +#Adding Custom files +ADD init/ /etc/my_init.d/ +ADD services/ /etc/service/ +ADD defaults/ /defaults/ +RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh + +# Volumes and Ports +VOLUME /config /music +EXPOSE 8337 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..459d41e --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +![http://linuxserver.io](http://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) + +## This is a Container in active development, and should not be used by the general public. +If you are curious about the current progress or want to comment\contribute to this work, feel free to join us at out irc channel: +[IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. + +or visit our website at [https://linuxserver.io](https://www.linuxserver.io/) + diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md new file mode 100644 index 0000000..fb19a71 --- /dev/null +++ b/READMETEMPLATE.md @@ -0,0 +1,46 @@ +![http://linuxserver.io](http://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) + +The [LinuxServer.io](https://www.linuxserver.io/) team brings you another quality container release featuring auto-update on startup, easy user mapping and community support. Be sure to checkout our [forums](https://forum.linuxserver.io/index.php) or for real-time support our [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. + +# linuxserver/ + + + +## Usage + +``` +docker create --name= -v /etc/localtime:/etc/localtime:ro -v :/config -e PGID= -e PUID= -p 1234:1234 linuxserver/ +``` + +**Parameters** + +* `-p 4242` - the port(s) +* `-v /etc/localtime` for timesync - *optional* +* `-v /config` - +* `-e PGID` for GroupID - see below for explanation +* `-e PUID` for UserID - see below for explanation + +It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it /bin/bash`. + +### User / Group Identifiers + +**TL;DR** - The `PGID` and `PUID` values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended). + +Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers. + +## Setting up the application + + DELETE ME + + +## Updates + +* Upgrade to the latest version simply `docker restart `. +* To monitor the logs of the container in realtime `docker logs -f `. + + + +## Versions + ++ **dd.MM.yyyy:** This is the standard Version type now. + diff --git a/defaults/beets.sh b/defaults/beets.sh new file mode 100644 index 0000000..8cd2626 --- /dev/null +++ b/defaults/beets.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# beets music tagger - post-processing script +# +# Author: Rich Manton (overbyrn) +# Date: 29-04-13 +# +# $1 - Fullpath of directory to be processed. eg./mnt/user/downloads/some.artist_some.album + +# $7 - Status of post processing. 0 = OK, 1 = failed verification, 2 = failed unpack, 3 = 1+2 +if [ ! -z $7 ] && [ $7 -gt 0 ]; then + echo "post-processing failed, bypassing script" + exit 1 +fi + +# process files +echo "--------------------------" +echo $(date) +echo "Starting beets.sh for $(basename $1)" + +BEETSDIR=/config +export BEETSDIR +FPCALC=/usr/bin/fpcalc +export FPCALC +/usr/local/bin/beet -v import -q "$1" + diff --git a/defaults/config.yaml b/defaults/config.yaml new file mode 100644 index 0000000..64c6f6c --- /dev/null +++ b/defaults/config.yaml @@ -0,0 +1,63 @@ +plugins: fetchart embedart convert scrub replaygain lastgenre chroma web +directory: /music +library: /config/musiclibrary.blb +art_filename: albumart +threaded: yes +original_date: no +per_disc_numbering: no + +convert: + auto: no + ffmpeg: /usr/bin/ffmpeg + opts: -ab 320k -ac 2 -ar 48000 + max_bitrate: 320 + threads: 1 + +paths: + default: $albumartist/$album%aunique{}/$track - $title + singleton: Non-Album/$artist - $title + comp: Compilations/$album%aunique{}/$track - $title + albumtype_soundtrack: Soundtracks/$album/$track $title + +import: + write: yes + copy: no + move: yes + resume: ask + incremental: yes + quiet_fallback: skip + timid: no + log: /config/beet.log + +lastgenre: + auto: yes + source: album + +embedart: + auto: yes + +fetchart: + auto: yes + +replaygain: + auto: no + +scrub: + auto: yes + +replace: + '^\.': _ + '[\x00-\x1f]': _ + '[<>:"\?\*\|]': _ + '[\xE8-\xEB]': e + '[\xEC-\xEF]': i + '[\xE2-\xE6]': a + '[\xF2-\xF6]': o + '[\xF8]': o + '\.$': _ + '\s+$': '' + +web: + host: 0.0.0.0 + port: 8337 + diff --git a/init/30_update.sh b/init/30_update.sh new file mode 100644 index 0000000..b71c6dc --- /dev/null +++ b/init/30_update.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +pip install -U pyacoustid +pip install -U pylast +pip install -U flask +pip install -U beets diff --git a/init/40_set_config.sh b/init/40_set_config.sh new file mode 100644 index 0000000..9b17a87 --- /dev/null +++ b/init/40_set_config.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if beets.sh exists. If not, copy in +if [ -f /config/beets.sh ]; then + echo "Using existing config file." +else + echo "Creating beets.sh from template." + cp -v /defaults/beets.sh /config/beets.sh + chown abc:abc /config/beets.sh + chmod +x /config/beets.sh +fi + + +# Check if config.yaml exists. If not, copy in +if [ -f /config/config.yaml ]; then + echo "Using existing config file." +else + echo "Creating config.yaml from template." + cp /defaults/config.yaml /config/config.yaml + chown abc:abc /config/config.yaml +fi + diff --git a/services/beets/run b/services/beets/run new file mode 100644 index 0000000..d35edd2 --- /dev/null +++ b/services/beets/run @@ -0,0 +1,4 @@ +#!/bin/bash +umask 002 + +/sbin/setuser abc beet web