Skip to content

Commit

Permalink
feat: save from the public network within 5 minutes (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeessy2 committed Apr 24, 2023
1 parent d42a7e2 commit 39bfef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func checkAndSave(request *http.Request) string {
// 验证安全性后才允许设置保存配置文件:
// 内网访问或在服务启动的 1 分钟内
if (!util.IsPrivateNetwork(request.RemoteAddr) || !util.IsPrivateNetwork(request.Host)) &&
firstTime && time.Now().Unix()-startTime > 60 { // 1 minutes
return "出于安全考虑,若通过公网访问,仅允许在ddns-go启动的 1 分钟内完成首次配置"
firstTime && time.Now().Unix()-startTime > 5*60 { // 5 minutes
return "出于安全考虑,若通过公网访问,仅允许在ddns-go启动的 5 分钟内完成首次配置"
}

conf.NotAllowWanAccess = request.FormValue("NotAllowWanAccess") == "on"
Expand Down

0 comments on commit 39bfef8

Please sign in to comment.