chore: sync with gin-template
This commit is contained in:
@@ -27,6 +27,8 @@ var PasswordRegisterEnabled = true
|
||||
var EmailVerificationEnabled = false
|
||||
var GitHubOAuthEnabled = false
|
||||
var WeChatAuthEnabled = false
|
||||
var TurnstileCheckEnabled = false
|
||||
var RegisterEnabled = true
|
||||
|
||||
var SMTPServer = ""
|
||||
var SMTPAccount = ""
|
||||
@@ -39,6 +41,9 @@ var WeChatServerAddress = ""
|
||||
var WeChatServerToken = ""
|
||||
var WeChatAccountQRCodeImageURL = ""
|
||||
|
||||
var TurnstileSiteKey = ""
|
||||
var TurnstileSecretKey = ""
|
||||
|
||||
const (
|
||||
RoleGuestUser = 0
|
||||
RoleCommonUser = 1
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"gopkg.in/gomail.v2"
|
||||
)
|
||||
import "gopkg.in/gomail.v2"
|
||||
|
||||
func SendEmail(subject string, receiver string, content string) error {
|
||||
m := gomail.NewMessage()
|
||||
|
||||
@@ -2,7 +2,7 @@ package common
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"github.com/gin-gonic/contrib/static"
|
||||
"github.com/gin-contrib/static"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
+3
-3
@@ -12,9 +12,9 @@ var (
|
||||
Port = flag.Int("port", 3000, "the listening port")
|
||||
PrintVersion = flag.Bool("version", false, "print version and exit")
|
||||
LogDir = flag.String("log-dir", "", "specify the log directory")
|
||||
//Host = flag.Key("host", "localhost", "the server's ip address or domain")
|
||||
//Path = flag.Key("path", "", "specify a local path to public")
|
||||
//VideoPath = flag.Key("video", "", "specify a video folder to public")
|
||||
//Host = flag.String("host", "localhost", "the server's ip address or domain")
|
||||
//Path = flag.String("path", "", "specify a local path to public")
|
||||
//VideoPath = flag.String("video", "", "specify a video folder to public")
|
||||
//NoBrowser = flag.Bool("no-browser", false, "open browser or not")
|
||||
)
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ func DeleteKey(key string, purpose string) {
|
||||
delete(verificationMap, purpose+key)
|
||||
}
|
||||
|
||||
// no lock inside!
|
||||
// no lock inside, so the caller must lock the verificationMap before calling!
|
||||
func removeExpiredPairs() {
|
||||
now := time.Now()
|
||||
for key := range verificationMap {
|
||||
|
||||
Reference in New Issue
Block a user