V2bX/node/lego/lego_test.go
yuzuki999 15c36a9580 update
refactor limiter
fix getLink bug
add connection limit
move limit config to ControllerConfig
del dynamic speed limit (next version will be re add)
del online ip sync (next version will be re add)
2023-05-16 09:15:29 +08:00

41 lines
625 B
Go

package lego
import (
"github.com/Yuzuki616/V2bX/conf"
"log"
"os"
"testing"
)
var l *Lego
func init() {
var err error
l, err = New(&conf.CertConfig{
CertMode: "dns",
Email: "test@test.com",
CertDomain: "test.test.com",
Provider: "cloudflare",
DNSEnv: map[string]string{
"CF_DNS_API_TOKEN": "123",
},
CertFile: "./cert/1.pem",
KeyFile: "./cert/1.key",
})
if err != nil {
log.Println(err)
os.Exit(1)
}
}
func TestLego_CreateCertByDns(t *testing.T) {
err := l.CreateCert()
if err != nil {
t.Error(err)
}
}
func TestLego_RenewCert(t *testing.T) {
log.Println(l.RenewCert())
}