From b82c14b3d2259912b47fa292b85772ba1d2493d0 Mon Sep 17 00:00:00 2001 From: Fluf <36822577+flufmonster@users.noreply.github.com> Date: Tue, 21 Aug 2018 09:56:50 -0400 Subject: add letsencrypt to Gitea (#4189) --- modules/setting/setting.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/setting/setting.go') 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") -- cgit v1.2.3