From e8b4092f7dfffe3cc74cd6a1719f910bc95c3518 Mon Sep 17 00:00:00 2001 From: chbmb Date: Sat, 18 May 2019 00:16:30 +0100 Subject: [PATCH] Var & Init files --- jenkins-vars.yml | 28 ++++++++++++++++++++++++++++ readme-vars.yml | 14 ++++++++------ root/defaults/config.json | 20 ++++++++++---------- root/etc/cont-init.d/30-config | 14 ++++++++++---- root/etc/services.d/mstream/run | 9 +++++++-- 5 files changed, 63 insertions(+), 22 deletions(-) create mode 100644 jenkins-vars.yml diff --git a/jenkins-vars.yml b/jenkins-vars.yml new file mode 100644 index 0000000..46885a3 --- /dev/null +++ b/jenkins-vars.yml @@ -0,0 +1,28 @@ +--- + # jenkins variables +project_name: docker-mstream +external_type: github_stable +release_type: stable +release_tag: latest +ls_branch: master +repo_vars: + - EXT_GIT_BRANCH = 'master' + - EXT_USER = 'IrosTheBeggar' + - EXT_REPO = 'mStream' + - BUILD_VERSION_ARG = 'MSTREAM_RELEASE' + - LS_USER = 'linuxserver' + - LS_REPO = 'docker-mstream' + - CONTAINER_NAME = 'mstream' + - DOCKERHUB_IMAGE = 'linuxserver/mstream' + - DEV_DOCKERHUB_IMAGE = 'lsiodev/mstream' + - PR_DOCKERHUB_IMAGE = 'lspipepr/mstream' + - DIST_IMAGE = 'alpine' + - MULTIARCH='true' + - CI='true' + - CI_WEB='true' + - CI_PORT='3000' + - CI_SSL='false' + - CI_DELAY='120' + - CI_DOCKERENV='TZ=US/Pacific' + - CI_AUTH='user:password' + - CI_WEBPATH='' \ No newline at end of file diff --git a/readme-vars.yml b/readme-vars.yml index becb478..9623368 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -1,8 +1,8 @@ -project_name: mstream -project_url: "https://github.com/IrosTheBeggar/mStream" +project_name: mStream +project_url: "https://mstream.io/" project_logo: "https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/mstream.png" project_blurb: | - [{{ project_name|capitalize }}]({{ project_url }}) is a personal music streaming server. You can use mStream to stream your music from your home computer to any device, anywhere. + [{{ project_name }}]({{ project_url }}) is a personal music streaming server. You can use mStream to stream your music from your home computer to any device, anywhere. project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_name }}" # supported architectures @@ -22,13 +22,15 @@ param_ports: - { external_port: "3000", internal_port: "3000", port_desc: "The port for the mStream webinterface" } param_usage_include_env: true param_env_vars: + - { env_var: "USER", env_value: "admin", desc: "Set username to login" } + - { env_var: "PASSWORD", env_value: "password", desc: "Set password for user" } + - { env_var: "USE_JSON", env_value: "true/false", desc: "Run mStream using the config specified at `/config/config.json`, note this will mean user/password is defined in `config.json`" } - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use e.g. Europe/London" } - # application setup block app_setup_block_enabled: true app_setup_block: | - Access the webui at `http://:3000`, for more information check out [{{ project_name|capitalize }}]({{ project_url }}). + Access the webui at `http://:3000`, For most users specifying a USER and PASSWORD is sufficient, the `USE_JSON` option allows for more granular control of mStream, but with added complexity, requiring manual editing of `config.json` to configure your install, for more information check out [{{ project_name|capitalize }}](https://github.com/IrosTheBeggar/mStream/blob/master/docs/json_config.md#json-config). # changelog changelogs: - - { date: "28.09.16:", desc: "Inital Release" } + - { date: "18.05.19:", desc: "Inital Release" } diff --git a/root/defaults/config.json b/root/defaults/config.json index e832d86..cb33299 100644 --- a/root/defaults/config.json +++ b/root/defaults/config.json @@ -1,11 +1,10 @@ { "port": 3000, "webAppDirectory": "public", - "secret": "", - "writeLogs": true, - "noUpload": false, + "writeLogs": false, + "noUpload": true, "scanOptions": { - "skipImg": true, + "skipImg": false, "scanInterval": 1.5, "pause": 50, "saveInterval": 500, @@ -13,16 +12,17 @@ }, "storage": { "albumArtDirectory": "/config/album-art", - "dbDirectory": "/config", - "logsDirectory": "/config/logs" + "dbDirectory": "/config/db" }, "folders": { - "music": "/music" + "library": "/music" }, "users": { "admin": { "password":"password", - "vpaths": "music" - } + "vpaths": "library", + "lastfm-user": "username", + "lastfm-password": "password" + } } -} \ No newline at end of file +} diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 4c1a1c7..203f259 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -1,9 +1,15 @@ #!/usr/bin/with-contenv bash -# make folders -mkdir -p \ - /config/album_art \ - /config/db +# make folders if don't exist +[[ ! -d /config/album-art ]] && \ + mkdir -p /config/album-art + +[[ ! - d /config/db ]] && \ + mkdir -p /config/db + +# copy config.json if doesn't exist +[[ ! -e /config/config.json ]] && \ + cp /defaults/config.json /config/config.json # permissions chown abc:abc -R \ diff --git a/root/etc/services.d/mstream/run b/root/etc/services.d/mstream/run index 776cab3..17bd4b8 100644 --- a/root/etc/services.d/mstream/run +++ b/root/etc/services.d/mstream/run @@ -2,5 +2,10 @@ cd /opt/mstream || exit -exec \ - s6-setuidgid abc mstream -j /config/config.json \ No newline at end of file +if [ "$USE_JSON" == "true" ]; then + exec \ + s6-setuidgid abc mstream -j /config/config.json +else + exec \ + s6-setuidgid abc mstream -m /music -I /config/album-art/ -d /config/db/ -u ${USER} -x ${PASSWORD} +fi \ No newline at end of file