Skip to content

Commit

Permalink
fix (snapweb): added ws_proxy option to snapweb client
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Lukas committed Feb 3, 2023
1 parent f556eae commit 6eac869
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
20 changes: 11 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ RUN apt-get update && \
&& python3 -m pip install --upgrade youtube-dl \
&& python3 -m pip install Mopidy-Bandcamp \
&& python3 -m pip install Mopidy-Local \
&& python3 -m pip install jinja2 tornado
&& python3 -m pip install jinja2 tornado \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache

#======================================= INSTALL SPOTIFY WORKAROUND ==============================================#

Expand All @@ -46,13 +47,12 @@ RUN apt-get update && \
RUN export GST_ARCH=$TARGETARCH \
&& if [ "$TARGETARCH" = "arm" ]; then GST_ARCH=${TARGETARCH}hf; fi \
&& curl -sLO https://github.com/mariolukas/gst-plugins-rs-builder/releases/download/2023-01-26/gst-plugin-spotify_0.9.8_${GST_ARCH}.deb \
&& dpkg -i gst-plugin-spotify_0.9.8_${GST_ARCH}.deb

RUN git clone --depth 1 -b gstspotifysrc-hack https://github.com/kingosticks/mopidy-spotify.git mopidy-spotify \
&& cd mopidy-spotify \
&& python3 setup.py install \
&& cd .. \
&& rm -rf mopidy-spotify
&& dpkg -i gst-plugin-spotify_0.9.8_${GST_ARCH}.deb \
&& git clone --depth 1 -b gstspotifysrc-hack https://github.com/kingosticks/mopidy-spotify.git mopidy-spotify \
&& cd mopidy-spotify \
&& python3 setup.py install \
&& cd .. \
&& rm -rf mopidy-spotify

#======================================= HYDRAPLAY INSTALLATION ==================================================#

Expand All @@ -62,7 +62,9 @@ RUN export LATEST_RELEASE_VER=$(curl -sL https://api.github.com/repos/mariolukas
&& mkdir -p /tmp/hydraplay \
&& mkdir -p /app \
&& unzip hydraplay-${LATEST_RELEASE_VER}.zip "src/*" -d /tmp/hydraplay/ \
&& cp -R /tmp/hydraplay/src/* /app/.
&& cp -R /tmp/hydraplay/src/* /app/. \
&& rm hydraplay-${LATEST_RELEASE_VER}.zip \
&& rm -R /tmp/hydraplay

#======================================= SNAPCAST INSTALLATION ===================================================#

Expand Down
11 changes: 11 additions & 0 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ http {
proxy_connect_timeout 20s;
}

location /control/stream {
proxy_pass http://hydraplay:1780/stream;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 600s;
proxy_send_timeout 600s;
proxy_connect_timeout 20s;
}

location /stream/0/mopidy/ws {
proxy_pass http://hydraplay:6680/mopidy/ws;
proxy_set_header Host $host;
Expand Down
2 changes: 2 additions & 0 deletions src/hydraplay/server/static/snapweb/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion src/hydraplay/server/static/snapweb/snapcontrol.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6eac869

Please sign in to comment.