diff --git a/.github/workflows/call_invalid_helper.yml b/.github/workflows/call_invalid_helper.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/permissions.yml b/.github/workflows/permissions.yml old mode 100755 new mode 100644 diff --git a/Dockerfile b/Dockerfile index c83c2f8..5379fab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # set version label ARG BUILD_DATE @@ -10,50 +12,44 @@ LABEL maintainer="aptalca" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies --upgrade \ + build-base \ + cairo-dev \ + cargo \ cmake \ ffmpeg-dev \ fftw-dev \ - g++ \ - gcc \ git \ + gobject-introspection-dev \ jpeg-dev \ libpng-dev \ - make \ mpg123-dev \ openjpeg-dev \ python3-dev && \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - curl \ + chromaprint \ expat \ ffmpeg \ - ffmpeg-libs \ fftw \ flac \ gdbm \ gst-plugins-good \ gstreamer \ jpeg \ - jq \ lame \ libffi \ libpng \ mpg123 \ nano \ openjpeg \ - py3-gobject3 \ - py3-pip \ - py3-pylast \ python3 \ - sqlite-libs \ - tar \ - wget && \ + sqlite-libs && \ echo "**** compile mp3gain ****" && \ mkdir -p \ /tmp/mp3gain-src && \ curl -o \ /tmp/mp3gain-src/mp3gain.zip -sL \ - https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.1/mp3gain-1_6_1-src.zip && \ + https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.2/mp3gain-1_6_2-src.zip && \ cd /tmp/mp3gain-src && \ unzip -qq /tmp/mp3gain-src/mp3gain.zip && \ sed -i "s#/usr/local/bin#/usr/bin#g" /tmp/mp3gain-src/Makefile && \ @@ -69,39 +65,34 @@ RUN \ tar xzf /tmp/mp3val-src/mp3val.tar.gz --strip 1 && \ make -f Makefile.linux && \ cp -p mp3val /usr/bin && \ - echo "**** compile chromaprint ****" && \ - git clone https://bitbucket.org/acoustid/chromaprint.git \ - /tmp/chromaprint && \ - cd /tmp/chromaprint && \ - cmake \ - -DBUILD_TOOLS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr && \ - make && \ - make install && \ echo "**** install pip packages ****" && \ if [ -z ${BEETS_VERSION+x} ]; then \ - BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json \ - |jq -r '. | .info.version'); \ + BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json |jq -r '. | .info.version'); \ fi && \ - python3 -m pip install --upgrade pip && \ - pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ \ - wheel \ + python3 -m ensurepip && \ + pip3 install -U --no-cache-dir \ + pip \ + wheel && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \ beautifulsoup4 \ beets==${BEETS_VERSION} \ beets-extrafiles \ + beetcamp \ discogs-client \ flask \ + PyGObject \ pillow \ pyacoustid \ + pylast \ requests \ unidecode && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ rm -rf \ - /root/.cache \ - /tmp/* + /tmp/* \ + $HOME/.cache \ + $HOME/.cargo # environment settings ENV BEETSDIR="/config" \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index f50ebc7..8d64d1e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.17 # set version label ARG BUILD_DATE @@ -10,21 +12,22 @@ LABEL maintainer="aptalca" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies --upgrade \ + build-base \ + cairo-dev \ + cargo \ cmake \ ffmpeg-dev \ fftw-dev \ - g++ \ - gcc \ git \ + gobject-introspection-dev \ jpeg-dev \ libpng-dev \ - make \ mpg123-dev \ openjpeg-dev \ python3-dev && \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - curl \ + chromaprint \ expat \ ffmpeg \ ffmpeg-libs \ @@ -34,26 +37,20 @@ RUN \ gst-plugins-good \ gstreamer \ jpeg \ - jq \ lame \ libffi \ libpng \ mpg123 \ nano \ openjpeg \ - py3-gobject3 \ - py3-pip \ - py3-pylast \ python3 \ - sqlite-libs \ - tar \ - wget && \ + sqlite-libs && \ echo "**** compile mp3gain ****" && \ mkdir -p \ /tmp/mp3gain-src && \ curl -o \ /tmp/mp3gain-src/mp3gain.zip -sL \ - https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.1/mp3gain-1_6_1-src.zip && \ + https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.2/mp3gain-1_6_2-src.zip && \ cd /tmp/mp3gain-src && \ unzip -qq /tmp/mp3gain-src/mp3gain.zip && \ sed -i "s#/usr/local/bin#/usr/bin#g" /tmp/mp3gain-src/Makefile && \ @@ -69,39 +66,34 @@ RUN \ tar xzf /tmp/mp3val-src/mp3val.tar.gz --strip 1 && \ make -f Makefile.linux && \ cp -p mp3val /usr/bin && \ - echo "**** compile chromaprint ****" && \ - git clone https://bitbucket.org/acoustid/chromaprint.git \ - /tmp/chromaprint && \ - cd /tmp/chromaprint && \ - cmake \ - -DBUILD_TOOLS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr && \ - make && \ - make install && \ echo "**** install pip packages ****" && \ if [ -z ${BEETS_VERSION+x} ]; then \ - BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json \ - |jq -r '. | .info.version'); \ + BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json |jq -r '. | .info.version'); \ fi && \ - python3 -m pip install --upgrade pip && \ - pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ \ - wheel \ + python3 -m ensurepip && \ + pip3 install -U --no-cache-dir \ + pip \ + wheel && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \ beautifulsoup4 \ beets==${BEETS_VERSION} \ beets-extrafiles \ + beetcamp \ discogs-client \ flask \ + PyGObject \ pillow \ pyacoustid \ + pylast \ requests \ unidecode && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ rm -rf \ - /root/.cache \ - /tmp/* + /tmp/* \ + $HOME/.cache \ + $HOME/.cargo # environment settings ENV BEETSDIR="/config" \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 65fec10..6cb0cdf 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15 +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.17 # set version label ARG BUILD_DATE @@ -10,21 +12,22 @@ LABEL maintainer="aptalca" RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies --upgrade \ + build-base \ + cairo-dev \ + cargo \ cmake \ ffmpeg-dev \ fftw-dev \ - g++ \ - gcc \ git \ + gobject-introspection-dev \ jpeg-dev \ libpng-dev \ - make \ mpg123-dev \ openjpeg-dev \ python3-dev && \ echo "**** install runtime packages ****" && \ apk add --no-cache --upgrade \ - curl \ + chromaprint \ expat \ ffmpeg \ ffmpeg-libs \ @@ -34,26 +37,20 @@ RUN \ gst-plugins-good \ gstreamer \ jpeg \ - jq \ lame \ libffi \ libpng \ mpg123 \ nano \ openjpeg \ - py3-gobject3 \ - py3-pip \ - py3-pylast \ python3 \ - sqlite-libs \ - tar \ - wget && \ + sqlite-libs && \ echo "**** compile mp3gain ****" && \ mkdir -p \ /tmp/mp3gain-src && \ curl -o \ /tmp/mp3gain-src/mp3gain.zip -sL \ - https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.1/mp3gain-1_6_1-src.zip && \ + https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.2/mp3gain-1_6_2-src.zip && \ cd /tmp/mp3gain-src && \ unzip -qq /tmp/mp3gain-src/mp3gain.zip && \ sed -i "s#/usr/local/bin#/usr/bin#g" /tmp/mp3gain-src/Makefile && \ @@ -69,39 +66,34 @@ RUN \ tar xzf /tmp/mp3val-src/mp3val.tar.gz --strip 1 && \ make -f Makefile.linux && \ cp -p mp3val /usr/bin && \ - echo "**** compile chromaprint ****" && \ - git clone https://bitbucket.org/acoustid/chromaprint.git \ - /tmp/chromaprint && \ - cd /tmp/chromaprint && \ - cmake \ - -DBUILD_TOOLS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr && \ - make && \ - make install && \ echo "**** install pip packages ****" && \ if [ -z ${BEETS_VERSION+x} ]; then \ - BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json \ - |jq -r '. | .info.version'); \ + BEETS_VERSION=$(curl -sL https://pypi.python.org/pypi/beets/json |jq -r '. | .info.version'); \ fi && \ - python3 -m pip install --upgrade pip && \ - pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ \ - wheel \ + python3 -m ensurepip && \ + pip3 install -U --no-cache-dir \ + pip \ + wheel && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \ beautifulsoup4 \ beets==${BEETS_VERSION} \ beets-extrafiles \ + beetcamp \ discogs-client \ flask \ + PyGObject \ pillow \ pyacoustid \ + pylast \ requests \ unidecode && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ rm -rf \ - /root/.cache \ - /tmp/* + /tmp/* \ + $HOME/.cache \ + $HOME/.cargo # environment settings ENV BEETSDIR="/config" \ diff --git a/README.md b/README.md index 851fb8d..bf72d19 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **24.02.23:** - Rebase to Alpine 3.17, migrate to s6v3, install chromaprint from Alpine repos, add beetcamp plugin. * **15.01.22:** - Rebasing to alpine 3.15. * **19.12.19:** - Rebasing to alpine 3.11. * **28.06.19:** - Rebasing to alpine 3.10. diff --git a/readme-vars.yml b/readme-vars.yml index a24f28c..5295f35 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -52,6 +52,7 @@ app_setup_block: | # changelog changelogs: + - { date: "24.02.23:", desc: "Rebase to Alpine 3.17, migrate to s6v3, install chromaprint from Alpine repos, add beetcamp plugin." } - { date: "15.01.22:", desc: "Rebasing to alpine 3.15." } - { date: "19.12.19:", desc: "Rebasing to alpine 3.11." } - { date: "28.06.19:", desc: "Rebasing to alpine 3.10." } diff --git a/root/defaults/beets.sh b/root/defaults/beets.sh index 1697b50..eeed21e 100644 --- a/root/defaults/beets.sh +++ b/root/defaults/beets.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/with-contenv bash +# shellcheck shell=bash # # beets music tagger - post-processing script # @@ -8,7 +9,7 @@ # $1 - Fullpath of directory to be processed. eg./mnt/user/downloads/some.artist_some.album # $7 - Status of post processing. 0 = OK, 1 = failed verification, 2 = failed unpack, 3 = 1+2 -if [ ! -z "$7" ] && [ "$7" -gt 0 ]; then +if [ -n "$7" ] && [ "$7" -gt 0 ]; then echo "post-processing failed, bypassing script" exit 1 fi @@ -16,7 +17,7 @@ fi # process files echo "--------------------------" printf %b "$(date)\n" -echo "Starting beets.sh for $(basename $1)" +echo "Starting beets.sh for $(basename "$1")" BEETSDIR=/config export BEETSDIR diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index 472eeda..0000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/with-contenv bash - -# copy config -[[ ! -e /config/beets.sh ]] && \ - cp /defaults/beets.sh /config/beets.sh -[[ ! -e /config/config.yaml ]] && \ - cp /defaults/config.yaml /config/config.yaml - -# permissions -chown -R abc:abc \ - /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-beets-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/run b/root/etc/s6-overlay/s6-rc.d/init-beets-config/run new file mode 100755 index 0000000..423429d --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-beets-config/run @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# copy config +cp -n /defaults/beets.sh /config/beets.sh +cp -n /defaults/config.yaml /config/config.yaml + +# permissions +lsiown -R abc:abc \ + /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/type b/root/etc/s6-overlay/s6-rc.d/init-beets-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-beets-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/up b/root/etc/s6-overlay/s6-rc.d/init-beets-config/up new file mode 100644 index 0000000..4f5e303 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-beets-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-beets-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-beets/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd @@ -0,0 +1 @@ +3 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/run b/root/etc/s6-overlay/s6-rc.d/svc-beets/run new file mode 100755 index 0000000..4c74a20 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-beets/run @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8337" \ + s6-setuidgid abc beet web diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/type b/root/etc/s6-overlay/s6-rc.d/svc-beets/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-beets/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-beets-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-beets-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-beets b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-beets new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/beets/run b/root/etc/services.d/beets/run deleted file mode 100644 index 28bb1ab..0000000 --- a/root/etc/services.d/beets/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bash -umask 022 - -exec \ - s6-setuidgid abc beet web