Merge branch 'main' into feature/optimize_placeholder

This commit is contained in:
usual2970 2024-09-26 20:28:23 +08:00 committed by GitHub
commit 7e94ba0875
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 1786 additions and 10 deletions

1
go.mod
View File

@ -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
View File

@ -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=

View File

@ -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 {

View File

@ -21,6 +21,7 @@ const (
targetWebhook = "webhook"
targetTencentCdn = "tencent-cdn"
targetQiniuCdn = "qiniu-cdn"
targetLocal = "local"
)
type DeployerOption struct {
@ -127,7 +128,10 @@ func getWithAccess(record *models.Record, cert *applicant.Certificate, access *m
case targetTencentCdn:
return NewTencentCdn(option)
case targetQiniuCdn:
return NewQiNiu(option)
case targetLocal:
return NewLocal(option), nil
}
return nil, errors.New("not implemented")
}

106
internal/deployer/local.go Normal file
View File

@ -0,0 +1,106 @@
package deployer
import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
)
type localAccess struct {
Command string `json:"command"`
CertPath string `json:"certPath"`
KeyPath string `json:"keyPath"`
}
type local struct {
option *DeployerOption
infos []string
}
func NewLocal(option *DeployerOption) *local {
return &local{
option: option,
infos: make([]string, 0),
}
}
func (l *local) GetID() string {
return fmt.Sprintf("%s-%s", l.option.AceessRecord.GetString("name"), l.option.AceessRecord.Id)
}
func (l *local) GetInfo() []string {
return []string{}
}
func (l *local) Deploy(ctx context.Context) error {
access := &localAccess{}
if err := json.Unmarshal([]byte(l.option.Access), access); err != nil {
return err
}
// 复制文件
if err := copyFile(l.option.Certificate.Certificate, access.CertPath); err != nil {
return fmt.Errorf("复制证书失败: %w", err)
}
if err := copyFile(l.option.Certificate.PrivateKey, access.KeyPath); err != nil {
return fmt.Errorf("复制私钥失败: %w", err)
}
// 执行命令
if err := execCmd(access.Command); err != nil {
return fmt.Errorf("执行命令失败: %w", err)
}
return nil
}
func execCmd(command string) error {
// 执行命令
var cmd *exec.Cmd
if runtime.GOOS == "windows" {
cmd = exec.Command("cmd", "/C", command)
} else {
cmd = exec.Command("sh", "-c", command)
}
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
return fmt.Errorf("执行命令失败: %w", err)
}
return nil
}
func copyFile(content string, path string) error {
dir := filepath.Dir(path)
// 如果目录不存在,创建目录
err := os.MkdirAll(dir, os.ModePerm)
if err != nil {
return fmt.Errorf("创建目录失败: %w", err)
}
// 创建或打开文件
file, err := os.Create(path)
if err != nil {
return fmt.Errorf("创建文件失败: %w", err)
}
defer file.Close()
// 写入内容到文件
_, err = file.Write([]byte(content))
if err != nil {
return fmt.Errorf("写入文件失败: %w", err)
}
return nil
}

View File

@ -27,3 +27,4 @@ type GodaddyAccess struct {
ApiKey string `json:"apiKey"`
ApiSecret string `json:"apiSecret"`
}

View File

