diff --git a/scripts/Common/Software/docker/services/jellyfin/proton.Dockerfile b/scripts/Common/Software/docker/services/jellyfin/proton.Dockerfile index 3f972d4b..7f956751 100644 --- a/scripts/Common/Software/docker/services/jellyfin/proton.Dockerfile +++ b/scripts/Common/Software/docker/services/jellyfin/proton.Dockerfile @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \ COPY ./proton/supervisord.conf /etc/supervisor/supervisord.conf COPY --from=protonwire /usr/bin/protonwire /usr/bin/ COPY --chmod=755 ./proton/proton-entrypoint.sh /usr/local/bin/proton-entrypoint +COPY --chmod=755 ./proton/rotate.sh /usr/local/bin/proton-rotate COPY --chmod=755 ./proton/service-entrypoint.sh /usr/local/bin/service-entrypoint COPY --chmod=755 ./proton/pvpn-login.py /usr/bin/pvpn-login COPY --chmod=755 ./proton/pvpn-cli.py /usr/bin/pvpn-cli @@ -34,6 +35,7 @@ RUN { echo "#!/bin/bash"; echo 'flask --app /opt/pvpn-api.py run --port 8989'; } ENV PVPN_USERNAME= \ PVPN_CMD_ARGS="--p2p --random" \ + PVPN_ROTATE_INTERVAL= \ USERNAME=proton \ PUID=1000 \ PGID=1000 \ diff --git a/scripts/Common/Software/docker/services/jellyfin/proton/rotate.sh b/scripts/Common/Software/docker/services/jellyfin/proton/rotate.sh new file mode 100644 index 00000000..9e49f1dc --- /dev/null +++ b/scripts/Common/Software/docker/services/jellyfin/proton/rotate.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +if [ ${PVPN_ROTATE_INTERVAL:-0} -gt 0 ] +then + echo "Rotating VPN connection every $PVPN_ROTATE_INTERVAL seconds" + + while true + do + sleep $PVPN_ROTATE_INTERVAL + echo "Rotating VPN connection…" + supervisorctl restart pvpn-cli + done +fi diff --git a/scripts/Common/Software/docker/services/jellyfin/proton/supervisord.conf b/scripts/Common/Software/docker/services/jellyfin/proton/supervisord.conf index ebd4720a..9bf15972 100644 --- a/scripts/Common/Software/docker/services/jellyfin/proton/supervisord.conf +++ b/scripts/Common/Software/docker/services/jellyfin/proton/supervisord.conf @@ -1,8 +1,18 @@ [supervisord] nodaemon=true +user=root logfile=/dev/null logfile_maxbytes=0 +[unix_http_server] +file=%(here)s/supervisord.sock + +[supervisorctl] +serverurl=unix://%(here)s/supervisord.sock + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + [include] files=/etc/supervisor/conf.d/* @@ -23,3 +33,11 @@ stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 + +[program:proton-rotate] +command=proton-rotate +exitcodes=0 +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/fd/2 +stderr_logfile_maxbytes=0 diff --git a/scripts/Common/Software/docker/services/jellyfin/rtorrent/supervisord.conf b/scripts/Common/Software/docker/services/jellyfin/rtorrent/supervisord.conf index 51ccc3d9..a460a7c8 100644 --- a/scripts/Common/Software/docker/services/jellyfin/rtorrent/supervisord.conf +++ b/scripts/Common/Software/docker/services/jellyfin/rtorrent/supervisord.conf @@ -1,8 +1,18 @@ [supervisord] nodaemon=true +user=root logfile=/dev/null logfile_maxbytes=0 +[unix_http_server] +file=%(here)s/supervisord.sock + +[supervisorctl] +serverurl=unix://%(here)s/supervisord.sock + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + [include] files=/etc/supervisor/conf.d/*