summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorFluf <36822577+flufmonster@users.noreply.github.com>2018-08-21 09:56:50 -0400
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-08-21 09:56:50 -0400
commitb82c14b3d2259912b47fa292b85772ba1d2493d0 (patch)
treee4cca15b19a1549961543779f9a11c9127e7475c /modules/setting/setting.go
parent6c1a31ffaaddf8ced7c30bf5b1e6e82d66f8c6ee (diff)
downloadgitea-b82c14b3d2259912b47fa292b85772ba1d2493d0.tar.gz
gitea-b82c14b3d2259912b47fa292b85772ba1d2493d0.zip
add letsencrypt to Gitea (#4189)
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 0f57098ea6..5d0354b110 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -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")