From ba5a9deeb6d46f0e1c888349ffc4f823e7ed74e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Thu, 28 May 2026 23:53:15 +0300 Subject: [PATCH] feat: random 5-digit port for panel on install Panel now gets a random port (10000-59999) instead of fixed 8443. Harder to find via port scanning, avoids conflicts with existing services. Port saved to /opt/phobos-panel/.port for reference. Override with PANEL_PORT=xxxxx env var. Co-Authored-By: Claude Opus 4.6 --- install.sh | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 093bc76..755178a 100644 --- a/install.sh +++ b/install.sh @@ -5,6 +5,9 @@ # # Usage: # bash <(curl -fsSL https://raw.githubusercontent.com/andrey271192/PCA_Phobos/main/install.sh) +# +# Custom port: +# PANEL_PORT=39172 bash <(curl ...) # ============================================================ set -e @@ -12,9 +15,13 @@ set -e PANEL_PASS="${PANEL_PASS:-OcAdmin2026!}" TG_TOKEN="${TG_TOKEN:-}" TG_CHAT="${TG_CHAT:-}" -PANEL_PORT="${PANEL_PORT:-8443}" PANEL_DIR="/opt/phobos-panel" +# Generate random 5-digit port (10000-59999) if not specified +if [ -z "$PANEL_PORT" ]; then + PANEL_PORT=$(shuf -i 10000-59999 -n 1 2>/dev/null || awk 'BEGIN{srand(); print int(10000+rand()*50000)}') +fi + # ── Check Phobos is installed ── if [ ! -d "/opt/Phobos" ]; then echo "ERROR: Phobos not found at /opt/Phobos" @@ -60,11 +67,29 @@ if [ ! -f "$PANEL_DIR/settings.json" ]; then EOF fi +# Save port for future reference +echo "$PANEL_PORT" > "$PANEL_DIR/.port" + # ── 3. Setup systemd service ── echo "[3/3] Setting up service..." -curl -fsSL "https://raw.githubusercontent.com/andrey271192/PCA_Phobos/main/phobos-panel.service" \ - > /etc/systemd/system/phobos-panel.service +cat > /etc/systemd/system/phobos-panel.service <