Rebase transmission to 3.16, migrate to s6v3

This commit is contained in:
TheSpad
2022-11-02 15:42:31 +00:00
parent a9637d59ac
commit ddc1a5a819
29 changed files with 91 additions and 94 deletions

View File

@@ -18,7 +18,7 @@ jobs:
fi
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_TRANSMISSION_MASTER\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:'"transmission-daemon"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"

View File

@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.15
FROM ghcr.io/linuxserver/baseimage-alpine:3.16
ARG UNRAR_VERSION=6.1.7
ARG BUILD_DATE
@@ -16,9 +16,7 @@ RUN \
echo "**** install packages ****" && \
apk add --no-cache \
ca-certificates \
curl \
findutils \
jq \
openssl \
p7zip \
python3 \

View File

@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.15
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.16
ARG UNRAR_VERSION=6.1.7
ARG BUILD_DATE
@@ -16,9 +16,7 @@ RUN \
echo "**** install packages ****" && \
apk add --no-cache \
ca-certificates \
curl \
findutils \
jq \
openssl \
p7zip \
python3 \

View File

@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.16
ARG UNRAR_VERSION=6.1.7
ARG BUILD_DATE
@@ -16,9 +16,7 @@ RUN \
echo "**** install packages ****" && \
apk add --no-cache \
ca-certificates \
curl \
findutils \
jq \
openssl \
p7zip \
python3 \

4
Jenkinsfile vendored
View File

@@ -25,8 +25,8 @@ pipeline {
DEV_DOCKERHUB_IMAGE = 'lsiodev/transmission'
PR_DOCKERHUB_IMAGE = 'lspipepr/transmission'
DIST_IMAGE = 'alpine'
DIST_TAG = '3.15'
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.15/community/'
DIST_TAG = '3.16'
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.16/community/'
DIST_REPO_PACKAGES = 'transmission-daemon'
MULTIARCH='true'
CI='true'

View File

@@ -275,6 +275,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **02.11.22:** - Rebase to Alpine 3.16, migrate to s6v3.
* **12.08.22:** - Bump unrar to 6.1.7.
* **03.04.22:** - Add Transmissionic as a UI option.
* **21.02.22:** - Build unrar from source, rebase to Alpine 3.15, add symlinks neeeded for TWC. Credit @alexbelgium

View File

@@ -15,8 +15,8 @@ repo_vars:
- DEV_DOCKERHUB_IMAGE = 'lsiodev/transmission'
- PR_DOCKERHUB_IMAGE = 'lspipepr/transmission'
- DIST_IMAGE = 'alpine'
- DIST_TAG = '3.15'
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.15/community/'
- DIST_TAG = '3.16'
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.16/community/'
- DIST_REPO_PACKAGES = 'transmission-daemon'
- MULTIARCH='true'
- CI='true'

View File

@@ -83,6 +83,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "02.11.22:", desc: "Rebase to Alpine 3.16, migrate to s6v3." }
- { date: "12.08.22:", desc: "Bump unrar to 6.1.7." }
- { date: "03.04.22:", desc: "Add Transmissionic as a UI option." }
- { date: "21.02.22:", desc: "Build unrar from source, rebase to Alpine 3.15, add symlinks neeeded for TWC. Credit @alexbelgium" }

View File

@@ -2,10 +2,10 @@
BLOCKLIST_ENABLED=$(jq -r '.["blocklist-enabled"]' /config/settings.json)
if [ "$BLOCKLIST_ENABLED" == true ]; then
if [ -n "$USER" ] && [ -n "$PASS" ]; then
/usr/bin/transmission-remote -n "$USER":"$PASS" --blocklist-update
else
/usr/bin/transmission-remote --blocklist-update
fi
if [[ "$BLOCKLIST_ENABLED" == true ]]; then
if [[ -n "$USER" ]] && [[ -n "$PASS" ]]; then
/usr/bin/transmission-remote -n "$USER":"$PASS" --blocklist-update
else
/usr/bin/transmission-remote --blocklist-update
fi
fi

View File

