mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
support duoshuo mirror of gravatar
This commit is contained in:
@@ -180,7 +180,7 @@ func AvatarLink(email string) string {
|
||||
} else if setting.Service.EnableCacheAvatar {
|
||||
return setting.AppSubUrl + "/avatar/" + EncodeMd5(email)
|
||||
}
|
||||
return "//1.gravatar.com/avatar/" + EncodeMd5(email)
|
||||
return setting.GravatarSource + EncodeMd5(email)
|
||||
}
|
||||
|
||||
// Seconds-based time units
|
||||
|
@@ -67,6 +67,7 @@ var (
|
||||
|
||||
// Picture settings.
|
||||
PictureService string
|
||||
GravatarSource string
|
||||
DisableGravatar bool
|
||||
|
||||
// Log settings.
|
||||
@@ -257,8 +258,13 @@ func NewConfigContext() {
|
||||
}
|
||||
ScriptType = Cfg.MustValue("repository", "SCRIPT_TYPE", "bash")
|
||||
|
||||
PictureService = Cfg.MustValueRange("picture", "SERVICE", "server",
|
||||
[]string{"server"})
|
||||
PictureService = Cfg.MustValueRange("picture", "SERVICE", "server", []string{"server"})
|
||||
switch Cfg.MustValue("picture", "GRAVATAR_SOURCE", "gravatar") {
|
||||
case "duoshuo":
|
||||
GravatarSource = "http://gravatar.duoshuo.com/avatar/"
|
||||
default:
|
||||
GravatarSource = "//1.gravatar.com/avatar/"
|
||||
}
|
||||
DisableGravatar = Cfg.MustBool("picture", "DISABLE_GRAVATAR")
|
||||
|
||||
MaxGitDiffLines = Cfg.MustInt("git", "MAX_GITDIFF_LINES", 10000)
|
||||
|
Reference in New Issue
Block a user