add letsencrypt to Gitea (#4189)

This commit is contained in:
Fluf 2018-08-21 09:56:50 -04:00 committed by techknowlogick
parent 6c1a31ffaa
commit b82c14b3d2
35 changed files with 4521 additions and 283 deletions

View file

@ -112,6 +112,10 @@ var (
UnixSocketPermission uint32
EnablePprof bool
PprofDataPath string
EnableLetsEncrypt bool
LetsEncryptTOS bool
LetsEncryptDirectory string
LetsEncryptEmail string
SSH = struct {
Disabled bool `ini:"DISABLE_SSH"`
@ -737,6 +741,14 @@ func NewContext() {
}
UnixSocketPermission = uint32(UnixSocketPermissionParsed)
}
EnableLetsEncrypt := sec.Key("ENABLE_LETSENCRYPT").MustBool(false)
LetsEncryptTOS := sec.Key("LETSENCRYPT_ACCEPTTOS").MustBool(false)
if !LetsEncryptTOS && EnableLetsEncrypt {
log.Warn("Failed to enable Let's Encrypt due to Let's Encrypt TOS not being accepted")
EnableLetsEncrypt = false
}
LetsEncryptDirectory = sec.Key("LETSENCRYPT_DIRECTORY").MustString("https")
LetsEncryptEmail = sec.Key("LETSENCRYPT_EMAIL").MustString("")
Domain = sec.Key("DOMAIN").MustString("localhost")
HTTPAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
HTTPPort = sec.Key("HTTP_PORT").MustString("3000")