@ -0,0 +1,706 @@
package migrations
import (
"encoding/json"
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations"
"github.com/pocketbase/pocketbase/models"
)
func init() {
m.Register(func(db dbx.Builder) error {
jsonData := `[
{
"id": "z3p974ainxjqlvs",
"created": "2024-07-29 10:02:48.334Z",
"updated": "2024-09-26 08:20:28.305Z",
"name": "domains",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "iuaerpl2",
"name": "domain",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "ukkhuw85",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
},
{
"system": false,
"id": "v98eebqq",
"name": "crontab",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "alc8e9ow",
"name": "access",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "4yzbv8urny5ja1e",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "topsc9bj",
"name": "certUrl",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "vixgq072",
"name": "certStableUrl",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "g3a3sza5",
"name": "privateKey",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "gr6iouny",
"name": "certificate",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "tk6vnrmn",
"name": "issuerCertificate",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "sjo6ibse",
"name": "csr",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "x03n1bkj",
"name": "expiredAt",
"type": "date",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
},
{
"system": false,
"id": "srybpixz",
"name": "targetType",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"aliyun-oss",
"aliyun-cdn",
"aliyun-dcdn",
"ssh",
"webhook",
"tencent-cdn",
"qiniu-cdn",
"local"
]
}
},
{
"system": false,
"id": "xy7yk0mb",
"name": "targetAccess",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "4yzbv8urny5ja1e",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "6jqeyggw",
"name": "enabled",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "hdsjcchf",
"name": "deployed",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "aiya3rev",
"name": "rightnow",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "ixznmhzc",
"name": "lastDeployedAt",
"type": "date",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
},
{
"system": false,
"id": "ghtlkn5j",
"name": "lastDeployment",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "0a1o4e6sstp694f",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "zfnyj9he",
"name": "variables",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "1bspzuku",
"name": "group",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "teolp9pl72dxlxq",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "g65gfh7a",
"name": "nameservers",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
],
"indexes": [
"CREATE UNIQUE INDEX ` + "`" + `idx_4ABO6EQ` + "`" + ` ON ` + "`" + `domains` + "`" + ` (` + "`" + `domain` + "`" + `)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "4yzbv8urny5ja1e",
"created": "2024-07-29 10:04:39.685Z",
"updated": "2024-09-26 08:36:59.632Z",
"name": "access",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "geeur58v",
"name": "name",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "iql7jpwx",
"name": "config",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
},
{
"system": false,
"id": "hwy7m03o",
"name": "configType",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"aliyun",
"tencent",
"ssh",
"webhook",
"cloudflare",
"qiniu",
"namesilo",
"godaddy",
"local"
]
}
},
{
"system": false,
"id": "lr33hiwg",
"name": "deleted",
"type": "date",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
},
{
"system": false,
"id": "hsxcnlvd",
"name": "usage",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"apply",
"deploy",
"all"
]
}
},
{
"system": false,
"id": "c8egzzwj",
"name": "group",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "teolp9pl72dxlxq",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}
],
"indexes": [
"CREATE UNIQUE INDEX ` + "`" + `idx_wkoST0j` + "`" + ` ON ` + "`" + `access` + "`" + ` (` + "`" + `name` + "`" + `)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "0a1o4e6sstp694f",
"created": "2024-07-30 06:30:27.801Z",
"updated": "2024-09-24 14:44:48.041Z",
"name": "deployments",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "farvlzk7",
"name": "domain",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "z3p974ainxjqlvs",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
},
{
"system": false,
"id": "jx5f69i3",
"name": "log",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
},
{
"system": false,
"id": "qbxdtg9q",
"name": "phase",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"check",
"apply",
"deploy"
]
}
},
{
"system": false,
"id": "rglrp1hz",
"name": "phaseSuccess",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
},
{
"system": false,
"id": "lt1g1blu",
"name": "deployedAt",
"type": "date",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
},
{
"system": false,
"id": "wledpzgb",
"name": "wholeSuccess",
"type": "bool",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "_pb_users_auth_",
"created": "2024-09-12 13:09:54.234Z",
"updated": "2024-09-24 14:44:48.041Z",
"name": "users",
"type": "auth",
"system": false,
"schema": [
{
"system": false,
"id": "users_name",
"name": "name",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "users_avatar",
"name": "avatar",
"type": "file",
"required": false,
"presentable": false,
"unique": false,
"options": {
"mimeTypes": [
"image/jpeg",
"image/png",
"image/svg+xml",
"image/gif",
"image/webp"
],
"thumbs": null,
"maxSelect": 1,
"maxSize": 5242880,
"protected": false
}
}
],
"indexes": [],
"listRule": "id = @request.auth.id",
"viewRule": "id = @request.auth.id",
"createRule": "",
"updateRule": "id = @request.auth.id",
"deleteRule": "id = @request.auth.id",
"options": {
"allowEmailAuth": true,
"allowOAuth2Auth": true,
"allowUsernameAuth": true,
"exceptEmailDomains": null,
"manageRule": null,
"minPasswordLength": 8,
"onlyEmailDomains": null,
"onlyVerified": false,
"requireEmail": false
}
},
{
"id": "dy6ccjb60spfy6p",
"created": "2024-09-12 23:12:21.677Z",
"updated": "2024-09-24 14:44:48.041Z",
"name": "settings",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "1tcmdsdf",
"name": "name",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "f9wyhypi",
"name": "content",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSize": 2000000
}
}
],
"indexes": [
"CREATE UNIQUE INDEX ` + "`" + `idx_RO7X9Vw` + "`" + ` ON ` + "`" + `settings` + "`" + ` (` + "`" + `name` + "`" + `)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
},
{
"id": "teolp9pl72dxlxq",
"created": "2024-09-13 12:51:05.611Z",
"updated": "2024-09-24 14:44:48.041Z",
"name": "access_groups",
"type": "base",
"system": false,
"schema": [
{
"system": false,
"id": "7sajiv6i",
"name": "name",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
},
{
"system": false,
"id": "xp8admif",
"name": "access",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "4yzbv8urny5ja1e",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": null,
"displayFields": null
}
}
],
"indexes": [
"CREATE UNIQUE INDEX ` + "`" + `idx_RgRXp0R` + "`" + ` ON ` + "`" + `access_groups` + "`" + ` (` + "`" + `name` + "`" + `)"
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
}
]`
collections := []*models.Collection{}
if err := json.Unmarshal([]byte(jsonData), &collections); err != nil {
return err
}
return daos.New(db).ImportCollections(collections, true, nil)
}, func(db dbx.Builder) error {
return nil
})
}

