Upgrade to Mopidy 3

This commit is contained in:
Wouter Habets
2020-12-28 12:42:19 +01:00
parent 35694836c9
commit c1fcb9458c
9 changed files with 77 additions and 64 deletions

View File

@@ -1 +1 @@
test-data/ data/

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
data/
accounts.conf

40
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,40 @@
docker-master:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
docker-tag:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
only:
- tags
docker:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master

View File

@@ -1,5 +1,14 @@
FROM debian:jessie FROM debian:buster
MAINTAINER Wouter Habets (wouterhabets@gmail.com) LABEL maintainer="wouter@habets.io"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3 \
python3-pip \
git \
gstreamer1.0-libav \
python-crypto \
python-setuptools
RUN apt-get update \ RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \
@@ -10,27 +19,18 @@ RUN apt-get update \
&& apt-get update \ && apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \
mopidy \ mopidy \
mopidy-mpd \
mopidy-local \
mopidy-scrobbler \ mopidy-scrobbler \
mopidy-soundcloud \ mopidy-soundcloud \
mopidy-spotify \ mopidy-spotify \
mopidy-spotify-tunigo \ mopidy-tunein
mopidy-tunein \
git \
gstreamer1.0-libav \
python-crypto \
python-setuptools
RUN curl -L https://bootstrap.pypa.io/get-pip.py | python - #RUN curl -L https://bootstrap.pypa.io/get-pip.py | python3 -
RUN pip install --ignore-installed Mopidy-Iris RUN python3 -m pip install \
RUN pip install -U six \ Mopidy-Iris \
&& pip install markerlib \ Mopidy-MusicBox-Webclient \
&& pip install Mopidy-Local-SQLite \ Mopidy-YouTube
&& pip install Mopidy-Local-Images \
&& pip install Mopidy-Party \
&& pip install Mopidy-Simple-Webclient \
&& pip install Mopidy-MusicBox-Webclient \
&& pip install Mopidy-API-Explorer \
&& pip install Mopidy-Mopify
#ADD snapserver.deb /tmp/snapserver.deb #ADD snapserver.deb /tmp/snapserver.deb
#RUN apt-get install -y libavahi-client3 libavahi-common3 \ #RUN apt-get install -y libavahi-client3 libavahi-common3 \
@@ -49,8 +49,6 @@ ADD localscan /usr/bin/localscan
RUN chmod +x /usr/bin/localscan RUN chmod +x /usr/bin/localscan
VOLUME /var/lib/mopidy VOLUME /var/lib/mopidy
VOLUME /media
VOLUME /mopidy.conf
EXPOSE 6600 EXPOSE 6600
EXPOSE 6680 EXPOSE 6680
@@ -59,4 +57,5 @@ EXPOSE 6681
USER mopidy USER mopidy
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/mopidy"] CMD ["/usr/bin/mopidy", "--config", "/etc/mopidy.conf:/mopidy.conf"]

View File

@@ -6,18 +6,12 @@ Uses Pulseaudio for audio output.
### Frontend extensions ### Frontend extensions
* [Iris](https://github.com/jaedb/Iris) * [Iris](https://github.com/jaedb/Iris)
* [Mopidy Musicbox Webclient](https://github.com/pimusicbox/mopidy-musicbox-webclient) * [Mopidy Musicbox Webclient](https://github.com/pimusicbox/mopidy-musicbox-webclient)
* [Mopidy Party](https://github.com/Lesterpig/mopidy-party)
* [Mopidy Simple webclient](https://github.com/xolox/mopidy-simple-webclient)
* [API explorer](https://github.com/dz0ny/mopidy-api-explorer)
* [Local images](https://github.com/tkem/mopidy-local-images)
### Backend extensions ### Backend extensions
* Spotify * Spotify
* Spotify tunigo
* Soundcloud * Soundcloud
* Scrobbler * Scrobbler
* Tunein * Tunein
* Local SQLite
## How to use ## How to use
```bash ```bash
@@ -46,6 +40,10 @@ To add Spotify, Last.FM etc. accounts, use the `/mopidy.conf` file. Example:
enabled = true enabled = true
username = username =
password = password =
client_id =
client_secret =
# To authenticate go to:
# https://mopidy.com/ext/spotify/#authentication
[scrobbler] [scrobbler]
enabled = true enabled = true
@@ -65,14 +63,14 @@ enable = true
The complete default config can be found in the file [mopidy.conf](./mopidy.conf) The complete default config can be found in the file [mopidy.conf](./mopidy.conf)
## Local media ## Local media
To play local media files, mount `/media`. All meta data will be stored using Mopidy-Local-SQLite. To scan for new media files, run `docker exec -it mopidy localscan`. To play local media files, mount `/media`. To scan for new media files, run `docker exec -it mopidy localscan`.
## Adding extensions ## Adding extensions
To add extensions, I advice to override this image by creating your own Dockerfile. To add extensions, I advice to override this image by creating your own Dockerfile.
In the example below, the material webclient is added. To add packages, we switch to the root user, run `pip` to add everything we need and switch back to the `mopidy` user. In the example below, a package is installed with pip. To add packages, we switch to the root user, run `pip` to add everything we need and switch back to the `mopidy` user.
```Dockerfile ```Dockerfile
FROM whhoesj/mopidy:latest FROM whhoesj/mopidy:latest
USER root USER root
RUN pip install RUN python3 -m pip install <your-package>
USER mopidy USER mopidy
``` ```

View File

@@ -1,16 +1,9 @@
#!/bin/bash #!/bin/bash
echo "WARNING. Mopidy-Youtube is removed."
echo "There are a lot of issues with it and there is currently no maintainer."
echo "I'll add it back once there is a mainainer found for the package."
echo ""
echo ""
echo "Starting container..." echo "Starting container..."
echo "Current user: $(whoami)" echo "Current user: $(whoami)"
echo "Current user id: $(id -u $(whoami))" echo "Current user id: $(id -u $(whoami))"
cd ~ cd ~
echo $PWD echo $PWD
ls -lsa ls -lsa
echo "" exec $@
echo ""
exec /usr/bin/mopidy --config /etc/mopidy.conf:/mopidy.conf

View File

@@ -45,22 +45,3 @@ protocols =
rtmps rtmps
rtsp rtsp
[spotify]
enabled = false
bitrate = 320
[spotify_tunigo]
enabled = true
region = all
[tunein]
enabled = false
[soundcloud]
enabled = false
[scrobbler]
enabled = false
[musicbox_webclient]
#on_track_click = PLAY_NOW

View File

@@ -2,9 +2,9 @@
docker run \ docker run \
--rm \ --rm \
--name mopidy \ --name mopidy \
-e PULSE_SERVER=tcp:10.10.10.10:4713 \ -e PULSE_SERVER=tcp:10.10.10.14:4713 \
-v /home/wouter/Muziek/Spotify:/media:ro \ -v /home/wouter/Muziek:/media:ro \
-v $PWD/test-data:/var/lib/mopidy \ -v $PWD/data:/var/lib/mopidy \
-v $PWD/accounts.conf:/mopidy.conf \ -v $PWD/accounts.conf:/mopidy.conf \
-p 6600:6600 \ -p 6600:6600 \
-p 6680:6680 \ -p 6680:6680 \