From 56dc16526edc10da3ab7e559101d0afc3155212f Mon Sep 17 00:00:00 2001 From: casjay Date: Thu, 16 Mar 2023 03:30:04 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rootfs/usr/local/etc/docker/init.d/00-aria2c.sh | 9 +++++---- rootfs/usr/local/etc/docker/init.d/zz-nginx.sh | 8 ++++---- .../share/template-files/config/aria2/aria-ng.config.js | 2 +- .../local/share/template-files/config/aria2/aria2.conf | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/rootfs/usr/local/etc/docker/init.d/00-aria2c.sh b/rootfs/usr/local/etc/docker/init.d/00-aria2c.sh index ed76229..15f8cd9 100755 --- a/rootfs/usr/local/etc/docker/init.d/00-aria2c.sh +++ b/rootfs/usr/local/etc/docker/init.d/00-aria2c.sh @@ -44,13 +44,14 @@ __update_conf_files() { [ -d "$etc_dir" ] || mkdir -p "$etc_dir" [ -d "$data_dir" ] || mkdir -p "$data_dir" [ -d "/data/logs/aria2" ] || mkdir -p "/data/logs/aria2" - cp -Rf "$conf_dir/." "$etc_dir/" + cp -Rf "$conf_dir/aria2.conf" "$etc_dir/aria2.conf" ln -sf "$conf_dir/aria2.session" "$etc_dir/aria2.session" if [ -f "$etc_dir/aria-ng.config.js" ]; then rm -Rf "$get_config" - ln -sf "$etc_dir/aria-ng.config.js" "$get_config" - ln -sf "$etc_dir/aria-ng.config.js" "$www_dir/js/aria-ng-f1dd57abb9.min.js" + ln -sf "$conf_dir/aria-ng.config.js" "$get_config" + ln -sf "$conf_dir/aria-ng.config.js" "$www_dir/js/aria-ng-f1dd57abb9.min.js" fi + __replace "REPLACE_RPC_PORT" "$SERVICE_PORT" "$etc_dir/aria2.conf" if [ -n "$RPC_SECRET" ]; then echo "Changing rpc secret to $RPC_SECRET" if grep -sq "rpc-secret=" "$etc_dir/aria2.conf"; then @@ -88,7 +89,7 @@ __run_start_script() { local path="/usr/local/bin:/usr/bin:/bin:/usr/sbin" case "$1" in check) shift 1 && __pgrep $EXEC_CMD_BIN || return 5 ;; - *) su_cmd env -i PWD="$home" HOME="$home" LC_CTYPE="$lc_type" PATH="$path" USER="$user" sh -c "$cmd" || return 10 ;; + *) su_cmd "$cmd" || return 10 ;; esac } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh b/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh index f127894..4c87b27 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-nginx.sh @@ -51,10 +51,10 @@ __update_conf_files() { [ -f "$www_dir/www/health/index.txt" ] || echo 'ok' >"$www_dir/www/health/index.txt" [ -f "$www_dir/www/health/index.json" ] || echo '{ "status": "ok" }' >"$www_dir/www/health/index.json" # - __replace "REPLACE_SERVER_PORT" "${SERVICE_PORT:-80}" "$etc_dir/nginx.conf" - __replace "REPLACE_SERVER_PORT" "${SERVICE_PORT:-80}" "$etc_dir/vhosts.d/default.conf" - # - __replace "REPLACE_SERVER_PORT" "${SERVICE_PORT:-80}" "/etc/aria2/aria-ng.config.js" + __replace "REPLACE_SERVER_PORT" "$SERVICE_PORT" "$etc_dir/nginx.conf" + __replace "REPLACE_SERVER_PORT" "$SERVICE_PORT" "$etc_dir/vhosts.d/default.conf" + __replace "REPLACE_SERVER_PORT" "$SERVICE_PORT" "/etc/aria2/aria-ng.config.js" + __replace "REPLACE_SERVER_ADDR" "$CONTAINER_IP4_ADDRESS" "/etc/aria2/aria-ng.config.js" return 0 } diff --git a/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js b/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js index 9d05e30..8780c21 100755 --- a/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js +++ b/rootfs/usr/local/share/template-files/config/aria2/aria-ng.config.js @@ -524,7 +524,7 @@ titleRefreshInterval: 5e3, browserNotification: !1, rpcAlias: 'aria2', - rpcHost: '127.0.0.1', + rpcHost: 'REPLACE_SERVER_ADDR', rpcPort: 'REPLACE_SERVER_PORT', rpcInterface: 'jsonrpc', protocol: 'http', diff --git a/rootfs/usr/local/share/template-files/config/aria2/aria2.conf b/rootfs/usr/local/share/template-files/config/aria2/aria2.conf index 5c1b5a7..de47cf6 100644 --- a/rootfs/usr/local/share/template-files/config/aria2/aria2.conf +++ b/rootfs/usr/local/share/template-files/config/aria2/aria2.conf @@ -4,7 +4,7 @@ log=/data/logs/aria2/aria2.log input-file=/config/aria2/aria2.session save-session=/config/aria2/aria2.session enable-rpc=true -rpc-listen-port=6800 +rpc-listen-port=REPLACE_RPC_PORT rpc-allow-origin-all=true rpc-listen-all=true rpc-secret=REPLACE_RPC_SECRET