Merge pull request #11 from linuxserver/v5

various updates for v5
This commit is contained in:
aptalca 2021-06-03 14:34:16 -04:00 committed by GitHub
commit c31c424c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 140 additions and 96 deletions

View File

@ -7,36 +7,39 @@ ARG MSTREAM_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="chbmb"
ENV HOME="/config"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
curl \
git && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
nodejs \
npm \
openssl && \
echo "**** install app ****" && \
mkdir -p \
echo "**** install app ****" && \
mkdir -p \
/opt/mstream && \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
"https://github.com/IrosTheBeggar/mStream/archive/${MSTREAM_RELEASE}.tar.gz" && \
tar xzf \
tar xzf \
/tmp/mstream.tar.gz -C \
/opt/mstream/ --strip-components=1 && \
cd /opt/mstream && \
npm install --only=production && \
npm link && \
echo "**** cleanup ****" && \
apk del --purge \
cd /opt/mstream && \
npm install --only=production && \
npm link && \
echo "**** cleanup ****" && \
npm cache clean --force && \
apk del --purge \
build-dependencies && \
rm -rf \
rm -rf \
/tmp/*
# add local files

View File

@ -7,36 +7,39 @@ ARG MSTREAM_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="chbmb"
ENV HOME="/config"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
curl \
git && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
nodejs \
npm \
openssl && \
echo "**** install app ****" && \
mkdir -p \
echo "**** install app ****" && \
mkdir -p \
/opt/mstream && \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
"https://github.com/IrosTheBeggar/mStream/archive/${MSTREAM_RELEASE}.tar.gz" && \
tar xf \
tar xf \
/tmp/mstream.tar.gz -C \
/opt/mstream/ --strip-components=1 && \
cd /opt/mstream && \
npm install --only=production && \
npm link && \
echo "**** cleanup ****" && \
apk del --purge \
cd /opt/mstream && \
npm install --only=production && \
npm link && \
echo "**** cleanup ****" && \
npm cache clean --force && \
apk del --purge \
build-dependencies && \
rm -rf \
rm -rf \
/tmp/*
# add local files

View File

@ -7,36 +7,39 @@ ARG MSTREAM_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="chbmb"
ENV HOME="/config"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
curl \
git && \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
nodejs \
npm \
openssl && \
echo "**** install app ****" && \
mkdir -p \
echo "**** install app ****" && \
mkdir -p \
/opt/mstream && \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
"https://github.com/IrosTheBeggar/mStream/archive/${MSTREAM_RELEASE}.tar.gz" && \
tar xf \
tar xf \
/tmp/mstream.tar.gz -C \
/opt/mstream/ --strip-components=1 && \
cd /opt/mstream && \
npm install --only=production && \
npm link && \
echo "**** cleanup ****" && \
apk del --purge \
cd /opt/mstream && \
npm install --only=production && \
npm link && \
echo "**** cleanup ****" && \
npm cache clean --force && \
apk del --purge \
build-dependencies && \
rm -rf \
rm -rf \
/tmp/*
# add local files

View File

@ -59,7 +59,14 @@ The architectures supported by this image are:
## Application Setup
Access the webui at `http://<your-ip>: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 [Mstream](https://github.com/IrosTheBeggar/mStream/blob/master/docs/json_config.md#json-config). Note using this option will make the default username:password `admin` and `password` respectively and any environmental variables will be ignored.
Access the webui at `http://<your-ip>:3000`
Settings are adjusted through the web ui or via editing of `config.json`. For more information check out [Mstream](https://github.com/IrosTheBeggar/mStream/blob/master/docs/json_config.md#json-config).
## IMPORTANT NOTICE:
mStream v5 no longer accepts cli arguments for setting the user and password and requires the use of `config.json`. Therefore, the environment variables `USER`, `PASSWORD` and `USE_JSON` are deprecated.
v4's `config.json` is not compatible with v5. Existing `config.json` will be renamed to `config.json.v4-bak` for your reference and a new default `config.json` will be created upon upgrade from v4 to v5.
## Usage
@ -79,13 +86,10 @@ services:
environment:
- PUID=1000
- PGID=1000
- USER=admin
- PASSWORD=password
- USE_JSON=true/false
- TZ=Europe/London
volumes:
- <path to data>:/config
- <path to music>:/music
- /path/to/data:/config
- /path/to/music:/music
ports:
- 3000:3000
restart: unless-stopped
@ -98,13 +102,10 @@ docker run -d \
--name=mstream \
-e PUID=1000 \
-e PGID=1000 \
-e USER=admin \
-e PASSWORD=password \
-e USE_JSON=true/false \
-e TZ=Europe/London \
-p 3000:3000 \
-v <path to data>:/config \
-v <path to music>:/music \
-v /path/to/data:/config \
-v /path/to/music:/music \
--restart unless-stopped \
ghcr.io/linuxserver/mstream
```
@ -118,9 +119,6 @@ Container images are configured using parameters passed at runtime (such as thos
| `-p 3000` | The port for the mStream webinterface |
| `-e PUID=1000` | for UserID - see below for explanation |
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e USER=admin` | Set username to login |
| `-e PASSWORD=password` | Set password for user |
| `-e USE_JSON=true/false` | Run mStream using the config specified at `/config/config.json`, note this will mean user/password is defined in `config.json` |
| `-e TZ=Europe/London` | Specify a timezone to use e.g. Europe/London |
| `-v /config` | mStream config |
| `-v /music` | Music location |
@ -234,6 +232,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **17.05.21:** - Deprecating the env vars `USER`, `PASSWORD` and `USE_JSON` as mStream v5 requires the use of `config.json`.
* **23.01.21:** - Rebasing to alpine 3.13.
* **01.06.20:** - Rebasing to alpine 3.12.
* **19.12.19:** - Rebasing to alpine 3.11.

View File

@ -15,24 +15,29 @@ available_architectures:
param_container_name: "{{ project_name }}"
param_usage_include_vols: true
param_volumes:
- { vol_path: "/config", vol_host_path: "<path to data>", desc: "mStream config" }
- { vol_path: "/music", vol_host_path: "<path to music>", desc: "Music location" }
- { vol_path: "/config", vol_host_path: "/path/to/data", desc: "mStream config" }
- { vol_path: "/music", vol_host_path: "/path/to/music", desc: "Music location" }
param_usage_include_ports: true
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://<your-ip>: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). Note using this option will make the default username:password `admin` and `password` respectively and any environmental variables will be ignored.
Access the webui at `http://<your-ip>:3000`
Settings are adjusted through the web ui or via editing of `config.json`. For more information check out [{{ project_name|capitalize }}](https://github.com/IrosTheBeggar/mStream/blob/master/docs/json_config.md#json-config).
## IMPORTANT NOTICE:
mStream v5 no longer accepts cli arguments for setting the user and password and requires the use of `config.json`. Therefore, the environment variables `USER`, `PASSWORD` and `USE_JSON` are deprecated.
v4's `config.json` is not compatible with v5. Existing `config.json` will be renamed to `config.json.v4-bak` for your reference and a new default `config.json` will be created upon upgrade from v4 to v5.
# changelog
changelogs:
- { date: "17.05.21:", desc: "Deprecating the env vars `USER`, `PASSWORD` and `USE_JSON` as mStream v5 requires the use of `config.json`." }
- { date: "23.01.21:", desc: "Rebasing to alpine 3.13." }
- { date: "01.06.20:", desc: "Rebasing to alpine 3.12." }
- { date: "19.12.19:", desc: "Rebasing to alpine 3.11." }

View File

@ -1,7 +1,7 @@
{
"port": 3000,
"webAppDirectory": "public",
"writeLogs": false,
"webAppDirectory": "webapp",
"writeLogs": true,
"noUpload": true,
"scanOptions": {
"skipImg": false,
@ -12,17 +12,10 @@
},
"storage": {
"albumArtDirectory": "/config/album-art",
"dbDirectory": "/config/db"
"dbDirectory": "/config/db",
"logsDirectory": "/config/logs"
},
"folders": {
"library": { "root": "/music" }
},
"users": {
"admin": {
"password":"password",
"vpaths": ["library"],
"lastfm-user": "username",
"lastfm-password": "password"
}
}
}

View File

@ -2,12 +2,55 @@
# make folders
mkdir -p \
/config/{album-art,db}
/config/{album-art,db,logs}
# copy config.json if doesn't exist
[[ ! -e /config/config.json ]] && \
cp /defaults/config.json /config/config.json
# Backwards compatibility notice
if [ -n "$USER" ] || [ -n "$PASSWORD" ] || [ -n "$USE_JSON" ]; then
echo '
*************************************
*************************************
**** ****
**** $USER, $PASSWORD and ****
**** ****
**** $USE_JSON env vars are ****
**** ****
**** deprecated. ****
**** ****
**** Please edit config.json ****
**** ****
**** or use the web ui to ****
**** ****
**** modify the settings. ****
**** ****
*************************************
*************************************'
fi
if grep -q '"webAppDirectory": "public"' /config/config.json; then
mv /config/config.json /config/config.json.v4-bak
echo '
*************************************
*************************************
**** ****
**** ****
**** v4 config.json detected ****
**** ****
**** renaming to ****
**** ****
**** config.json.v4-bak ****
**** ****
**** due to incompatibility ****
**** ****
**** with v5 ****
**** ****
*************************************
*************************************'
fi
# permissions
chown abc:abc -R \
/config

View File

@ -2,10 +2,5 @@
cd /opt/mstream || exit
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
exec \
s6-setuidgid abc mstream -j /config/config.json