diff --git a/rootfs/usr/local/bin/start-aria2.sh b/rootfs/usr/local/bin/start-aria2.sh index d57cfa4..46bb959 100755 --- a/rootfs/usr/local/bin/start-aria2.sh +++ b/rootfs/usr/local/bin/start-aria2.sh @@ -70,7 +70,8 @@ CONTAINER_IP_ADDRESS="$(ip a 2>/dev/null | grep 'inet' | grep -v '127.0.0.1' | a [ "$HTTPS_PORT" = "443" ] && HTTP_PORT="$HTTPS_PORT" && SSL_ENABLED="true" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Overwrite variables -SERVICE_PORT="${ARIA2RPCPORT:-8080}" +RPC_SECRET="${RPC_SECRET:-}" +SERVICE_PORT="" SERVICE_NAME="aria2" SERVICE_COMMAND="aria2c --conf-path=/config/aria2/aria2.conf" export exec_message="Starting $SERVICE_NAME on $CONTAINER_IP_ADDRESS:$SERVICE_PORT" @@ -110,19 +111,12 @@ fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if [ -n "$RPC_SECRET" ]; then echo "Changing rpc secret to $RPC_SECRET" - grep -sq "rpc-secret=*" "/config/aria2.conf" || - echo "rpc-secret=$RPC_SECRET" >>"/config/aria2.conf" || - sed -i "s|rpc-secret=.*|rpc-secret=$RPC_SECRET|g" "/config/aria2.conf" + grep -sq "rpc-secret=*" "/config/aria2/aria2.conf" || + echo "rpc-secret=$RPC_SECRET" >>"/config/aria2/aria2.conf" || + sed -i "s|rpc-secret=.*|rpc-secret=$RPC_SECRET|g" "/config/aria2/aria2.conf" sed -i "s|secret: |secret: $RPC_SECRET|g" "/var/www/ariang/js/aria-ng-f1dd57abb9.min.js" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# allow Changing of port [unsupported] -if [ -n "$SERVICE_PORT" ] && [ "$SERVICE_PORT" != "8080" ]; then - echo "Changing rpc request port to $SERVICE_PORT" - sed -i "s|rpc-listen-port=.*|rpc-listen-port=${SERVICE_PORT}|g" "/config/nginx/nginx.conf" - sed -i "s|rpcPort: *,|rpcPort: ''${SERVICE_PORT}'',|g" "/var/www/ariang/js/aria-ng-f1dd57abb9.min.js" -fi -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Initialized [ -d "/data" ] && touch "/data/.docker_has_run" [ -d "/config" ] && touch "/config/.docker_has_run" diff --git a/rootfs/usr/local/bin/start-nginx.sh b/rootfs/usr/local/bin/start-nginx.sh index 5531f8d..697d428 100755 --- a/rootfs/usr/local/bin/start-nginx.sh +++ b/rootfs/usr/local/bin/start-nginx.sh @@ -70,7 +70,7 @@ CONTAINER_IP_ADDRESS="$(ip a 2>/dev/null | grep 'inet' | grep -v '127.0.0.1' | a [ "$HTTPS_PORT" = "443" ] && HTTP_PORT="$HTTPS_PORT" && SSL_ENABLED="true" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Overwrite variables -SERVICE_PORT="6800" +SERVICE_PORT="${ARIA2RPCPORT:-6800}" SERVICE_NAME="nginx" SERVICE_COMMAND="nginx -c /etc/nginx/nginx.conf" export exec_message="Starting $SERVICE_NAME on $CONTAINER_IP_ADDRESS:$SERVICE_PORT" @@ -103,7 +103,11 @@ if [ "$DATA_DIR_INITIALIZED" = "false" ] && [ -d "$DEFAULT_DATA_DIR/data/htdocs" fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Post copy commands - +# allow Changing of port [unsupported] +if [ -n "$SERVICE_PORT" ] && [ "$SERVICE_PORT" != "6800" ]; then + echo "Changing rpc request port to $SERVICE_PORT" + sed -i "s|listen .*|listen ${SERVICE_PORT}|g" "/config/nginx/nginx.conf" +fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Initialized [ -d "/data" ] && touch "/data/.docker_has_run" diff --git a/rootfs/usr/local/share/template-files/config/aria2/aria-ng-f1dd57abb9.min.js b/rootfs/usr/local/share/template-files/config/aria2/aria-ng-f1dd57abb9.min.js index d9be0d4..ff485af 100755 --- a/rootfs/usr/local/share/template-files/config/aria2/aria-ng-f1dd57abb9.min.js +++ b/rootfs/usr/local/share/template-files/config/aria2/aria-ng-f1dd57abb9.min.js @@ -525,7 +525,7 @@ browserNotification: !1, rpcAlias: '', rpcHost: 'localhost', - rpcPort: '8080', + rpcPort: '6800', rpcInterface: 'jsonrpc', protocol: 'ws', httpMethod: 'POST', @@ -2106,7 +2106,7 @@ 'rpc-listen-port': { type: 'integer', readonly: !0, - defaultValue: '8080', + defaultValue: '6080', }, 'rpc-max-request-size': { type: 'string', @@ -2155,7 +2155,7 @@ 'conf-path': { type: 'string', readonly: !0, - defaultValue: '/etc/aria2.conf', + defaultValue: '/config/aria2/aria2.conf', }, 'console-log-level': { type: 'option',