@@ -1,49 +0,0 @@
#!/usr/bin/with-contenv bash
# make folders
mkdir -p \
/downloads/{complete,incomplete} /watch
# copy config
[[ ! -f /config/settings.json ]] && cp \
/defaults/settings.json /config/settings.json
if [ ! -z "$USER" ] && [ ! -z "$PASS" ]; then
sed -i '/rpc-authentication-required/c\ "rpc-authentication-required": true,' /config/settings.json
sed -i "/rpc-username/c\ \"rpc-username\": \"$USER\"," /config/settings.json
sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json
else
sed -i '/rpc-authentication-required/c\ "rpc-authentication-required": false,' /config/settings.json
sed -i "/rpc-username/c\ \"rpc-username\": \"$USER\"," /config/settings.json
sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json
fi
if [ ! -z "$WHITELIST" ]; then
sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": true,' /config/settings.json
sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json
else
sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": false,' /config/settings.json
sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json
fi
if [ ! -z "$HOST_WHITELIST" ]; then
sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": true,' /config/settings.json
sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$HOST_WHITELIST\"," /config/settings.json
else
sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": false,' /config/settings.json
sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$HOST_WHITELIST\"," /config/settings.json
fi
if [ ! -z "${PEERPORT}" ]; then
sed -i "/\"peer-port\"/c\ \"peer-port\": ${PEERPORT}," /config/settings.json
sed -i '/peer-port-random-on-start/c\ "peer-port-random-on-start": false,' /config/settings.json
fi
# permissions
chown abc:abc \
/config/settings.json \
/downloads \
/downloads/complete \
/downloads/incomplete \
/watch

View File

@@ -0,0 +1,49 @@
#!/usr/bin/with-contenv bash
# make folders
mkdir -p \
/downloads/{complete,incomplete} /watch
# copy config
if [[ ! -f /config/settings.json ]]; then
cp /defaults/settings.json /config/settings.json
fi
if [[ -n "$USER" ]] && [[ -n "$PASS" ]]; then
sed -i '/rpc-authentication-required/c\ "rpc-authentication-required": true,' /config/settings.json
sed -i "/rpc-username/c\ \"rpc-username\": \"$USER\"," /config/settings.json
sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json
else
sed -i '/rpc-authentication-required/c\ "rpc-authentication-required": false,' /config/settings.json
sed -i "/rpc-username/c\ \"rpc-username\": \"$USER\"," /config/settings.json
sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json
fi
if [[ -n "$WHITELIST" ]]; then
sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": true,' /config/settings.json
sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json
else
sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": false,' /config/settings.json
sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json
fi
if [[ -n "$HOST_WHITELIST" ]]; then
sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": true,' /config/settings.json
sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$HOST_WHITELIST\"," /config/settings.json
else
sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": false,' /config/settings.json
sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$HOST_WHITELIST\"," /config/settings.json
fi
if [[ -n "${PEERPORT}" ]]; then
sed -i "/\"peer-port\"/c\ \"peer-port\": ${PEERPORT}," /config/settings.json
sed -i '/peer-port-random-on-start/c\ "peer-port-random-on-start": false,' /config/settings.json
fi
# permissions
chown abc:abc \
/config/settings.json \
/downloads \
/downloads/complete \
/downloads/incomplete \
/watch

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-transmission-config/run

View File

@@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bash
exec \
/usr/sbin/crond -f -S -l 0 -c /etc/crontabs

View File

@@ -0,0 +1 @@
longrun

View File

@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/svc-transmission/finish

View File

@@ -0,0 +1,11 @@
#!/usr/bin/with-contenv bash
pid=$(pidof transmission-daemon)
if [[ -n "$USER" ]] && [[ -n "$PASS" ]]; then
/usr/bin/transmission-remote -n "$USER":"$PASS" --exit
else
/usr/bin/transmission-remote --exit
fi
tail --pid=${pid} -f /dev/null

View File

@@ -0,0 +1 @@
3

View File

@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 9091" \
s6-setuidgid abc /usr/bin/transmission-daemon \
-g /config -c /watch -f

View File

@@ -0,0 +1 @@
longrun

View File

@@ -1,4 +0,0 @@
#!/usr/bin/with-contenv bash
exec \
/usr/sbin/crond -f -S -l 0 -c /etc/crontabs

View File

@@ -1,21 +0,0 @@
#!/usr/bin/with-contenv bash
_term() {
echo "Caught SIGTERM signal!"
echo "Tell the transmission session to shut down."
pid=$(pidof transmission-daemon)
if [ ! -z "$USER" ] && [ ! -z "$PASS" ]; then
/usr/bin/transmission-remote -n "$USER":"$PASS" --exit
else
/usr/bin/transmission-remote --exit
fi
# terminate when the transmission-daemon process dies
tail --pid=${pid} -f /dev/null
}
trap _term SIGTERM
s6-setuidgid abc /usr/bin/transmission-daemon \
-g /config -c /watch -f &
wait