chore: sync with gin-template

This commit is contained in:
JustSong
2022-11-22 11:04:06 +08:00
parent 8247192977
commit 5913266969
41 changed files with 813 additions and 490 deletions
+5
View File
@@ -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
View File
@@ -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()
+1 -1
View File
@@ -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
View File
@@ -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")
)
+1 -1
View File
@@ -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 {