holy后端

This commit is contained in:
2026-08-04 14:02:45 +08:00
commit 175b38138e
25 changed files with 3752 additions and 0 deletions

18
deploy/holy-crab.env Normal file
View File

@@ -0,0 +1,18 @@
HOST=127.0.0.1
PORT=18000
DATABASE_PATH=/var/lib/holy-crab/holy_crab.db
FILE_STORAGE_PATH=/var/lib/holy-crab/files
CRAWLER_BASE_URL=http://43.139.175.114:12007
CRAWLER_RETRY_TIMES=3
CRAWLER_RETRY_DELAY_SECONDS=2
CRAWLER_TIMEOUT_SECONDS=120
CRAWLER_POLL_INTERVAL_SECONDS=5
CORS_ORIGIN=https://content.gbotai.cn
FRONTEND_BASE_URL=https://content.gbotai.cn/holy-crab
SESSION_COOKIE_NAME=hc_session
SESSION_COOKIE_SECURE=true
SESSION_COOKIE_SAMESITE=Lax
SESSION_EXPIRE_DAYS=14
DINGTALK_CLIENT_ID=ding1a03sq3htguwcigp
DINGTALK_CLIENT_SECRET=1GhCT3t2iW2iqZ7FTEywDnR7u-aCMzCu1Kum6VGHGeNMk7hj9TIs2dsLy5vi3XXk
DINGTALK_REDIRECT_URI=https://content.gbotai.cn/holy-crab/api/v1/auth/dingtalk/callback

18
deploy/holy-crab.service Normal file
View File

@@ -0,0 +1,18 @@
[Unit]
Description=Holy Crab Monitoring Platform Backend
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/opt/holy-crab/backend
EnvironmentFile=/etc/holy-crab.env
ExecStart=/opt/holy-crab/backend/.venv/bin/gunicorn --bind 127.0.0.1:18000 --workers 1 --threads 8 --timeout 180 --access-logfile - --error-logfile - app:app
Restart=always
RestartSec=3
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,26 @@
location = /holy-crab {
return 301 /holy-crab/;
}
location ^~ /holy-crab/api/ {
proxy_pass http://127.0.0.1:18000/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 180s;
proxy_send_timeout 180s;
}
location = /holy-crab/health {
proxy_pass http://127.0.0.1:18000/health;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ^~ /holy-crab/ {
alias /opt/holy-crab/frontend/;
try_files $uri $uri/ /holy-crab/index.html;
}