summaryrefslogtreecommitdiffstats
path: root/cmd/web.go
diff options
context:
space:
mode:
authorCristian Le <github@lecris.me>2022-02-08 14:45:35 +0900
committerGitHub <noreply@github.com>2022-02-08 13:45:35 +0800
commit60f203385e6f27fae47f3cc8c5d71309f4fd88dc (patch)
tree3be2a41b96ab7ab0419e0e63676a5fc16e20cd7d /cmd/web.go
parenta60e8be8d15e90a44f2a746a4e8d81a81e03d2db (diff)
downloadgitea-60f203385e6f27fae47f3cc8c5d71309f4fd88dc.tar.gz
gitea-60f203385e6f27fae47f3cc8c5d71309f4fd88dc.zip
Support custom ACME provider (#18340)
* Added ACMECAURL option to support custom ACME provider. Closes #18306 * Refactor setting.go https settings, renamed options and variables, and documented app.example.ini * Refactored runLetsEncrypt to runACME * Improved documentation
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 9a8d9dfa73..710c12775f 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -222,18 +222,19 @@ func listen(m http.Handler, handleRedirector bool) error {
}
err = runHTTP("tcp", listenAddr, "Web", m)
case setting.HTTPS:
- if setting.EnableLetsEncrypt {
- err = runLetsEncrypt(listenAddr, setting.Domain, setting.LetsEncryptDirectory, setting.LetsEncryptEmail, m)
+ if setting.EnableAcme {
+ err = runACME(listenAddr, m)
break
- }
- if handleRedirector {
- if setting.RedirectOtherPort {
- go runHTTPRedirector()
- } else {
- NoHTTPRedirector()
+ } else {
+ if handleRedirector {
+ if setting.RedirectOtherPort {
+ go runHTTPRedirector()
+ } else {
+ NoHTTPRedirector()
+ }
}
+ err = runHTTPS("tcp", listenAddr, "Web", setting.CertFile, setting.KeyFile, m)
}
- err = runHTTPS("tcp", listenAddr, "Web", setting.CertFile, setting.KeyFile, m)
case setting.FCGI:
if handleRedirector {
NoHTTPRedirector()