Skip to content

Commit c31c424

Browse files
authored
Merge pull request #11 from linuxserver/v5
various updates for v5
2 parents dd743f8 + b1ec78b commit c31c424

File tree

8 files changed

+140
-96
lines changed

8 files changed

+140
-96
lines changed

Dockerfile

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,39 @@ ARG MSTREAM_RELEASE
77
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
88
LABEL maintainer="chbmb"
99

10+
ENV HOME="/config"
11+
1012
RUN \
11-
echo "**** install build packages ****" && \
12-
apk add --no-cache --virtual=build-dependencies \
13+
echo "**** install build packages ****" && \
14+
apk add --no-cache --virtual=build-dependencies \
1315
curl \
1416
git && \
15-
echo "**** install runtime packages ****" && \
16-
apk add --no-cache --upgrade \
17+
echo "**** install runtime packages ****" && \
18+
apk add --no-cache --upgrade \
1719
nodejs \
1820
npm \
1921
openssl && \
20-
echo "**** install app ****" && \
21-
mkdir -p \
22+
echo "**** install app ****" && \
23+
mkdir -p \
2224
/opt/mstream && \
23-
if [ -z ${MSTREAM_RELEASE+x} ]; then \
24-
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
25-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
26-
fi && \
27-
curl -o \
28-
/tmp/mstream.tar.gz -L \
25+
if [ -z ${MSTREAM_RELEASE+x} ]; then \
26+
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
27+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
28+
fi && \
29+
curl -o \
30+
/tmp/mstream.tar.gz -L \
2931
"https://github.com/IrosTheBeggar/mStream/archive/${MSTREAM_RELEASE}.tar.gz" && \
30-
tar xzf \
32+
tar xzf \
3133
/tmp/mstream.tar.gz -C \
3234
/opt/mstream/ --strip-components=1 && \
33-
cd /opt/mstream && \
34-
npm install --only=production && \
35-
npm link && \
36-
echo "**** cleanup ****" && \
37-
apk del --purge \
35+
cd /opt/mstream && \
36+
npm install --only=production && \
37+
npm link && \
38+
echo "**** cleanup ****" && \
39+
npm cache clean --force && \
40+
apk del --purge \
3841
build-dependencies && \
39-
rm -rf \
42+
rm -rf \
4043
/tmp/*
4144

4245
# add local files

Dockerfile.aarch64

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,39 @@ ARG MSTREAM_RELEASE
77
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
88
LABEL maintainer="chbmb"
99

10+
ENV HOME="/config"
11+
1012
RUN \
11-
echo "**** install build packages ****" && \
12-
apk add --no-cache --virtual=build-dependencies \
13+
echo "**** install build packages ****" && \
14+
apk add --no-cache --virtual=build-dependencies \
1315
curl \
1416
git && \
15-
echo "**** install runtime packages ****" && \
16-
apk add --no-cache --upgrade \
17+
echo "**** install runtime packages ****" && \
18+
apk add --no-cache --upgrade \
1719
nodejs \
1820
npm \
1921
openssl && \
20-
echo "**** install app ****" && \
21-
mkdir -p \
22+
echo "**** install app ****" && \
23+
mkdir -p \
2224
/opt/mstream && \
23-
if [ -z ${MSTREAM_RELEASE+x} ]; then \
24-
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
25-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
26-
fi && \
27-
curl -o \
28-
/tmp/mstream.tar.gz -L \
25+
if [ -z ${MSTREAM_RELEASE+x} ]; then \
26+
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
27+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
28+
fi && \
29+
curl -o \
30+
/tmp/mstream.tar.gz -L \
2931
"https://github.com/IrosTheBeggar/mStream/archive/${MSTREAM_RELEASE}.tar.gz" && \
30-
tar xf \
32+
tar xf \
3133
/tmp/mstream.tar.gz -C \
3234
/opt/mstream/ --strip-components=1 && \
33-
cd /opt/mstream && \
34-
npm install --only=production && \
35-
npm link && \
36-
echo "**** cleanup ****" && \
37-
apk del --purge \
35+
cd /opt/mstream && \
36+
npm install --only=production && \
37+
npm link && \
38+
echo "**** cleanup ****" && \
39+
npm cache clean --force && \
40+
apk del --purge \
3841
build-dependencies && \
39-
rm -rf \
42+
rm -rf \
4043
/tmp/*
4144

4245
# add local files

Dockerfile.armhf

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,39 @@ ARG MSTREAM_RELEASE
77
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
88
LABEL maintainer="chbmb"
99

10+
ENV HOME="/config"
11+
1012
RUN \
11-
echo "**** install build packages ****" && \
12-
apk add --no-cache --virtual=build-dependencies \
13+
echo "**** install build packages ****" && \
14+
apk add --no-cache --virtual=build-dependencies \
1315
curl \
1416
git && \
15-
echo "**** install runtime packages ****" && \
16-
apk add --no-cache --upgrade \
17+
echo "**** install runtime packages ****" && \
18+
apk add --no-cache --upgrade \
1719
nodejs \
1820
npm \
1921
openssl && \
20-
echo "**** install app ****" && \
21-
mkdir -p \
22+
echo "**** install app ****" && \
23+
mkdir -p \
2224
/opt/mstream && \
23-
if [ -z ${MSTREAM_RELEASE+x} ]; then \
24-
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
25-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
26-
fi && \
27-
curl -o \
28-
/tmp/mstream.tar.gz -L \
25+
if [ -z ${MSTREAM_RELEASE+x} ]; then \
26+
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
27+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
28+
fi && \
29+
curl -o \
30+
/tmp/mstream.tar.gz -L \
2931
"https://github.com/IrosTheBeggar/mStream/archive/${MSTREAM_RELEASE}.tar.gz" && \
30-
tar xf \
32+
tar xf \
3133
/tmp/mstream.tar.gz -C \
3234
/opt/mstream/ --strip-components=1 && \
33-
cd /opt/mstream && \
34-
npm install --only=production && \
35-
npm link && \
36-
echo "**** cleanup ****" && \
37-
apk del --purge \
35+
cd /opt/mstream && \
36+
npm install --only=production && \
37+
npm link && \
38+
echo "**** cleanup ****" && \
39+
npm cache clean --force && \
40+
apk del --purge \
3841
build-dependencies && \
39-
rm -rf \
42+
rm -rf \
4043
/tmp/*
4144

4245
# add local files

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ The architectures supported by this image are:
5959

6060
## Application Setup
6161

62-
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.
62+
Access the webui at `http://<your-ip>:3000`
63+
64+
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).
65+
66+
## IMPORTANT NOTICE:
67+
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.
68+
69+
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.
6370

6471
## Usage
6572

@@ -79,13 +86,10 @@ services:
7986
environment:
8087
- PUID=1000
8188
- PGID=1000
82-
- USER=admin
83-
- PASSWORD=password
84-
- USE_JSON=true/false
8589
- TZ=Europe/London
8690
volumes:
87-
- <path to data>:/config
88-
- <path to music>:/music
91+
- /path/to/data:/config
92+
- /path/to/music:/music
8993
ports:
9094
- 3000:3000
9195
restart: unless-stopped
@@ -98,13 +102,10 @@ docker run -d \
98102
--name=mstream \
99103
-e PUID=1000 \
100104
-e PGID=1000 \
101-
-e USER=admin \
102-
-e PASSWORD=password \
103-
-e USE_JSON=true/false \
104105
-e TZ=Europe/London \
105106
-p 3000:3000 \
106-
-v <path to data>:/config \
107-
-v <path to music>:/music \
107+
-v /path/to/data:/config \
108+
-v /path/to/music:/music \
108109
--restart unless-stopped \
109110
ghcr.io/linuxserver/mstream
110111
```
@@ -118,9 +119,6 @@ Container images are configured using parameters passed at runtime (such as thos
118119
| `-p 3000` | The port for the mStream webinterface |
119120
| `-e PUID=1000` | for UserID - see below for explanation |
120121
| `-e PGID=1000` | for GroupID - see below for explanation |
121-
| `-e USER=admin` | Set username to login |
122-
| `-e PASSWORD=password` | Set password for user |
123-
| `-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` |
124122
| `-e TZ=Europe/London` | Specify a timezone to use e.g. Europe/London |
125123
| `-v /config` | mStream config |
126124
| `-v /music` | Music location |
@@ -234,6 +232,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
234232

235233
## Versions
236234

235+
* **17.05.21:** - Deprecating the env vars `USER`, `PASSWORD` and `USE_JSON` as mStream v5 requires the use of `config.json`.
237236
* **23.01.21:** - Rebasing to alpine 3.13.
238237
* **01.06.20:** - Rebasing to alpine 3.12.
239238
* **19.12.19:** - Rebasing to alpine 3.11.

readme-vars.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,29 @@ available_architectures:
1515
param_container_name: "{{ project_name }}"
1616
param_usage_include_vols: true
1717
param_volumes:
18-
- { vol_path: "/config", vol_host_path: "<path to data>", desc: "mStream config" }
19-
- { vol_path: "/music", vol_host_path: "<path to music>", desc: "Music location" }
18+
- { vol_path: "/config", vol_host_path: "/path/to/data", desc: "mStream config" }
19+
- { vol_path: "/music", vol_host_path: "/path/to/music", desc: "Music location" }
2020
param_usage_include_ports: true
2121
param_ports:
2222
- { external_port: "3000", internal_port: "3000", port_desc: "The port for the mStream webinterface" }
2323
param_usage_include_env: true
2424
param_env_vars:
25-
- { env_var: "USER", env_value: "admin", desc: "Set username to login" }
26-
- { env_var: "PASSWORD", env_value: "password", desc: "Set password for user" }
27-
- { 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`" }
2825
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use e.g. Europe/London" }
2926
# application setup block
3027
app_setup_block_enabled: true
3128
app_setup_block: |
32-
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.
29+
Access the webui at `http://<your-ip>:3000`
30+
31+
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).
32+
33+
## IMPORTANT NOTICE:
34+
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.
35+
36+
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.
3337
3438
# changelog
3539
changelogs:
40+
- { date: "17.05.21:", desc: "Deprecating the env vars `USER`, `PASSWORD` and `USE_JSON` as mStream v5 requires the use of `config.json`." }
3641
- { date: "23.01.21:", desc: "Rebasing to alpine 3.13." }
3742
- { date: "01.06.20:", desc: "Rebasing to alpine 3.12." }
3843
- { date: "19.12.19:", desc: "Rebasing to alpine 3.11." }

root/defaults/config.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"port": 3000,
3-
"webAppDirectory": "public",
4-
"writeLogs": false,
3+
"webAppDirectory": "webapp",
4+
"writeLogs": true,
55
"noUpload": true,
66
"scanOptions": {
77
"skipImg": false,
@@ -12,17 +12,10 @@
1212
},
1313
"storage": {
1414
"albumArtDirectory": "/config/album-art",
15-
"dbDirectory": "/config/db"
15+
"dbDirectory": "/config/db",
16+
"logsDirectory": "/config/logs"
1617
},
1718
"folders": {
1819
"library": { "root": "/music" }
19-
},
20-
"users": {
21-
"admin": {
22-
"password":"password",
23-
"vpaths": ["library"],
24-
"lastfm-user": "username",
25-
"lastfm-password": "password"
26-
}
2720
}
2821
}

root/etc/cont-init.d/30-config

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,55 @@
22

33
# make folders
44
mkdir -p \
5-
/config/{album-art,db}
5+
/config/{album-art,db,logs}
66

77
# copy config.json if doesn't exist
88
[[ ! -e /config/config.json ]] && \
99
cp /defaults/config.json /config/config.json
1010

11+
# Backwards compatibility notice
12+
if [ -n "$USER" ] || [ -n "$PASSWORD" ] || [ -n "$USE_JSON" ]; then
13+
echo '
14+
*************************************
15+
*************************************
16+
**** ****
17+
**** $USER, $PASSWORD and ****
18+
**** ****
19+
**** $USE_JSON env vars are ****
20+
**** ****
21+
**** deprecated. ****
22+
**** ****
23+
**** Please edit config.json ****
24+
**** ****
25+
**** or use the web ui to ****
26+
**** ****
27+
**** modify the settings. ****
28+
**** ****
29+
*************************************
30+
*************************************'
31+
fi
32+
33+
if grep -q '"webAppDirectory": "public"' /config/config.json; then
34+
mv /config/config.json /config/config.json.v4-bak
35+
echo '
36+
*************************************
37+
*************************************
38+
**** ****
39+
**** ****
40+
**** v4 config.json detected ****
41+
**** ****
42+
**** renaming to ****
43+
**** ****
44+
**** config.json.v4-bak ****
45+
**** ****
46+
**** due to incompatibility ****
47+
**** ****
48+
**** with v5 ****
49+
**** ****
50+
*************************************
51+
*************************************'
52+
fi
53+
1154
# permissions
1255
chown abc:abc -R \
1356
/config

root/etc/services.d/mstream/run

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,5 @@
22

33
cd /opt/mstream || exit
44

5-
if [ "$USE_JSON" == "true" ]; then
6-
exec \
7-
s6-setuidgid abc mstream -j /config/config.json
8-
else
9-
exec \
10-
s6-setuidgid abc mstream -m /music -I /config/album-art/ -d /config/db/ -u ${USER} -x ${PASSWORD}
11-
fi
5+
exec \
6+
s6-setuidgid abc mstream -j /config/config.json

0 commit comments

Comments
 (0)