new changes
This commit is contained in:
BIN
YakPanel-server/backend/app/__pycache__/main.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/__pycache__/main.cpython-314.pyc
Normal file
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/auth.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/auth.cpython-314.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/ftp.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/ftp.cpython-314.pyc
Normal file
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/logs.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/logs.cpython-314.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/node.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/node.cpython-314.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/site.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/site.cpython-314.pyc
Normal file
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/soft.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/soft.cpython-314.pyc
Normal file
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/ssl.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/ssl.cpython-314.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
YakPanel-server/backend/app/api/__pycache__/user.cpython-314.pyc
Normal file
BIN
YakPanel-server/backend/app/api/__pycache__/user.cpython-314.pyc
Normal file
Binary file not shown.
@@ -13,7 +13,6 @@ from collections import defaultdict
|
||||
from typing import Annotated, Any, Literal, Optional, Union
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import asyncssh
|
||||
from fastapi import APIRouter, HTTPException, Request, WebSocket
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
@@ -198,6 +197,8 @@ async def create_job(body: CreateJobRequest, request: Request):
|
||||
auth_payload = body.auth
|
||||
|
||||
async def runner() -> None:
|
||||
import asyncssh
|
||||
|
||||
async with _jobs_lock:
|
||||
job = _jobs.get(job_id)
|
||||
if not job:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
YakPanel-server/backend/app/data/default.db
Normal file
BIN
YakPanel-server/backend/app/data/default.db
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -100,7 +100,8 @@ install_base_packages() {
|
||||
apt)
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
git python3 python3-venv python3-pip redis-server nginx curl ca-certificates
|
||||
git python3 python3-venv python3-pip python3-dev build-essential \
|
||||
redis-server nginx curl ca-certificates
|
||||
;;
|
||||
dnf|yum)
|
||||
if [ "$PKG" = dnf ]; then
|
||||
@@ -119,27 +120,29 @@ install_base_packages() {
|
||||
esac
|
||||
}
|
||||
|
||||
ensure_python_min_311() {
|
||||
if command -v python3.11 >/dev/null 2>&1; then
|
||||
if python3.11 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else 1)' 2>/dev/null; then
|
||||
PYTHON_CMD=python3.11
|
||||
# Default dist Python (3.10+ on Ubuntu 22.04) is enough; otherwise install 3.11 from apt.
|
||||
ensure_python_for_backend() {
|
||||
if [ -n "${PYTHON_CMD:-}" ]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
if python3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else 1)' 2>/dev/null; then
|
||||
if python3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' 2>/dev/null; then
|
||||
PYTHON_CMD=python3
|
||||
return 0
|
||||
fi
|
||||
if command -v python3.11 >/dev/null 2>&1 && python3.11 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)' 2>/dev/null; then
|
||||
PYTHON_CMD=python3.11
|
||||
return 0
|
||||
fi
|
||||
if [ "$PKG" = apt ]; then
|
||||
echo "Python 3.11+ required for the backend; installing python3.11 from apt..."
|
||||
echo "Python 3.10+ required for the backend; installing python3.11 from apt..."
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y python3.11 python3.11-venv python3.11-dev || {
|
||||
echo "Could not install python3.11. Use Ubuntu 24.04+, enable universe, or install Python 3.11+ manually."
|
||||
echo "Could not install python3.11. Enable universe or install Python 3.10+ manually."
|
||||
exit 1
|
||||
}
|
||||
PYTHON_CMD=python3.11
|
||||
return 0
|
||||
fi
|
||||
echo "Python 3.11+ required. Current: $(python3 -V 2>/dev/null || echo 'python3 missing')"
|
||||
echo "Python 3.10+ required. Current: $(python3 -V 2>/dev/null || echo 'python3 missing')"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -189,6 +192,7 @@ stage_source_to_install_path() {
|
||||
}
|
||||
|
||||
install_base_packages
|
||||
ensure_python_for_backend
|
||||
ensure_node_18_plus
|
||||
|
||||
echo ""
|
||||
@@ -234,6 +238,10 @@ cd "$INSTALL_PATH/backend"
|
||||
# shellcheck source=/dev/null
|
||||
source venv/bin/activate
|
||||
pip install -q -r requirements.txt
|
||||
./venv/bin/python -c "import app.main" || {
|
||||
echo "ERROR: Backend failed to import (see traceback above). Check Python version and requirements."
|
||||
exit 1
|
||||
}
|
||||
python scripts/seed_admin.py
|
||||
deactivate
|
||||
|
||||
@@ -281,6 +289,7 @@ Type=simple
|
||||
User=root
|
||||
WorkingDirectory=$INSTALL_PATH/backend
|
||||
Environment="PATH=$INSTALL_PATH/backend/venv/bin:\$PATH"
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=$INSTALL_PATH/backend/venv/bin/uvicorn app.main:app --host 127.0.0.1 --port $BACKEND_PORT
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
@@ -294,7 +303,7 @@ systemctl enable "$SYSTEMD_UNIT"
|
||||
systemctl restart "$SYSTEMD_UNIT" || systemctl start "$SYSTEMD_UNIT"
|
||||
|
||||
backend_ok=0
|
||||
for _ in {1..40}; do
|
||||
for _ in {1..120}; do
|
||||
if curl -sfS --max-time 2 "http://127.0.0.1:${BACKEND_PORT}/api/health" >/dev/null 2>&1; then
|
||||
backend_ok=1
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user