mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 21:28:30 +02:00
Added experimental acme renew from Let's Encrypt
This commit is contained in:
21
src/start.go
21
src/start.go
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"imuslab.com/zoraxy/mod/acme"
|
||||
"imuslab.com/zoraxy/mod/auth"
|
||||
"imuslab.com/zoraxy/mod/database"
|
||||
"imuslab.com/zoraxy/mod/dynamicproxy/redirection"
|
||||
@@ -95,13 +96,14 @@ func startupSequence() {
|
||||
}
|
||||
|
||||
/*
|
||||
Path Blocker
|
||||
Path Rules
|
||||
|
||||
This section of starutp script start the pathblocker
|
||||
from file.
|
||||
This section of starutp script start the path rules where
|
||||
user can define their own routing logics
|
||||
*/
|
||||
|
||||
pathRuleHandler = pathrule.NewPathBlocker(&pathrule.Options{
|
||||
pathRuleHandler = pathrule.NewPathRuleHandler(&pathrule.Options{
|
||||
Enabled: false,
|
||||
ConfigFolder: "./rules/pathrules",
|
||||
})
|
||||
|
||||
@@ -188,6 +190,17 @@ func startupSequence() {
|
||||
|
||||
//Create an analytic loader
|
||||
AnalyticLoader = analytic.NewDataLoader(sysdb, statisticCollector)
|
||||
|
||||
/*
|
||||
ACME API
|
||||
|
||||
Obtaining certificates from ACME Server
|
||||
*/
|
||||
acmeHandler = initACME()
|
||||
acmeAutoRenewer, err = acme.NewAutoRenewer("./rules/acme_conf.json", "./certs/", int64(*acmeAutoRenewInterval), acmeHandler)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// This sequence start after everything is initialized
|
||||
|
Reference in New Issue
Block a user