This commit is contained in:
Mateusz Gruszczyński committed 2026-10-04 09:29:10 +02:00
1 parent 2e4aa4df4d
commit 87e571c170
106 files changed
+17952 -6185

No files matched your search

+23 -9
View File
@@ -4,7 +4,8 @@
set -euo pipefail
REPO_URL="${RUSTPROXY_REPO_URL:-https://git.linuxiarz.pl/gru/RustProxy.git}"
ADMIN_LISTEN="${RUSTPROXY_ADMIN_LISTEN:-0.0.0.0:9090}"
ADMIN_LISTEN="${RUSTPROXY_ADMIN_LISTEN:-127.0.0.1:9090}"
ALLOW_REMOTE_ADMIN="${RUSTPROXY_ALLOW_REMOTE_ADMIN:-0}"
PREFIX="${RUSTPROXY_PREFIX:-/opt/rustproxy}"
MODE="${1:-auto}"
@@ -22,7 +23,8 @@ Usage: install-debian13.sh [auto|install|update]
Environment:
RUSTPROXY_REPO_URL Git repository URL
RUSTPROXY_ADMIN_LISTEN Admin bind used only on first install (default 0.0.0.0:9090)
RUSTPROXY_ADMIN_LISTEN Admin bind used only on first install (default 127.0.0.1:9090)
RUSTPROXY_ALLOW_REMOTE_ADMIN Set to 1 only to permit plain-HTTP non-loopback admin on first install
RUSTPROXY_PREFIX Managed install prefix (default /opt/rustproxy)
RUSTPROXY_BUILD_JOBS Cargo jobs for low-memory builds (default 1)
USAGE
@@ -115,19 +117,31 @@ if ! [[ "$BUILD_JOBS" =~ ^[1-9][0-9]*$ ]]; then
echo "RUSTPROXY_BUILD_JOBS must be a positive integer." >&2
exit 1
fi
if [[ "$ALLOW_REMOTE_ADMIN" != "0" && "$ALLOW_REMOTE_ADMIN" != "1" ]]; then
echo "RUSTPROXY_ALLOW_REMOTE_ADMIN must be 0 or 1." >&2
exit 1
fi
run_builder bash -lc "cd '$work/RustProxy' && CARGO_BUILD_JOBS='$BUILD_JOBS' CARGO_PROFILE_RELEASE_LTO=false CARGO_PROFILE_RELEASE_CODEGEN_UNITS=8 cargo build --release --locked"
cd "$work/RustProxy"
if [[ "$MODE" == install ]]; then
bash install.sh \
--binary target/release/rust-proxy \
--prefix "$PREFIX" \
--admin "$ADMIN_LISTEN" \
--allow-remote-admin \
install_args=(
--binary target/release/rust-proxy
--prefix "$PREFIX"
--admin "$ADMIN_LISTEN"
)
if [[ "$ALLOW_REMOTE_ADMIN" == "1" ]]; then
install_args+=(--allow-remote-admin)
fi
bash install.sh "${install_args[@]}"
printf '\nRustProxy installed. Admin panel: http://%s\n' "$ADMIN_LISTEN"
printf 'WARNING: remote administration uses plain HTTP. Restrict TCP/9090 with a firewall/private network.\n'
if [[ "$ALLOW_REMOTE_ADMIN" == "1" ]]; then
printf 'WARNING: plain-HTTP remote administration was explicitly enabled. Restrict it to a trusted private network and migrate to Administration HTTPS.\n'
else
printf 'Administration is loopback-only by default. Use an SSH tunnel or enable Administration HTTPS before remote exposure.\n'
fi
else
# update.sh reads the saved installation record and therefore preserves the
# existing data directory, HTTP/TLS/admin binds and service account.