全项目扫描修复: Docker数据卷修复+安全requireAdmin+12页SEO+API白名单+脚本超时+常量提取+假数据删除

This commit is contained in:
ZhuiGuangAI Dev
2026-06-12 17:27:47 +08:00
parent 464924aea0
commit 4c325c8699
454 changed files with 33647 additions and 980 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/bin/sh
# =============================================================================
# 追光AI CRON 容器启动入口
# - 用 supercronic 调度 /app/crontab.txt 里的任务
# - 跟 host cron 行为一致,但完全在容器内
# =============================================================================
set -e
cd /app
# Seed data volume if empty
if [ ! -f /app/data/bot-characters.json ] && [ -d /app/data-seed ]; then
echo "[entrypoint] Seeding data volume..."
cp -r /app/data-seed/* /app/data/
fi
# 1) .env 校验
if [ ! -f /app/.env ]; then
echo "[entrypoint-cron] FATAL: /app/.env not found. Mount .env file into container."
exit 1
fi
# 2) crontab 文件校验
if [ ! -f /app/crontab.txt ]; then
echo "[entrypoint-cron] FATAL: /app/crontab.txt not found. Mount crontab into container."
exit 1
fi
# 3) supercronic 启动
echo "[entrypoint-cron] Starting supercronic..."
echo "[entrypoint-cron] crontab:"
sed 's/^/ /' /app/crontab.txt
# -prometheus-listen-address 可选 (开监控)
# -split-logs 把 stdout/stderr 拆开
exec /usr/local/bin/supercronic-linux-amd64 \
-prometheus-listen-address 0.0.0.0:8310 \
/app/crontab.txt