feat: Реализована веб-панель управления и интеграция Sing-box для настройки VPN.

This commit is contained in:
2025-12-29 11:22:28 +03:00
parent 4144560a44
commit af72540aa8
6 changed files with 33 additions and 23 deletions

View File

@@ -4,6 +4,10 @@ set -e
CONFIG_FILE="/app/data/client.json"
SINGBOX_PID=""
# Порты из ENV (по умолчанию: 3456 для веба, 8080 для прокси)
PORT="${PORT:-3456}"
PROXY_PORT="${PROXY_PORT:-8080}"
# Ensure data directory exists
mkdir -p /app/data
@@ -14,7 +18,7 @@ start_singbox() {
SINGBOX_PID=$!
echo "$(date): sing-box started with PID $SINGBOX_PID"
else
echo "$(date): Config file not found. Use web UI at :3456 to apply config."
echo "$(date): Config file not found. Use web UI at :$PORT to apply config."
SINGBOX_PID=""
fi
}
@@ -35,9 +39,9 @@ restart_singbox() {
start_singbox
# Start Web UI Server
echo "$(date): Starting Web UI on port 3456..."
python3 /app/web/server.py &
# Start Web UI Server with configurable port
echo "$(date): Starting Web UI on port $PORT..."
PORT=$PORT PROXY_PORT=$PROXY_PORT python3 /app/web/server.py &
WEBUI_PID=$!
# HTTP Control Server (Simple Netcat loop)