diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..db18abc --- /dev/null +++ b/.env.example @@ -0,0 +1,24 @@ +# NOVAVPS - ссылка на страницу с подключениями +NOVAVPS_URL=https://novavps.app/s/your_link_here + +# Панель Xray 1 (основная) +XRAY_URL=https://your-xray-panel.com/panel/xray +XRAY_USERNAME=your_username +XRAY_PASSWORD=your_password + +# Панель Xray 2 (резервная, опционально) +XRAY_URL2=https://your-second-xray-panel.com/panel/xray +XRAY_USERNAME2=your_username2 +XRAY_PASSWORD2=your_password2 + +# Порт веб-интерфейса +PORT=3000 + +# Интервал автозапуска парсера (в секундах, по умолчанию 1800 = 30 минут) +PARSE_INTERVAL=1800 + +# Секрет для сессий (опционально, генерируется автоматически если не указан) +# SESSION_SECRET=your_random_secret_here_64_chars + +# Режим окружения (production включает secure cookie flag) +# NODE_ENV=production diff --git a/entrypoint.sh b/entrypoint.sh index 208861d..a54d3e1 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,8 @@ #!/bin/sh set -e +echo "[entrypoint] Building TypeScript..." +npm run build + echo "[entrypoint] Starting web server..." -exec npx ts-node src/server.ts +exec npm run start:prod diff --git a/package.json b/package.json index 59bf44f..d24bbd2 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "start": "ts-node src/server.ts", "start:cli": "ts-node src/index.ts", + "start:prod": "node dist/server.js", "build": "tsc", "typecheck": "tsc --noEmit" }, diff --git a/public/index.html b/public/index.html index e947ba7..15920c4 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,11 @@
@@ -32,7 +36,11 @@