File diff suppressed because one or more lines are too long

313
ui/dist/assets/index-CnO7gXFE.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

File diff suppressed because one or more lines are too long

18
ui/dist/imgs/providers/letsencrypt.svg vendored Normal file
View 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

10
ui/dist/imgs/providers/local.svg vendored Normal file
View File

@ -0,0 +1,10 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#29a34a" stroke="#29a34a">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier">
<path d="M10.875 7l2.008 5h-.711l-2.008-5h.711zm-5.125.594c-.276 0-.526.041-.75.125a1.542 1.542 0 0 0-.578.375c-.162.166-.287.37-.375.61a2.364 2.364 0 0 0-.133.827c0 .287.04.547.117.781.078.235.196.433.352.594.156.162.346.29.57.383.224.094.48.138.766.133a2.63 2.63 0 0 0 .992-.195l.125.484a1.998 1.998 0 0 1-.492.148 4.381 4.381 0 0 1-.75.07 2.61 2.61 0 0 1-.914-.156 2.207 2.207 0 0 1-.742-.453 1.878 1.878 0 0 1-.485-.742 3.204 3.204 0 0 1-.18-1.023c0-.365.06-.698.18-1 .12-.302.287-.563.5-.782.214-.218.471-.388.774-.507a2.69 2.69 0 0 1 1-.18c.296 0 .536.023.718.07.183.047.315.094.399.14l-.149.493a1.85 1.85 0 0 0-.406-.14 2.386 2.386 0 0 0-.539-.055zM8 8h1v1H8V8zm0 2h1v1H8v-1z"/>
<path d="M15.5 1H.5l-.5.5v13l.5.5h15l.5-.5v-13l-.5-.5zM15 14H1V5h14v9zm0-10H1V2h14v2z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

1
ui/dist/imgs/providers/zerossl.svg vendored Normal file
View 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

View 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

View File

@ -0,0 +1,10 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#29a34a" stroke="#29a34a">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier">
<path d="M10.875 7l2.008 5h-.711l-2.008-5h.711zm-5.125.594c-.276 0-.526.041-.75.125a1.542 1.542 0 0 0-.578.375c-.162.166-.287.37-.375.61a2.364 2.364 0 0 0-.133.827c0 .287.04.547.117.781.078.235.196.433.352.594.156.162.346.29.57.383.224.094.48.138.766.133a2.63 2.63 0 0 0 .992-.195l.125.484a1.998 1.998 0 0 1-.492.148 4.381 4.381 0 0 1-.75.07 2.61 2.61 0 0 1-.914-.156 2.207 2.207 0 0 1-.742-.453 1.878 1.878 0 0 1-.485-.742 3.204 3.204 0 0 1-.18-1.023c0-.365.06-.698.18-1 .12-.302.287-.563.5-.782.214-.218.471-.388.774-.507a2.69 2.69 0 0 1 1-.18c.296 0 .536.023.718.07.183.047.315.094.399.14l-.149.493a1.85 1.85 0 0 0-.406-.14 2.386 2.386 0 0 0-.539-.055zM8 8h1v1H8V8zm0 2h1v1H8v-1z"/>
<path d="M15.5 1H.5l-.5.5v13l.5.5h15l.5-.5v-13l-.5-.5zM15 14H1V5h14v9zm0-10H1V2h14v2z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View 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

View File

