From 177da1a1c2055d6283cfeb1a15cff1a615cb1f03 Mon Sep 17 00:00:00 2001 From: AnthonyDuan Date: Sun, 11 Jan 2026 06:21:33 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20setup.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.sh b/setup.sh index 0d4733f..93fa33d 100644 --- a/setup.sh +++ b/setup.sh @@ -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