更新 setup.sh

This commit is contained in:
2026-01-11 06:21:33 +00:00
parent 0bbe394cb5
commit 177da1a1c2

View File

@@ -127,6 +127,14 @@ fi
nginx -t
systemctl restart nginx
# 5.1 配置防火墙 (如果有 UFW)
if command -v ufw > /dev/null; then
echo -e "${YELLOW}5.1 配置防火墙允许 HTTP (80)...${NC}"
ufw allow 'Nginx Full'
ufw allow 80
# 不强制启用 ufw以免锁住 SSH只开放端口
fi
# 6. 初始化数据库
echo -e "${YELLOW}6. 初始化数据库...${NC}"
# 我们需要在虚拟环境中运行一个简单的脚本来触发 create_all