Skip to content

Commit 83b0332

Browse files
authored
Merge pull request #879 from jaedb/develop
3.66
2 parents 737b774 + 58f487c commit 83b0332

File tree

19 files changed

+438
-605
lines changed

19 files changed

+438
-605
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,22 @@ jobs:
127127
name: 'Publish: DockerHub'
128128
runs-on: ubuntu-latest
129129
needs: [jest, tox]
130-
if: github.event_name == 'release'
130+
if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
131131
steps:
132132
- name: Set up QEMU
133133
uses: docker/setup-qemu-action@v1
134134

135135
- name: Set up Docker Buildx
136136
uses: docker/setup-buildx-action@v1
137137

138-
- name: Generating tags and labels
139-
id: meta
138+
- name: Extract branch name
139+
shell: bash
140+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
141+
id: extract_branch
142+
143+
- name: Generating release tags and labels
144+
if: github.event_name == 'release'
145+
id: release_meta
140146
uses: docker/metadata-action@v4
141147
with:
142148
images: jaedb/iris
@@ -145,6 +151,14 @@ jobs:
145151
type=semver,pattern={{version}}
146152
type=semver,pattern={{major}}.{{minor}}
147153
154+
- name: Generating edge branch labels
155+
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
156+
id: edge_meta
157+
uses: docker/metadata-action@v4
158+
with:
159+
images: jaedb/iris
160+
tags: ${{ steps.extract_branch.outputs.branch }}
161+
148162
- name: Login to DockerHub
149163
uses: docker/login-action@v1
150164
with:
@@ -155,5 +169,5 @@ jobs:
155169
uses: docker/build-push-action@v2
156170
with:
157171
push: true
158-
tags: ${{ steps.meta.outputs.tags }}
159-
labels: ${{ steps.meta.outputs.labels }}
172+
tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }}
173+
labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }}

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v14

Dockerfile

