🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay 2023-03-16 03:30:04 -04:00
parent e58cbdedc7
commit 56dc16526e
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F
4 changed files with 11 additions and 10 deletions

View File

@ -44,13 +44,14 @@ __update_conf_files() {
[ -d "$etc_dir" ] || mkdir -p "$etc_dir" [ -d "$etc_dir" ] || mkdir -p "$etc_dir"
[ -d "$data_dir" ] || mkdir -p "$data_dir" [ -d "$data_dir" ] || mkdir -p "$data_dir"
[ -d "/data/logs/aria2" ] || mkdir -p "/data/logs/aria2" [ -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" ln -sf "$conf_dir/aria2.session" "$etc_dir/aria2.session"
if [ -f "$etc_dir/aria-ng.config.js" ]; then if [ -f "$etc_dir/aria-ng.config.js" ]; then
rm -Rf "$get_config" rm -Rf "$get_config"
ln -sf "$etc_dir/aria-ng.config.js" "$get_config" ln -sf "$conf_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" "$www_dir/js/aria-ng-f1dd57abb9.min.js"
fi fi
__replace "REPLACE_RPC_PORT" "$SERVICE_PORT" "$etc_dir/aria2.conf"
if [ -n "$RPC_SECRET" ]; then if [ -n "$RPC_SECRET" ]; then
echo "Changing rpc secret to $RPC_SECRET" echo "Changing rpc secret to $RPC_SECRET"
if grep -sq "rpc-secret=" "$etc_dir/aria2.conf"; then 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" local path="/usr/local/bin:/usr/bin:/bin:/usr/sbin"
case "$1" in case "$1" in
check) shift 1 && __pgrep $EXEC_CMD_BIN || return 5 ;; 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 esac
} }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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.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" [ -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" "$etc_dir/nginx.conf"
__replace "REPLACE_SERVER_PORT" "${SERVICE_PORT:-80}" "$etc_dir/vhosts.d/default.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_PORT" "${SERVICE_PORT:-80}" "/etc/aria2/aria-ng.config.js" __replace "REPLACE_SERVER_ADDR" "$CONTAINER_IP4_ADDRESS" "/etc/aria2/aria-ng.config.js"
return 0 return 0
} }

View File

@ -524,7 +524,7 @@
titleRefreshInterval: 5e3, titleRefreshInterval: 5e3,
browserNotification: !1, browserNotification: !1,
rpcAlias: 'aria2', rpcAlias: 'aria2',
rpcHost: '127.0.0.1', rpcHost: 'REPLACE_SERVER_ADDR',
rpcPort: 'REPLACE_SERVER_PORT', rpcPort: 'REPLACE_SERVER_PORT',
rpcInterface: 'jsonrpc', rpcInterface: 'jsonrpc',
protocol: 'http', protocol: 'http',

View File

@ -4,7 +4,7 @@ log=/data/logs/aria2/aria2.log
input-file=/config/aria2/aria2.session input-file=/config/aria2/aria2.session
save-session=/config/aria2/aria2.session save-session=/config/aria2/aria2.session
enable-rpc=true enable-rpc=true
rpc-listen-port=6800 rpc-listen-port=REPLACE_RPC_PORT
rpc-allow-origin-all=true rpc-allow-origin-all=true
rpc-listen-all=true rpc-listen-all=true
rpc-secret=REPLACE_RPC_SECRET rpc-secret=REPLACE_RPC_SECRET