@ -32,6 +32,7 @@ import AccessCloudflareForm from "./AccessCloudflareForm";
import AccessQiniuForm from "./AccessQiniuForm";
import AccessNamesiloForm from "./AccessNamesiloForm";
import AccessGodaddyFrom from "./AccessGodaddyForm";
import AccessLocalForm from "./AccessLocalForm";
type TargetConfigEditProps = {
op: "add" | "edit";
@ -133,6 +134,16 @@ export function AccessEdit({
/>
);
break;
case "local":
form = (
<AccessLocalForm
data={data}
onAfterReq={() => {
setOpen(false);
}}
/>
);
break;
}
const getOptionCls = (val: string) => {

View File

@ -0,0 +1,223 @@
import {
Access,
accessFormType,
getUsageByConfigType,
LocalConfig,
SSHConfig,
} from "@/domain/access";
import { useConfig } from "@/providers/config";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "../ui/form";
import { Input } from "../ui/input";
import { Button } from "../ui/button";
import { Textarea } from "../ui/textarea";
import { save } from "@/repository/access";
import { ClientResponseError } from "pocketbase";
import { PbErrorData } from "@/domain/base";
const AccessLocalForm = ({
data,
onAfterReq,
}: {
data?: Access;
onAfterReq: () => void;
}) => {
const { addAccess, updateAccess, reloadAccessGroups } = useConfig();
const formSchema = z.object({
id: z.string().optional(),
name: z.string().min(1).max(64),
configType: accessFormType,
command: z.string().min(1).max(2048),
certPath: z.string().min(0).max(2048),
keyPath: z.string().min(0).max(2048),
});
let config: LocalConfig = {
command: "sudo service nginx restart",
certPath: "/etc/nginx/ssl/certificate.crt",
keyPath: "/etc/nginx/ssl/private.key",
};
if (data) config = data.config as SSHConfig;
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
id: data?.id,
name: data?.name,
configType: "local",
certPath: config.certPath,
keyPath: config.keyPath,
command: config.command,
},
});
const onSubmit = async (data: z.infer<typeof formSchema>) => {
const req: Access = {
id: data.id as string,
name: data.name,
configType: data.configType,
usage: getUsageByConfigType(data.configType),
config: {
command: data.command,
certPath: data.certPath,
keyPath: data.keyPath,
},
};
try {
const rs = await save(req);
onAfterReq();
req.id = rs.id;
req.created = rs.created;
req.updated = rs.updated;
if (data.id) {
updateAccess(req);
} else {
addAccess(req);
}
reloadAccessGroups();
} catch (e) {
const err = e as ClientResponseError;
Object.entries(err.response.data as PbErrorData).forEach(
([key, value]) => {
form.setError(key as keyof z.infer<typeof formSchema>, {
type: "manual",
message: value.message,
});
}
);
return;
}
};
return (
<>
<div className="max-w-[35em] mx-auto mt-10">
<Form {...form}>
<form
onSubmit={(e) => {
e.stopPropagation();
form.handleSubmit(onSubmit)(e);
}}
className="space-y-3"
>
<FormField
control={form.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input placeholder="请输入授权名称" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="id"
render={({ field }) => (
<FormItem className="hidden">
<FormLabel></FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="configType"
render={({ field }) => (
<FormItem className="hidden">
<FormLabel></FormLabel>
<FormControl>
<Input {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="certPath"
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input placeholder="请输入证书上传路径" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="keyPath"
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input placeholder="请输入私钥上传路径" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="command"
render={({ field }) => (
<FormItem>
<FormLabel>Command</FormLabel>
<FormControl>
<Textarea placeholder="请输入要执行的命令" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormMessage />
<div className="flex justify-end">
<Button type="submit"></Button>
</div>
</form>
</Form>
</div>
</>
);
};
export default AccessLocalForm;

View File

@ -9,6 +9,7 @@ export const accessTypeMap: Map<string, [string, string]> = new Map([
["qiniu", ["七牛云", "/imgs/providers/qiniu.svg"]],
["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]],
["webhook", ["Webhook", "/imgs/providers/webhook.svg"]],
["local", ["本地部署", "/imgs/providers/local.svg"]],
]);
export const getProviderInfo = (t: string) => {
@ -25,6 +26,7 @@ export const accessFormType = z.union(
z.literal("qiniu"),
z.literal("namesilo"),
z.literal("godaddy"),
z.literal("local"),
],
{ message: "请选择云服务商" }
);
@ -45,7 +47,8 @@ export type Access = {
| CloudflareConfig
| QiniuConfig
| NamesiloConfig
| GodaddyConfig;
| GodaddyConfig
| LocalConfig;
deleted?: string;
created?: string;
@ -95,6 +98,12 @@ export type SSHConfig = {
keyPath: string;
};
export type LocalConfig = {
command: string;
certPath: string;
keyPath: string;
};
export const getUsageByConfigType = (configType: string): AccessUsage => {
switch (configType) {
case "aliyun":
@ -103,6 +112,7 @@ export const getUsageByConfigType = (configType: string): AccessUsage => {
case "ssh":
case "webhook":
case "qiniu":
case "local":
return "deploy";
case "cloudflare":

View File

@ -47,6 +47,7 @@ export const targetTypeMap: Map<string, [string, string]> = new Map([
["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]],
["qiniu-cdn", ["七牛云-CDN", "/imgs/providers/qiniu.svg"]],
["webhook", ["Webhook", "/imgs/providers/webhook.svg"]],
["local", ["本地部署", "/imgs/providers/local.svg"]],
]);
export const targetTypeKeys = Array.from(targetTypeMap.keys());

View File

@ -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;
};
};
};

View File

@ -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]">

View 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;

View File

@ -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 />,
},
],
},
],