- Switch to config onboarding mode,

- Enable AutoAdd plugin,
- Add TotalTraffic plugin.
This commit is contained in:
2025-05-23 20:16:19 +02:00
parent 2f66143916
commit dc04aa9a4e
17 changed files with 296 additions and 67 deletions

View File

@@ -15,6 +15,7 @@ LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
ARG MODULE_PATH
ARG DELUGE_PORT_DAEMON
ARG DELUGE_PORT_WEB
@@ -25,72 +26,53 @@ ARG DELUGE_CONFIG=${DELUGE_HOME}
ARG DELUGE_CONFIG_TEMPLATE=${DELUGE_HOME}-template
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG DELUGED='#!/bin/bash \n\
\n\
usermod -u ${DELUGE_UID} deluge \n\
groupmod -g ${DELUGE_GID} deluge \n\
\n\
if [[ ! -f '${DELUGE_CONFIG}'/auth ]] \n\
then \n\
cp -R '${DELUGE_CONFIG_TEMPLATE}'/* '${DELUGE_CONFIG}' \n\
\n\
deluged --config '${DELUGE_CONFIG}' \n\
\n\
deluge-console --config '${DELUGE_CONFIG}' config --set allow_remote true \n\
deluge-console --config '${DELUGE_CONFIG}' config --set copy_torrent_file true \n\
deluge-console --config '${DELUGE_CONFIG}' config --set move_completed true \n\
\n\
deluge-console --config '${DELUGE_CONFIG}' config --set listen_ports "[${DELUGE_PORT_BT_LOW},${DELUGE_PORT_BT_HIGH}]" \n\
\n\
deluge-console --config '${DELUGE_CONFIG}' config --set download_location '${DELUGE_SPOOL}'/tmp \n\
deluge-console --config '${DELUGE_CONFIG}' config --set move_completed_path '${DELUGE_SPOOL}'/completed \n\
deluge-console --config '${DELUGE_CONFIG}' config --set plugins_location '${DELUGE_CONFIG}'/plugins \n\
deluge-console --config '${DELUGE_CONFIG}' config --set torrentfiles_location '${DELUGE_SPOOL}'/torrent \n\
\n\
deluge-console --config '${DELUGE_CONFIG}' plugin --enable Label Stats WebUi \n\
\n\
deluge-console --config '${DELUGE_CONFIG}' halt \n\
\n\
echo "deluge:delugeadmin:10" >> '${DELUGE_CONFIG}'/auth \n\
\n\
echo "{\n \"file\": 1,\n \"format\": 1\n}{\n \"enabled\": true,\n \"port\": '${DELUGE_PORT_WEB}',\n \"ssl\": false\n}" > '${DELUGE_CONFIG}'/web_plugin.conf \n\
fi \n\
\n\
for dir in torrent tmp completed \n\
do \n\
if [[ ! -d '${DELUGE_SPOOL}'/${dir} ]] \n\
then \n\
mkdir '${DELUGE_SPOOL}'/${dir} \n\
fi \n\
done \n\
\n\
#-----------------------------------------------------------------------------------------------------------------------
ARG DELUGED='#!/bin/bash \n\
\n\
usermod -u ${DELUGE_UID} deluge \n\
groupmod -g ${DELUGE_GID} deluge \n\
\n\
if [[ ! -f '${DELUGE_CONFIG}'/auth ]] \n\
then \n\
cp -R '${DELUGE_CONFIG_TEMPLATE}'/* '${DELUGE_CONFIG}' \n\
\n\
sed -e "s/DELUGE_PORT_BT_LOW/${DELUGE_PORT_BT_LOW}/" -i '${DELUGE_CONFIG}'/core.conf \n\
sed -e "s/DELUGE_PORT_BT_HIGH/${DELUGE_PORT_BT_HIGH}/" -i '${DELUGE_CONFIG}'/core.conf \n\
fi \n\
\n\
for dir in torrent-auto torrent tmp completed \n\
do \n\
if [[ ! -d '${DELUGE_SPOOL}'/${dir} ]] \n\
then \n\
mkdir '${DELUGE_SPOOL}'/${dir} \n\
fi \n\
done \n\
\n\
chown -R deluge:deluge '${DELUGE_LIB}' '${DELUGE_SPOOL}
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG DELUGED_INI='[program:deluged] \n\
directory='${DELUGE_HOME}' \n\
command=deluged --config '${DELUGE_CONFIG}' --do-not-daemonize \n\
user=deluge \n\
#-----------------------------------------------------------------------------------------------------------------------
ARG DELUGED_INI='[program:deluged] \n\
directory='${DELUGE_HOME}' \n\
command=deluged --config '${DELUGE_CONFIG}' --do-not-daemonize \n\
user=deluge \n\
environment=HOME='${DELUGE_HOME}
#----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
RUN urpmi.update -a \
&& urpmi --force deluge myip --no-recommends \
&& useradd --home-dir ${DELUGE_HOME} --password "" deluge \
&& mkdir ${DELUGE_SPOOL} \
&& echo -e "${DELUGED}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/deluged \
&& chmod a+x /etc/init.d/deluged \
&& ln -s /etc/init.d/deluged /etc/rcD.d/S30deluged \
&& echo -e "${DELUGED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/deluged.ini \
&& deluged --config ${DELUGE_CONFIG_TEMPLATE} \
&& deluge-console --config ${DELUGE_CONFIG_TEMPLATE} halt
RUN urpmi.update -a \
&& urpmi --force deluge myip --no-recommends \
&& useradd --home-dir ${DELUGE_HOME} --password "" deluge \
&& mkdir ${DELUGE_SPOOL} \
&& echo -e "${DELUGED}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/deluged \
&& chmod a+x /etc/init.d/deluged \
&& ln -s /etc/init.d/deluged /etc/rcD.d/S30deluged \
&& echo -e "${DELUGED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/deluged.ini
ADD ${MODULE_PATH} ${DELUGE_CONFIG_TEMPLATE}
EXPOSE ${DELUGE_PORT_DAEMON}
EXPOSE ${DELUGE_PORT_WEB}