100755100644
Lines changed: 128 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,171 @@
1-
FROM debian:buster
1+
# --- Build Node ---
2+
FROM rust:slim-bullseye AS Builder
3+
LABEL org.opencontainers.image.authors="https://github.com/seppi91"
4+
ARG TARGETPLATFORM
5+
ARG TARGETARCH
6+
ARG TARGETVARIANT
7+
8+
# Print Info about current build Target
9+
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
10+
&& printf ", TARGETARCH=${TARGETARCH}" \
11+
&& printf ", TARGETVARIANT=${TARGETVARIANT} \n" \
12+
&& printf "With uname -s : " && uname -s \
13+
&& printf "and uname -m : " && uname -mm
14+
15+
# Switch to the root user while we do our changes
16+
USER root
17+
18+
# Install all libraries and needs
19+
RUN apt update \
20+
&& apt install -yq --no-install-recommends \
21+
git \
22+
patch \
23+
libgstreamer-plugins-base1.0-dev \
24+
libgstreamer1.0-dev \
25+
libcsound64-dev \
26+
libclang-11-dev \
27+
libpango1.0-dev \
28+
libdav1d-dev \
29+
# libgtk-4-dev \ Only in bookworm
30+
&& rm -rf /var/lib/apt/lists/*
31+
32+
WORKDIR /usr/src/gst-plugins-rs
33+
34+
# Clone source of gst-plugins-rs to workdir
35+
ARG GST_PLUGINS_RS_TAG=main
36+
RUN git clone -c advice.detachedHead=false \
37+
--single-branch --depth 1 \
38+
--branch ${GST_PLUGINS_RS_TAG} \
39+
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git ./
40+
# EXPERIMENTAL: For gstreamer-spotify set upgraded version number of dependency librespot to 0.4.2
41+
RUN sed -i 's/librespot = { version = "0.4", default-features = false }/librespot = { version = "0.4.2", default-features = false }/g' audio/spotify/Cargo.toml
42+
43+
# Build GStreamer plugins written in Rust (optional with --no-default-features)
44+
ENV DEST_DIR /target/gst-plugins-rs
45+
ENV CARGO_PROFILE_RELEASE_DEBUG false
46+
RUN export CSOUND_LIB_DIR="/usr/lib/$(uname -m)-linux-gnu" \
47+
&& export PLUGINS_DIR=$(pkg-config --variable=pluginsdir gstreamer-1.0) \
48+
&& export SO_SUFFIX=so \
49+
&& cargo build --release --no-default-features \
50+
# List of packages to build
51+
--package gst-plugin-spotify \
52+
# Use install command to create directory (-d), copy and print filenames (-v), and set attributes/permissions (-m)
53+
&& install -v -d ${DEST_DIR}/${PLUGINS_DIR} \
54+
&& install -v -m 755 target/release/*.${SO_SUFFIX} ${DEST_DIR}/${PLUGINS_DIR}
55+
56+
57+
# --- Release Node ---
58+
FROM debian:bullseye-slim as Release
259

360
# Switch to the root user while we do our changes
461
USER root
62+
WORKDIR /
563

664
# Install GStreamer and other required Debian packages
765
RUN apt-get update \
8-
&& apt-get install -y --no-install-recommends \
66+
&& apt-get install -y --no-install-recommends \
67+
sudo \
68+
build-essential \
69+
curl \
70+
git \
971
wget \
1072
gnupg2 \
11-
git \
12-
python3-setuptools \
13-
python3-pip \
1473
dumb-init \
1574
graphviz-dev \
16-
gstreamer1.0-plugins-bad \
17-
gstreamer1.0-plugins-good \
18-
gstreamer1.0-plugins-ugly \
19-
gstreamer1.0-pulseaudio \
75+
pulseaudio \
2076
libasound2-dev \
21-
python3-dev \
22-
python3-gst-1.0 \
23-
build-essential \
2477
libdbus-glib-1-dev \
2578
libgirepository1.0-dev \
26-
dleyna-server \
27-
sudo \
28-
&& rm -rf /var/lib/apt/lists/*
79+
# Install Python
80+
python3-dev \
81+
python3-gst-1.0 \
82+
python3-setuptools \
83+
python3-pip \
84+
# GStreamer (Plugins)
85+
gstreamer1.0-plugins-good \
86+
gstreamer1.0-plugins-bad \
87+
gstreamer1.0-plugins-ugly \
88+
gstreamer1.0-libav \
89+
gstreamer1.0-pulseaudio \
90+
&& rm -rf /var/lib/apt/lists/*
91+
92+
# Copy builded target data from Builder DEST_DIR to root
93+
# Note: target directory tree links directly to $GST_PLUGIN_PATH
94+
COPY --from=Builder /target/gst-plugins-rs/ /
95+
96+
# Install Node, to build Iris JS application
97+
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
98+
apt-get install -y nodejs
2999

30-
# Install libspotify-dev from apt.mopidy.com
100+
# Install mopidy and (optional) DLNA-server dleyna from apt.mopidy.com
101+
# see https://docs.mopidy.com/en/latest/installation/debian/
31102
RUN mkdir -p /usr/local/share/keyrings \
32-
&& wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg \
33-
&& wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list \
34-
&& apt-get update \
35-
&& apt-get install -y libspotify-dev mopidy-spotify \
36-
&& rm -rf /var/lib/apt/lists/*
103+
&& wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg \
104+
&& wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list \
105+
&& apt-get update \
106+
&& apt-get install -y \
107+
mopidy \
108+
&& rm -rf /var/lib/apt/lists/*
109+
110+
# Upgrade Python package manager pip
111+
# https://pypi.org/project/pip/
112+
RUN python3 -m pip install --upgrade pip
37113

38114
# Clone Iris from the repository and install in development mode.
39115
# This allows a binding at "/iris" to map to your local folder for development, rather than
40116
# installing using pip.
41-
# Note using ADD helps prevent caching issues. When HEAD changes, our cache is invalidated, whee!
117+
# Note: ADD helps prevent RUN caching issues. When HEAD changes in repo, our cache will be invalidated!
42118
ADD https://api.github.com/repos/jaedb/Iris/git/refs/heads/master version.json
43-
RUN git clone --depth 1 -b master https://github.com/jaedb/Iris.git /iris \
119+
ENV IRIS_VERSION=develop
120+
RUN git clone --depth 1 --single-branch -b ${IRIS_VERSION} https://github.com/jaedb/Iris.git /iris \
44121
&& cd /iris \
122+
&& npm install \
123+
&& npm run prod \
45124
&& python3 setup.py develop \
46125
&& mkdir -p /var/lib/mopidy/.config \
47126
&& ln -s /config /var/lib/mopidy/.config/mopidy \
48127
# Allow mopidy user to run system commands (restart, local scan, etc)
49-
&& echo "mopidy ALL=NOPASSWD: /iris/mopidy_iris/system.sh" >> /etc/sudoers
128+
&& echo "mopidy ALL=NOPASSWD: /iris/mopidy_iris/system.sh" >> /etc/sudoers \
129+
# Enable container mode (disable restart option, etc.)
130+
&& echo "1" >> /IS_CONTAINER \
131+
# Copy Version file
132+
&& cp /iris/VERSION /
133+
134+
# Install mopidy-spotify-gstspotify (Hack, not released yet!)
135+
# (https://github.com/kingosticks/mopidy-spotify/tree/gstspotifysrc-hack)
136+
RUN git clone --depth 1 -b gstspotifysrc-hack https://github.com/kingosticks/mopidy-spotify.git mopidy-spotify \
137+
&& cd mopidy-spotify \
138+
&& python3 setup.py install \
139+
&& cd .. \
140+
&& rm -rf mopidy-spotify
50141

51-
# Install additional Python dependencies
52-
RUN python3 -m pip install --no-cache \
53-
tox \
54-
mopidy-mpd \
55-
mopidy-local
142+
# Install additional mopidy extensions and Python dependencies via pip
143+
COPY docker/requirements.txt .
144+
RUN python3 -m pip install -r requirements.txt
145+
146+
# Cleanup
147+
RUN apt-get clean all \
148+
&& rm -rf /var/lib/apt/lists/* \
149+
&& rm -rf /root/.cache \
150+
&& rm -rf /iris/node_modules
56151

57152
# Start helper script.
58153
COPY docker/entrypoint.sh /entrypoint.sh
59154

60-
# Default configuration.
155+
# Copy Default configuration for mopidy
61156
COPY docker/mopidy/mopidy.example.conf /config/mopidy.conf
62157

63-
# Copy the pulse-client configuratrion.
158+
# Copy the pulse-client configuratrion
64159
COPY docker/mopidy/pulse-client.conf /etc/pulse/client.conf
65160

66-
# Add version info to image
67-
COPY VERSION /
68-
69161
# Allows any user to run mopidy, but runs by default as a randomly generated UID/GID.
70162
# RUN useradd -ms /bin/bash mopidy
71163
ENV HOME=/var/lib/mopidy
72164
RUN set -ex \
73-
&& usermod -G audio,sudo mopidy \
165+
&& usermod -G audio,sudo,pulse-access mopidy \
74166
&& mkdir /var/lib/mopidy/local \
75167
&& chown mopidy:audio -R $HOME /entrypoint.sh /iris \
76-
&& chmod go+rwx -R $HOME /entrypoint.sh /iris \
77-
&& echo "1" >> /IS_CONTAINER
168+
&& chmod go+rwx -R $HOME /entrypoint.sh /iris
78169

79170
# Runs as mopidy user by default.
80171
USER mopidy:audio

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ recursive-exclude src *
1515
recursive-exclude docker *
1616
exclude .jshintrc
1717
exclude .babelrc
18-
exclude jest.config.js
18+
exclude jest.config.js
19+
exclude .nvmrc

docker-compose.example.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ services:
2323
- 6600:6600
2424
- 6680:6680
2525
volumes:
26+
# - ./mopidy/iris:/iris/mopidy/iris # To use a locally-built UI
2627
- ./docker/mopidy/iris:/var/lib/mopidy/iris # Iris-specific storage
2728
- ./docker/mopidy/m3u:/var/lib/mopidy/m3u # To persist local playlists
2829
- ./docker/mopidy/mopidy.conf:/config/mopidy.conf

docker/requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Mopidy-Local
2+
Mopidy-Mpd
3+
Mopidy-MusicBox-Webclient
4+
Mopidy-Soundcloud
5+
Mopidy-Youtube
6+
Mopidy-YTMusic
7+
ytmusicapi
8+
youtube_dl
9+
tox

src/js/components/GridItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const GridItem = ({
101101
dispatch(spotifyActions.getArtistImages(item));
102102
}
103103
break;
104-
// case 'playlist':
104+
case 'playlist':
105105
case 'album':
106106
dispatch(mopidyActions.getImages([item.uri]));
107107
break;
@@ -122,7 +122,7 @@ const GridItem = ({
122122
to = `/${item.type}/${encodeUri(item.uri)}`;
123123
if (item.name && item.type !== 'artist') {
124124
// Strip out "%"; this causes conflicts with our uri decoder
125-
to += `/${encodeURIComponent(item.name.replace('%', ''))}`;
125+
to += `/${encodeURIComponent(item.name.replace('%', '').replace('/', ''))}`;
126126
}
127127
}
128128

0 commit comments

Comments
 (0)