mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 13:39:53 +00:00
Merge pull request #105 from usual2970/feat/zerossl
Add zerossl provider
This commit is contained in:
commit
253075e7c0
1
go.mod
1
go.mod
@ -20,7 +20,6 @@ require (
|
||||
github.com/qiniu/go-sdk/v7 v7.22.0
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.992
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.992
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.992
|
||||
golang.org/x/crypto v0.26.0
|
||||
)
|
||||
|
||||
|
2
go.sum
2
go.sum
@ -388,8 +388,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.898 h1:LoYv
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.898/go.mod h1:c1j6YQ+vCbeA8kJ59Im4UnMd1GxovlpPBDhGZoewfn8=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.992 h1:A6O89OlCJQUpNxGqC/E5By04UNKBryIt5olQIGOx8mg=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.992/go.mod h1:BcvC7ZPdSlhRggVq4J1ToJlgv8bmODIAuSo0naFZOLo=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.992 h1:ttCM2rrkGipHMFTavrPExKCWcfNjT7AMQ5ERrPExdI4=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.992/go.mod h1:WtzarrflM+eoyD8vcRuIPd8fT5UXD4IhUry6iSAUnxc=
|
||||
github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM=
|
||||
github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
|
||||
github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=
|
||||
|
@ -1,11 +1,13 @@
|
||||
package applicant
|
||||
|
||||
import (
|
||||
"certimate/internal/utils/app"
|
||||
"crypto"
|
||||
"crypto/ecdsa"
|
||||
"crypto/elliptic"
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/go-acme/lego/v4/certcrypto"
|
||||
@ -25,6 +27,22 @@ const (
|
||||
configTypeGodaddy = "godaddy"
|
||||
)
|
||||
|
||||
const defaultSSLProvider = "letsencrypt"
|
||||
const (
|
||||
sslProviderLetsencrypt = "letsencrypt"
|
||||
sslProviderZeroSSL = "zerossl"
|
||||
)
|
||||
|
||||
const (
|
||||
zerosslUrl = "https://acme.zerossl.com/v2/DV90"
|
||||
letsencryptUrl = "https://acme-v02.api.letsencrypt.org/directory"
|
||||
)
|
||||
|
||||
var sslProviderUrls = map[string]string{
|
||||
sslProviderLetsencrypt: letsencryptUrl,
|
||||
sslProviderZeroSSL: zerosslUrl,
|
||||
}
|
||||
|
||||
const defaultEmail = "536464346@qq.com"
|
||||
|
||||
type Certificate struct {
|
||||
@ -92,7 +110,31 @@ func Get(record *models.Record) (Applicant, error) {
|
||||
|
||||
}
|
||||
|
||||
type SSLProviderConfig struct {
|
||||
Config SSLProviderConfigContent `json:"config"`
|
||||
Provider string `json:"provider"`
|
||||
}
|
||||
|
||||
type SSLProviderConfigContent struct {
|
||||
Zerossl struct {
|
||||
EabHmacKey string `json:"eabHmacKey"`
|
||||
EabKid string `json:"eabKid"`
|
||||
}
|
||||
}
|
||||
|
||||
func apply(option *ApplyOption, provider challenge.Provider) (*Certificate, error) {
|
||||
record, _ := app.GetApp().Dao().FindFirstRecordByFilter("settings", "name='ssl-provider'")
|
||||
|
||||
sslProvider := &SSLProviderConfig{
|
||||
Config: SSLProviderConfigContent{},
|
||||
Provider: defaultSSLProvider,
|
||||
}
|
||||
if record != nil {
|
||||
if err := record.UnmarshalJSONField("content", sslProvider); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -106,7 +148,7 @@ func apply(option *ApplyOption, provider challenge.Provider) (*Certificate, erro
|
||||
config := lego.NewConfig(&myUser)
|
||||
|
||||
// This CA URL is configured for a local dev instance of Boulder running in Docker in a VM.
|
||||
config.CADirURL = "https://acme-v02.api.letsencrypt.org/directory"
|
||||
config.CADirURL = sslProviderUrls[sslProvider.Provider]
|
||||
config.Certificate.KeyType = certcrypto.RSA2048
|
||||
|
||||
// A client facilitates communication with the CA server.
|
||||
@ -124,9 +166,9 @@ func apply(option *ApplyOption, provider challenge.Provider) (*Certificate, erro
|
||||
client.Challenge.SetDNS01Provider(provider, challengeOptions...)
|
||||
|
||||
// New users will need to register
|
||||
reg, err := client.Registration.Register(registration.RegisterOptions{TermsOfServiceAgreed: true})
|
||||
reg, err := getReg(client, sslProvider)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("failed to register: %w", err)
|
||||
}
|
||||
myUser.Registration = reg
|
||||
|
||||
@ -155,6 +197,33 @@ func apply(option *ApplyOption, provider challenge.Provider) (*Certificate, erro
|
||||
IssuerCertificate: string(certificates.IssuerCertificate),
|
||||
Csr: string(certificates.CSR),
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
func getReg(client *lego.Client, sslProvider *SSLProviderConfig) (*registration.Resource, error) {
|
||||
var reg *registration.Resource
|
||||
var err error
|
||||
switch sslProvider.Provider {
|
||||
case sslProviderZeroSSL:
|
||||
reg, err = client.Registration.RegisterWithExternalAccountBinding(registration.RegisterEABOptions{
|
||||
TermsOfServiceAgreed: true,
|
||||
Kid: sslProvider.Config.Zerossl.EabKid,
|
||||
HmacEncoded: sslProvider.Config.Zerossl.EabHmacKey,
|
||||
})
|
||||
|
||||
case sslProviderLetsencrypt:
|
||||
reg, err = client.Registration.Register(registration.RegisterOptions{TermsOfServiceAgreed: true})
|
||||
|
||||
default:
|
||||
err = errors.New("unknown ssl provider")
|
||||
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return reg, nil
|
||||
}
|
||||
|
||||
func ParseNameservers(ns string) []string {
|
||||
|
308
ui/dist/assets/index-B-WSkv0U.js
vendored
308
ui/dist/assets/index-B-WSkv0U.js
vendored
File diff suppressed because one or more lines are too long
1
ui/dist/assets/index-BLt37AhW.css
vendored
1
ui/dist/assets/index-BLt37AhW.css
vendored
File diff suppressed because one or more lines are too long
313
ui/dist/assets/index-C_Xz8zGf.js
vendored
Normal file
313
ui/dist/assets/index-C_Xz8zGf.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ui/dist/assets/index-Djc_JtNf.css
vendored
Normal file
1
ui/dist/assets/index-Djc_JtNf.css
vendored
Normal file
File diff suppressed because one or more lines are too long
18
ui/dist/imgs/providers/letsencrypt.svg
vendored
Normal file
18
ui/dist/imgs/providers/letsencrypt.svg
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="96" height="96">
|
||||
<path d="M0 0 C3.96616708 2.87966696 6.94216973 6.71174376 8.75390625 11.2734375 C8.94921875 14.2890625 8.94921875 14.2890625 8.87890625 17.5234375 C8.86085937 18.60109375 8.8428125 19.67875 8.82421875 20.7890625 C8.80101562 21.60890625 8.7778125 22.42875 8.75390625 23.2734375 C9.86765625 23.2321875 10.98140625 23.1909375 12.12890625 23.1484375 C15.75390625 23.2734375 15.75390625 23.2734375 17.75390625 25.2734375 C17.94178314 28.33535881 18.00936994 31.30529877 17.984375 34.3671875 C17.98391678 35.2696521 17.98345856 36.1721167 17.98298645 37.10192871 C17.97996265 39.01181349 17.97207256 40.92169577 17.9597168 42.83154297 C17.94148066 45.76148172 17.93920695 48.69110422 17.93945312 51.62109375 C17.93453722 53.47396108 17.92870858 55.32682625 17.921875 57.1796875 C17.92076218 58.05991577 17.91964935 58.94014404 17.91850281 59.8470459 C17.86996885 66.04131231 17.86996885 66.04131231 16.75390625 68.2734375 C-1.72609375 68.2734375 -20.20609375 68.2734375 -39.24609375 68.2734375 C-40.95558713 64.85445075 -40.40930624 60.94182137 -40.4140625 57.1796875 C-40.4173909 56.2772229 -40.4207193 55.3747583 -40.42414856 54.44494629 C-40.42921569 52.53508006 -40.43155695 50.62520497 -40.43139648 48.71533203 C-40.43358486 45.78533449 -40.45174793 42.85571222 -40.47070312 39.92578125 C-40.47363664 38.07291796 -40.47562172 36.22005287 -40.4765625 34.3671875 C-40.48374802 33.48695923 -40.49093353 32.60673096 -40.49833679 31.6998291 C-40.47491923 25.50226298 -40.47491923 25.50226298 -38.24609375 23.2734375 C-34.62109375 23.1484375 -34.62109375 23.1484375 -31.24609375 23.2734375 C-31.30410156 22.5 -31.36210937 21.7265625 -31.421875 20.9296875 C-31.73940921 13.59918343 -31.17057807 8.85901698 -26.24609375 3.2734375 C-18.78730361 -3.81241313 -9.01893001 -5.1380571 0 0 Z M-19.24609375 15.2734375 C-19.24609375 17.9134375 -19.24609375 20.5534375 -19.24609375 23.2734375 C-13.96609375 23.2734375 -8.68609375 23.2734375 -3.24609375 23.2734375 C-2.47540396 15.74874343 -2.47540396 15.74874343 -5.37109375 12.2734375 C-8.09392313 10.10082379 -8.09392313 10.10082379 -11.24609375 9.6484375 C-15.38792256 10.5113185 -16.80835846 11.83192885 -19.24609375 15.2734375 Z M-11.24609375 39.2734375 C-11.24609375 44.5534375 -11.24609375 49.8334375 -11.24609375 55.2734375 C-10.58609375 54.9434375 -9.92609375 54.6134375 -9.24609375 54.2734375 C-8.89430178 51.9428157 -8.56279196 49.60908683 -8.24609375 47.2734375 C-7.18359375 44.8359375 -7.18359375 44.8359375 -6.24609375 43.2734375 C-7.60933118 41.2334656 -7.60933118 41.2334656 -9.24609375 39.2734375 C-9.90609375 39.2734375 -10.56609375 39.2734375 -11.24609375 39.2734375 Z " fill="#10376E" transform="translate(59.24609375,27.7265625)"/>
|
||||
<path d="M0 0 C1.12067871 0.01047363 2.24135742 0.02094727 3.39599609 0.03173828 C5.21357422 0.04140625 5.21357422 0.04140625 7.06787109 0.05126953 C8.33888672 0.06802734 9.60990234 0.08478516 10.91943359 0.10205078 C12.19818359 0.11107422 13.47693359 0.12009766 14.79443359 0.12939453 C17.96128526 0.15302775 21.12776783 0.18597449 24.29443359 0.22705078 C24.4024195 2.66573246 24.48169949 5.09964212 24.54443359 7.53955078 C24.59470703 8.57499023 24.59470703 8.57499023 24.64599609 9.63134766 C24.68505859 11.65283203 24.68505859 11.65283203 24.29443359 15.22705078 C22.27880859 17.20751953 22.27880859 17.20751953 20.29443359 18.22705078 C20.7362031 21.76120687 21.41676358 24.50596315 22.85693359 27.78955078 C24.29443359 32.22705078 24.29443359 32.22705078 24.29443359 45.22705078 C15.05443359 45.22705078 5.81443359 45.22705078 -3.70556641 45.22705078 C-5.41505978 41.80806403 -4.8687789 37.89543466 -4.87353516 34.13330078 C-4.87686356 33.23083618 -4.88019196 32.32837158 -4.88362122 31.39855957 C-4.88868835 29.48869334 -4.89102961 27.57881825 -4.89086914 25.66894531 C-4.89305752 22.73894777 -4.91122059 19.8093255 -4.93017578 16.87939453 C-4.9331093 15.02653124 -4.93509437 13.17366616 -4.93603516 11.32080078 C-4.94322067 10.44057251 -4.95040619 9.56034424 -4.95780945 8.65344238 C-4.92667455 0.41344589 -4.92667455 0.41344589 0 0 Z " fill="#0F3161" transform="translate(23.70556640625,50.77294921875)"/>
|
||||
<path d="M0 0 C3.95863415 2.87419762 6.96698604 6.71040909 8.75390625 11.2734375 C8.94921875 14.5078125 8.94921875 14.5078125 8.87890625 18.0234375 C8.86085937 19.19390625 8.8428125 20.364375 8.82421875 21.5703125 C8.80101562 22.46234375 8.7778125 23.354375 8.75390625 24.2734375 C4.79390625 24.2734375 0.83390625 24.2734375 -3.24609375 24.2734375 C-3.32859375 22.8709375 -3.41109375 21.4684375 -3.49609375 20.0234375 C-3.85974947 16.86013089 -4.14926646 15.42047154 -5.93359375 12.7109375 C-8.99476118 10.80804964 -10.701589 10.68268671 -14.24609375 11.2734375 C-16.74330199 12.6018971 -16.74330199 12.6018971 -18.24609375 15.2734375 C-18.86751236 18.3074225 -19.06322936 21.16474289 -19.24609375 24.2734375 C-23.20609375 24.2734375 -27.16609375 24.2734375 -31.24609375 24.2734375 C-32.16565531 10.86827339 -32.16565531 10.86827339 -27.671875 4.85546875 C-20.21832025 -3.41491392 -9.84160472 -5.60673239 0 0 Z " fill="#F3A006" transform="translate(59.24609375,27.7265625)"/>
|
||||
<path d="M0 0 C0 3.96 0 7.92 0 12 C-1.4540625 12.680625 -1.4540625 12.680625 -2.9375 13.375 C-6.07079582 14.65786221 -6.07079582 14.65786221 -7 17 C-7.22467831 18.53668865 -7.40796805 20.07968054 -7.5625 21.625 C-7.706875 23.06875 -7.85125 24.5125 -8 26 C-11.96 26 -15.92 26 -20 26 C-20.91789085 12.61919109 -20.91789085 12.61919109 -16.4375 6.5859375 C-11.06401953 0.65758677 -7.616909 -0.12285337 0 0 Z " fill="#D58C05" transform="translate(48,26)"/>
|
||||
<path d="M0 0 C0.75 1.6875 0.75 1.6875 1 4 C-1.81446105 8.64997913 -6.25914236 12.37140566 -11 15 C-14 14.875 -14 14.875 -16 14 C-16.80078125 11.796875 -16.80078125 11.796875 -17 9 C-14.98046875 6.578125 -14.98046875 6.578125 -12.1875 4.25 C-10.81658203 3.08210938 -10.81658203 3.08210938 -9.41796875 1.890625 C-5.71909434 -1.00154821 -4.50480579 -1.06692769 0 0 Z " fill="#DA9004" transform="translate(82,13)"/>
|
||||
<path d="M0 0 C5.0875582 0.44824301 7.6553513 1.85561989 11.4375 5.25 C12.32308594 6.01828125 13.20867188 6.7865625 14.12109375 7.578125 C16 10 16 10 15.78515625 12.796875 C15.52605469 13.52390625 15.26695313 14.2509375 15 15 C12.859375 15.76171875 12.859375 15.76171875 10 16 C7.140625 14.26953125 7.140625 14.26953125 4.25 11.8125 C3.28578125 11.01457031 2.3215625 10.21664063 1.328125 9.39453125 C-1.92423854 6.04939896 -1.92423854 6.04939896 -2 3 C-1.34 2.01 -0.68 1.02 0 0 Z " fill="#DA8F04" transform="translate(15,12)"/>
|
||||
<path d="M0 0 C3 0.125 3 0.125 4 1.125 C4.07325168 3.98767567 4.09238205 6.825719 4.0625 9.6875 C4.05798828 10.49380859 4.05347656 11.30011719 4.04882812 12.13085938 C4.03700518 14.12893756 4.01906914 16.12697783 4 18.125 C1.6875 19.25 1.6875 19.25 -1 20.125 C-1.99 19.465 -2.98 18.805 -4 18.125 C-4.24817926 15.19116664 -4.32643881 12.48867315 -4.25 9.5625 C-4.24484375 8.76908203 -4.2396875 7.97566406 -4.234375 7.15820312 C-4.13892499 0.17245521 -4.13892499 0.17245521 0 0 Z " fill="#F5A105" transform="translate(48,-0.125)"/>
|
||||
<path d="M0 0 C0.79792969 0.00386719 1.59585938 0.00773437 2.41796875 0.01171875 C3.21589844 0.00785156 4.01382813 0.00398438 4.8359375 0 C10.79136108 0.01011108 10.79136108 0.01011108 11.91796875 1.13671875 C11.95877658 3.13630239 11.96051231 5.13717129 11.91796875 7.13671875 C8.88367198 8.65386714 5.74195208 8.28035791 2.41796875 8.26171875 C1.72832031 8.26558594 1.03867188 8.26945312 0.328125 8.2734375 C-4.82869832 8.26338521 -4.82869832 8.26338521 -7.08203125 7.13671875 C-7.12457481 5.13717129 -7.12283908 3.13630239 -7.08203125 1.13671875 C-5.19650595 -0.74880655 -2.50434294 0.00425186 0 0 Z " fill="#DA9104" transform="translate(81.08203125,38.86328125)"/>
|
||||
<path d="M0 0 C0.79792969 0.00386719 1.59585937 0.00773437 2.41796875 0.01171875 C3.21589844 0.00785156 4.01382812 0.00398438 4.8359375 0 C10.79136108 0.01011108 10.79136108 0.01011108 11.91796875 1.13671875 C12.16796875 3.57421875 12.16796875 3.57421875 11.91796875 6.13671875 C8.21555593 8.60499397 6.25885765 8.37430901 1.85546875 8.32421875 C-0.01818359 8.31455078 -0.01818359 8.31455078 -1.9296875 8.3046875 C-5.08203125 8.13671875 -5.08203125 8.13671875 -7.08203125 7.13671875 C-7.12457481 5.13717129 -7.12283908 3.13630239 -7.08203125 1.13671875 C-5.19650595 -0.74880655 -2.50434294 0.00425186 0 0 Z " fill="#D98F04" transform="translate(10.08203125,38.86328125)"/>
|
||||
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C0.62661079 5.37336228 -1.26467582 7.51333672 -4.8125 10.375 C-6.09060547 11.43847656 -6.09060547 11.43847656 -7.39453125 12.5234375 C-10 14 -10 14 -12.82421875 13.7265625 C-13.90123047 13.36691406 -13.90123047 13.36691406 -15 13 C-10.43369266 8.12927217 -5.25023461 4.10843602 0 0 Z " fill="#F4A005" transform="translate(81,14)"/>
|
||||
<path d="M0 0 C0.99 0 1.98 0 3 0 C3 6.6 3 13.2 3 20 C1.68 19.34 0.36 18.68 -1 18 C-1.02684312 15.18743719 -1.04676188 12.37512759 -1.0625 9.5625 C-1.07087891 8.76005859 -1.07925781 7.95761719 -1.08789062 7.13085938 C-1.0965143 5.08704779 -1.0522815 3.04316098 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#D88E04" transform="translate(45,0)"/>
|
||||
<path d="M0 0 C5.23589631 0.4222497 7.61710401 1.95695114 11.375 5.5625 C12.24898437 6.38878906 13.12296875 7.21507812 14.0234375 8.06640625 C14.67570312 8.70449219 15.32796875 9.34257812 16 10 C15.67 11.32 15.34 12.64 15 14 C9.66666667 10 4.33333333 6 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z " fill="#F4A005" transform="translate(15,12)"/>
|
||||
<path d="M0 0 C5.61 0 11.22 0 17 0 C17.33 0.99 17.66 1.98 18 3 C11.73 3 5.46 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#F4A005" transform="translate(75,39)"/>
|
||||
<path d="M0 0 C5.61 0 11.22 0 17 0 C17.33 0.99 17.66 1.98 18 3 C11.73 3 5.46 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#F4A005" transform="translate(4,39)"/>
|
||||
<path d="M0 0 C0 5.61 0 11.22 0 17 C-2 16 -2 16 -3.0625 12.8125 C-3.371875 11.554375 -3.68125 10.29625 -4 9 C-4.268125 7.9275 -4.53625 6.855 -4.8125 5.75 C-5 3 -5 3 -3.6875 1.125 C-2 0 -2 0 0 0 Z " fill="#D6D7D9" transform="translate(48,66)"/>
|
||||
</svg>
|
After Width: | Height: | Size: 9.8 KiB |
1
ui/dist/imgs/providers/zerossl.svg
vendored
Normal file
1
ui/dist/imgs/providers/zerossl.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg height="500" width="500" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h500v500c-165 0-330 0-500 0 0-165 0-330 0-500z" fill="#4d70d5"/><path d="m0 0h86v85h85v85h85v86c-28.05 0-56.1 0-85 0v85c-28.05 0-56.1 0-85 0 0-28.05 0-56.1 0-85-28.05 0-56.1 0-85 0v85c-28.38 0-56.76 0-86 0 0-28.38 0-56.76 0-86h85c0-28.05 0-56.1 0-85-27.72 0-55.44 0-84 0 0-28.05 0-56.1 0-85h84c0-28.05 0-56.1 0-85z" fill="#fefefe" transform="translate(175 76)"/><path d="m0 0h1v84h85v1c-28.05 0-56.1 0-85 0v85c-28.38 0-56.76 0-86 0 0-28.38 0-56.76 0-86h85c0-27.72 0-55.44 0-84zm-84 85v84h84c0-27.72 0-55.44 0-84-27.72 0-55.44 0-84 0z" fill="#bcc9ef" transform="translate(175 247)"/></svg>
|
After Width: | Height: | Size: 666 B |
4
ui/dist/index.html
vendored
4
ui/dist/index.html
vendored
@ -5,8 +5,8 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Certimate - Your Trusted SSL Automation Partner</title>
|
||||
<script type="module" crossorigin src="/assets/index-B-WSkv0U.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BLt37AhW.css">
|
||||
<script type="module" crossorigin src="/assets/index-C_Xz8zGf.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Djc_JtNf.css">
|
||||
</head>
|
||||
<body class="bg-background">
|
||||
<div id="root"></div>
|
||||
|
18
ui/public/imgs/providers/letsencrypt.svg
Normal file
18
ui/public/imgs/providers/letsencrypt.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="96" height="96">
|
||||
<path d="M0 0 C3.96616708 2.87966696 6.94216973 6.71174376 8.75390625 11.2734375 C8.94921875 14.2890625 8.94921875 14.2890625 8.87890625 17.5234375 C8.86085937 18.60109375 8.8428125 19.67875 8.82421875 20.7890625 C8.80101562 21.60890625 8.7778125 22.42875 8.75390625 23.2734375 C9.86765625 23.2321875 10.98140625 23.1909375 12.12890625 23.1484375 C15.75390625 23.2734375 15.75390625 23.2734375 17.75390625 25.2734375 C17.94178314 28.33535881 18.00936994 31.30529877 17.984375 34.3671875 C17.98391678 35.2696521 17.98345856 36.1721167 17.98298645 37.10192871 C17.97996265 39.01181349 17.97207256 40.92169577 17.9597168 42.83154297 C17.94148066 45.76148172 17.93920695 48.69110422 17.93945312 51.62109375 C17.93453722 53.47396108 17.92870858 55.32682625 17.921875 57.1796875 C17.92076218 58.05991577 17.91964935 58.94014404 17.91850281 59.8470459 C17.86996885 66.04131231 17.86996885 66.04131231 16.75390625 68.2734375 C-1.72609375 68.2734375 -20.20609375 68.2734375 -39.24609375 68.2734375 C-40.95558713 64.85445075 -40.40930624 60.94182137 -40.4140625 57.1796875 C-40.4173909 56.2772229 -40.4207193 55.3747583 -40.42414856 54.44494629 C-40.42921569 52.53508006 -40.43155695 50.62520497 -40.43139648 48.71533203 C-40.43358486 45.78533449 -40.45174793 42.85571222 -40.47070312 39.92578125 C-40.47363664 38.07291796 -40.47562172 36.22005287 -40.4765625 34.3671875 C-40.48374802 33.48695923 -40.49093353 32.60673096 -40.49833679 31.6998291 C-40.47491923 25.50226298 -40.47491923 25.50226298 -38.24609375 23.2734375 C-34.62109375 23.1484375 -34.62109375 23.1484375 -31.24609375 23.2734375 C-31.30410156 22.5 -31.36210937 21.7265625 -31.421875 20.9296875 C-31.73940921 13.59918343 -31.17057807 8.85901698 -26.24609375 3.2734375 C-18.78730361 -3.81241313 -9.01893001 -5.1380571 0 0 Z M-19.24609375 15.2734375 C-19.24609375 17.9134375 -19.24609375 20.5534375 -19.24609375 23.2734375 C-13.96609375 23.2734375 -8.68609375 23.2734375 -3.24609375 23.2734375 C-2.47540396 15.74874343 -2.47540396 15.74874343 -5.37109375 12.2734375 C-8.09392313 10.10082379 -8.09392313 10.10082379 -11.24609375 9.6484375 C-15.38792256 10.5113185 -16.80835846 11.83192885 -19.24609375 15.2734375 Z M-11.24609375 39.2734375 C-11.24609375 44.5534375 -11.24609375 49.8334375 -11.24609375 55.2734375 C-10.58609375 54.9434375 -9.92609375 54.6134375 -9.24609375 54.2734375 C-8.89430178 51.9428157 -8.56279196 49.60908683 -8.24609375 47.2734375 C-7.18359375 44.8359375 -7.18359375 44.8359375 -6.24609375 43.2734375 C-7.60933118 41.2334656 -7.60933118 41.2334656 -9.24609375 39.2734375 C-9.90609375 39.2734375 -10.56609375 39.2734375 -11.24609375 39.2734375 Z " fill="#10376E" transform="translate(59.24609375,27.7265625)"/>
|
||||
<path d="M0 0 C1.12067871 0.01047363 2.24135742 0.02094727 3.39599609 0.03173828 C5.21357422 0.04140625 5.21357422 0.04140625 7.06787109 0.05126953 C8.33888672 0.06802734 9.60990234 0.08478516 10.91943359 0.10205078 C12.19818359 0.11107422 13.47693359 0.12009766 14.79443359 0.12939453 C17.96128526 0.15302775 21.12776783 0.18597449 24.29443359 0.22705078 C24.4024195 2.66573246 24.48169949 5.09964212 24.54443359 7.53955078 C24.59470703 8.57499023 24.59470703 8.57499023 24.64599609 9.63134766 C24.68505859 11.65283203 24.68505859 11.65283203 24.29443359 15.22705078 C22.27880859 17.20751953 22.27880859 17.20751953 20.29443359 18.22705078 C20.7362031 21.76120687 21.41676358 24.50596315 22.85693359 27.78955078 C24.29443359 32.22705078 24.29443359 32.22705078 24.29443359 45.22705078 C15.05443359 45.22705078 5.81443359 45.22705078 -3.70556641 45.22705078 C-5.41505978 41.80806403 -4.8687789 37.89543466 -4.87353516 34.13330078 C-4.87686356 33.23083618 -4.88019196 32.32837158 -4.88362122 31.39855957 C-4.88868835 29.48869334 -4.89102961 27.57881825 -4.89086914 25.66894531 C-4.89305752 22.73894777 -4.91122059 19.8093255 -4.93017578 16.87939453 C-4.9331093 15.02653124 -4.93509437 13.17366616 -4.93603516 11.32080078 C-4.94322067 10.44057251 -4.95040619 9.56034424 -4.95780945 8.65344238 C-4.92667455 0.41344589 -4.92667455 0.41344589 0 0 Z " fill="#0F3161" transform="translate(23.70556640625,50.77294921875)"/>
|
||||
<path d="M0 0 C3.95863415 2.87419762 6.96698604 6.71040909 8.75390625 11.2734375 C8.94921875 14.5078125 8.94921875 14.5078125 8.87890625 18.0234375 C8.86085937 19.19390625 8.8428125 20.364375 8.82421875 21.5703125 C8.80101562 22.46234375 8.7778125 23.354375 8.75390625 24.2734375 C4.79390625 24.2734375 0.83390625 24.2734375 -3.24609375 24.2734375 C-3.32859375 22.8709375 -3.41109375 21.4684375 -3.49609375 20.0234375 C-3.85974947 16.86013089 -4.14926646 15.42047154 -5.93359375 12.7109375 C-8.99476118 10.80804964 -10.701589 10.68268671 -14.24609375 11.2734375 C-16.74330199 12.6018971 -16.74330199 12.6018971 -18.24609375 15.2734375 C-18.86751236 18.3074225 -19.06322936 21.16474289 -19.24609375 24.2734375 C-23.20609375 24.2734375 -27.16609375 24.2734375 -31.24609375 24.2734375 C-32.16565531 10.86827339 -32.16565531 10.86827339 -27.671875 4.85546875 C-20.21832025 -3.41491392 -9.84160472 -5.60673239 0 0 Z " fill="#F3A006" transform="translate(59.24609375,27.7265625)"/>
|
||||
<path d="M0 0 C0 3.96 0 7.92 0 12 C-1.4540625 12.680625 -1.4540625 12.680625 -2.9375 13.375 C-6.07079582 14.65786221 -6.07079582 14.65786221 -7 17 C-7.22467831 18.53668865 -7.40796805 20.07968054 -7.5625 21.625 C-7.706875 23.06875 -7.85125 24.5125 -8 26 C-11.96 26 -15.92 26 -20 26 C-20.91789085 12.61919109 -20.91789085 12.61919109 -16.4375 6.5859375 C-11.06401953 0.65758677 -7.616909 -0.12285337 0 0 Z " fill="#D58C05" transform="translate(48,26)"/>
|
||||
<path d="M0 0 C0.75 1.6875 0.75 1.6875 1 4 C-1.81446105 8.64997913 -6.25914236 12.37140566 -11 15 C-14 14.875 -14 14.875 -16 14 C-16.80078125 11.796875 -16.80078125 11.796875 -17 9 C-14.98046875 6.578125 -14.98046875 6.578125 -12.1875 4.25 C-10.81658203 3.08210938 -10.81658203 3.08210938 -9.41796875 1.890625 C-5.71909434 -1.00154821 -4.50480579 -1.06692769 0 0 Z " fill="#DA9004" transform="translate(82,13)"/>
|
||||
<path d="M0 0 C5.0875582 0.44824301 7.6553513 1.85561989 11.4375 5.25 C12.32308594 6.01828125 13.20867188 6.7865625 14.12109375 7.578125 C16 10 16 10 15.78515625 12.796875 C15.52605469 13.52390625 15.26695313 14.2509375 15 15 C12.859375 15.76171875 12.859375 15.76171875 10 16 C7.140625 14.26953125 7.140625 14.26953125 4.25 11.8125 C3.28578125 11.01457031 2.3215625 10.21664063 1.328125 9.39453125 C-1.92423854 6.04939896 -1.92423854 6.04939896 -2 3 C-1.34 2.01 -0.68 1.02 0 0 Z " fill="#DA8F04" transform="translate(15,12)"/>
|
||||
<path d="M0 0 C3 0.125 3 0.125 4 1.125 C4.07325168 3.98767567 4.09238205 6.825719 4.0625 9.6875 C4.05798828 10.49380859 4.05347656 11.30011719 4.04882812 12.13085938 C4.03700518 14.12893756 4.01906914 16.12697783 4 18.125 C1.6875 19.25 1.6875 19.25 -1 20.125 C-1.99 19.465 -2.98 18.805 -4 18.125 C-4.24817926 15.19116664 -4.32643881 12.48867315 -4.25 9.5625 C-4.24484375 8.76908203 -4.2396875 7.97566406 -4.234375 7.15820312 C-4.13892499 0.17245521 -4.13892499 0.17245521 0 0 Z " fill="#F5A105" transform="translate(48,-0.125)"/>
|
||||
<path d="M0 0 C0.79792969 0.00386719 1.59585938 0.00773437 2.41796875 0.01171875 C3.21589844 0.00785156 4.01382813 0.00398438 4.8359375 0 C10.79136108 0.01011108 10.79136108 0.01011108 11.91796875 1.13671875 C11.95877658 3.13630239 11.96051231 5.13717129 11.91796875 7.13671875 C8.88367198 8.65386714 5.74195208 8.28035791 2.41796875 8.26171875 C1.72832031 8.26558594 1.03867188 8.26945312 0.328125 8.2734375 C-4.82869832 8.26338521 -4.82869832 8.26338521 -7.08203125 7.13671875 C-7.12457481 5.13717129 -7.12283908 3.13630239 -7.08203125 1.13671875 C-5.19650595 -0.74880655 -2.50434294 0.00425186 0 0 Z " fill="#DA9104" transform="translate(81.08203125,38.86328125)"/>
|
||||
<path d="M0 0 C0.79792969 0.00386719 1.59585937 0.00773437 2.41796875 0.01171875 C3.21589844 0.00785156 4.01382812 0.00398438 4.8359375 0 C10.79136108 0.01011108 10.79136108 0.01011108 11.91796875 1.13671875 C12.16796875 3.57421875 12.16796875 3.57421875 11.91796875 6.13671875 C8.21555593 8.60499397 6.25885765 8.37430901 1.85546875 8.32421875 C-0.01818359 8.31455078 -0.01818359 8.31455078 -1.9296875 8.3046875 C-5.08203125 8.13671875 -5.08203125 8.13671875 -7.08203125 7.13671875 C-7.12457481 5.13717129 -7.12283908 3.13630239 -7.08203125 1.13671875 C-5.19650595 -0.74880655 -2.50434294 0.00425186 0 0 Z " fill="#D98F04" transform="translate(10.08203125,38.86328125)"/>
|
||||
<path d="M0 0 C0.66 0.33 1.32 0.66 2 1 C0.62661079 5.37336228 -1.26467582 7.51333672 -4.8125 10.375 C-6.09060547 11.43847656 -6.09060547 11.43847656 -7.39453125 12.5234375 C-10 14 -10 14 -12.82421875 13.7265625 C-13.90123047 13.36691406 -13.90123047 13.36691406 -15 13 C-10.43369266 8.12927217 -5.25023461 4.10843602 0 0 Z " fill="#F4A005" transform="translate(81,14)"/>
|
||||
<path d="M0 0 C0.99 0 1.98 0 3 0 C3 6.6 3 13.2 3 20 C1.68 19.34 0.36 18.68 -1 18 C-1.02684312 15.18743719 -1.04676188 12.37512759 -1.0625 9.5625 C-1.07087891 8.76005859 -1.07925781 7.95761719 -1.08789062 7.13085938 C-1.0965143 5.08704779 -1.0522815 3.04316098 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z " fill="#D88E04" transform="translate(45,0)"/>
|
||||
<path d="M0 0 C5.23589631 0.4222497 7.61710401 1.95695114 11.375 5.5625 C12.24898437 6.38878906 13.12296875 7.21507812 14.0234375 8.06640625 C14.67570312 8.70449219 15.32796875 9.34257812 16 10 C15.67 11.32 15.34 12.64 15 14 C9.66666667 10 4.33333333 6 -1 2 C-0.67 1.34 -0.34 0.68 0 0 Z " fill="#F4A005" transform="translate(15,12)"/>
|
||||
<path d="M0 0 C5.61 0 11.22 0 17 0 C17.33 0.99 17.66 1.98 18 3 C11.73 3 5.46 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#F4A005" transform="translate(75,39)"/>
|
||||
<path d="M0 0 C5.61 0 11.22 0 17 0 C17.33 0.99 17.66 1.98 18 3 C11.73 3 5.46 3 -1 3 C-0.67 2.01 -0.34 1.02 0 0 Z " fill="#F4A005" transform="translate(4,39)"/>
|
||||
<path d="M0 0 C0 5.61 0 11.22 0 17 C-2 16 -2 16 -3.0625 12.8125 C-3.371875 11.554375 -3.68125 10.29625 -4 9 C-4.268125 7.9275 -4.53625 6.855 -4.8125 5.75 C-5 3 -5 3 -3.6875 1.125 C-2 0 -2 0 0 0 Z " fill="#D6D7D9" transform="translate(48,66)"/>
|
||||
</svg>
|
After Width: | Height: | Size: 9.8 KiB |
1
ui/public/imgs/providers/zerossl.svg
Normal file
1
ui/public/imgs/providers/zerossl.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg height="500" width="500" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h500v500c-165 0-330 0-500 0 0-165 0-330 0-500z" fill="#4d70d5"/><path d="m0 0h86v85h85v85h85v86c-28.05 0-56.1 0-85 0v85c-28.05 0-56.1 0-85 0 0-28.05 0-56.1 0-85-28.05 0-56.1 0-85 0v85c-28.38 0-56.76 0-86 0 0-28.38 0-56.76 0-86h85c0-28.05 0-56.1 0-85-27.72 0-55.44 0-84 0 0-28.05 0-56.1 0-85h84c0-28.05 0-56.1 0-85z" fill="#fefefe" transform="translate(175 76)"/><path d="m0 0h1v84h85v1c-28.05 0-56.1 0-85 0v85c-28.38 0-56.76 0-86 0 0-28.38 0-56.76 0-86h85c0-27.72 0-55.44 0-84zm-84 85v84h84c0-27.72 0-55.44 0-84-27.72 0-55.44 0-84 0z" fill="#bcc9ef" transform="translate(175 247)"/></svg>
|
After Width: | Height: | Size: 666 B |
@ -1,7 +1,11 @@
|
||||
export type Setting = {
|
||||
id?: string;
|
||||
name?: string;
|
||||
content?: EmailsSetting | NotifyTemplates | NotifyChannels;
|
||||
content?:
|
||||
| EmailsSetting
|
||||
| NotifyTemplates
|
||||
| NotifyChannels
|
||||
| SSLProviderSetting;
|
||||
};
|
||||
|
||||
export type EmailsSetting = {
|
||||
@ -49,3 +53,14 @@ export const defaultNotifyTemplate: NotifyTemplate = {
|
||||
title: "您有{COUNT}张证书即将过期",
|
||||
content: "有{COUNT}张证书即将过期,域名分别为{DOMAINS},请保持关注!",
|
||||
};
|
||||
|
||||
export type SSLProvider = "letsencrypt" | "zerossl";
|
||||
|
||||
export type SSLProviderSetting = {
|
||||
provider: SSLProvider;
|
||||
config: {
|
||||
[key: string]: {
|
||||
[key: string]: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { KeyRound, Megaphone, UserRound } from "lucide-react";
|
||||
import { KeyRound, Megaphone, ShieldCheck, UserRound } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
@ -56,6 +56,16 @@ const SettingLayout = () => {
|
||||
<Megaphone size={14} />
|
||||
<div className="ml-1">消息推送</div>
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
value="ssl-provider"
|
||||
onClick={() => {
|
||||
navigate("/setting/ssl-provider");
|
||||
}}
|
||||
className="px-5"
|
||||
>
|
||||
<ShieldCheck size={14} />
|
||||
<div className="ml-1">证书厂商</div>
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value={tabValue}>
|
||||
<div className="mt-5 w-full md:w-[45em]">
|
||||
|
247
ui/src/pages/setting/SSLProvider.tsx
Normal file
247
ui/src/pages/setting/SSLProvider.tsx
Normal file
@ -0,0 +1,247 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
|
||||
import {
|
||||
SSLProvider as SSLProviderType,
|
||||
SSLProviderSetting,
|
||||
Setting,
|
||||
} from "@/domain/settings";
|
||||
import { getErrMessage } from "@/lib/error";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
import { getSetting, update } from "@/repository/settings";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
const formSchema = z.object({
|
||||
provider: z.enum(["letsencrypt", "zerossl"], {
|
||||
message: "请选择SSL提供商",
|
||||
}),
|
||||
eabKid: z.string().optional(),
|
||||
eabHmacKey: z.string().optional(),
|
||||
});
|
||||
|
||||
const SSLProvider = () => {
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
provider: "letsencrypt",
|
||||
},
|
||||
});
|
||||
|
||||
const [provider, setProvider] = useState("letsencrypt");
|
||||
|
||||
const [config, setConfig] = useState<Setting>();
|
||||
|
||||
const { toast } = useToast();
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const setting = await getSetting("ssl-provider");
|
||||
|
||||
if (setting) {
|
||||
setConfig(setting);
|
||||
const content = setting.content as SSLProviderSetting;
|
||||
|
||||
form.setValue("provider", content.provider);
|
||||
form.setValue("eabKid", content.config[content.provider].eabKid);
|
||||
form.setValue(
|
||||
"eabHmacKey",
|
||||
content.config[content.provider].eabHmacKey
|
||||
);
|
||||
setProvider(content.provider);
|
||||
} else {
|
||||
form.setValue("provider", "letsencrypt");
|
||||
setProvider("letsencrypt");
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const getOptionCls = (val: string) => {
|
||||
if (provider === val) {
|
||||
return "border-primary";
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
const onSubmit = async (values: z.infer<typeof formSchema>) => {
|
||||
if (values.provider === "zerossl") {
|
||||
if (!values.eabKid) {
|
||||
form.setError("eabKid", {
|
||||
message: "请输入EAB_KID和EAB_HMAC_KEY",
|
||||
});
|
||||
}
|
||||
if (!values.eabHmacKey) {
|
||||
form.setError("eabHmacKey", {
|
||||
message: "请输入EAB_KID和EAB_HMAC_KEY",
|
||||
});
|
||||
}
|
||||
if (!values.eabKid || !values.eabHmacKey) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const setting: Setting = {
|
||||
id: config?.id,
|
||||
name: "ssl-provider",
|
||||
content: {
|
||||
provider: values.provider,
|
||||
config: {
|
||||
letsencrypt: {},
|
||||
zerossl: {
|
||||
eabKid: values.eabKid ?? "",
|
||||
eabHmacKey: values.eabHmacKey ?? "",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
await update(setting);
|
||||
toast({
|
||||
title: "修改成功",
|
||||
description: "修改成功",
|
||||
});
|
||||
} catch (e) {
|
||||
const message = getErrMessage(e);
|
||||
toast({
|
||||
title: "修改失败",
|
||||
description: message,
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="w-full md:max-w-[35em]">
|
||||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8 dark:text-stone-200"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="provider"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>证书厂商</FormLabel>
|
||||
<FormControl>
|
||||
<RadioGroup
|
||||
{...field}
|
||||
className="flex"
|
||||
onValueChange={(val) => {
|
||||
setProvider(val);
|
||||
form.setValue("provider", val as SSLProviderType);
|
||||
}}
|
||||
value={provider}
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
<RadioGroupItem value="letsencrypt" id="letsencrypt" />
|
||||
<Label htmlFor="letsencrypt">
|
||||
<div
|
||||
className={cn(
|
||||
"flex items-center space-x-2 border p-2 rounded cursor-pointer",
|
||||
getOptionCls("letsencrypt")
|
||||
)}
|
||||
>
|
||||
<img
|
||||
src={"/imgs/providers/letsencrypt.svg"}
|
||||
className="h-6"
|
||||
/>
|
||||
<div>{"Let's Encrypt"}</div>
|
||||
</div>
|
||||
</Label>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<RadioGroupItem value="zerossl" id="zerossl" />
|
||||
<Label htmlFor="zerossl">
|
||||
<div
|
||||
className={cn(
|
||||
"flex items-center space-x-2 border p-2 rounded cursor-pointer",
|
||||
getOptionCls("zerossl")
|
||||
)}
|
||||
>
|
||||
<img
|
||||
src={"/imgs/providers/zerossl.svg"}
|
||||
className="h-6"
|
||||
/>
|
||||
<div>{"ZeroSSL"}</div>
|
||||
</div>
|
||||
</Label>
|
||||
</div>
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="eabKid"
|
||||
render={({ field }) => (
|
||||
<FormItem hidden={provider !== "zerossl"}>
|
||||
<FormLabel>EAB_KID</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="请输入EAB_KID"
|
||||
{...field}
|
||||
type="text"
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="eabHmacKey"
|
||||
render={({ field }) => (
|
||||
<FormItem hidden={provider !== "zerossl"}>
|
||||
<FormLabel>EAB_HMAC_KEY</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="请输入EAB_HMAC_KEY"
|
||||
{...field}
|
||||
type="text"
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<Button type="submit">确认修改</Button>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SSLProvider;
|
@ -12,6 +12,7 @@ import SettingLayout from "./pages/SettingLayout";
|
||||
import Dashboard from "./pages/dashboard/Dashboard";
|
||||
import Account from "./pages/setting/Account";
|
||||
import Notify from "./pages/setting/Notify";
|
||||
import SSLProvider from "./pages/setting/SSLProvider";
|
||||
|
||||
export const router = createHashRouter([
|
||||
{
|
||||
@ -54,6 +55,10 @@ export const router = createHashRouter([
|
||||
path: "/setting/notify",
|
||||
element: <Notify />,
|
||||
},
|
||||
{
|
||||
path: "/setting/ssl-provider",
|
||||
element: <SSLProvider />,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user