修复初始化向导服务外部监听与白名单放行并升级版本至V2.10.5
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-10-17 01:35:41 +08:00
parent f9e0a425c8
commit f75bc9854f
3 changed files with 6 additions and 7 deletions

View File

@ -58,11 +58,10 @@ func SetupStart() error {
setupHost := strings.TrimSpace(os.Getenv("SMAIL_SETUP_HOST"))
if setupHost == "" {
setupHost = "127.0.0.1"
}
if setupHost != "127.0.0.1" && setupHost != "localhost" {
if net.ParseIP(setupHost) == nil || strings.TrimSpace(os.Getenv("SMAIL_SETUP_ALLOWED_CIDRS")) == "" || strings.TrimSpace(os.Getenv("SMAIL_SETUP_TOKEN")) == "" {
setupHost = "127.0.0.1"
setupHost = "0.0.0.0"
} else if setupHost != "127.0.0.1" && setupHost != "localhost" {
if net.ParseIP(setupHost) == nil {
setupHost = "0.0.0.0"
}
}
setupServer = &http.Server{

View File

@ -166,7 +166,7 @@ install -d -o root -g root -m 0750 /etc/smail
if [ ! -e /etc/smail/smail.env ]; then
# 每次部署都重新创建服务环境文件,不继承旧的凭据或代理配置。
umask 0077
printf '%s\n' "SMAIL_ROOT=$runtime_dir" 'GOMEMLIMIT=256MiB' > /etc/smail/smail.env
printf '%s\n' "SMAIL_ROOT=$runtime_dir" 'GOMEMLIMIT=256MiB' 'SMAIL_SETUP_HOST=0.0.0.0' 'SMAIL_SETUP_ALLOWED_CIDRS=0.0.0.0/0,::/0' > /etc/smail/smail.env
fi
if ! grep -q '^SMAIL_PLUGIN_UID=' /etc/smail/smail.env; then
printf 'SMAIL_PLUGIN_UID=%s\n' "$(id -u smail)" >> /etc/smail/smail.env

View File

@ -57,7 +57,7 @@
<el-icon><Setting /></el-icon>
<span class="settings-label">{{ lang.settings }}</span>
</div>
<span class="app-version-badge">V2.10.4</span>
<span class="app-version-badge">V2.10.5</span>
</button>
</div>
</div>