From 0869eaafdd2f9c9abf76c5e58d3ef2db40456b9d Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 17 Jan 2025 18:01:47 +0800 Subject: [PATCH 01/16] refactor: clean code --- internal/certificate/service.go | 6 ++-- .../{acme_accounts.go => acme_account.go} | 0 internal/notify/service.go | 10 +++--- internal/repository/workflow.go | 1 + internal/rest/notify.go | 13 ++++---- internal/rest/statistics.go | 13 ++++---- internal/rest/workflow.go | 16 +++++----- internal/routes/routes.go | 31 +++++++------------ .../workflow/node-processor/notify_node.go | 2 +- internal/workflow/node-processor/processor.go | 2 +- internal/workflow/service.go | 12 +++---- main.go | 1 + 12 files changed, 50 insertions(+), 57 deletions(-) rename internal/domain/{acme_accounts.go => acme_account.go} (100%) diff --git a/internal/certificate/service.go b/internal/certificate/service.go index af46c202..83c97c83 100644 --- a/internal/certificate/service.go +++ b/internal/certificate/service.go @@ -70,11 +70,11 @@ func buildExpireSoonNotification(certificates []*domain.Certificate) *struct { message := defaultExpireMessage // 查询模板信息 - settingRepo := repository.NewSettingsRepository() - setting, err := settingRepo.GetByName(context.Background(), "notifyTemplates") + settingsRepo := repository.NewSettingsRepository() + settings, err := settingsRepo.GetByName(context.Background(), "notifyTemplates") if err == nil { var templates *domain.NotifyTemplatesSettingsContent - json.Unmarshal([]byte(setting.Content), &templates) + json.Unmarshal([]byte(settings.Content), &templates) if templates != nil && len(templates.NotifyTemplates) > 0 { subject = templates.NotifyTemplates[0].Subject diff --git a/internal/domain/acme_accounts.go b/internal/domain/acme_account.go similarity index 100% rename from internal/domain/acme_accounts.go rename to internal/domain/acme_account.go diff --git a/internal/notify/service.go b/internal/notify/service.go index 0e414950..a99d9620 100644 --- a/internal/notify/service.go +++ b/internal/notify/service.go @@ -17,22 +17,22 @@ type settingsRepository interface { } type NotifyService struct { - settingRepo settingsRepository + settingsRepo settingsRepository } -func NewNotifyService(settingRepo settingsRepository) *NotifyService { +func NewNotifyService(settingsRepo settingsRepository) *NotifyService { return &NotifyService{ - settingRepo: settingRepo, + settingsRepo: settingsRepo, } } func (n *NotifyService) Test(ctx context.Context, req *domain.NotifyTestPushReq) error { - setting, err := n.settingRepo.GetByName(ctx, "notifyChannels") + settings, err := n.settingsRepo.GetByName(ctx, "notifyChannels") if err != nil { return fmt.Errorf("failed to get notify channels settings: %w", err) } - channelConfig, err := setting.GetNotifyChannelConfig(req.Channel) + channelConfig, err := settings.GetNotifyChannelConfig(req.Channel) if err != nil { return fmt.Errorf("failed to get notify channel \"%s\" config: %w", req.Channel, err) } diff --git a/internal/repository/workflow.go b/internal/repository/workflow.go index d8a1980f..c4f13ba1 100644 --- a/internal/repository/workflow.go +++ b/internal/repository/workflow.go @@ -61,6 +61,7 @@ func (r *WorkflowRepository) Save(ctx context.Context, workflow *domain.Workflow if err != nil { return err } + var record *models.Record if workflow.Id == "" { record = models.NewRecord(collection) diff --git a/internal/rest/notify.go b/internal/rest/notify.go index 2eb3db7b..33a8d461 100644 --- a/internal/rest/notify.go +++ b/internal/rest/notify.go @@ -9,25 +9,24 @@ import ( "github.com/labstack/echo/v5" ) -type NotifyService interface { +type notifyService interface { Test(ctx context.Context, req *domain.NotifyTestPushReq) error } -type notifyHandler struct { - service NotifyService +type NotifyHandler struct { + service notifyService } -func NewNotifyHandler(route *echo.Group, service NotifyService) { - handler := ¬ifyHandler{ +func NewNotifyHandler(route *echo.Group, service notifyService) { + handler := &NotifyHandler{ service: service, } group := route.Group("/notify") - group.POST("/test", handler.test) } -func (handler *notifyHandler) test(c echo.Context) error { +func (handler *NotifyHandler) test(c echo.Context) error { req := &domain.NotifyTestPushReq{} if err := c.Bind(req); err != nil { return resp.Err(c, err) diff --git a/internal/rest/statistics.go b/internal/rest/statistics.go index e3129c50..6db35be4 100644 --- a/internal/rest/statistics.go +++ b/internal/rest/statistics.go @@ -8,25 +8,24 @@ import ( "github.com/usual2970/certimate/internal/rest/resp" ) -type StatisticsService interface { +type statisticsService interface { Get(ctx context.Context) (*domain.Statistics, error) } -type statisticsHandler struct { - service StatisticsService +type StatisticsHandler struct { + service statisticsService } -func NewStatisticsHandler(route *echo.Group, service StatisticsService) { - handler := &statisticsHandler{ +func NewStatisticsHandler(route *echo.Group, service statisticsService) { + handler := &StatisticsHandler{ service: service, } group := route.Group("/statistics") - group.GET("/get", handler.get) } -func (handler *statisticsHandler) get(c echo.Context) error { +func (handler *StatisticsHandler) get(c echo.Context) error { if statistics, err := handler.service.Get(c.Request().Context()); err != nil { return resp.Err(c, err) } else { diff --git a/internal/rest/workflow.go b/internal/rest/workflow.go index 8881ee42..2bdf4120 100644 --- a/internal/rest/workflow.go +++ b/internal/rest/workflow.go @@ -8,26 +8,25 @@ import ( "github.com/usual2970/certimate/internal/rest/resp" ) -type WorkflowService interface { +type workflowService interface { Run(ctx context.Context, req *domain.WorkflowRunReq) error - Stop() + Stop(ctx context.Context) } -type workflowHandler struct { - service WorkflowService +type WorkflowHandler struct { + service workflowService } -func NewWorkflowHandler(route *echo.Group, service WorkflowService) { - handler := &workflowHandler{ +func NewWorkflowHandler(route *echo.Group, service workflowService) { + handler := &WorkflowHandler{ service: service, } group := route.Group("/workflow") - group.POST("/run", handler.run) } -func (handler *workflowHandler) run(c echo.Context) error { +func (handler *WorkflowHandler) run(c echo.Context) error { req := &domain.WorkflowRunReq{} if err := c.Bind(req); err != nil { return resp.Err(c, err) @@ -36,5 +35,6 @@ func (handler *workflowHandler) run(c echo.Context) error { if err := handler.service.Run(c.Request().Context(), req); err != nil { return resp.Err(c, err) } + return resp.Ok(c, nil) } diff --git a/internal/routes/routes.go b/internal/routes/routes.go index 8fab1a15..b85b30a1 100644 --- a/internal/routes/routes.go +++ b/internal/routes/routes.go @@ -1,7 +1,7 @@ package routes import ( - "sync" + "context" "github.com/usual2970/certimate/internal/notify" "github.com/usual2970/certimate/internal/repository" @@ -14,36 +14,29 @@ import ( ) var ( - workflowSvc rest.WorkflowService - workflowSvcOnce sync.Once + notifySvc *notify.NotifyService + workflowSvc *workflow.WorkflowService + statisticsSvc *statistics.StatisticsService ) -func getWorkflowService() rest.WorkflowService { - workflowSvcOnce.Do(func() { - workflowRepo := repository.NewWorkflowRepository() - workflowSvc = workflow.NewWorkflowService(workflowRepo) - }) - return workflowSvc -} - func Register(e *echo.Echo) { - group := e.Group("/api", apis.RequireAdminAuth()) - notifyRepo := repository.NewSettingsRepository() - notifySvc := notify.NewNotifyService(notifyRepo) + notifySvc = notify.NewNotifyService(notifyRepo) - workflowSvc := getWorkflowService() + workflowRepo := repository.NewWorkflowRepository() + workflowSvc = workflow.NewWorkflowService(workflowRepo) statisticsRepo := repository.NewStatisticsRepository() - statisticsSvc := statistics.NewStatisticsService(statisticsRepo) + statisticsSvc = statistics.NewStatisticsService(statisticsRepo) + group := e.Group("/api", apis.RequireAdminAuth()) rest.NewWorkflowHandler(group, workflowSvc) - rest.NewNotifyHandler(group, notifySvc) - rest.NewStatisticsHandler(group, statisticsSvc) } func Unregister() { - getWorkflowService().Stop() + if workflowSvc != nil { + workflowSvc.Stop(context.Background()) + } } diff --git a/internal/workflow/node-processor/notify_node.go b/internal/workflow/node-processor/notify_node.go index cbc7fa47..8b175cc0 100644 --- a/internal/workflow/node-processor/notify_node.go +++ b/internal/workflow/node-processor/notify_node.go @@ -10,7 +10,7 @@ import ( type notifyNode struct { node *domain.WorkflowNode - settingsRepo settingRepository + settingsRepo settingsRepository *nodeLogger } diff --git a/internal/workflow/node-processor/processor.go b/internal/workflow/node-processor/processor.go index 128022ac..de16e93a 100644 --- a/internal/workflow/node-processor/processor.go +++ b/internal/workflow/node-processor/processor.go @@ -70,6 +70,6 @@ type workflowOutputRepository interface { Save(ctx context.Context, output *domain.WorkflowOutput, certificate *domain.Certificate, cb func(id string) error) error } -type settingRepository interface { +type settingsRepository interface { GetByName(ctx context.Context, name string) (*domain.Settings, error) } diff --git a/internal/workflow/service.go b/internal/workflow/service.go index 93b4c51a..f0cc8475 100644 --- a/internal/workflow/service.go +++ b/internal/workflow/service.go @@ -23,7 +23,7 @@ type workflowRepository interface { ListEnabledAuto(ctx context.Context) ([]*domain.Workflow, error) GetById(ctx context.Context, id string) (*domain.Workflow, error) Save(ctx context.Context, workflow *domain.Workflow) error - SaveRun(ctx context.Context, run *domain.WorkflowRun) error + SaveRun(ctx context.Context, workflowRun *domain.WorkflowRun) error } type WorkflowService struct { @@ -91,11 +91,11 @@ func (s *WorkflowService) InitSchedule(ctx context.Context) error { return nil } -func (s *WorkflowService) Run(ctx context.Context, options *domain.WorkflowRunReq) error { +func (s *WorkflowService) Run(ctx context.Context, req *domain.WorkflowRunReq) error { // 查询 - workflow, err := s.repo.GetById(ctx, options.WorkflowId) + workflow, err := s.repo.GetById(ctx, req.WorkflowId) if err != nil { - app.GetLogger().Error("failed to get workflow", "id", options.WorkflowId, "err", err) + app.GetLogger().Error("failed to get workflow", "id", req.WorkflowId, "err", err) return err } @@ -114,7 +114,7 @@ func (s *WorkflowService) Run(ctx context.Context, options *domain.WorkflowRunRe s.ch <- &workflowRunData{ Workflow: workflow, - Options: options, + Options: req, } return nil @@ -165,7 +165,7 @@ func (s *WorkflowService) run(ctx context.Context, runData *workflowRunData) err return nil } -func (s *WorkflowService) Stop() { +func (s *WorkflowService) Stop(ctx context.Context) { s.cancel() s.wg.Wait() } diff --git a/main.go b/main.go index 2db632d6..4bcb025a 100644 --- a/main.go +++ b/main.go @@ -43,6 +43,7 @@ func main() { workflow.Register() routes.Register(e.Router) + e.Router.GET( "/*", echo.StaticDirectoryHandler(ui.DistDirFS, false), From 1568e5a2a77995854945b8512d1c169595ba53b1 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 17 Jan 2025 20:21:35 +0800 Subject: [PATCH 02/16] fix: incorrect config in deployment on aliyun oss --- .../node/DeployNodeConfigFormAliyunOSSConfig.tsx | 16 ++++++++-------- ui/src/i18n/locales/en/nls.workflow.nodes.json | 6 +++--- ui/src/i18n/locales/zh/nls.workflow.nodes.json | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx index 156892f9..5cc1edd6 100644 --- a/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx +++ b/ui/src/components/workflow/node/DeployNodeConfigFormAliyunOSSConfig.tsx @@ -6,7 +6,7 @@ import { z } from "zod"; import { validDomainName } from "@/utils/validators"; type DeployNodeConfigFormAliyunOSSConfigFieldValues = Nullish<{ - endpoint: string; + region: string; bucket: string; domain: string; }>; @@ -33,9 +33,9 @@ const DeployNodeConfigFormAliyunOSSConfig = ({ const { t } = useTranslation(); const formSchema = z.object({ - endpoint: z - .string({ message: t("workflow_node.deploy.form.aliyun_oss_endpoint.placeholder") }) - .url(t("common.errmsg.url_invalid")) + region: z + .string({ message: t("workflow_node.deploy.form.aliyun_oss_region.placeholder") }) + .nonempty(t("workflow_node.deploy.form.aliyun_oss_region.placeholder")) .trim(), bucket: z .string({ message: t("workflow_node.deploy.form.aliyun_oss_bucket.placeholder") }) @@ -61,12 +61,12 @@ const DeployNodeConfigFormAliyunOSSConfig = ({ onValuesChange={handleFormChange} > } + tooltip={} > - + https://slb.console.aliyun.com/nlb", - "workflow_node.deploy.form.aliyun_oss_endpoint.label": "Alibaba Cloud OSS endpoint", - "workflow_node.deploy.form.aliyun_oss_endpoint.placeholder": "Please enter Alibaba Cloud OSS endpoint", - "workflow_node.deploy.form.aliyun_oss_endpoint.tooltip": "For more information, see https://www.alibabacloud.com/help/en/oss/user-guide/regions-and-endpoints", + "workflow_node.deploy.form.aliyun_oss_region.label": "Alibaba Cloud region", + "workflow_node.deploy.form.aliyun_oss_region.placeholder": "Please enter Alibaba Cloud region (e.g. cn-hangzhou)", + "workflow_node.deploy.form.aliyun_oss_region.tooltip": "For more information, see https://www.alibabacloud.com/help/en/oss/user-guide/regions-and-endpoints", "workflow_node.deploy.form.aliyun_oss_bucket.label": "Alibaba Cloud OSS bucket", "workflow_node.deploy.form.aliyun_oss_bucket.placeholder": "Please enter Alibaba Cloud OSS bucket name", "workflow_node.deploy.form.aliyun_oss_bucket.tooltip": "For more information, see https://oss.console.aliyun.com", diff --git a/ui/src/i18n/locales/zh/nls.workflow.nodes.json b/ui/src/i18n/locales/zh/nls.workflow.nodes.json index 9ea8c7dc..96b5f5cb 100644 --- a/ui/src/i18n/locales/zh/nls.workflow.nodes.json +++ b/ui/src/i18n/locales/zh/nls.workflow.nodes.json @@ -130,9 +130,9 @@ "workflow_node.deploy.form.aliyun_nlb_listener_id.label": "阿里云 NLB 监听器 ID", "workflow_node.deploy.form.aliyun_nlb_listener_id.placeholder": "请输入阿里云 NLB 监听器 ID", "workflow_node.deploy.form.aliyun_nlb_listener_id.tooltip": "这是什么?请参阅 https://slb.console.aliyun.com/nlb", - "workflow_node.deploy.form.aliyun_oss_endpoint.label": "阿里云 OSS Endpoint", - "workflow_node.deploy.form.aliyun_oss_endpoint.placeholder": "请输入阿里云 OSS Endpoint", - "workflow_node.deploy.form.aliyun_oss_endpoint.tooltip": "这是什么?请参阅 https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints", + "workflow_node.deploy.form.aliyun_oss_region.label": "阿里云地域", + "workflow_node.deploy.form.aliyun_oss_region.placeholder": "请输入阿里云地域(例如:cn-hangzhou)", + "workflow_node.deploy.form.aliyun_oss_region.tooltip": "这是什么?请参阅 https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints", "workflow_node.deploy.form.aliyun_oss_bucket.label": "阿里云 OSS 存储桶名", "workflow_node.deploy.form.aliyun_oss_bucket.placeholder": "请输入阿里云 OSS 存储桶名", "workflow_node.deploy.form.aliyun_oss_bucket.tooltip": "这是什么?请参阅 https://oss.console.aliyun.com", From 32f9c95dd0c21571991ec0226f9fd6058f83e56c Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 18 Jan 2025 05:22:18 +0800 Subject: [PATCH 03/16] feat: migrate pocketbase to v0.23 --- go.mod | 140 ++++--- go.sum | 365 +++++++++--------- internal/app/app.go | 10 +- internal/app/scheduler.go | 4 +- internal/certificate/service.go | 9 +- .../huaweicloud-cdn/huaweicloud_cdn.go | 57 ++- .../pkg/vendors/huaweicloud-sdk/cdn/client.go | 28 -- .../pkg/vendors/huaweicloud-sdk/cdn/models.go | 62 --- internal/repository/access.go | 13 +- internal/repository/acme_account.go | 20 +- internal/repository/certificate.go | 16 +- internal/repository/settings.go | 8 +- internal/repository/statistics.go | 16 +- internal/repository/workflow.go | 62 +-- internal/repository/workflow_output.go | 32 +- internal/rest/handlers/notify.go | 41 ++ internal/rest/handlers/statistics.go | 36 ++ internal/rest/handlers/workflow.go | 42 ++ internal/rest/notify.go | 40 -- internal/rest/resp/resp.go | 6 +- internal/{ => rest}/routes/routes.go | 20 +- internal/rest/statistics.go | 34 -- internal/rest/workflow.go | 40 -- internal/scheduler/certificate.go | 4 +- internal/scheduler/workflow.go | 4 +- internal/workflow/event.go | 50 ++- internal/workflow/service.go | 3 - main.go | 40 +- ui/embed.go | 4 +- ui/package-lock.json | 8 +- ui/package.json | 2 +- ui/src/api/notify.ts | 2 +- ui/src/api/statistics.ts | 2 +- ui/src/api/workflow.ts | 2 +- ui/src/pages/AuthLayout.tsx | 6 +- ui/src/pages/ConsoleLayout.tsx | 6 +- ui/src/pages/login/Login.tsx | 4 +- ui/src/pages/settings/SettingsAccount.tsx | 10 +- ui/src/pages/settings/SettingsPassword.tsx | 11 +- .../{pocketbase.ts => _pocketbase.ts} | 3 - ui/src/repository/access.ts | 13 +- ui/src/repository/admin.ts | 17 + ui/src/repository/certificate.ts | 8 +- ui/src/repository/settings.ts | 2 +- ui/src/repository/workflow.ts | 2 +- ui/src/repository/workflowRun.ts | 2 +- 46 files changed, 632 insertions(+), 674 deletions(-) delete mode 100644 internal/pkg/vendors/huaweicloud-sdk/cdn/client.go delete mode 100644 internal/pkg/vendors/huaweicloud-sdk/cdn/models.go create mode 100644 internal/rest/handlers/notify.go create mode 100644 internal/rest/handlers/statistics.go create mode 100644 internal/rest/handlers/workflow.go delete mode 100644 internal/rest/notify.go rename internal/{ => rest}/routes/routes.go (66%) delete mode 100644 internal/rest/statistics.go delete mode 100644 internal/rest/workflow.go rename ui/src/repository/{pocketbase.ts => _pocketbase.ts} (62%) create mode 100644 ui/src/repository/admin.ts diff --git a/go.mod b/go.mod index 152d66c6..b91c2e36 100644 --- a/go.mod +++ b/go.mod @@ -12,42 +12,41 @@ require ( github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 github.com/alibabacloud-go/live-20161101 v1.1.1 github.com/alibabacloud-go/nlb-20220430/v2 v2.0.3 - github.com/alibabacloud-go/slb-20140515/v4 v4.0.9 + github.com/alibabacloud-go/slb-20140515/v4 v4.0.10 github.com/alibabacloud-go/tea v1.2.2 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible - github.com/baidubce/bce-sdk-go v0.9.209 - github.com/byteplus-sdk/byteplus-sdk-golang v1.0.35 + github.com/baidubce/bce-sdk-go v0.9.214 + github.com/byteplus-sdk/byteplus-sdk-golang v1.0.40 github.com/go-acme/lego/v4 v4.21.0 github.com/go-resty/resty/v2 v2.16.3 github.com/go-viper/mapstructure/v2 v2.2.1 - github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128 - github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 - github.com/nikoksr/notify v1.1.0 + github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.132 + github.com/nikoksr/notify v1.3.0 github.com/pavlo-v-chernykh/keystore-go/v4 v4.5.0 github.com/pkg/sftp v1.13.7 github.com/pocketbase/dbx v1.11.0 - github.com/pocketbase/pocketbase v0.22.21 - github.com/qiniu/go-sdk/v7 v7.25.1 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.1065 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1065 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1080 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.1080 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1065 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.1065 + github.com/pocketbase/pocketbase v0.24.3 + github.com/qiniu/go-sdk/v7 v7.25.2 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.1084 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1084 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1084 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.1084 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1084 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.1084 github.com/ucloud/ucloud-sdk-go v0.22.31 github.com/volcengine/ve-tos-golang-sdk/v2 v2.7.8 - github.com/volcengine/volc-sdk-golang v1.0.189 - github.com/volcengine/volcengine-go-sdk v1.0.177 + github.com/volcengine/volc-sdk-golang v1.0.193 + github.com/volcengine/volcengine-go-sdk v1.0.178 golang.org/x/crypto v0.32.0 golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 - k8s.io/api v0.32.0 - k8s.io/apimachinery v0.32.0 - k8s.io/client-go v0.32.0 + k8s.io/api v0.32.1 + k8s.io/apimachinery v0.32.1 + k8s.io/client-go v0.32.1 software.sslmate.com/src/go-pkcs12 v0.5.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0 // indirect @@ -57,26 +56,27 @@ require ( github.com/alibabacloud-go/tea-fileform v1.1.1 // indirect github.com/alibabacloud-go/tea-oss-sdk v1.1.3 // indirect github.com/alibabacloud-go/tea-oss-utils v1.1.0 // indirect - github.com/alibabacloud-go/tea-utils/v2 v2.0.6 // indirect - github.com/aws/aws-sdk-go-v2/service/route53 v1.46.4 // indirect + github.com/alibabacloud-go/tea-utils/v2 v2.0.7 // indirect + github.com/aws/aws-sdk-go-v2/service/route53 v1.48.1 // indirect github.com/blinkbean/dingtalk v1.1.3 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/go-lark/lark v1.15.0 // indirect + github.com/go-lark/lark v1.15.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/mailru/easyjson v0.9.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect @@ -84,16 +84,19 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/technoweenie/multipartstreamer v1.0.1 // indirect github.com/x448/float16 v0.8.4 // indirect - go.mongodb.org/mongo-driver v1.12.0 // indirect + go.mongodb.org/mongo-driver v1.17.2 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ns1/ns1-go.v2 v2.13.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect - sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect + k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect + k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect + modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6 // indirect + modernc.org/strutil v1.2.1 // indirect + modernc.org/token v1.1.0 // indirect + sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) @@ -101,43 +104,43 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect - github.com/alibabacloud-go/dcdn-20180115/v3 v3.4.2 + github.com/alibabacloud-go/dcdn-20180115/v3 v3.5.0 github.com/alibabacloud-go/debug v1.0.1 // indirect - github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect + github.com/alibabacloud-go/endpoint-util v1.1.1 // indirect github.com/alibabacloud-go/openapi-util v0.1.1 // indirect github.com/alibabacloud-go/tea-utils v1.4.5 // indirect github.com/alibabacloud-go/tea-xml v1.1.3 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.63.80 // indirect - github.com/aliyun/credentials-go v1.3.10 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.63.83 // indirect + github.com/aliyun/credentials-go v1.4.3 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2 v1.32.7 // indirect + github.com/aws/aws-sdk-go-v2 v1.33.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect - github.com/aws/aws-sdk-go-v2/config v1.28.7 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.48 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 // indirect + github.com/aws/aws-sdk-go-v2/config v1.29.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.53 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.24 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.51 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.28 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.28 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.28 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.9 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.73.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.10 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.9 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.8 // indirect github.com/aws/smithy-go v1.22.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/clbanning/mxj/v2 v2.5.6 // indirect - github.com/cloudflare/cloudflare-go v0.112.0 // indirect + github.com/clbanning/mxj/v2 v2.7.0 // indirect + github.com/cloudflare/cloudflare-go v0.114.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/disintegration/imaging v1.6.2 // indirect github.com/domodwyer/mailyak/v3 v3.6.2 github.com/dustin/go-humanize v1.0.1 // indirect github.com/fatih/color v1.18.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.7 // indirect + github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/ganigeorgiev/fexpr v0.4.1 // indirect github.com/go-jose/go-jose/v4 v4.0.4 // indirect github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect @@ -147,15 +150,13 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/gax-go/v2 v2.14.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kr/fs v0.1.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/miekg/dns v1.1.62 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -170,34 +171,29 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/stretchr/testify v1.10.0 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1065 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1084 // indirect github.com/tjfoc/gmsm v1.4.1 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect gocloud.dev v0.40.0 // indirect golang.org/x/image v0.23.0 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.34.0 // indirect - golang.org/x/oauth2 v0.24.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect golang.org/x/sync v0.10.0 golang.org/x/sys v0.29.0 // indirect golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.8.0 // indirect + golang.org/x/time v0.9.0 golang.org/x/tools v0.29.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - google.golang.org/api v0.214.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect - google.golang.org/grpc v1.69.2 // indirect - google.golang.org/protobuf v1.36.0 // indirect + google.golang.org/api v0.217.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect + google.golang.org/grpc v1.69.4 // indirect + google.golang.org/protobuf v1.36.3 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - modernc.org/gc/v3 v3.0.0-20241213165251-3bc300f6d0c9 // indirect - modernc.org/libc v1.61.5 // indirect - modernc.org/mathutil v1.7.0 // indirect - modernc.org/memory v1.8.0 // indirect + modernc.org/libc v1.55.3 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.8.2 // indirect modernc.org/sqlite v1.34.4 // indirect - modernc.org/strutil v1.2.0 // indirect - modernc.org/token v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 57ff9916..27e5c075 100644 --- a/go.sum +++ b/go.sum @@ -17,10 +17,10 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= -cloud.google.com/go/auth v0.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs= -cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q= -cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= -cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= +cloud.google.com/go/auth v0.14.0 h1:A5C4dKV/Spdvxcl0ggWwWEzzP7AZMJSEIgrkngwhGYM= +cloud.google.com/go/auth v0.14.0/go.mod h1:CYsoRL1PdiDuqeQpZE0bP2pnPrGqFcOkI0nldEQis+A= +cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M= +cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -44,8 +44,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.45.0 h1:5av0QcIVj77t+44mV4gffFC/LscFRUhto6UBMB5SimM= -cloud.google.com/go/storage v1.45.0/go.mod h1:wpPblkIuMP5jCB/E48Pz9zIo2S/zD8g+ITmxKkPCITE= +cloud.google.com/go/storage v1.47.0 h1:ajqgt30fnOMmLfWfu1PWcb+V9Dxz6n+9WKjdNg5R4HM= +cloud.google.com/go/storage v1.47.0/go.mod h1:Ks0vP374w0PW6jOUameJbapbQKXqkjGd/OJRp2fb9IQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -54,10 +54,10 @@ github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1r github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0/go.mod h1:PwOyop78lveYMRs6oCxjiVyBdyCgIYH6XHIVZO9/SFQ= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1 h1:1mvYtZfWQAnwNah/C+Z+Jb9rQH95LPE2vlmMuWAHJk8= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1/go.mod h1:75I/mXtme1JyWFtz8GocPHVFyH421IBoZErnO16dd0k= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.1 h1:Bk5uOhSAenHyR5P61D/NzeQCv+4fEVV8mOkJ82NqpWw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.1/go.mod h1:QZ4pw3or1WPmRBxf0cHd1tknzrT54WPBOQoGutCPvSU= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 h1:lpOxwrQ919lCZoNCd69rVt8u1eLZuMORrGXqy8sNf3c= @@ -81,12 +81,12 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0 github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.3 h1:cb3br57K508pQEFgBxn9GDhPS9HefpyMPK1RzmtMNzk= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.3/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.3 h1:xir5X8TS8UBVPWg2jHL+cSTf0jZgqYQSA54TscSt1/0= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.3/go.mod h1:SsdWig2J5PMnfMvfJuEb1uZa8Y+kvNyvrULFo69gTFk= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.3 h1:2vcVkrNdSMJpoOVAWi9ApsQR5iqNeFGt5Qx8Xlt3IoI= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.3/go.mod h1:wRbFgBQUVm1YXrvWKofAEmq9HNJTDphbAaJSSX01KUI= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0 h1:o90wcURuxekmXrtxmYWTyNla0+ZEHhud6DI1ZTxd1vI= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0/go.mod h1:6fTWu4m3jocfUZLYF5KsZC1TUfRvEjs7lM4crme/irw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0 h1:GYUJLfvd++4DMuMhCFLgLXvFwofIxh/qOwoGuS/LTew= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0/go.mod h1:wRbFgBQUVm1YXrvWKofAEmq9HNJTDphbAaJSSX01KUI= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -126,22 +126,21 @@ github.com/alibabacloud-go/darabonba-map v0.0.2/go.mod h1:28AJaX8FOE/ym8OUFWga+M github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.0/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.5/go.mod h1:kUe8JqFmoVU7lfBauaDD5taFaW7mBI+xVsyHutYtabg= -github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.7/go.mod h1:CzQnh+94WDnJOnKZH5YRyouL+OOcdBnXY5VWAf0McgI= -github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.9/go.mod h1:bb+Io8Sn2RuM3/Rpme6ll86jMyFSrD1bxeV/+v61KeU= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10 h1:GEYkMApgpKEVDn6z12DcH1EGYpDYRB8JxsazM4Rywak= github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.10/go.mod h1:26a14FGhZVELuz2cc2AolvW4RHmIO3/HRwsdHhaIPDE= github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg= github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ= github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo= github.com/alibabacloud-go/darabonba-string v1.0.2/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= -github.com/alibabacloud-go/dcdn-20180115/v3 v3.4.2 h1:WKMtPfhEmf8jX4FvdG7MFBJeCknPQ+FEHQppDcaCoU0= -github.com/alibabacloud-go/dcdn-20180115/v3 v3.4.2/go.mod h1:dGuR8qQqofJKl99rVaWvObnP3bMkru3cdOtqJJ95048= +github.com/alibabacloud-go/dcdn-20180115/v3 v3.5.0 h1:EQmKhYju6y38kJ1ZvZROeJG2Q1Wk6hlc8KQrVhvGyaw= +github.com/alibabacloud-go/dcdn-20180115/v3 v3.5.0/go.mod h1:b9qzvr/2V1f0r1Z6xUmkLqEouKcPGy4LCC22yV+6HQo= github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= github.com/alibabacloud-go/debug v1.0.1 h1:MsW9SmUtbb1Fnt3ieC6NNZi6aEwrXfDksD4QA6GSbPg= github.com/alibabacloud-go/debug v1.0.1/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= -github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/endpoint-util v1.1.1 h1:ZkBv2/jnghxtU0p+upSU0GGzW1VL9GQdZO3mcSUTUy8= +github.com/alibabacloud-go/endpoint-util v1.1.1/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= github.com/alibabacloud-go/live-20161101 v1.1.1 h1:rUGfA8RHmCMtQ5M3yMSyRde+yRXWqVecmiXBU3XrGJ8= github.com/alibabacloud-go/live-20161101 v1.1.1/go.mod h1:g84w6qeAodT0/IHdc0tEed2a8PyhQhYl7TAj3jGl4A4= github.com/alibabacloud-go/nlb-20220430/v2 v2.0.3 h1:LtyUVlgBEKyzWgQJurzXM6MXCt84sQr9cE5OKqYymko= @@ -152,8 +151,8 @@ github.com/alibabacloud-go/openapi-util v0.1.1 h1:ujGErJjG8ncRW6XtBBMphzHTvCxn4D github.com/alibabacloud-go/openapi-util v0.1.1/go.mod h1:/UehBSE2cf1gYT43GV4E+RxTdLRzURImCYY0aRmlXpw= github.com/alibabacloud-go/openplatform-20191219/v2 v2.0.1 h1:L0TIjr9Qh/SLVc1yPhFkcB9+9SbCNK/jPq4ZKB5zmnc= github.com/alibabacloud-go/openplatform-20191219/v2 v2.0.1/go.mod h1:EKxBRDLcMzwl4VLF/1WJwlByZZECJawPXUvinKMsTTs= -github.com/alibabacloud-go/slb-20140515/v4 v4.0.9 h1:nrf9gQth7fONUj7V8i78Yb98eb9NdKl0VdeSjmeYugI= -github.com/alibabacloud-go/slb-20140515/v4 v4.0.9/go.mod h1:PEMEsQoxhkMvykMFP5ZXg6SWI9vmAiZ6lK3Pu4mTKB0= +github.com/alibabacloud-go/slb-20140515/v4 v4.0.10 h1:ppAt0BUr8hPyp9aCP+fV1KTKclbr/QRqFCSjCPFVXTE= +github.com/alibabacloud-go/slb-20140515/v4 v4.0.10/go.mod h1:N1z4uYIL1DcWrrsIq5r552RlAoarl2zmaPKChoG+UA0= github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= @@ -180,21 +179,23 @@ github.com/alibabacloud-go/tea-utils/v2 v2.0.0/go.mod h1:U5MTY10WwlquGPS34DOeomU github.com/alibabacloud-go/tea-utils/v2 v2.0.1/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= github.com/alibabacloud-go/tea-utils/v2 v2.0.4/go.mod h1:sj1PbjPodAVTqGTA3olprfeeqqmwD0A5OQz94o9EuXQ= github.com/alibabacloud-go/tea-utils/v2 v2.0.5/go.mod h1:dL6vbUT35E4F4bFTHL845eUloqaerYBYPsdWR2/jhe4= -github.com/alibabacloud-go/tea-utils/v2 v2.0.6 h1:ZkmUlhlQbaDC+Eba/GARMPy6hKdCLiSke5RsN5LcyQ0= github.com/alibabacloud-go/tea-utils/v2 v2.0.6/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= +github.com/alibabacloud-go/tea-utils/v2 v2.0.7 h1:WDx5qW3Xa5ZgJ1c8NfqJkF6w+AU5wB8835UdhPr6Ax0= +github.com/alibabacloud-go/tea-utils/v2 v2.0.7/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= github.com/alibabacloud-go/tea-xml v1.1.1/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= github.com/alibabacloud-go/tea-xml v1.1.3 h1:7LYnm+JbOq2B+T/B0fHC4Ies4/FofC4zHzYtqw7dgt0= github.com/alibabacloud-go/tea-xml v1.1.3/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.80 h1:Dn5QrIWYgi7IZJkuhrAe33x/jFWlbHCW3Dip1Tv3z9c= -github.com/aliyun/alibaba-cloud-sdk-go v1.63.80/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.83 h1:YBkf7H5CSgrlb3C1aWcpDt7Vk8UEGFPeD2OOirtt6IM= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.83/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g= github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTsBEN04dgcAcYz0= github.com/aliyun/credentials-go v1.3.6/go.mod h1:1LxUuX7L5YrZUWzBrRyk0SwSdH4OmPrib8NVePL3fxM= -github.com/aliyun/credentials-go v1.3.10 h1:45Xxrae/evfzQL9V10zL3xX31eqgLWEaIdCoPipOEQA= github.com/aliyun/credentials-go v1.3.10/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= +github.com/aliyun/credentials-go v1.4.3 h1:N3iHyvHRMyOwY1+0qBLSf3hb5JFiOujVSVuEpgeGttY= +github.com/aliyun/credentials-go v1.4.3/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -209,50 +210,50 @@ github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= -github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2 v1.33.0 h1:Evgm4DI9imD81V0WwD+TN4DCwjUMdc94TrduMLbgZJs= +github.com/aws/aws-sdk-go-v2 v1.33.0/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= -github.com/aws/aws-sdk-go-v2/config v1.28.7 h1:GduUnoTXlhkgnxTD93g1nv4tVPILbdNQOzav+Wpg7AE= -github.com/aws/aws-sdk-go-v2/config v1.28.7/go.mod h1:vZGX6GVkIE8uECSUHB6MWAUsd4ZcG2Yq/dMa4refR3M= -github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4afs45mOWEI+MzZtTfQ= -github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 h1:2zxMLXLedpB4K1ilbJFxtMKsVKaexOqDttOhc0QGm3Q= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44/go.mod h1:VuLHdqwjSvgftNC7yqPWyGVhEwPmJpeRi07gOgOfHF8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26/go.mod h1:3o2Wpy0bogG1kyOPrgkXA8pgIfEEv0+m19O9D5+W8y8= +github.com/aws/aws-sdk-go-v2/config v1.29.0 h1:Vk/u4jof33or1qAQLdofpjKV7mQQT7DcUpnYx8kdmxY= +github.com/aws/aws-sdk-go-v2/config v1.29.0/go.mod h1:iXAZK3Gxvpq3tA+B9WaDYpZis7M8KFgdrDPMmHrgbJM= +github.com/aws/aws-sdk-go-v2/credentials v1.17.53 h1:lwrVhiEDW5yXsuVKlFVUnR2R50zt2DklhOyeLETqDuE= +github.com/aws/aws-sdk-go-v2/credentials v1.17.53/go.mod h1:CkqM1bIw/xjEpBMhBnvqUXYZbpCFuj6dnCAyDk2AtAY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.24 h1:5grmdTdMsovn9kPZPI23Hhvp0ZyNm5cRO+IZFIYiAfw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.24/go.mod h1:zqi7TVKTswH3Ozq28PkmBmgzG1tona7mo9G2IJg4Cis= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.51 h1:Q0FNHs6JTGuoBWNQycD5LRSf+/WVHWEl+FwJ0tEDZUE= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.51/go.mod h1:B9sW5/AD5bStKdTyUdz1xWRKOwnyUwJ4eJ4olQBtZo0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.28 h1:igORFSiH3bfq4lxKFkTSYDhJEUCYo6C8VKiWJjYwQuQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.28/go.mod h1:3So8EA/aAYm36L7XIvCVwLa0s5N0P7o2b1oqnx/2R4g= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.28 h1:1mOW9zAUMhTSrMDssEHS/ajx8JcAj/IcftzcmNlmVLI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.28/go.mod h1:kGlXVIWDfvt2Ox5zEaNglmq0hXPHgQFNMix33Tw22jA= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 h1:GeNJsIFHB+WW5ap2Tec4K6dzcVTsRbsT1Lra46Hv9ME= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26/go.mod h1:zfgMpwHDXX2WGoG84xG2H+ZlPTkJUU4YUvx2svLQYWo= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.28 h1:7kpeALOUeThs2kEjlAxlADAVfxKmkYAedlpZ3kdoSJ4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.28/go.mod h1:pyaOYEdp1MJWgtXLy6q80r3DhsVdOIOZNB9hdTcJIvI= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 h1:tB4tNw83KcajNAzaIMhkhVI2Nt8fAZd5A5ro113FEMY= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7/go.mod h1:lvpyBGkZ3tZ9iSsUIcC2EWp+0ywa7aK3BLT+FwZi+mQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQzZHqe/3FE+cqwfH+0p5Jo8PFM/QYQSmeZ+M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= -github.com/aws/aws-sdk-go-v2/service/route53 v1.46.4 h1:0jMtawybbfpFEIMy4wvfyW2Z4YLr7mnuzT0fhR67Nrc= -github.com/aws/aws-sdk-go-v2/service/route53 v1.46.4/go.mod h1:xlMODgumb0Pp8bzfpojqelDrf8SL9rb5ovwmwKJl+oU= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7/go.mod h1:JfyQ0g2JG8+Krq0EuZNnRwX0mU0HrwY/tG6JNfcqh4k= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 h1:Xgv/hyNgvLda/M9l9qxXc4UFSgppnRczLxlMs5Ae/QY= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.3/go.mod h1:5Gn+d+VaaRgsjewpMvGazt0WfcFO+Md4wLOuBfGR9Bc= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.1 h1:mJ9FRktB8v1Ihpqwfk0AWvYEd0FgQtLsshc2Qb2TVc8= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.1/go.mod h1:dIW8puxSbYLSPv/ju0d9A3CpwXdtqvJtYKDMVmPLOWE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.9 h1:TQmKDyETFGiXVhZfQ/I0cCFziqqX58pi4tKJGYGFSz0= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.9/go.mod h1:HVLPK2iHQBUx7HfZeOQSEu3v2ubZaAY2YPbAm5/WUyY= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.9 h1:2aInXbh02XsbO0KobPGMNXyv2QP73VDKsWPNJARj/+4= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.9/go.mod h1:dgXS1i+HgWnYkPXqNoPIPKeUsUUYHaUbThC90aDnNiE= +github.com/aws/aws-sdk-go-v2/service/route53 v1.48.1 h1:njgAP7Rtt4DGdTGFPhJ4gaZXCD1CDj/SZDa5W4ZgSTs= +github.com/aws/aws-sdk-go-v2/service/route53 v1.48.1/go.mod h1:TN4PcCL0lvqmYcv+AV8iZFC4Sd0FM06QDaoBXrFEftU= +github.com/aws/aws-sdk-go-v2/service/s3 v1.73.1 h1:OzmyfYGiMCOIAq5pa0KWcaZoA9F8FqajOJevh+hhFdY= +github.com/aws/aws-sdk-go-v2/service/s3 v1.73.1/go.mod h1:K+0a0kWDHAUXBH8GvYGS3cQRwIuRjO9bMWUz6vpNCaU= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.10 h1:DyZUj3xSw3FR3TXSwDhPhuZkkT14QHBiacdbUVcD0Dg= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.10/go.mod h1:Ro744S4fKiCCuZECXgOi760TiYylUM8ZBf6OGiZzJtY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.9 h1:I1TsPEs34vbpOnR81GIcAq4/3Ud+jRHVGwx6qLQUHLs= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.9/go.mod h1:Fzsj6lZEb8AkTE5S68OhcbBqeWPsR8RnGuKPr8Todl8= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.8 h1:pqEJQtlKWvnv3B6VRt60ZmsHy3SotlEBvfUBPB1KVcM= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.8/go.mod h1:f6vjfZER1M17Fokn0IzssOTMT2N8ZSq+7jnNF0tArvw= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= -github.com/baidubce/bce-sdk-go v0.9.209 h1:2UaYKD5D2kia+8bhLlqhYWZdhhGnx8vgHfHX7YUpXPg= -github.com/baidubce/bce-sdk-go v0.9.209/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= +github.com/baidubce/bce-sdk-go v0.9.214 h1:bsVfwMh/emI6vreEveUEq9xAr6xtHLycTAGy2K7kvKM= +github.com/baidubce/bce-sdk-go v0.9.214/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -260,8 +261,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blinkbean/dingtalk v1.1.3 h1:MbidFZYom7DTFHD/YIs+eaI7kRy52kmWE/sy0xjo6E4= github.com/blinkbean/dingtalk v1.1.3/go.mod h1:9BaLuGSBqY3vT5hstValh48DbsKO7vaHaJnG9pXwbto= -github.com/byteplus-sdk/byteplus-sdk-golang v1.0.35 h1:bM18V4iw9ylRc2LahQaq3k3gjEVJdyQYvptLVZaCa54= -github.com/byteplus-sdk/byteplus-sdk-golang v1.0.35/go.mod h1:7iCaE+dR9EycrJU0GQyMhptbInLbQhsKXiDKDjNi8Vs= +github.com/byteplus-sdk/byteplus-sdk-golang v1.0.40 h1:DIVVXfeIg4FXdN1pIoL3Q8YoC/VXu5nn2zcDKFHqe6s= +github.com/byteplus-sdk/byteplus-sdk-golang v1.0.40/go.mod h1:7iCaE+dR9EycrJU0GQyMhptbInLbQhsKXiDKDjNi8Vs= github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -283,11 +284,11 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= -github.com/clbanning/mxj/v2 v2.5.6 h1:Jm4VaCI/+Ug5Q57IzEoZbwx4iQFA6wkXv72juUSeK+g= -github.com/clbanning/mxj/v2 v2.5.6/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.112.0 h1:caFwqXdGJCl3rjVMgbPEn8iCYAg9JsRYV3dIVQE5d7g= -github.com/cloudflare/cloudflare-go v0.112.0/go.mod h1:QB55kuJ5ZTeLNFcLJePfMuBilhu/LDKpLBmKFQIoSZ0= +github.com/cloudflare/cloudflare-go v0.114.0 h1:ucoti4/7Exo0XQ+rzpn1H+IfVVe++zgiM+tyKtf0HUA= +github.com/cloudflare/cloudflare-go v0.114.0/go.mod h1:O7fYfFfA6wKqKFn2QIR9lhj7FDw6VQCGOY6hd2TBtd0= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -319,10 +320,8 @@ github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elastic/go-sysinfo v1.0.2/go.mod h1:O/D5m1VpYLwGjCYzEt63g3Z1uO3jXfwyzzjiW90t8cY= -github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -352,8 +351,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA= -github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU= +github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM= +github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8= github.com/gammazero/toposort v0.1.1/go.mod h1:H2cozTnNpMw0hg2VHAYsAxmkHXBYroNangj2NTBQDvw= github.com/ganigeorgiev/fexpr v0.4.1 h1:hpUgbUEEWIZhSDBtf4M9aUNfQQ0BZkGRaMePy7Gcx5k= github.com/ganigeorgiev/fexpr v0.4.1/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE= @@ -370,8 +369,8 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-lark/lark v1.15.0 h1:wzfzK9j85BrbFYcjxGZSjJiXbOxHQYkKjIClUwyT9XU= -github.com/go-lark/lark v1.15.0/go.mod h1:6ltbSztPZRT6IaO9ZIQyVaY5pVp/KeMizDYtfZkU+vM= +github.com/go-lark/lark v1.15.1 h1:fo6PQKBJht/71N9Zn3/xjknOYx0TmdVuP+VP8NrUCsI= +github.com/go-lark/lark v1.15.1/go.mod h1:6ltbSztPZRT6IaO9ZIQyVaY5pVp/KeMizDYtfZkU+vM= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -380,12 +379,10 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= @@ -463,8 +460,8 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -498,8 +495,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= -github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= +github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -554,8 +551,8 @@ github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKEN github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128 h1:kQ2Agpfy7Ze1ajn9xCQG9G6T7XIbqv+FBDS/U98W9Mk= -github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI= +github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.132 h1:5LqzrJa8LADcY0sDEdV35e8nbwI7RoUQEt+KXWvWoY0= +github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.132/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -573,7 +570,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= @@ -619,30 +615,25 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 h1:FwuzbVh87iLiUQj1+uQUsuw9x5t9m5n5g7rG7o4svW4= -github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61/go.mod h1:paQfF1YtHe+GrGg5fOgjsjoCX/UKDr9bc1DoWpZfns8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= +github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= @@ -684,8 +675,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nikoksr/notify v1.1.0 h1:IMw9p5ARDtKzZQmQSUy2+2LU/PPwBCdwQg2lCZh9EvY= -github.com/nikoksr/notify v1.1.0/go.mod h1:joe1r6qqAznTHzkC734Li8hxxVAYxzO6phBtMLfOVuo= +github.com/nikoksr/notify v1.3.0 h1:UxzfxzAYGQD9a5JYLBTVx0lFMxeHCke3rPCkfWdPgLs= +github.com/nikoksr/notify v1.3.0/go.mod h1:Xor2hMmkvrCfkCKvXGbcrESez4brac2zQjhd6U2BbeM= github.com/nrdcg/namesilo v0.2.1 h1:kLjCjsufdW/IlC+iSfAqj0iQGgKjlbUUeDJio5Y6eMg= github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -732,8 +723,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pocketbase/dbx v1.11.0 h1:LpZezioMfT3K4tLrqA55wWFw1EtH1pM4tzSVa7kgszU= github.com/pocketbase/dbx v1.11.0/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs= -github.com/pocketbase/pocketbase v0.22.21 h1:DGPCxn6co8VuTV0mton4NFO/ON49XiFMszRr+Mysy48= -github.com/pocketbase/pocketbase v0.22.21/go.mod h1:Cw5E4uoGhKItBIE2lJL3NfmiUr9Syk2xaNJ2G7Dssow= +github.com/pocketbase/pocketbase v0.24.3 h1:WUrzW11ijCySlDsVRHon3HXdtiratWv+ODK26/k6cI8= +github.com/pocketbase/pocketbase v0.24.3/go.mod h1:EfXV/8RUY76jA6g1RPNHjOuW7wTd2bz0QlvAI/RU8YY= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -751,20 +742,19 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/qiniu/dyn v1.3.0/go.mod h1:E8oERcm8TtwJiZvkQPbcAh0RL8jO1G0VXJMW3FAWdkk= -github.com/qiniu/go-sdk/v7 v7.25.1 h1:fynXKE2RP9XYkispAI3YI+eML39JFEx2+PLYP46ephA= -github.com/qiniu/go-sdk/v7 v7.25.1/go.mod h1:uZE85Pi0ftIHT/UNLShosdzwsovqpdas0LwAGO7cPao= +github.com/qiniu/go-sdk/v7 v7.25.2 h1:URwgZpxySdiwu2yQpHk93X4LXWHyFRp1x3Vmlk/YWvo= +github.com/qiniu/go-sdk/v7 v7.25.2/go.mod h1:dmKtJ2ahhPWFVi9o1D5GemmWoh/ctuB9peqTowyTO8o= github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= -github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= +github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= +github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -822,21 +812,20 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM= github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.1065 h1:q0Op2QlMmag0R2vZX08GvOh0T29dcUqc+aIHF6a1sIE= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.1065/go.mod h1:UiS7HMWbxGhO/y7nmnHuBMyP4qEDmJeooK6YKWNMuEw= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1065 h1:Kb/l5yh9M6Ow59ZRAMcdIBxsNT3uy8fZYh8xy2rM+xQ= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1065/go.mod h1:bgwicHdrBXLcgB4mQd8pWbSNuM7fIAjhxHfdZ/Hb7p4= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1065/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1080 h1:N+Urn1Sva75ZoYh9Gjf7A4kJAA3wWItxsoxyADZBol4= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1080/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1065 h1:aEFtLD1ceyeljQXB1S2BjN0zjTkf0X3XmpuxFIiC29w= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1065/go.mod h1:HWvwy09hFSMXrj9SMvVRWV4U7rZO3l+WuogyNuxiT3M= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.1080 h1:ygmXHhIedpjo0yFe6LbB+4ygHaVK8mnrwBAllfw7cX8= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.1080/go.mod h1:UuvtB7f2kQMCBC5vt8hbjWGEba8qzf5YWP+C3VLKY6w= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1065 h1:rHI/2WYmEBfnqVNo5iUy0gu0J7ekFBE/NDV/oKZv448= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1065/go.mod h1:nnd6/G8xfl7RMsm2XYdQT5SfjdxG/U09QaC6qO89JJg= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.1065 h1:gDuqak8/kNgF99+ksk70JHjI1Poa5pmrgYDW6xYya8I= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.1065/go.mod h1:r6yv70O5CZLsVhz6z05ZTGVUYxKQtGE2p90mopsR014= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.1084 h1:5Iz0/XXuUU1MdKrmvccQLAk+llp7bEk36h984qE8T9Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.1084/go.mod h1:3nbV34YVSizZRIqFx1dgNp4ef8omgIebKaLR9F5bICM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1084 h1:/71/twaTjtN5Hj9iMQaq4Zf20whqKcRO8FExzQMQzdM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1084/go.mod h1:i/+RxtoN5tjr68alWwo99kNNE7mNPYg2liUFvAwNtJk= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1084 h1:kVMffrA57uPQvNaPBXSp1NJPiz+Y0a/bxqiEVBjrZAI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1084/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1084 h1:kwctN0WQYt8/iKP+iRCTCwdzEMIXsXklbRIib5rjeQ8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1084/go.mod h1:qE67ApiBzeRvzeDsV+GxyIDbVIDemsKpHXllQATz/Vw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.1084 h1:5qycOmUrfeOXluBDdULUZdbadZsvNqdpXgkt3SfZGSI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/live v1.0.1084/go.mod h1:tEa+1jYkcgrFo4Y13orgk3D3BySAwnrZ1T+lnAU+3Q8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1084 h1:NBRaaKBeZKhGhpZkXKnAT8HWMQuV15QPNApBjB+4C8k= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1084/go.mod h1:+VVUGbyLN66PdAu7+qM0gTNKQ8JH02eJSaImGGg+UzU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.1084 h1:Tcl6f/fBt+y7KmhlRcCMenm4wRNf8z1fm0jrhDmIkaQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.1084/go.mod h1:hBCyZEVg22KuOIaiUc7M2mjXWpCwa8Q3T1X6h+3EPCA= github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= @@ -848,17 +837,13 @@ github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6 github.com/ucloud/ucloud-sdk-go v0.22.31 h1:izZK+Re9ZkJAd1fHSVpFzgh8uKda4f5G6++iUw4n/mE= github.com/ucloud/ucloud-sdk-go v0.22.31/go.mod h1:dyLmFHmUfgb4RZKYQP9IArlvQ2pxzFthfhwxRzOEPIw= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= -github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/volcengine/ve-tos-golang-sdk/v2 v2.7.8 h1:/vB6jop4i70Ys8KAzK0xZfbMzMggJsTnIp6gZYnnSFM= github.com/volcengine/ve-tos-golang-sdk/v2 v2.7.8/go.mod h1:IrjK84IJJTuOZOTMv/P18Ydjy/x+ow7fF7q11jAxXLM= github.com/volcengine/volc-sdk-golang v1.0.23/go.mod h1:AfG/PZRUkHJ9inETvbjNifTDgut25Wbkm2QoYBTbvyU= -github.com/volcengine/volc-sdk-golang v1.0.189 h1:VMDTHWYXakXJtZqPYn0As/h4eB0c4imvyru6mIp+o60= -github.com/volcengine/volc-sdk-golang v1.0.189/go.mod h1:u0VtPvlXWpXDTmc9IHkaW1q+5Jjwus4oAqRhNMDRInE= -github.com/volcengine/volcengine-go-sdk v1.0.177 h1:Z5D8BZAR1ilH7bLtRjBVP/I0QOIk7G/xuLvjeSJIax0= -github.com/volcengine/volcengine-go-sdk v1.0.177/go.mod h1:gfEDc1s7SYaGoY+WH2dRrS3qiuDJMkwqyfXWCa7+7oA= +github.com/volcengine/volc-sdk-golang v1.0.193 h1:mL1rlk+m9SaqF2MSGFWfigEaz10ZVJiYDnFuWfj65Ww= +github.com/volcengine/volc-sdk-golang v1.0.193/go.mod h1:u0VtPvlXWpXDTmc9IHkaW1q+5Jjwus4oAqRhNMDRInE= +github.com/volcengine/volcengine-go-sdk v1.0.178 h1:lCu2JuWOoIZAjNfJSBi/KLTWVFdvejLXsBrNE1wgCIU= +github.com/volcengine/volcengine-go-sdk v1.0.178/go.mod h1:gfEDc1s7SYaGoY+WH2dRrS3qiuDJMkwqyfXWCa7+7oA= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -878,8 +863,9 @@ go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQc go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE= go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0= +go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM= +go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -888,22 +874,22 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/detectors/gcp v1.31.0 h1:G1JQOreVrfhRkner+l4mrGxmfqYCAuy76asTDAo0xsA= -go.opentelemetry.io/contrib/detectors/gcp v1.31.0/go.mod h1:tzQL6E1l+iV44YFTkcAeNQqzXUiekSYP9jjJjXwEd00= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 h1:yMkBS9yViCc7U7yeLzJPM2XizlfdVvBRSmsQDWu6qc0= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0/go.mod h1:n8MR6/liuGB5EmTETUBeU5ZgqMOlqKRxUaqPQBOANZ8= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= -go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= -go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= -go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= -go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= -go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= -go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= -go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= -go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= -go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= -go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= +go.opentelemetry.io/contrib/detectors/gcp v1.32.0 h1:P78qWqkLSShicHmAzfECaTgvslqHxblNE9j62Ws1NK8= +go.opentelemetry.io/contrib/detectors/gcp v1.32.0/go.mod h1:TVqo0Sda4Cv8gCIixd7LuLwW4EylumVWfhjZJjDD4DU= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 h1:qtFISDHKolvIxzSs0gIaiPUPR0Cucb0F2coHC7ZLdps= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0/go.mod h1:Y+Pop1Q6hCOnETWTW4NROK/q1hv50hM7yDaUTjG8lp8= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -1049,8 +1035,8 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= -golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1078,7 +1064,6 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190425145619-16072639606e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1129,7 +1114,6 @@ golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1182,8 +1166,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1264,8 +1248,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA= -google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE= +google.golang.org/api v0.217.0 h1:GYrUtD289o4zl1AhiTZL0jvQGa2RDLyC+kX1N/lfGOU= +google.golang.org/api v0.217.0/go.mod h1:qMc2E8cBAbQlRypBTBWHklNJlaZZJBwDv81B1Iu8oSI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1304,12 +1288,12 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38 h1:Q3nlH8iSQSRUwOskjbcSMcF2jiYMNiQYZ0c2KEJLKKU= -google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38/go.mod h1:xBI+tzfqGGN2JBeSebfKXFSdBpWVQ7sLW40PTupVRm4= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb h1:3oy2tynMOP1QbTC0MsNNAV+Se8M2Bd0A5+x1QHyw+pI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1327,8 +1311,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= -google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A= +google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1344,8 +1328,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= -google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= +google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1389,54 +1373,53 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.32.0 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE= -k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0= -k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg= -k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/client-go v0.32.0 h1:DimtMcnN/JIKZcrSrstiwvvZvLjG0aSxy8PxN8IChp8= -k8s.io/client-go v0.32.0/go.mod h1:boDWvdM1Drk4NJj/VddSLnx59X3OPgwrOo0vGbtq9+8= +k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc= +k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k= +k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs= +k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU= +k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= -k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -modernc.org/cc/v4 v4.24.1 h1:mLykA8iIlZ/SZbwI2JgYIURXQMSgmOb/+5jaielxPi4= -modernc.org/cc/v4 v4.24.1/go.mod h1:T1lKJZhXIi2VSqGBiB4LIbKs9NsKTbUXj4IDrmGqtTI= -modernc.org/ccgo/v4 v4.23.5 h1:6uAwu8u3pnla3l/+UVUrDDO1HIGxHTYmFH6w+X9nsyw= -modernc.org/ccgo/v4 v4.23.5/go.mod h1:FogrWfBdzqLWm1ku6cfr4IzEFouq2fSAPf6aSAHdAJQ= +k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg= +k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7/go.mod h1:GewRfANuJ70iYzvn+i4lezLDAFzvjxZYK1gn1lWcfas= +k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= +k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= +modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y= +modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s= modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= -modernc.org/gc/v2 v2.6.0 h1:Tiw3pezQj7PfV8k4Dzyu/vhRHR2e92kOXtTFU8pbCl4= -modernc.org/gc/v2 v2.6.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= -modernc.org/gc/v3 v3.0.0-20241213165251-3bc300f6d0c9 h1:ovz6yUKX71igz2yvk4NpiCL5fvdjZAI+DhuDEGx1xyU= -modernc.org/gc/v3 v3.0.0-20241213165251-3bc300f6d0c9/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= -modernc.org/libc v1.61.5 h1:WzsPUvWl2CvsRmk2foyWWHUEUmQ2iW4oFyWOVR0O5ho= -modernc.org/libc v1.61.5/go.mod h1:llBdEGIywhnRgAFuTF+CWaKV8/2bFgACcQZTXhkAuAM= -modernc.org/mathutil v1.7.0 h1:KPlMfpLMs4EXAo8T8JJEkmCT9KP/B4vU1+GaBnDhHQY= -modernc.org/mathutil v1.7.0/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= -modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6 h1:JoKwHjIFumiKrjMbp1cNbC5E9UyCgA/ZcID0xOWQ2N8= +modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6/go.mod h1:LG5UO1Ran4OO0JRKz2oNiXhR5nNrgz0PzH7UKhz0aMU= +modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U= +modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w= +modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= +modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= +modernc.org/memory v1.8.2 h1:cL9L4bcoAObu4NkxOlKWBWtNHIsnnACGF/TbqQ6sbcI= +modernc.org/memory v1.8.2/go.mod h1:ZbjSvMO5NQ1A2i3bWeDiVMxIorXwdClKE/0SZ+BMotU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= modernc.org/sqlite v1.34.4 h1:sjdARozcL5KJBvYQvLlZEmctRgW9xqIZc2ncN7PU0P8= modernc.org/sqlite v1.34.4/go.mod h1:3QQFCG2SEMtc2nv+Wq4cQCH7Hjcg+p/RMlS1XK+zwbk= -modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= -modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= +modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= +sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= +sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/internal/app/app.go b/internal/app/app.go index 7a13e2ea..11c81d8d 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -4,14 +4,16 @@ import ( "log/slog" "sync" + "github.com/pocketbase/dbx" "github.com/pocketbase/pocketbase" + "github.com/pocketbase/pocketbase/core" ) -var instance *pocketbase.PocketBase +var instance core.App var intanceOnce sync.Once -func GetApp() *pocketbase.PocketBase { +func GetApp() core.App { intanceOnce.Do(func() { instance = pocketbase.NewWithConfig(pocketbase.Config{ HideStartBanner: true, @@ -21,6 +23,10 @@ func GetApp() *pocketbase.PocketBase { return instance } +func GetDB() dbx.Builder { + return GetApp().DB() +} + func GetLogger() *slog.Logger { return GetApp().Logger() } diff --git a/internal/app/scheduler.go b/internal/app/scheduler.go index 6b274302..1b16ac32 100644 --- a/internal/app/scheduler.go +++ b/internal/app/scheduler.go @@ -12,11 +12,13 @@ var scheduler *cron.Cron var schedulerOnce sync.Once func GetScheduler() *cron.Cron { + scheduler = GetApp().Cron() schedulerOnce.Do(func() { - scheduler = cron.New() location, err := time.LoadLocation("Local") if err == nil { + scheduler.Stop() scheduler.SetTimezone(location) + scheduler.Start() } }) diff --git a/internal/certificate/service.go b/internal/certificate/service.go index 83c97c83..6fb2db34 100644 --- a/internal/certificate/service.go +++ b/internal/certificate/service.go @@ -32,8 +32,7 @@ func NewCertificateService(repo certificateRepository) *CertificateService { } func (s *CertificateService) InitSchedule(ctx context.Context) error { - scheduler := app.GetScheduler() - err := scheduler.Add("certificate", "0 0 * * *", func() { + app.GetScheduler().MustAdd("certificateExpireSoonNotify", "0 0 * * *", func() { certs, err := s.repo.ListExpireSoon(context.Background()) if err != nil { app.GetLogger().Error("failed to get certificates which expire soon", "err", err) @@ -49,12 +48,6 @@ func (s *CertificateService) InitSchedule(ctx context.Context) error { app.GetLogger().Error("failed to send notification", "err", err) } }) - if err != nil { - app.GetLogger().Error("failed to add schedule", "err", err) - return err - } - scheduler.Start() - app.GetLogger().Info("certificate schedule started") return nil } diff --git a/internal/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn.go b/internal/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn.go index 1b2de807..5c303ce4 100644 --- a/internal/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn.go +++ b/internal/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn.go @@ -15,7 +15,6 @@ import ( "github.com/usual2970/certimate/internal/pkg/core/uploader" providerScm "github.com/usual2970/certimate/internal/pkg/core/uploader/providers/huaweicloud-scm" hwsdk "github.com/usual2970/certimate/internal/pkg/vendors/huaweicloud-sdk" - hwsdkCdn "github.com/usual2970/certimate/internal/pkg/vendors/huaweicloud-sdk/cdn" ) type HuaweiCloudCDNDeployerConfig struct { @@ -32,7 +31,7 @@ type HuaweiCloudCDNDeployerConfig struct { type HuaweiCloudCDNDeployer struct { config *HuaweiCloudCDNDeployerConfig logger logger.Logger - sdkClient *hwsdkCdn.Client + sdkClient *hcCdn.CdnClient sslUploader uploader.Uploader } @@ -100,21 +99,21 @@ func (d *HuaweiCloudCDNDeployer) Deploy(ctx context.Context, certPem string, pri // 更新加速域名配置 // REF: https://support.huaweicloud.com/api-cdn/UpdateDomainMultiCertificates.html // REF: https://support.huaweicloud.com/usermanual-cdn/cdn_01_0306.html - updateDomainMultiCertificatesReqBodyContent := &hwsdkCdn.UpdateDomainMultiCertificatesExRequestBodyContent{} + updateDomainMultiCertificatesReqBodyContent := &hcCdnModel.UpdateDomainMultiCertificatesRequestBodyContent{} updateDomainMultiCertificatesReqBodyContent.DomainName = d.config.Domain updateDomainMultiCertificatesReqBodyContent.HttpsSwitch = 1 updateDomainMultiCertificatesReqBodyContent.CertificateType = hwsdk.Int32Ptr(2) - updateDomainMultiCertificatesReqBodyContent.SCMCertificateId = hwsdk.StringPtr(upres.CertId) + updateDomainMultiCertificatesReqBodyContent.ScmCertificateId = hwsdk.StringPtr(upres.CertId) updateDomainMultiCertificatesReqBodyContent.CertName = hwsdk.StringPtr(upres.CertName) - updateDomainMultiCertificatesReqBodyContent = updateDomainMultiCertificatesReqBodyContent.MergeConfig(showDomainFullConfigResp.Configs) - updateDomainMultiCertificatesReq := &hwsdkCdn.UpdateDomainMultiCertificatesExRequest{ - Body: &hwsdkCdn.UpdateDomainMultiCertificatesExRequestBody{ + updateDomainMultiCertificatesReqBodyContent = assign(updateDomainMultiCertificatesReqBodyContent, showDomainFullConfigResp.Configs) + updateDomainMultiCertificatesReq := &hcCdnModel.UpdateDomainMultiCertificatesRequest{ + Body: &hcCdnModel.UpdateDomainMultiCertificatesRequestBody{ Https: updateDomainMultiCertificatesReqBodyContent, }, } - updateDomainMultiCertificatesResp, err := d.sdkClient.UploadDomainMultiCertificatesEx(updateDomainMultiCertificatesReq) + updateDomainMultiCertificatesResp, err := d.sdkClient.UpdateDomainMultiCertificates(updateDomainMultiCertificatesReq) if err != nil { - return nil, xerrors.Wrap(err, "failed to execute sdk request 'cdn.UploadDomainMultiCertificatesEx'") + return nil, xerrors.Wrap(err, "failed to execute sdk request 'cdn.UploadDomainMultiCertificates'") } d.logger.Logt("已更新加速域名配置", updateDomainMultiCertificatesResp) @@ -122,7 +121,7 @@ func (d *HuaweiCloudCDNDeployer) Deploy(ctx context.Context, certPem string, pri return &deployer.DeployResult{}, nil } -func createSdkClient(accessKeyId, secretAccessKey, region string) (*hwsdkCdn.Client, error) { +func createSdkClient(accessKeyId, secretAccessKey, region string) (*hcCdn.CdnClient, error) { if region == "" { region = "cn-north-1" // CDN 服务默认区域:华北一北京 } @@ -148,6 +147,42 @@ func createSdkClient(accessKeyId, secretAccessKey, region string) (*hwsdkCdn.Cli return nil, err } - client := hwsdkCdn.NewClient(hcClient) + client := hcCdn.NewCdnClient(hcClient) return client, nil } + +func assign(reqContent *hcCdnModel.UpdateDomainMultiCertificatesRequestBodyContent, target *hcCdnModel.ConfigsGetBody) *hcCdnModel.UpdateDomainMultiCertificatesRequestBodyContent { + if target == nil { + return reqContent + } + + // 华为云 API 中不传的字段表示使用默认值、而非保留原值,因此这里需要把原配置中的参数重新赋值回去。 + // 而且蛋疼的是查询接口返回的数据结构和更新接口传入的参数结构不一致,需要做很多转化。 + + if *target.OriginProtocol == "follow" { + reqContent.AccessOriginWay = hwsdk.Int32Ptr(1) + } else if *target.OriginProtocol == "http" { + reqContent.AccessOriginWay = hwsdk.Int32Ptr(2) + } else if *target.OriginProtocol == "https" { + reqContent.AccessOriginWay = hwsdk.Int32Ptr(3) + } + + if target.ForceRedirect != nil { + reqContent.ForceRedirectConfig = &hcCdnModel.ForceRedirect{} + + if target.ForceRedirect.Status == "on" { + reqContent.ForceRedirectConfig.Switch = 1 + reqContent.ForceRedirectConfig.RedirectType = target.ForceRedirect.Type + } else { + reqContent.ForceRedirectConfig.Switch = 0 + } + } + + if target.Https != nil { + if *target.Https.Http2Status == "on" { + reqContent.Http2 = hwsdk.Int32Ptr(1) + } + } + + return reqContent +} diff --git a/internal/pkg/vendors/huaweicloud-sdk/cdn/client.go b/internal/pkg/vendors/huaweicloud-sdk/cdn/client.go deleted file mode 100644 index 842ce9ef..00000000 --- a/internal/pkg/vendors/huaweicloud-sdk/cdn/client.go +++ /dev/null @@ -1,28 +0,0 @@ -package cdn - -import ( - "github.com/huaweicloud/huaweicloud-sdk-go-v3/core" - hcCdn "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2" - hcCdnModel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2/model" -) - -type Client struct { - hcCdn.CdnClient -} - -func NewClient(hcClient *core.HcHttpClient) *Client { - return &Client{ - CdnClient: *hcCdn.NewCdnClient(hcClient), - } -} - -func (c *Client) UploadDomainMultiCertificatesEx(request *UpdateDomainMultiCertificatesExRequest) (*UpdateDomainMultiCertificatesExResponse, error) { - requestDef := hcCdn.GenReqDefForUpdateDomainMultiCertificates() - - if resp, err := c.HcClient.Sync(request, requestDef); err != nil { - return nil, err - } else { - temp := resp.(*hcCdnModel.UpdateDomainMultiCertificatesResponse) - return &UpdateDomainMultiCertificatesExResponse{UpdateDomainMultiCertificatesResponse: *temp}, nil - } -} diff --git a/internal/pkg/vendors/huaweicloud-sdk/cdn/models.go b/internal/pkg/vendors/huaweicloud-sdk/cdn/models.go deleted file mode 100644 index 5aa167f0..00000000 --- a/internal/pkg/vendors/huaweicloud-sdk/cdn/models.go +++ /dev/null @@ -1,62 +0,0 @@ -package cdn - -import ( - hcCdnModel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2/model" - - hwsdk "github.com/usual2970/certimate/internal/pkg/vendors/huaweicloud-sdk" -) - -type UpdateDomainMultiCertificatesExRequestBodyContent struct { - hcCdnModel.UpdateDomainMultiCertificatesRequestBodyContent `json:",inline"` - - // 华为云官方 SDK 中目前提供的字段缺失,这里暂时先需自定义请求,可能需要等之后 SDK 更新。 - SCMCertificateId *string `json:"scm_certificate_id,omitempty"` -} - -type UpdateDomainMultiCertificatesExRequestBody struct { - Https *UpdateDomainMultiCertificatesExRequestBodyContent `json:"https,omitempty"` -} - -type UpdateDomainMultiCertificatesExRequest struct { - Body *UpdateDomainMultiCertificatesExRequestBody `json:"body,omitempty"` -} - -type UpdateDomainMultiCertificatesExResponse struct { - hcCdnModel.UpdateDomainMultiCertificatesResponse -} - -func (m *UpdateDomainMultiCertificatesExRequestBodyContent) MergeConfig(src *hcCdnModel.ConfigsGetBody) *UpdateDomainMultiCertificatesExRequestBodyContent { - if src == nil { - return m - } - - // 华为云 API 中不传的字段表示使用默认值、而非保留原值,因此这里需要把原配置中的参数重新赋值回去。 - // 而且蛋疼的是查询接口返回的数据结构和更新接口传入的参数结构不一致,需要做很多转化。 - - if *src.OriginProtocol == "follow" { - m.AccessOriginWay = hwsdk.Int32Ptr(1) - } else if *src.OriginProtocol == "http" { - m.AccessOriginWay = hwsdk.Int32Ptr(2) - } else if *src.OriginProtocol == "https" { - m.AccessOriginWay = hwsdk.Int32Ptr(3) - } - - if src.ForceRedirect != nil { - m.ForceRedirectConfig = &hcCdnModel.ForceRedirect{} - - if src.ForceRedirect.Status == "on" { - m.ForceRedirectConfig.Switch = 1 - m.ForceRedirectConfig.RedirectType = src.ForceRedirect.Type - } else { - m.ForceRedirectConfig.Switch = 0 - } - } - - if src.Https != nil { - if *src.Https.Http2Status == "on" { - m.Http2 = hwsdk.Int32Ptr(1) - } - } - - return m -} diff --git a/internal/repository/access.go b/internal/repository/access.go index 9244a112..8ce6450a 100644 --- a/internal/repository/access.go +++ b/internal/repository/access.go @@ -6,7 +6,8 @@ import ( "errors" "fmt" - "github.com/pocketbase/pocketbase/models" + "github.com/pocketbase/pocketbase/core" + "github.com/usual2970/certimate/internal/app" "github.com/usual2970/certimate/internal/domain" ) @@ -18,7 +19,7 @@ func NewAccessRepository() *AccessRepository { } func (r *AccessRepository) GetById(ctx context.Context, id string) (*domain.Access, error) { - record, err := app.GetApp().Dao().FindRecordById("access", id) + record, err := app.GetApp().FindRecordById("access", id) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, domain.ErrRecordNotFound @@ -33,16 +34,16 @@ func (r *AccessRepository) GetById(ctx context.Context, id string) (*domain.Acce return r.castRecordToModel(record) } -func (r *AccessRepository) castRecordToModel(record *models.Record) (*domain.Access, error) { +func (r *AccessRepository) castRecordToModel(record *core.Record) (*domain.Access, error) { if record == nil { return nil, fmt.Errorf("record is nil") } access := &domain.Access{ Meta: domain.Meta{ - Id: record.GetId(), - CreatedAt: record.GetCreated().Time(), - UpdatedAt: record.GetUpdated().Time(), + Id: record.Id, + CreatedAt: record.GetDateTime("created").Time(), + UpdatedAt: record.GetDateTime("updated").Time(), }, Name: record.GetString("name"), Provider: record.GetString("provider"), diff --git a/internal/repository/acme_account.go b/internal/repository/acme_account.go index f5996fe9..85ee0fbf 100644 --- a/internal/repository/acme_account.go +++ b/internal/repository/acme_account.go @@ -5,7 +5,7 @@ import ( "github.com/go-acme/lego/v4/registration" "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/models" + "github.com/pocketbase/pocketbase/core" "golang.org/x/sync/singleflight" "github.com/usual2970/certimate/internal/app" @@ -22,7 +22,7 @@ var g singleflight.Group func (r *AcmeAccountRepository) GetByCAAndEmail(ca, email string) (*domain.AcmeAccount, error) { resp, err, _ := g.Do(fmt.Sprintf("acme_account_%s_%s", ca, email), func() (interface{}, error) { - resp, err := app.GetApp().Dao().FindFirstRecordByFilter( + resp, err := app.GetApp().FindFirstRecordByFilter( "acme_accounts", "ca={:ca} && email={:email}", dbx.Params{"ca": ca, "email": email}, @@ -40,7 +40,7 @@ func (r *AcmeAccountRepository) GetByCAAndEmail(ca, email string) (*domain.AcmeA return nil, domain.ErrRecordNotFound } - record, ok := resp.(*models.Record) + record, ok := resp.(*core.Record) if !ok { return nil, domain.ErrRecordNotFound } @@ -49,20 +49,20 @@ func (r *AcmeAccountRepository) GetByCAAndEmail(ca, email string) (*domain.AcmeA } func (r *AcmeAccountRepository) Save(ca, email, key string, resource *registration.Resource) error { - collection, err := app.GetApp().Dao().FindCollectionByNameOrId("acme_accounts") + collection, err := app.GetApp().FindCollectionByNameOrId("acme_accounts") if err != nil { return err } - record := models.NewRecord(collection) + record := core.NewRecord(collection) record.Set("ca", ca) record.Set("email", email) record.Set("key", key) record.Set("resource", resource) - return app.GetApp().Dao().Save(record) + return app.GetApp().Save(record) } -func (r *AcmeAccountRepository) castRecordToModel(record *models.Record) (*domain.AcmeAccount, error) { +func (r *AcmeAccountRepository) castRecordToModel(record *core.Record) (*domain.AcmeAccount, error) { if record == nil { return nil, fmt.Errorf("record is nil") } @@ -74,9 +74,9 @@ func (r *AcmeAccountRepository) castRecordToModel(record *models.Record) (*domai acmeAccount := &domain.AcmeAccount{ Meta: domain.Meta{ - Id: record.GetId(), - CreatedAt: record.GetCreated().Time(), - UpdatedAt: record.GetUpdated().Time(), + Id: record.Id, + CreatedAt: record.GetDateTime("created").Time(), + UpdatedAt: record.GetDateTime("updated").Time(), }, CA: record.GetString("ca"), Email: record.GetString("email"), diff --git a/internal/repository/certificate.go b/internal/repository/certificate.go index 0499eb48..d56e7f72 100644 --- a/internal/repository/certificate.go +++ b/internal/repository/certificate.go @@ -7,7 +7,7 @@ import ( "fmt" "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/models" + "github.com/pocketbase/pocketbase/core" "github.com/usual2970/certimate/internal/app" "github.com/usual2970/certimate/internal/domain" ) @@ -19,7 +19,7 @@ func NewCertificateRepository() *CertificateRepository { } func (r *CertificateRepository) ListExpireSoon(ctx context.Context) ([]*domain.Certificate, error) { - records, err := app.GetApp().Dao().FindRecordsByFilter( + records, err := app.GetApp().FindRecordsByFilter( "certificate", "expireAt>DATETIME('now') && expireAt DATETIME('now') and expireAt < DATETIME('now', '+20 days')"). One(&certExpireSoonTotal); err != nil { return nil, err @@ -40,7 +42,7 @@ func (r *StatisticsRepository) Get(ctx context.Context) (*domain.Statistics, err certExpiredTotal := struct { Total int `db:"total"` }{} - if err := app.GetApp().Dao().DB(). + if err := app.GetDB(). NewQuery("SELECT COUNT(*) AS total FROM certificate WHERE expireAt < DATETIME('now')"). One(&certExpiredTotal); err != nil { return nil, err @@ -51,7 +53,9 @@ func (r *StatisticsRepository) Get(ctx context.Context) (*domain.Statistics, err workflowTotal := struct { Total int `db:"total"` }{} - if err := app.GetApp().Dao().DB().NewQuery("SELECT COUNT(*) AS total FROM workflow").One(&workflowTotal); err != nil { + if err := app.GetDB(). + NewQuery("SELECT COUNT(*) AS total FROM workflow"). + One(&workflowTotal); err != nil { return nil, err } rs.WorkflowTotal = workflowTotal.Total @@ -60,7 +64,9 @@ func (r *StatisticsRepository) Get(ctx context.Context) (*domain.Statistics, err workflowEnabledTotal := struct { Total int `db:"total"` }{} - if err := app.GetApp().Dao().DB().NewQuery("SELECT COUNT(*) AS total FROM workflow WHERE enabled IS TRUE").One(&workflowEnabledTotal); err != nil { + if err := app.GetDB(). + NewQuery("SELECT COUNT(*) AS total FROM workflow WHERE enabled IS TRUE"). + One(&workflowEnabledTotal); err != nil { return nil, err } rs.WorkflowEnabled = workflowEnabledTotal.Total diff --git a/internal/repository/workflow.go b/internal/repository/workflow.go index c4f13ba1..d38f612d 100644 --- a/internal/repository/workflow.go +++ b/internal/repository/workflow.go @@ -7,8 +7,7 @@ import ( "fmt" "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/daos" - "github.com/pocketbase/pocketbase/models" + "github.com/pocketbase/pocketbase/core" "github.com/usual2970/certimate/internal/app" "github.com/usual2970/certimate/internal/domain" ) @@ -20,7 +19,7 @@ func NewWorkflowRepository() *WorkflowRepository { } func (r *WorkflowRepository) ListEnabledAuto(ctx context.Context) ([]*domain.Workflow, error) { - records, err := app.GetApp().Dao().FindRecordsByFilter( + records, err := app.GetApp().FindRecordsByFilter( "workflow", "enabled={:enabled} && trigger={:trigger}", "-created", @@ -45,7 +44,7 @@ func (r *WorkflowRepository) ListEnabledAuto(ctx context.Context) ([]*domain.Wor } func (r *WorkflowRepository) GetById(ctx context.Context, id string) (*domain.Workflow, error) { - record, err := app.GetApp().Dao().FindRecordById("workflow", id) + record, err := app.GetApp().FindRecordById("workflow", id) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, domain.ErrRecordNotFound @@ -57,16 +56,16 @@ func (r *WorkflowRepository) GetById(ctx context.Context, id string) (*domain.Wo } func (r *WorkflowRepository) Save(ctx context.Context, workflow *domain.Workflow) error { - collection, err := app.GetApp().Dao().FindCollectionByNameOrId(workflow.Table()) + collection, err := app.GetApp().FindCollectionByNameOrId(workflow.Table()) if err != nil { return err } - var record *models.Record + var record *core.Record if workflow.Id == "" { - record = models.NewRecord(collection) + record = core.NewRecord(collection) } else { - record, err = app.GetApp().Dao().FindRecordById(workflow.Table(), workflow.Id) + record, err = app.GetApp().FindRecordById(workflow.Table(), workflow.Id) if err != nil { if errors.Is(err, sql.ErrNoRows) { return domain.ErrRecordNotFound @@ -87,40 +86,43 @@ func (r *WorkflowRepository) Save(ctx context.Context, workflow *domain.Workflow record.Set("lastRunStatus", string(workflow.LastRunStatus)) record.Set("lastRunTime", workflow.LastRunTime) - return app.GetApp().Dao().SaveRecord(record) + return app.GetApp().Save(record) } func (r *WorkflowRepository) SaveRun(ctx context.Context, workflowRun *domain.WorkflowRun) error { - collection, err := app.GetApp().Dao().FindCollectionByNameOrId("workflow_run") + collection, err := app.GetApp().FindCollectionByNameOrId("workflow_run") if err != nil { return err } - err = app.GetApp().Dao().RunInTransaction(func(txDao *daos.Dao) error { - record := models.NewRecord(collection) - record.Set("workflowId", workflowRun.WorkflowId) - record.Set("trigger", string(workflowRun.Trigger)) - record.Set("status", string(workflowRun.Status)) - record.Set("startedAt", workflowRun.StartedAt) - record.Set("endedAt", workflowRun.EndedAt) - record.Set("logs", workflowRun.Logs) - record.Set("error", workflowRun.Error) - err = txDao.SaveRecord(record) + err = app.GetApp().RunInTransaction(func(txApp core.App) error { + workflowRunRecord := core.NewRecord(collection) + workflowRunRecord.Set("workflowId", workflowRun.WorkflowId) + workflowRunRecord.Set("trigger", string(workflowRun.Trigger)) + workflowRunRecord.Set("status", string(workflowRun.Status)) + workflowRunRecord.Set("startedAt", workflowRun.StartedAt) + workflowRunRecord.Set("endedAt", workflowRun.EndedAt) + workflowRunRecord.Set("logs", workflowRun.Logs) + workflowRunRecord.Set("error", workflowRun.Error) + err = txApp.Save(workflowRunRecord) if err != nil { return err } - // unable trigger sse using DB() - workflowRecord, err := txDao.FindRecordById("workflow", workflowRun.WorkflowId) + workflowRecord, err := txApp.FindRecordById("workflow", workflowRun.WorkflowId) if err != nil { return err } - workflowRecord.Set("lastRunId", record.GetId()) - workflowRecord.Set("lastRunStatus", record.GetString("status")) - workflowRecord.Set("lastRunTime", record.GetString("startedAt")) + workflowRecord.Set("lastRunId", workflowRunRecord.Id) + workflowRecord.Set("lastRunStatus", workflowRunRecord.GetString("status")) + workflowRecord.Set("lastRunTime", workflowRunRecord.GetString("startedAt")) + err = txApp.Save(workflowRecord) + if err != nil { + return err + } - return txDao.SaveRecord(workflowRecord) + return nil }) if err != nil { return err @@ -129,7 +131,7 @@ func (r *WorkflowRepository) SaveRun(ctx context.Context, workflowRun *domain.Wo return nil } -func (r *WorkflowRepository) castRecordToModel(record *models.Record) (*domain.Workflow, error) { +func (r *WorkflowRepository) castRecordToModel(record *core.Record) (*domain.Workflow, error) { if record == nil { return nil, fmt.Errorf("record is nil") } @@ -146,9 +148,9 @@ func (r *WorkflowRepository) castRecordToModel(record *models.Record) (*domain.W workflow := &domain.Workflow{ Meta: domain.Meta{ - Id: record.GetId(), - CreatedAt: record.GetCreated().Time(), - UpdatedAt: record.GetUpdated().Time(), + Id: record.Id, + CreatedAt: record.GetDateTime("created").Time(), + UpdatedAt: record.GetDateTime("updated").Time(), }, Name: record.GetString("name"), Description: record.GetString("description"), diff --git a/internal/repository/workflow_output.go b/internal/repository/workflow_output.go index 43a6294b..8d9a2ff8 100644 --- a/internal/repository/workflow_output.go +++ b/internal/repository/workflow_output.go @@ -6,7 +6,7 @@ import ( "errors" "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/models" + "github.com/pocketbase/pocketbase/core" "github.com/usual2970/certimate/internal/app" "github.com/usual2970/certimate/internal/domain" ) @@ -18,7 +18,7 @@ func NewWorkflowOutputRepository() *WorkflowOutputRepository { } func (r *WorkflowOutputRepository) GetByNodeId(ctx context.Context, nodeId string) (*domain.WorkflowOutput, error) { - records, err := app.GetApp().Dao().FindRecordsByFilter( + records, err := app.GetApp().FindRecordsByFilter( "workflow_output", "nodeId={:nodeId}", "-created", @@ -48,9 +48,9 @@ func (r *WorkflowOutputRepository) GetByNodeId(ctx context.Context, nodeId strin rs := &domain.WorkflowOutput{ Meta: domain.Meta{ - Id: record.GetId(), - CreatedAt: record.GetCreated().Time(), - UpdatedAt: record.GetUpdated().Time(), + Id: record.Id, + CreatedAt: record.GetDateTime("created").Time(), + UpdatedAt: record.GetDateTime("updated").Time(), }, WorkflowId: record.GetString("workflowId"), NodeId: record.GetString("nodeId"), @@ -64,17 +64,17 @@ func (r *WorkflowOutputRepository) GetByNodeId(ctx context.Context, nodeId strin // 保存节点输出 func (r *WorkflowOutputRepository) Save(ctx context.Context, output *domain.WorkflowOutput, certificate *domain.Certificate, cb func(id string) error) error { - var record *models.Record + var record *core.Record var err error if output.Id == "" { - collection, err := app.GetApp().Dao().FindCollectionByNameOrId("workflow_output") + collection, err := app.GetApp().FindCollectionByNameOrId("workflow_output") if err != nil { return err } - record = models.NewRecord(collection) + record = core.NewRecord(collection) } else { - record, err = app.GetApp().Dao().FindRecordById("workflow_output", output.Id) + record, err = app.GetApp().FindRecordById("workflow_output", output.Id) if err != nil { return err } @@ -85,21 +85,21 @@ func (r *WorkflowOutputRepository) Save(ctx context.Context, output *domain.Work record.Set("outputs", output.Outputs) record.Set("succeeded", output.Succeeded) - if err := app.GetApp().Dao().SaveRecord(record); err != nil { + if err := app.GetApp().Save(record); err != nil { return err } if cb != nil && certificate != nil { - if err := cb(record.GetId()); err != nil { + if err := cb(record.Id); err != nil { return err } - certCollection, err := app.GetApp().Dao().FindCollectionByNameOrId("certificate") + certCollection, err := app.GetApp().FindCollectionByNameOrId("certificate") if err != nil { return err } - certRecord := models.NewRecord(certCollection) + certRecord := core.NewRecord(certCollection) certRecord.Set("source", string(certificate.Source)) certRecord.Set("subjectAltNames", certificate.SubjectAltNames) certRecord.Set("certificate", certificate.Certificate) @@ -113,21 +113,21 @@ func (r *WorkflowOutputRepository) Save(ctx context.Context, output *domain.Work certRecord.Set("workflowNodeId", certificate.WorkflowNodeId) certRecord.Set("workflowOutputId", certificate.WorkflowOutputId) - if err := app.GetApp().Dao().SaveRecord(certRecord); err != nil { + if err := app.GetApp().Save(certRecord); err != nil { return err } // 更新 certificate for i, item := range output.Outputs { if item.Name == domain.WORKFLOW_OUTPUT_CERTIFICATE { - output.Outputs[i].Value = certRecord.GetId() + output.Outputs[i].Value = certRecord.Id break } } record.Set("outputs", output.Outputs) - if err := app.GetApp().Dao().SaveRecord(record); err != nil { + if err := app.GetApp().Save(record); err != nil { return err } diff --git a/internal/rest/handlers/notify.go b/internal/rest/handlers/notify.go new file mode 100644 index 00000000..ad7c650f --- /dev/null +++ b/internal/rest/handlers/notify.go @@ -0,0 +1,41 @@ +package handlers + +import ( + "context" + + "github.com/pocketbase/pocketbase/core" + "github.com/pocketbase/pocketbase/tools/router" + + "github.com/usual2970/certimate/internal/domain" + "github.com/usual2970/certimate/internal/rest/resp" +) + +type notifyService interface { + Test(ctx context.Context, req *domain.NotifyTestPushReq) error +} + +type NotifyHandler struct { + service notifyService +} + +func NewNotifyHandler(router *router.RouterGroup[*core.RequestEvent], service notifyService) { + handler := &NotifyHandler{ + service: service, + } + + group := router.Group("/notify") + group.POST("/test", handler.test) +} + +func (handler *NotifyHandler) test(e *core.RequestEvent) error { + req := &domain.NotifyTestPushReq{} + if err := e.BindBody(req); err != nil { + return resp.Err(e, err) + } + + if err := handler.service.Test(e.Request.Context(), req); err != nil { + return resp.Err(e, err) + } + + return resp.Ok(e, nil) +} diff --git a/internal/rest/handlers/statistics.go b/internal/rest/handlers/statistics.go new file mode 100644 index 00000000..65853cae --- /dev/null +++ b/internal/rest/handlers/statistics.go @@ -0,0 +1,36 @@ +package handlers + +import ( + "context" + + "github.com/pocketbase/pocketbase/core" + "github.com/pocketbase/pocketbase/tools/router" + + "github.com/usual2970/certimate/internal/domain" + "github.com/usual2970/certimate/internal/rest/resp" +) + +type statisticsService interface { + Get(ctx context.Context) (*domain.Statistics, error) +} + +type StatisticsHandler struct { + service statisticsService +} + +func NewStatisticsHandler(router *router.RouterGroup[*core.RequestEvent], service statisticsService) { + handler := &StatisticsHandler{ + service: service, + } + + group := router.Group("/statistics") + group.GET("/get", handler.get) +} + +func (handler *StatisticsHandler) get(e *core.RequestEvent) error { + if statistics, err := handler.service.Get(e.Request.Context()); err != nil { + return resp.Err(e, err) + } else { + return resp.Ok(e, statistics) + } +} diff --git a/internal/rest/handlers/workflow.go b/internal/rest/handlers/workflow.go new file mode 100644 index 00000000..d6d30720 --- /dev/null +++ b/internal/rest/handlers/workflow.go @@ -0,0 +1,42 @@ +package handlers + +import ( + "context" + + "github.com/pocketbase/pocketbase/core" + "github.com/pocketbase/pocketbase/tools/router" + + "github.com/usual2970/certimate/internal/domain" + "github.com/usual2970/certimate/internal/rest/resp" +) + +type workflowService interface { + Run(ctx context.Context, req *domain.WorkflowRunReq) error + Stop(ctx context.Context) +} + +type WorkflowHandler struct { + service workflowService +} + +func NewWorkflowHandler(router *router.RouterGroup[*core.RequestEvent], service workflowService) { + handler := &WorkflowHandler{ + service: service, + } + + group := router.Group("/workflow") + group.POST("/run", handler.run) +} + +func (handler *WorkflowHandler) run(e *core.RequestEvent) error { + req := &domain.WorkflowRunReq{} + if err := e.BindBody(req); err != nil { + return resp.Err(e, err) + } + + if err := handler.service.Run(e.Request.Context(), req); err != nil { + return resp.Err(e, err) + } + + return resp.Ok(e, nil) +} diff --git a/internal/rest/notify.go b/internal/rest/notify.go deleted file mode 100644 index 33a8d461..00000000 --- a/internal/rest/notify.go +++ /dev/null @@ -1,40 +0,0 @@ -package rest - -import ( - "context" - - "github.com/usual2970/certimate/internal/domain" - "github.com/usual2970/certimate/internal/rest/resp" - - "github.com/labstack/echo/v5" -) - -type notifyService interface { - Test(ctx context.Context, req *domain.NotifyTestPushReq) error -} - -type NotifyHandler struct { - service notifyService -} - -func NewNotifyHandler(route *echo.Group, service notifyService) { - handler := &NotifyHandler{ - service: service, - } - - group := route.Group("/notify") - group.POST("/test", handler.test) -} - -func (handler *NotifyHandler) test(c echo.Context) error { - req := &domain.NotifyTestPushReq{} - if err := c.Bind(req); err != nil { - return resp.Err(c, err) - } - - if err := handler.service.Test(c.Request().Context(), req); err != nil { - return resp.Err(c, err) - } - - return resp.Ok(c, nil) -} diff --git a/internal/rest/resp/resp.go b/internal/rest/resp/resp.go index 20fd4a06..3b0ae91b 100644 --- a/internal/rest/resp/resp.go +++ b/internal/rest/resp/resp.go @@ -3,7 +3,7 @@ package resp import ( "net/http" - "github.com/labstack/echo/v5" + "github.com/pocketbase/pocketbase/core" "github.com/usual2970/certimate/internal/domain" ) @@ -14,7 +14,7 @@ type Response struct { Data interface{} `json:"data"` } -func Ok(e echo.Context, data interface{}) error { +func Ok(e *core.RequestEvent, data interface{}) error { rs := &Response{ Code: 0, Msg: "success", @@ -23,7 +23,7 @@ func Ok(e echo.Context, data interface{}) error { return e.JSON(http.StatusOK, rs) } -func Err(e echo.Context, err error) error { +func Err(e *core.RequestEvent, err error) error { code := 500 xerr, ok := err.(*domain.Error) diff --git a/internal/routes/routes.go b/internal/rest/routes/routes.go similarity index 66% rename from internal/routes/routes.go rename to internal/rest/routes/routes.go index b85b30a1..638c9a10 100644 --- a/internal/routes/routes.go +++ b/internal/rest/routes/routes.go @@ -3,14 +3,15 @@ package routes import ( "context" + "github.com/pocketbase/pocketbase/apis" + "github.com/pocketbase/pocketbase/core" + "github.com/pocketbase/pocketbase/tools/router" + "github.com/usual2970/certimate/internal/notify" "github.com/usual2970/certimate/internal/repository" - "github.com/usual2970/certimate/internal/rest" + "github.com/usual2970/certimate/internal/rest/handlers" "github.com/usual2970/certimate/internal/statistics" "github.com/usual2970/certimate/internal/workflow" - - "github.com/labstack/echo/v5" - "github.com/pocketbase/pocketbase/apis" ) var ( @@ -19,7 +20,7 @@ var ( statisticsSvc *statistics.StatisticsService ) -func Register(e *echo.Echo) { +func Register(router *router.Router[*core.RequestEvent]) { notifyRepo := repository.NewSettingsRepository() notifySvc = notify.NewNotifyService(notifyRepo) @@ -29,10 +30,11 @@ func Register(e *echo.Echo) { statisticsRepo := repository.NewStatisticsRepository() statisticsSvc = statistics.NewStatisticsService(statisticsRepo) - group := e.Group("/api", apis.RequireAdminAuth()) - rest.NewWorkflowHandler(group, workflowSvc) - rest.NewNotifyHandler(group, notifySvc) - rest.NewStatisticsHandler(group, statisticsSvc) + group := router.Group("/api") + group.Bind(apis.RequireSuperuserAuth()) + handlers.NewWorkflowHandler(group, workflowSvc) + handlers.NewNotifyHandler(group, notifySvc) + handlers.NewStatisticsHandler(group, statisticsSvc) } func Unregister() { diff --git a/internal/rest/statistics.go b/internal/rest/statistics.go deleted file mode 100644 index 6db35be4..00000000 --- a/internal/rest/statistics.go +++ /dev/null @@ -1,34 +0,0 @@ -package rest - -import ( - "context" - - "github.com/labstack/echo/v5" - "github.com/usual2970/certimate/internal/domain" - "github.com/usual2970/certimate/internal/rest/resp" -) - -type statisticsService interface { - Get(ctx context.Context) (*domain.Statistics, error) -} - -type StatisticsHandler struct { - service statisticsService -} - -func NewStatisticsHandler(route *echo.Group, service statisticsService) { - handler := &StatisticsHandler{ - service: service, - } - - group := route.Group("/statistics") - group.GET("/get", handler.get) -} - -func (handler *StatisticsHandler) get(c echo.Context) error { - if statistics, err := handler.service.Get(c.Request().Context()); err != nil { - return resp.Err(c, err) - } else { - return resp.Ok(c, statistics) - } -} diff --git a/internal/rest/workflow.go b/internal/rest/workflow.go deleted file mode 100644 index 2bdf4120..00000000 --- a/internal/rest/workflow.go +++ /dev/null @@ -1,40 +0,0 @@ -package rest - -import ( - "context" - - "github.com/labstack/echo/v5" - "github.com/usual2970/certimate/internal/domain" - "github.com/usual2970/certimate/internal/rest/resp" -) - -type workflowService interface { - Run(ctx context.Context, req *domain.WorkflowRunReq) error - Stop(ctx context.Context) -} - -type WorkflowHandler struct { - service workflowService -} - -func NewWorkflowHandler(route *echo.Group, service workflowService) { - handler := &WorkflowHandler{ - service: service, - } - - group := route.Group("/workflow") - group.POST("/run", handler.run) -} - -func (handler *WorkflowHandler) run(c echo.Context) error { - req := &domain.WorkflowRunReq{} - if err := c.Bind(req); err != nil { - return resp.Err(c, err) - } - - if err := handler.service.Run(c.Request().Context(), req); err != nil { - return resp.Err(c, err) - } - - return resp.Ok(c, nil) -} diff --git a/internal/scheduler/certificate.go b/internal/scheduler/certificate.go index 352ff0aa..26c7311f 100644 --- a/internal/scheduler/certificate.go +++ b/internal/scheduler/certificate.go @@ -2,10 +2,10 @@ package scheduler import "context" -type CertificateService interface { +type certificateService interface { InitSchedule(ctx context.Context) error } -func NewCertificateScheduler(service CertificateService) error { +func NewCertificateScheduler(service certificateService) error { return service.InitSchedule(context.Background()) } diff --git a/internal/scheduler/workflow.go b/internal/scheduler/workflow.go index 679bb3aa..7cb4dfa8 100644 --- a/internal/scheduler/workflow.go +++ b/internal/scheduler/workflow.go @@ -2,10 +2,10 @@ package scheduler import "context" -type WorkflowService interface { +type workflowService interface { InitSchedule(ctx context.Context) error } -func NewWorkflowScheduler(service WorkflowService) error { +func NewWorkflowScheduler(service workflowService) error { return service.InitSchedule(context.Background()) } diff --git a/internal/workflow/event.go b/internal/workflow/event.go index aaad9822..96a5d7ec 100644 --- a/internal/workflow/event.go +++ b/internal/workflow/event.go @@ -5,43 +5,62 @@ import ( "fmt" "github.com/pocketbase/pocketbase/core" - "github.com/pocketbase/pocketbase/models" "github.com/usual2970/certimate/internal/app" "github.com/usual2970/certimate/internal/domain" "github.com/usual2970/certimate/internal/repository" ) -const tableName = "workflow" - func Register() { + const tableName = "workflow" + app := app.GetApp() + app.OnRecordCreateRequest(tableName).BindFunc(func(e *core.RecordRequestEvent) error { + if err := e.Next(); err != nil { + return err + } - app.OnRecordAfterCreateRequest(tableName).Add(func(e *core.RecordCreateEvent) error { - return update(e.HttpContext.Request().Context(), e.Record) + if err := update(e.Request.Context(), e.Record); err != nil { + return err + } + + return nil }) + app.OnRecordUpdateRequest(tableName).BindFunc(func(e *core.RecordRequestEvent) error { + if err := e.Next(); err != nil { + return err + } - app.OnRecordAfterUpdateRequest(tableName).Add(func(e *core.RecordUpdateEvent) error { - return update(e.HttpContext.Request().Context(), e.Record) + if err := update(e.Request.Context(), e.Record); err != nil { + return err + } + + return nil }) + app.OnRecordDeleteRequest(tableName).BindFunc(func(e *core.RecordRequestEvent) error { + if err := e.Next(); err != nil { + return err + } - app.OnRecordAfterDeleteRequest(tableName).Add(func(e *core.RecordDeleteEvent) error { - return delete(e.HttpContext.Request().Context(), e.Record) + if err := delete(e.Request.Context(), e.Record); err != nil { + return err + } + + return nil }) } -func update(ctx context.Context, record *models.Record) error { +func update(ctx context.Context, record *core.Record) error { scheduler := app.GetScheduler() // 向数据库插入/更新时,同时更新定时任务 - workflowId := record.GetId() + workflowId := record.Id enabled := record.GetBool("enabled") trigger := record.GetString("trigger") // 如果是手动触发或未启用,移除定时任务 if !enabled || trigger == string(domain.WorkflowTriggerTypeManual) { scheduler.Remove(fmt.Sprintf("workflow#%s", workflowId)) - scheduler.Start() return nil } @@ -57,18 +76,15 @@ func update(ctx context.Context, record *models.Record) error { return fmt.Errorf("add cron job failed: %w", err) } - scheduler.Start() - return nil } -func delete(_ context.Context, record *models.Record) error { +func delete(_ context.Context, record *core.Record) error { scheduler := app.GetScheduler() // 从数据库删除时,同时移除定时任务 - workflowId := record.GetId() + workflowId := record.Id scheduler.Remove(fmt.Sprintf("workflow#%s", workflowId)) - scheduler.Start() return nil } diff --git a/internal/workflow/service.go b/internal/workflow/service.go index f0cc8475..bf057690 100644 --- a/internal/workflow/service.go +++ b/internal/workflow/service.go @@ -84,9 +84,6 @@ func (s *WorkflowService) InitSchedule(ctx context.Context) error { return err } } - scheduler.Start() - - app.GetLogger().Info("workflow schedule started") return nil } diff --git a/main.go b/main.go index 4bcb025a..1928c46b 100644 --- a/main.go +++ b/main.go @@ -5,25 +5,24 @@ import ( "log" "os" "strings" - _ "time/tzdata" - "github.com/labstack/echo/v5" - "github.com/labstack/echo/v5/middleware" + "github.com/pocketbase/pocketbase" + "github.com/pocketbase/pocketbase/apis" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/plugins/migratecmd" + "github.com/pocketbase/pocketbase/tools/hook" "github.com/usual2970/certimate/internal/app" - "github.com/usual2970/certimate/internal/routes" + "github.com/usual2970/certimate/internal/rest/routes" "github.com/usual2970/certimate/internal/scheduler" "github.com/usual2970/certimate/internal/workflow" "github.com/usual2970/certimate/ui" - - _ "github.com/usual2970/certimate/migrations" + //_ "github.com/usual2970/certimate/migrations" ) func main() { - app := app.GetApp() + app := app.GetApp().(*pocketbase.PocketBase) var flagHttp string var flagDir string @@ -37,28 +36,29 @@ func main() { Automigrate: strings.HasPrefix(os.Args[0], os.TempDir()), }) - app.OnBeforeServe().Add(func(e *core.ServeEvent) error { + app.OnServe().BindFunc(func(e *core.ServeEvent) error { scheduler.Register() - workflow.Register() - routes.Register(e.Router) - - e.Router.GET( - "/*", - echo.StaticDirectoryHandler(ui.DistDirFS, false), - middleware.Gzip(), - ) - - return nil + return e.Next() }) - app.OnTerminate().Add(func(e *core.TerminateEvent) error { + app.OnServe().Bind(&hook.Handler[*core.ServeEvent]{ + Func: func(e *core.ServeEvent) error { + e.Router. + GET("/{path...}", apis.Static(ui.DistDirFS, false)). + Bind(apis.Gzip()) + return e.Next() + }, + Priority: 999, + }) + + app.OnTerminate().BindFunc(func(e *core.TerminateEvent) error { routes.Unregister() log.Println("Exit!") - return nil + return e.Next() }) log.Printf("Visit the website: http://%s", flagHttp) diff --git a/ui/embed.go b/ui/embed.go index 5d1cb45f..dc02dac5 100644 --- a/ui/embed.go +++ b/ui/embed.go @@ -4,11 +4,11 @@ package ui import ( "embed" - "github.com/labstack/echo/v5" + "github.com/pocketbase/pocketbase/apis" ) //go:embed all:dist var distDir embed.FS // DistDirFS contains the embedded dist directory files (without the "dist" prefix) -var DistDirFS = echo.MustSubFS(distDir, "dist") +var DistDirFS = apis.MustSubFS(distDir, "dist") diff --git a/ui/package-lock.json b/ui/package-lock.json index 57e6696d..5be7df2a 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -20,7 +20,7 @@ "jszip": "^3.10.1", "lucide-react": "^0.469.0", "nanoid": "^5.0.9", - "pocketbase": "^0.21.5", + "pocketbase": "^0.25.0", "radash": "^12.1.0", "react": "^18.3.1", "react-copy-to-clipboard": "^5.1.0", @@ -6811,9 +6811,9 @@ } }, "node_modules/pocketbase": { - "version": "0.21.5", - "resolved": "https://registry.npmmirror.com/pocketbase/-/pocketbase-0.21.5.tgz", - "integrity": "sha512-bnI/uinnQps+ElSlzxkc4yvwuSFfKcoszDtXH/4QT2FhGq2mJVUvDlxn+rjRXVntUjPfmMG5LEPZ1eGqV6ssog==" + "version": "0.25.0", + "resolved": "https://registry.npmmirror.com/pocketbase/-/pocketbase-0.25.0.tgz", + "integrity": "sha512-xbjiQG/tnh2HsjZrTW7ZEJASvl4hmGAB5PQAmNRkRU8BmrPib7zwKyXdiYJl34QN7ADpqykZD2lAMdDtrrQbuw==" }, "node_modules/possible-typed-array-names": { "version": "1.0.0", diff --git a/ui/package.json b/ui/package.json index 3d390b94..e98a4679 100644 --- a/ui/package.json +++ b/ui/package.json @@ -22,7 +22,7 @@ "jszip": "^3.10.1", "lucide-react": "^0.469.0", "nanoid": "^5.0.9", - "pocketbase": "^0.21.5", + "pocketbase": "^0.25.0", "radash": "^12.1.0", "react": "^18.3.1", "react-copy-to-clipboard": "^5.1.0", diff --git a/ui/src/api/notify.ts b/ui/src/api/notify.ts index e0167175..b98a1610 100644 --- a/ui/src/api/notify.ts +++ b/ui/src/api/notify.ts @@ -1,6 +1,6 @@ import { ClientResponseError } from "pocketbase"; -import { getPocketBase } from "@/repository/pocketbase"; +import { getPocketBase } from "@/repository/_pocketbase"; export const notifyTest = async (channel: string) => { const pb = getPocketBase(); diff --git a/ui/src/api/statistics.ts b/ui/src/api/statistics.ts index f05dda0c..162e7a92 100644 --- a/ui/src/api/statistics.ts +++ b/ui/src/api/statistics.ts @@ -1,7 +1,7 @@ import { ClientResponseError } from "pocketbase"; import { type Statistics } from "@/domain/statistics"; -import { getPocketBase } from "@/repository/pocketbase"; +import { getPocketBase } from "@/repository/_pocketbase"; export const get = async () => { const pb = getPocketBase(); diff --git a/ui/src/api/workflow.ts b/ui/src/api/workflow.ts index afead94e..a5a29bd8 100644 --- a/ui/src/api/workflow.ts +++ b/ui/src/api/workflow.ts @@ -1,7 +1,7 @@ import { ClientResponseError } from "pocketbase"; import { WORKFLOW_TRIGGERS } from "@/domain/workflow"; -import { getPocketBase } from "@/repository/pocketbase"; +import { getPocketBase } from "@/repository/_pocketbase"; export const run = async (id: string) => { const pb = getPocketBase(); diff --git a/ui/src/pages/AuthLayout.tsx b/ui/src/pages/AuthLayout.tsx index 8e15fb4d..73ce0076 100644 --- a/ui/src/pages/AuthLayout.tsx +++ b/ui/src/pages/AuthLayout.tsx @@ -1,11 +1,11 @@ import { Navigate, Outlet } from "react-router-dom"; import Version from "@/components/Version"; -import { getPocketBase } from "@/repository/pocketbase"; +import { getAuthStore } from "@/repository/admin"; const AuthLayout = () => { - const auth = getPocketBase().authStore; - if (auth.isValid && auth.isAdmin) { + const auth = getAuthStore(); + if (auth.isValid && auth.isSuperuser) { return ; } diff --git a/ui/src/pages/ConsoleLayout.tsx b/ui/src/pages/ConsoleLayout.tsx index a5125be4..a370d46c 100644 --- a/ui/src/pages/ConsoleLayout.tsx +++ b/ui/src/pages/ConsoleLayout.tsx @@ -17,7 +17,7 @@ import { Button, type ButtonProps, Drawer, Dropdown, Layout, Menu, type MenuProp import Version from "@/components/Version"; import { useBrowserTheme, useTriggerElement } from "@/hooks"; -import { getPocketBase } from "@/repository/pocketbase"; +import { getAuthStore } from "@/repository/admin"; const ConsoleLayout = () => { const navigate = useNavigate(); @@ -35,8 +35,8 @@ const ConsoleLayout = () => { navigate("/settings/account"); }; - const auth = getPocketBase().authStore; - if (!auth.isValid || !auth.isAdmin) { + const auth = getAuthStore(); + if (!auth.isValid || !auth.isSuperuser) { return ; } diff --git a/ui/src/pages/login/Login.tsx b/ui/src/pages/login/Login.tsx index 8725c4e4..32d8759b 100644 --- a/ui/src/pages/login/Login.tsx +++ b/ui/src/pages/login/Login.tsx @@ -5,7 +5,7 @@ import { createSchemaFieldRule } from "antd-zod"; import { z } from "zod"; import { useAntdForm } from "@/hooks"; -import { getPocketBase } from "@/repository/pocketbase"; +import { authWithPassword } from "@/repository/admin"; import { getErrMsg } from "@/utils/error"; const Login = () => { @@ -27,7 +27,7 @@ const Login = () => { } = useAntdForm>({ onSubmit: async (values) => { try { - await getPocketBase().admins.authWithPassword(values.username, values.password); + await authWithPassword(values.username, values.password); await navigage("/"); } catch (err) { notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); diff --git a/ui/src/pages/settings/SettingsAccount.tsx b/ui/src/pages/settings/SettingsAccount.tsx index 5a3aac0b..aedd746a 100644 --- a/ui/src/pages/settings/SettingsAccount.tsx +++ b/ui/src/pages/settings/SettingsAccount.tsx @@ -6,7 +6,7 @@ import { createSchemaFieldRule } from "antd-zod"; import { z } from "zod"; import { useAntdForm } from "@/hooks"; -import { getPocketBase } from "@/repository/pocketbase"; +import { getAuthStore, save as saveAdmin } from "@/repository/admin"; import { getErrMsg } from "@/utils/error"; const SettingsAccount = () => { @@ -27,18 +27,16 @@ const SettingsAccount = () => { formProps, } = useAntdForm>({ initialValues: { - username: getPocketBase().authStore.model?.email, + username: getAuthStore().record?.email, }, onSubmit: async (values) => { try { - await getPocketBase().admins.update(getPocketBase().authStore.model?.id, { - email: values.username, - }); + await saveAdmin({ email: values.username }); messageApi.success(t("common.text.operation_succeeded")); setTimeout(() => { - getPocketBase().authStore.clear(); + getAuthStore().clear(); navigate("/login"); }, 500); } catch (err) { diff --git a/ui/src/pages/settings/SettingsPassword.tsx b/ui/src/pages/settings/SettingsPassword.tsx index e7b28656..59447be7 100644 --- a/ui/src/pages/settings/SettingsPassword.tsx +++ b/ui/src/pages/settings/SettingsPassword.tsx @@ -6,7 +6,7 @@ import { createSchemaFieldRule } from "antd-zod"; import { z } from "zod"; import { useAntdForm } from "@/hooks"; -import { getPocketBase } from "@/repository/pocketbase"; +import { authWithPassword, getAuthStore, save as saveAdmin } from "@/repository/admin"; import { getErrMsg } from "@/utils/error"; const SettingsPassword = () => { @@ -33,16 +33,13 @@ const SettingsPassword = () => { } = useAntdForm({ onSubmit: async (values) => { try { - await getPocketBase().admins.authWithPassword(getPocketBase().authStore.model?.email, values.oldPassword); - await getPocketBase().admins.update(getPocketBase().authStore.model?.id, { - password: values.newPassword, - passwordConfirm: values.confirmPassword, - }); + await authWithPassword(getAuthStore().record!.email, values.oldPassword); + await saveAdmin({ password: values.newPassword }); messageApi.success(t("common.text.operation_succeeded")); setTimeout(() => { - getPocketBase().authStore.clear(); + getAuthStore().clear(); navigate("/login"); }, 500); } catch (err) { diff --git a/ui/src/repository/pocketbase.ts b/ui/src/repository/_pocketbase.ts similarity index 62% rename from ui/src/repository/pocketbase.ts rename to ui/src/repository/_pocketbase.ts index dbc0aaad..53d2f792 100644 --- a/ui/src/repository/pocketbase.ts +++ b/ui/src/repository/_pocketbase.ts @@ -1,8 +1,5 @@ import PocketBase from "pocketbase"; -const apiDomain = import.meta.env.VITE_API_DOMAIN; -console.log("VITE_API_DOMAIN:", apiDomain); - let pb: PocketBase; export const getPocketBase = () => { if (pb) return pb; diff --git a/ui/src/repository/access.ts b/ui/src/repository/access.ts index 02d9827b..c254f386 100644 --- a/ui/src/repository/access.ts +++ b/ui/src/repository/access.ts @@ -1,7 +1,7 @@ import dayjs from "dayjs"; import { type AccessModel } from "@/domain/access"; -import { getPocketBase } from "./pocketbase"; +import { getPocketBase } from "./_pocketbase"; const COLLECTION_NAME = "access"; @@ -22,13 +22,8 @@ export const save = async (record: MaybeModelRecord) => { }; export const remove = async (record: MaybeModelRecordWithId) => { - record = { ...record, deleted: dayjs.utc().format("YYYY-MM-DD HH:mm:ss") }; - - // TODO: 仅为兼容旧版本,后续迭代时删除 - if ("provider" in record && record.provider === "httpreq") record.provider = "acmehttpreq"; - if ("provider" in record && record.provider === "tencent") record.provider = "tencentcloud"; - if ("provider" in record && record.provider === "pdns") record.provider = "powerdns"; - - await getPocketBase().collection(COLLECTION_NAME).update(record.id!, record); + await getPocketBase() + .collection(COLLECTION_NAME) + .update(record.id!, { deleted: dayjs.utc().format("YYYY-MM-DD HH:mm:ss") }); return true; }; diff --git a/ui/src/repository/admin.ts b/ui/src/repository/admin.ts new file mode 100644 index 00000000..15074fee --- /dev/null +++ b/ui/src/repository/admin.ts @@ -0,0 +1,17 @@ +import { getPocketBase } from "./_pocketbase"; + +const COLLECTION_NAME = "_superusers"; + +export const authWithPassword = (username: string, password: string) => { + return getPocketBase().collection(COLLECTION_NAME).authWithPassword(username, password); +}; + +export const getAuthStore = () => { + return getPocketBase().authStore; +}; + +export const save = (data: { email: string } | { password: string }) => { + return getPocketBase() + .collection(COLLECTION_NAME) + .update(getAuthStore().record?.id || "", data); +}; diff --git a/ui/src/repository/certificate.ts b/ui/src/repository/certificate.ts index 64ae9edb..6bfbbcbe 100644 --- a/ui/src/repository/certificate.ts +++ b/ui/src/repository/certificate.ts @@ -2,7 +2,7 @@ import dayjs from "dayjs"; import { type RecordListOptions } from "pocketbase"; import { type CertificateModel } from "@/domain/certificate"; -import { getPocketBase } from "./pocketbase"; +import { getPocketBase } from "./_pocketbase"; const COLLECTION_NAME = "certificate"; @@ -39,8 +39,8 @@ export const list = async (request: ListCertificateRequest) => { }; export const remove = async (record: MaybeModelRecordWithId) => { - record = { ...record, deleted: dayjs.utc().format("YYYY-MM-DD HH:mm:ss") }; - - await getPocketBase().collection(COLLECTION_NAME).update(record.id!, record); + await getPocketBase() + .collection(COLLECTION_NAME) + .update(record.id!, { deleted: dayjs.utc().format("YYYY-MM-DD HH:mm:ss") }); return true; }; diff --git a/ui/src/repository/settings.ts b/ui/src/repository/settings.ts index fe7c8a54..a06794e0 100644 --- a/ui/src/repository/settings.ts +++ b/ui/src/repository/settings.ts @@ -1,7 +1,7 @@ import { ClientResponseError } from "pocketbase"; import { type SettingsModel, type SettingsNames } from "@/domain/settings"; -import { getPocketBase } from "./pocketbase"; +import { getPocketBase } from "./_pocketbase"; export const get = async >(name: SettingsNames) => { try { diff --git a/ui/src/repository/workflow.ts b/ui/src/repository/workflow.ts index 4410aa52..54ddddd4 100644 --- a/ui/src/repository/workflow.ts +++ b/ui/src/repository/workflow.ts @@ -1,7 +1,7 @@ import { type RecordListOptions, type RecordSubscription } from "pocketbase"; import { type WorkflowModel } from "@/domain/workflow"; -import { getPocketBase } from "./pocketbase"; +import { getPocketBase } from "./_pocketbase"; const COLLECTION_NAME = "workflow"; diff --git a/ui/src/repository/workflowRun.ts b/ui/src/repository/workflowRun.ts index fd99de98..25571eaf 100644 --- a/ui/src/repository/workflowRun.ts +++ b/ui/src/repository/workflowRun.ts @@ -1,6 +1,6 @@ import { type WorkflowRunModel } from "@/domain/workflowRun"; -import { getPocketBase } from "./pocketbase"; +import { getPocketBase } from "./_pocketbase"; const COLLECTION_NAME = "workflow_run"; From c66027ae8a62d9c753f6b42a597d1e980dbd2739 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 18 Jan 2025 05:22:52 +0800 Subject: [PATCH 04/16] build: rebuilld pocketbase migration snapshot --- migrations/1724677539_update_admin.go | 29 - migrations/1726147254_collections_snapshot.go | 526 ------ migrations/1726147268_update_access_usage.go | 20 - migrations/1726184067_collections_snapshot.go | 584 ------- migrations/1726299230_collections_snapshot.go | 679 -------- migrations/1729671262_collections_snapshot.go | 805 --------- migrations/1730766480_collections_snapshot.go | 807 --------- migrations/1731463526_updated_access.go | 105 -- migrations/1731872250_add_byteplus.go | 107 -- migrations/1732450576_collections_snapshot.go | 1236 ------------- migrations/1734398918_updated_access.go | 108 -- migrations/1734434522_updated_access.go | 43 - migrations/1734868882_updated_access.go | 57 - migrations/1734869127_updated_domains.go | 57 - migrations/1734869146_updated_deployments.go | 57 - migrations/1734869175_updated_domains.go | 57 - migrations/1734869180_deleted_domains.go | 337 ---- migrations/1734869185_deleted_deployments.go | 110 -- .../1734869190_deleted_access_groups.go | 80 - migrations/1735032595_add_namedotcom.go | 109 -- migrations/1735151867_updated_access.go | 110 -- migrations/1735913237_updated_access.go | 110 -- migrations/1735966817_updated_workflow.go | 116 -- migrations/1735976342_updated_certificate.go | 298 ---- .../1735977005_updated_workflow_output.go | 144 -- .../1735977021_updated_workflow_run_log.go | 144 -- migrations/1735977530_updated_certificate.go | 57 - .../1735980691_updated_workflow_run_log.go | 105 -- migrations/1735981441_updated_workflow.go | 106 -- migrations/1735981515_updated_workflow_run.go | 78 - migrations/1736685828_updated_access.go | 111 -- migrations/1736861196_updated_access.go | 113 -- migrations/1737019549_updated_certificate.go | 54 - migrations/1737141501_collections_snapshot.go | 1525 +++++++++++++++++ migrations/1737141502_superusers_initial.go | 27 + 35 files changed, 1552 insertions(+), 7459 deletions(-) delete mode 100644 migrations/1724677539_update_admin.go delete mode 100644 migrations/1726147254_collections_snapshot.go delete mode 100644 migrations/1726147268_update_access_usage.go delete mode 100644 migrations/1726184067_collections_snapshot.go delete mode 100644 migrations/1726299230_collections_snapshot.go delete mode 100644 migrations/1729671262_collections_snapshot.go delete mode 100644 migrations/1730766480_collections_snapshot.go delete mode 100644 migrations/1731463526_updated_access.go delete mode 100644 migrations/1731872250_add_byteplus.go delete mode 100644 migrations/1732450576_collections_snapshot.go delete mode 100644 migrations/1734398918_updated_access.go delete mode 100644 migrations/1734434522_updated_access.go delete mode 100644 migrations/1734868882_updated_access.go delete mode 100644 migrations/1734869127_updated_domains.go delete mode 100644 migrations/1734869146_updated_deployments.go delete mode 100644 migrations/1734869175_updated_domains.go delete mode 100644 migrations/1734869180_deleted_domains.go delete mode 100644 migrations/1734869185_deleted_deployments.go delete mode 100644 migrations/1734869190_deleted_access_groups.go delete mode 100644 migrations/1735032595_add_namedotcom.go delete mode 100644 migrations/1735151867_updated_access.go delete mode 100644 migrations/1735913237_updated_access.go delete mode 100644 migrations/1735966817_updated_workflow.go delete mode 100644 migrations/1735976342_updated_certificate.go delete mode 100644 migrations/1735977005_updated_workflow_output.go delete mode 100644 migrations/1735977021_updated_workflow_run_log.go delete mode 100644 migrations/1735977530_updated_certificate.go delete mode 100644 migrations/1735980691_updated_workflow_run_log.go delete mode 100644 migrations/1735981441_updated_workflow.go delete mode 100644 migrations/1735981515_updated_workflow_run.go delete mode 100644 migrations/1736685828_updated_access.go delete mode 100644 migrations/1736861196_updated_access.go delete mode 100644 migrations/1737019549_updated_certificate.go create mode 100644 migrations/1737141501_collections_snapshot.go create mode 100644 migrations/1737141502_superusers_initial.go diff --git a/migrations/1724677539_update_admin.go b/migrations/1724677539_update_admin.go deleted file mode 100644 index fffa4dff..00000000 --- a/migrations/1724677539_update_admin.go +++ /dev/null @@ -1,29 +0,0 @@ -package migrations - -import ( - "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 { - // add up queries... - dao := daos.New(db) - - admin := &models.Admin{} - admin.Email = "admin@certimate.fun" - admin.SetPassword("1234567890") - return dao.SaveAdmin(admin) - }, func(db dbx.Builder) error { - // add down queries... - dao := daos.New(db) - - admin, _ := dao.FindAdminByEmail("admin@certimate.fun") - if admin != nil { - return dao.DeleteAdmin(admin) - } - return nil - }) -} diff --git a/migrations/1726147254_collections_snapshot.go b/migrations/1726147254_collections_snapshot.go deleted file mode 100644 index 9ccb728d..00000000 --- a/migrations/1726147254_collections_snapshot.go +++ /dev/null @@ -1,526 +0,0 @@ -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-12 13:09:54.500Z", - "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": "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", - "ssh", - "webhook", - "tencent-cdn", - "qiniu-cdn" - ] - } - }, - { - "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 - } - } - ], - "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-12 13:18:00.093Z", - "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" - ] - } - }, - { - "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" - ] - } - } - ], - "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-12 13:09:54.500Z", - "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": "" - } - } - ], - "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-12 13:09:54.500Z", - "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 - } - } - ]` - - 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 - }) -} diff --git a/migrations/1726147268_update_access_usage.go b/migrations/1726147268_update_access_usage.go deleted file mode 100644 index 07d8c188..00000000 --- a/migrations/1726147268_update_access_usage.go +++ /dev/null @@ -1,20 +0,0 @@ -package migrations - -import ( - "github.com/pocketbase/dbx" - m "github.com/pocketbase/pocketbase/migrations" -) - -func init() { - m.Register(func(db dbx.Builder) error { - // add up queries... - db.NewQuery("update access set usage='all' where configType in ('aliyun', 'tencent')").Execute() - db.NewQuery("update access set usage='deploy' where configType in ('ssh', 'webhook','qiniu')").Execute() - db.NewQuery("update access set usage='apply' where configType in ('cloudflare','namesilo','godaddy')").Execute() - return nil - }, func(db dbx.Builder) error { - // add down queries... - - return nil - }) -} diff --git a/migrations/1726184067_collections_snapshot.go b/migrations/1726184067_collections_snapshot.go deleted file mode 100644 index 86b806d7..00000000 --- a/migrations/1726184067_collections_snapshot.go +++ /dev/null @@ -1,584 +0,0 @@ -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-12 23:13:12.119Z", - "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", - "ssh", - "webhook", - "tencent-cdn", - "qiniu-cdn" - ] - } - }, - { - "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 - } - } - ], - "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-12 23:08:52.810Z", - "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" - ] - } - }, - { - "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" - ] - } - } - ], - "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-12 23:08:52.810Z", - "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": "" - } - } - ], - "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-12 23:08:52.811Z", - "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-12 23:19:09.110Z", - "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": {} - } - ]` - - 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 - }) -} diff --git a/migrations/1726299230_collections_snapshot.go b/migrations/1726299230_collections_snapshot.go deleted file mode 100644 index d0ab1968..00000000 --- a/migrations/1726299230_collections_snapshot.go +++ /dev/null @@ -1,679 +0,0 @@ -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-14 02:53:22.520Z", - "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", - "ssh", - "webhook", - "tencent-cdn", - "qiniu-cdn" - ] - } - }, - { - "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 - } - } - ], - "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-13 23:47:27.173Z", - "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" - ] - } - }, - { - "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-13 12:52:50.804Z", - "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": "" - } - } - ], - "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-12 23:34:40.687Z", - "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-12 23:34:40.687Z", - "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-14 00:01:58.239Z", - "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 - }) -} diff --git a/migrations/1729671262_collections_snapshot.go b/migrations/1729671262_collections_snapshot.go deleted file mode 100644 index f72fdbe0..00000000 --- a/migrations/1729671262_collections_snapshot.go +++ /dev/null @@ -1,805 +0,0 @@ -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-10-13 02:40:36.312Z", - "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": "" - } - }, - { - "system": false, - "id": "wwrzc3jo", - "name": "applyConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "474iwy8r", - "name": "deployConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "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-10-20 04:36:58.692Z", - "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", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s" - ] - } - }, - { - "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-10-17 15:21:58.176Z", - "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-10-13 02:40:36.312Z", - "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-10-13 02:40:36.312Z", - "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-10-13 02:40:36.312Z", - "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": {} - }, - { - "id": "012d7abbod1hwvr", - "created": "2024-10-23 06:37:13.155Z", - "updated": "2024-10-23 07:34:58.636Z", - "name": "acme_accounts", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "fmjfn0yw", - "name": "ca", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "qqwijqzt", - "name": "email", - "type": "email", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }, - { - "system": false, - "id": "genxqtii", - "name": "key", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "1aoia909", - "name": "resource", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "indexes": [], - "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 - }) -} diff --git a/migrations/1730766480_collections_snapshot.go b/migrations/1730766480_collections_snapshot.go deleted file mode 100644 index 74be734c..00000000 --- a/migrations/1730766480_collections_snapshot.go +++ /dev/null @@ -1,807 +0,0 @@ -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-10-23 09:25:43.083Z", - "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": "" - } - }, - { - "system": false, - "id": "wwrzc3jo", - "name": "applyConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "474iwy8r", - "name": "deployConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "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-11-05 00:21:32.129Z", - "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", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud" - ] - } - }, - { - "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-10-23 09:25:43.084Z", - "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-10-23 09:25:43.085Z", - "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-10-23 09:25:43.085Z", - "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-10-23 09:25:43.086Z", - "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": {} - }, - { - "id": "012d7abbod1hwvr", - "created": "2024-10-23 06:37:13.155Z", - "updated": "2024-10-23 09:25:43.086Z", - "name": "acme_accounts", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "fmjfn0yw", - "name": "ca", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "qqwijqzt", - "name": "email", - "type": "email", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }, - { - "system": false, - "id": "genxqtii", - "name": "key", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "1aoia909", - "name": "resource", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "indexes": [], - "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 - }) -} diff --git a/migrations/1731463526_updated_access.go b/migrations/1731463526_updated_access.go deleted file mode 100644 index 68249292..00000000 --- a/migrations/1731463526_updated_access.go +++ /dev/null @@ -1,105 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db) - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db) - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1731872250_add_byteplus.go b/migrations/1731872250_add_byteplus.go deleted file mode 100644 index 63daae39..00000000 --- a/migrations/1731872250_add_byteplus.go +++ /dev/null @@ -1,107 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db) - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine", - "byteplus" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db) - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1732450576_collections_snapshot.go b/migrations/1732450576_collections_snapshot.go deleted file mode 100644 index 01aa2d29..00000000 --- a/migrations/1732450576_collections_snapshot.go +++ /dev/null @@ -1,1236 +0,0 @@ -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-11-05 12:57:58.246Z", - "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": "" - } - }, - { - "system": false, - "id": "wwrzc3jo", - "name": "applyConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "474iwy8r", - "name": "deployConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "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-11-18 11:43:01.059Z", - "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", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine", - "byteplus" - ] - } - }, - { - "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-11-05 12:57:58.247Z", - "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-11-05 12:57:58.247Z", - "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-11-05 12:57:58.247Z", - "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-11-05 12:57:58.247Z", - "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": {} - }, - { - "id": "012d7abbod1hwvr", - "created": "2024-10-23 06:37:13.155Z", - "updated": "2024-11-05 12:57:58.247Z", - "name": "acme_accounts", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "fmjfn0yw", - "name": "ca", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "qqwijqzt", - "name": "email", - "type": "email", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }, - { - "system": false, - "id": "genxqtii", - "name": "key", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "1aoia909", - "name": "resource", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "indexes": [], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }, - { - "id": "tovyif5ax6j62ur", - "created": "2024-11-12 01:09:03.542Z", - "updated": "2024-11-18 02:36:33.502Z", - "name": "workflow", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "8yydhv1h", - "name": "name", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "1buzebwz", - "name": "description", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "vqoajwjq", - "name": "type", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "auto", - "manual" - ] - } - }, - { - "system": false, - "id": "8ho247wh", - "name": "crontab", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "awlphkfe", - "name": "content", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "g9ohkk5o", - "name": "draft", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "nq7kfdzi", - "name": "enabled", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }, - { - "system": false, - "id": "2rpfz9t3", - "name": "hasDraft", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - } - ], - "indexes": [], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }, - { - "id": "bqnxb95f2cooowp", - "created": "2024-11-18 01:35:35.222Z", - "updated": "2024-11-18 08:27:41.125Z", - "name": "workflow_output", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "jka88auc", - "name": "workflow", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "z9fgvqkz", - "name": "nodeId", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "c2rm9omj", - "name": "node", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "he4cceqb", - "name": "output", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "2yfxbxuf", - "name": "succeed", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - } - ], - "indexes": [], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }, - { - "id": "4szxr9x43tpj6np", - "created": "2024-11-18 01:36:34.011Z", - "updated": "2024-11-19 06:50:53.806Z", - "name": "certificate", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "fugxf58p", - "name": "san", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "plmambpz", - "name": "certificate", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "49qvwxcg", - "name": "privateKey", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "agt7n5bb", - "name": "issuerCertificate", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "ayyjy5ve", - "name": "certUrl", - "type": "url", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }, - { - "system": false, - "id": "3x5heo8e", - "name": "certStableUrl", - "type": "url", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }, - { - "system": false, - "id": "2ohlr0yd", - "name": "output", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "bqnxb95f2cooowp", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "zgpdby2k", - "name": "expireAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }, - { - "system": false, - "id": "uvqfamb1", - "name": "workflow", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "uqldzldw", - "name": "nodeId", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - } - ], - "indexes": [], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }, - { - "id": "qjp8lygssgwyqyz", - "created": "2024-11-19 07:58:21.573Z", - "updated": "2024-11-19 07:59:50.658Z", - "name": "workflow_run_log", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "m8xfsyyy", - "name": "workflow", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "2m9byaa9", - "name": "log", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "cht6kqw9", - "name": "succeed", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }, - { - "system": false, - "id": "hvebkuxw", - "name": "error", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - } - ], - "indexes": [], - "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 - }) -} diff --git a/migrations/1734398918_updated_access.go b/migrations/1734398918_updated_access.go deleted file mode 100644 index e7e3cd98..00000000 --- a/migrations/1734398918_updated_access.go +++ /dev/null @@ -1,108 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "acmehttpreq", - "aws", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine", - "byteplus" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1734434522_updated_access.go b/migrations/1734434522_updated_access.go deleted file mode 100644 index 02c87f24..00000000 --- a/migrations/1734434522_updated_access.go +++ /dev/null @@ -1,43 +0,0 @@ -package migrations - -import ( - "encoding/json" - - "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/daos" - m "github.com/pocketbase/pocketbase/migrations" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - if err := json.Unmarshal([]byte(`[ - "CREATE INDEX ` + "`" + `idx_wkoST0j` + "`" + ` ON ` + "`" + `access` + "`" + ` (` + "`" + `name` + "`" + `)" - ]`), &collection.Indexes); err != nil { - return err - } - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - if err := json.Unmarshal([]byte(`[ - "CREATE UNIQUE INDEX ` + "`" + `idx_wkoST0j` + "`" + ` ON ` + "`" + `access` + "`" + ` (` + "`" + `name` + "`" + `)" - ]`), &collection.Indexes); err != nil { - return err - } - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1734868882_updated_access.go b/migrations/1734868882_updated_access.go deleted file mode 100644 index 75dedc10..00000000 --- a/migrations/1734868882_updated_access.go +++ /dev/null @@ -1,57 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("c8egzzwj") - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // add - del_group := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "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 - } - }`), del_group); err != nil { - return err - } - collection.Schema.AddField(del_group) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1734869127_updated_domains.go b/migrations/1734869127_updated_domains.go deleted file mode 100644 index f9575fa0..00000000 --- a/migrations/1734869127_updated_domains.go +++ /dev/null @@ -1,57 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("z3p974ainxjqlvs") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("1bspzuku") - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("z3p974ainxjqlvs") - if err != nil { - return err - } - - // add - del_group := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "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 - } - }`), del_group); err != nil { - return err - } - collection.Schema.AddField(del_group) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1734869146_updated_deployments.go b/migrations/1734869146_updated_deployments.go deleted file mode 100644 index a1b31228..00000000 --- a/migrations/1734869146_updated_deployments.go +++ /dev/null @@ -1,57 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("0a1o4e6sstp694f") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("farvlzk7") - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("0a1o4e6sstp694f") - if err != nil { - return err - } - - // add - del_domain := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "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 - } - }`), del_domain); err != nil { - return err - } - collection.Schema.AddField(del_domain) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1734869175_updated_domains.go b/migrations/1734869175_updated_domains.go deleted file mode 100644 index 1c89f58a..00000000 --- a/migrations/1734869175_updated_domains.go +++ /dev/null @@ -1,57 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("z3p974ainxjqlvs") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("ghtlkn5j") - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("z3p974ainxjqlvs") - if err != nil { - return err - } - - // add - del_lastDeployment := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "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 - } - }`), del_lastDeployment); err != nil { - return err - } - collection.Schema.AddField(del_lastDeployment) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1734869180_deleted_domains.go b/migrations/1734869180_deleted_domains.go deleted file mode 100644 index af224651..00000000 --- a/migrations/1734869180_deleted_domains.go +++ /dev/null @@ -1,337 +0,0 @@ -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 { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("z3p974ainxjqlvs") - if err != nil { - return err - } - - return dao.DeleteCollection(collection) - }, func(db dbx.Builder) error { - jsonData := `{ - "id": "z3p974ainxjqlvs", - "created": "2024-07-29 10:02:48.334Z", - "updated": "2024-12-22 12:06:15.156Z", - "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": "zfnyj9he", - "name": "variables", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "g65gfh7a", - "name": "nameservers", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "wwrzc3jo", - "name": "applyConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "474iwy8r", - "name": "deployConfig", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - } - ], - "indexes": [ - "CREATE UNIQUE INDEX ` + "`" + `idx_4ABO6EQ` + "`" + ` ON ` + "`" + `domains` + "`" + ` (` + "`" + `domain` + "`" + `)" - ], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }` - - collection := &models.Collection{} - if err := json.Unmarshal([]byte(jsonData), &collection); err != nil { - return err - } - - return daos.New(db).SaveCollection(collection) - }) -} diff --git a/migrations/1734869185_deleted_deployments.go b/migrations/1734869185_deleted_deployments.go deleted file mode 100644 index 5b7ab42a..00000000 --- a/migrations/1734869185_deleted_deployments.go +++ /dev/null @@ -1,110 +0,0 @@ -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 { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("0a1o4e6sstp694f") - if err != nil { - return err - } - - return dao.DeleteCollection(collection) - }, func(db dbx.Builder) error { - jsonData := `{ - "id": "0a1o4e6sstp694f", - "created": "2024-07-30 06:30:27.801Z", - "updated": "2024-12-22 12:05:46.060Z", - "name": "deployments", - "type": "base", - "system": false, - "schema": [ - { - "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": {} - }` - - collection := &models.Collection{} - if err := json.Unmarshal([]byte(jsonData), &collection); err != nil { - return err - } - - return daos.New(db).SaveCollection(collection) - }) -} diff --git a/migrations/1734869190_deleted_access_groups.go b/migrations/1734869190_deleted_access_groups.go deleted file mode 100644 index 6e423d88..00000000 --- a/migrations/1734869190_deleted_access_groups.go +++ /dev/null @@ -1,80 +0,0 @@ -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 { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("teolp9pl72dxlxq") - if err != nil { - return err - } - - return dao.DeleteCollection(collection) - }, func(db dbx.Builder) error { - jsonData := `{ - "id": "teolp9pl72dxlxq", - "created": "2024-09-13 12:51:05.611Z", - "updated": "2024-11-25 07:41:10.235Z", - "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": {} - }` - - collection := &models.Collection{} - if err := json.Unmarshal([]byte(jsonData), &collection); err != nil { - return err - } - - return daos.New(db).SaveCollection(collection) - }) -} diff --git a/migrations/1735032595_add_namedotcom.go b/migrations/1735032595_add_namedotcom.go deleted file mode 100644 index b464a93c..00000000 --- a/migrations/1735032595_add_namedotcom.go +++ /dev/null @@ -1,109 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db) - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine", - "byteplus", - "namedotcom" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db) - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine", - "byteplus" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735151867_updated_access.go b/migrations/1735151867_updated_access.go deleted file mode 100644 index 4dfdef1a..00000000 --- a/migrations/1735151867_updated_access.go +++ /dev/null @@ -1,110 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_configType := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "huaweicloud", - "qiniu", - "aws", - "cloudflare", - "namesilo", - "godaddy", - "pdns", - "httpreq", - "local", - "ssh", - "webhook", - "k8s", - "baiducloud", - "dogecloud", - "volcengine", - "byteplus", - "namedotcom" - ] - } - }`), edit_configType); err != nil { - return err - } - collection.Schema.AddField(edit_configType) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735913237_updated_access.go b/migrations/1735913237_updated_access.go deleted file mode 100644 index 047028cb..00000000 --- a/migrations/1735913237_updated_access.go +++ /dev/null @@ -1,110 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_provider := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "provider", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_provider); err != nil { - return err - } - collection.Schema.AddField(edit_provider) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_provider := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_provider); err != nil { - return err - } - collection.Schema.AddField(edit_provider) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735966817_updated_workflow.go b/migrations/1735966817_updated_workflow.go deleted file mode 100644 index 6d714a0b..00000000 --- a/migrations/1735966817_updated_workflow.go +++ /dev/null @@ -1,116 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("tovyif5ax6j62ur") - if err != nil { - return err - } - - // update - edit_trigger := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "vqoajwjq", - "name": "trigger", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "auto", - "manual" - ] - } - }`), edit_trigger); err != nil { - return err - } - collection.Schema.AddField(edit_trigger) - - // update - edit_triggerCron := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "8ho247wh", - "name": "triggerCron", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }`), edit_triggerCron); err != nil { - return err - } - collection.Schema.AddField(edit_triggerCron) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("tovyif5ax6j62ur") - if err != nil { - return err - } - - // update - edit_trigger := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "vqoajwjq", - "name": "type", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "auto", - "manual" - ] - } - }`), edit_trigger); err != nil { - return err - } - collection.Schema.AddField(edit_trigger) - - // update - edit_triggerCron := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "8ho247wh", - "name": "crontab", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }`), edit_triggerCron); err != nil { - return err - } - collection.Schema.AddField(edit_triggerCron) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735976342_updated_certificate.go b/migrations/1735976342_updated_certificate.go deleted file mode 100644 index 2537f86c..00000000 --- a/migrations/1735976342_updated_certificate.go +++ /dev/null @@ -1,298 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4szxr9x43tpj6np") - if err != nil { - return err - } - - // add - new_effectAt := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "v40aqzpd", - "name": "effectAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }`), new_effectAt); err != nil { - return err - } - collection.Schema.AddField(new_effectAt) - - // update - edit_subjectAltNames := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "fugxf58p", - "name": "subjectAltNames", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }`), edit_subjectAltNames); err != nil { - return err - } - collection.Schema.AddField(edit_subjectAltNames) - - // update - edit_acmeCertUrl := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "ayyjy5ve", - "name": "acmeCertUrl", - "type": "url", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }`), edit_acmeCertUrl); err != nil { - return err - } - collection.Schema.AddField(edit_acmeCertUrl) - - // update - edit_acmeCertStableUrl := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "3x5heo8e", - "name": "acmeCertStableUrl", - "type": "url", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }`), edit_acmeCertStableUrl); err != nil { - return err - } - collection.Schema.AddField(edit_acmeCertStableUrl) - - // update - edit_workflowId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "uvqfamb1", - "name": "workflowId", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowId) - - // update - edit_workflowNodeId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "uqldzldw", - "name": "workflowNodeId", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }`), edit_workflowNodeId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowNodeId) - - // update - edit_workflowOutputId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "2ohlr0yd", - "name": "workflowOutputId", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "bqnxb95f2cooowp", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowOutputId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowOutputId) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4szxr9x43tpj6np") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("v40aqzpd") - - // update - edit_subjectAltNames := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "fugxf58p", - "name": "san", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }`), edit_subjectAltNames); err != nil { - return err - } - collection.Schema.AddField(edit_subjectAltNames) - - // update - edit_acmeCertUrl := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "ayyjy5ve", - "name": "certUrl", - "type": "url", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }`), edit_acmeCertUrl); err != nil { - return err - } - collection.Schema.AddField(edit_acmeCertUrl) - - // update - edit_acmeCertStableUrl := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "3x5heo8e", - "name": "certStableUrl", - "type": "url", - "required": false, - "presentable": false, - "unique": false, - "options": { - "exceptDomains": null, - "onlyDomains": null - } - }`), edit_acmeCertStableUrl); err != nil { - return err - } - collection.Schema.AddField(edit_acmeCertStableUrl) - - // update - edit_workflowId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "uvqfamb1", - "name": "workflow", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowId) - - // update - edit_workflowNodeId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "uqldzldw", - "name": "nodeId", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }`), edit_workflowNodeId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowNodeId) - - // update - edit_workflowOutputId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "2ohlr0yd", - "name": "output", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "bqnxb95f2cooowp", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowOutputId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowOutputId) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735977005_updated_workflow_output.go b/migrations/1735977005_updated_workflow_output.go deleted file mode 100644 index 26795e2e..00000000 --- a/migrations/1735977005_updated_workflow_output.go +++ /dev/null @@ -1,144 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("bqnxb95f2cooowp") - if err != nil { - return err - } - - // update - edit_workflowId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "jka88auc", - "name": "workflowId", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowId) - - // update - edit_outputs := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "he4cceqb", - "name": "outputs", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }`), edit_outputs); err != nil { - return err - } - collection.Schema.AddField(edit_outputs) - - // update - edit_succeeded := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "2yfxbxuf", - "name": "succeeded", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }`), edit_succeeded); err != nil { - return err - } - collection.Schema.AddField(edit_succeeded) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("bqnxb95f2cooowp") - if err != nil { - return err - } - - // update - edit_workflowId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "jka88auc", - "name": "workflow", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowId) - - // update - edit_outputs := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "he4cceqb", - "name": "output", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }`), edit_outputs); err != nil { - return err - } - collection.Schema.AddField(edit_outputs) - - // update - edit_succeeded := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "2yfxbxuf", - "name": "succeed", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }`), edit_succeeded); err != nil { - return err - } - collection.Schema.AddField(edit_succeeded) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735977021_updated_workflow_run_log.go b/migrations/1735977021_updated_workflow_run_log.go deleted file mode 100644 index 1cafab81..00000000 --- a/migrations/1735977021_updated_workflow_run_log.go +++ /dev/null @@ -1,144 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("qjp8lygssgwyqyz") - if err != nil { - return err - } - - // update - edit_workflowId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "m8xfsyyy", - "name": "workflowId", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowId) - - // update - edit_logs := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "2m9byaa9", - "name": "logs", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }`), edit_logs); err != nil { - return err - } - collection.Schema.AddField(edit_logs) - - // update - edit_succeeded := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "cht6kqw9", - "name": "succeeded", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }`), edit_succeeded); err != nil { - return err - } - collection.Schema.AddField(edit_succeeded) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("qjp8lygssgwyqyz") - if err != nil { - return err - } - - // update - edit_workflowId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "m8xfsyyy", - "name": "workflow", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "tovyif5ax6j62ur", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), edit_workflowId); err != nil { - return err - } - collection.Schema.AddField(edit_workflowId) - - // update - edit_logs := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "2m9byaa9", - "name": "log", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }`), edit_logs); err != nil { - return err - } - collection.Schema.AddField(edit_logs) - - // update - edit_succeeded := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "cht6kqw9", - "name": "succeed", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }`), edit_succeeded); err != nil { - return err - } - collection.Schema.AddField(edit_succeeded) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735977530_updated_certificate.go b/migrations/1735977530_updated_certificate.go deleted file mode 100644 index 8812c593..00000000 --- a/migrations/1735977530_updated_certificate.go +++ /dev/null @@ -1,57 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4szxr9x43tpj6np") - if err != nil { - return err - } - - // add - new_source := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "by9hetqi", - "name": "source", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "workflow", - "upload" - ] - } - }`), new_source); err != nil { - return err - } - collection.Schema.AddField(new_source) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4szxr9x43tpj6np") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("by9hetqi") - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735980691_updated_workflow_run_log.go b/migrations/1735980691_updated_workflow_run_log.go deleted file mode 100644 index 03117dc8..00000000 --- a/migrations/1735980691_updated_workflow_run_log.go +++ /dev/null @@ -1,105 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("qjp8lygssgwyqyz") - if err != nil { - return err - } - - collection.Name = "workflow_run" - - // add - new_trigger := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "jlroa3fk", - "name": "trigger", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "auto", - "manual" - ] - } - }`), new_trigger); err != nil { - return err - } - collection.Schema.AddField(new_trigger) - - // add - new_startedAt := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "k9xvtf89", - "name": "startedAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }`), new_startedAt); err != nil { - return err - } - collection.Schema.AddField(new_startedAt) - - // add - new_endedAt := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "3ikum7mk", - "name": "endedAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }`), new_endedAt); err != nil { - return err - } - collection.Schema.AddField(new_endedAt) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("qjp8lygssgwyqyz") - if err != nil { - return err - } - - collection.Name = "workflow_run_log" - - // remove - collection.Schema.RemoveField("jlroa3fk") - - // remove - collection.Schema.RemoveField("k9xvtf89") - - // remove - collection.Schema.RemoveField("3ikum7mk") - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735981441_updated_workflow.go b/migrations/1735981441_updated_workflow.go deleted file mode 100644 index 051945f2..00000000 --- a/migrations/1735981441_updated_workflow.go +++ /dev/null @@ -1,106 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("tovyif5ax6j62ur") - if err != nil { - return err - } - - // add - new_lastRunId := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "a23wkj9x", - "name": "lastRunId", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "qjp8lygssgwyqyz", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }`), new_lastRunId); err != nil { - return err - } - collection.Schema.AddField(new_lastRunId) - - // add - new_lastRunStatus := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "zivdxh23", - "name": "lastRunStatus", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "pending", - "running", - "succeeded", - "failed" - ] - } - }`), new_lastRunStatus); err != nil { - return err - } - collection.Schema.AddField(new_lastRunStatus) - - // add - new_lastRunTime := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "u9bosu36", - "name": "lastRunTime", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }`), new_lastRunTime); err != nil { - return err - } - collection.Schema.AddField(new_lastRunTime) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("tovyif5ax6j62ur") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("a23wkj9x") - - // remove - collection.Schema.RemoveField("zivdxh23") - - // remove - collection.Schema.RemoveField("u9bosu36") - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1735981515_updated_workflow_run.go b/migrations/1735981515_updated_workflow_run.go deleted file mode 100644 index c649cd04..00000000 --- a/migrations/1735981515_updated_workflow_run.go +++ /dev/null @@ -1,78 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("qjp8lygssgwyqyz") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("cht6kqw9") - - // add - new_status := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "qldmh0tw", - "name": "status", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "pending", - "running", - "succeeded", - "failed" - ] - } - }`), new_status); err != nil { - return err - } - collection.Schema.AddField(new_status) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("qjp8lygssgwyqyz") - if err != nil { - return err - } - - // add - del_succeeded := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "cht6kqw9", - "name": "succeeded", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }`), del_succeeded); err != nil { - return err - } - collection.Schema.AddField(del_succeeded) - - // remove - collection.Schema.RemoveField("qldmh0tw") - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1736685828_updated_access.go b/migrations/1736685828_updated_access.go deleted file mode 100644 index dc0fe496..00000000 --- a/migrations/1736685828_updated_access.go +++ /dev/null @@ -1,111 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_provider := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "provider", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "azure", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_provider); err != nil { - return err - } - collection.Schema.AddField(edit_provider) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_provider := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "provider", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_provider); err != nil { - return err - } - collection.Schema.AddField(edit_provider) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1736861196_updated_access.go b/migrations/1736861196_updated_access.go deleted file mode 100644 index 8d6023bc..00000000 --- a/migrations/1736861196_updated_access.go +++ /dev/null @@ -1,113 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_provider := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "provider", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "azure", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "ucloud", - "volcengine", - "webhook" - ] - } - }`), edit_provider); err != nil { - return err - } - collection.Schema.AddField(edit_provider) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e") - if err != nil { - return err - } - - // update - edit_provider := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "hwy7m03o", - "name": "provider", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "acmehttpreq", - "aliyun", - "aws", - "azure", - "baiducloud", - "byteplus", - "cloudflare", - "dogecloud", - "godaddy", - "huaweicloud", - "k8s", - "local", - "namedotcom", - "namesilo", - "powerdns", - "qiniu", - "ssh", - "tencentcloud", - "volcengine", - "webhook" - ] - } - }`), edit_provider); err != nil { - return err - } - collection.Schema.AddField(edit_provider) - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1737019549_updated_certificate.go b/migrations/1737019549_updated_certificate.go deleted file mode 100644 index cef2a645..00000000 --- a/migrations/1737019549_updated_certificate.go +++ /dev/null @@ -1,54 +0,0 @@ -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/schema" -) - -func init() { - m.Register(func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4szxr9x43tpj6np") - if err != nil { - return err - } - - // add - new_deleted := &schema.SchemaField{} - if err := json.Unmarshal([]byte(`{ - "system": false, - "id": "klyf4nlq", - "name": "deleted", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }`), new_deleted); err != nil { - return err - } - collection.Schema.AddField(new_deleted) - - return dao.SaveCollection(collection) - }, func(db dbx.Builder) error { - dao := daos.New(db); - - collection, err := dao.FindCollectionByNameOrId("4szxr9x43tpj6np") - if err != nil { - return err - } - - // remove - collection.Schema.RemoveField("klyf4nlq") - - return dao.SaveCollection(collection) - }) -} diff --git a/migrations/1737141501_collections_snapshot.go b/migrations/1737141501_collections_snapshot.go new file mode 100644 index 00000000..1a933d41 --- /dev/null +++ b/migrations/1737141501_collections_snapshot.go @@ -0,0 +1,1525 @@ +package migrations + +import ( + "github.com/pocketbase/pocketbase/core" + m "github.com/pocketbase/pocketbase/migrations" +) + +func init() { + m.Register(func(app core.App) error { + jsonData := `[ + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "geeur58v", + "max": 0, + "min": 0, + "name": "name", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "hwy7m03o", + "maxSelect": 1, + "name": "provider", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "acmehttpreq", + "aliyun", + "aws", + "azure", + "baiducloud", + "byteplus", + "cloudflare", + "dogecloud", + "godaddy", + "huaweicloud", + "k8s", + "local", + "namedotcom", + "namesilo", + "powerdns", + "qiniu", + "ssh", + "tencentcloud", + "ucloud", + "volcengine", + "webhook" + ] + }, + { + "hidden": false, + "id": "iql7jpwx", + "maxSize": 2000000, + "name": "config", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "hsxcnlvd", + "maxSelect": 1, + "name": "usage", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "apply", + "deploy", + "all" + ] + }, + { + "hidden": false, + "id": "lr33hiwg", + "max": "", + "min": "", + "name": "deleted", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "4yzbv8urny5ja1e", + "indexes": [ + "CREATE INDEX ` + "`" + `idx_wkoST0j` + "`" + ` ON ` + "`" + `access` + "`" + ` (` + "`" + `name` + "`" + `)" + ], + "listRule": null, + "name": "access", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "1tcmdsdf", + "max": 0, + "min": 0, + "name": "name", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "f9wyhypi", + "maxSize": 2000000, + "name": "content", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "dy6ccjb60spfy6p", + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_RO7X9Vw` + "`" + ` ON ` + "`" + `settings` + "`" + ` (` + "`" + `name` + "`" + `)" + ], + "listRule": null, + "name": "settings", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "fmjfn0yw", + "max": 0, + "min": 0, + "name": "ca", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "exceptDomains": null, + "hidden": false, + "id": "qqwijqzt", + "name": "email", + "onlyDomains": null, + "presentable": false, + "required": false, + "system": false, + "type": "email" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "genxqtii", + "max": 0, + "min": 0, + "name": "key", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "1aoia909", + "maxSize": 2000000, + "name": "resource", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "012d7abbod1hwvr", + "indexes": [], + "listRule": null, + "name": "acme_accounts", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "8yydhv1h", + "max": 0, + "min": 0, + "name": "name", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "1buzebwz", + "max": 0, + "min": 0, + "name": "description", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "vqoajwjq", + "maxSelect": 1, + "name": "trigger", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "auto", + "manual" + ] + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "8ho247wh", + "max": 0, + "min": 0, + "name": "triggerCron", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "nq7kfdzi", + "name": "enabled", + "presentable": false, + "required": false, + "system": false, + "type": "bool" + }, + { + "hidden": false, + "id": "awlphkfe", + "maxSize": 2000000, + "name": "content", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "g9ohkk5o", + "maxSize": 2000000, + "name": "draft", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "2rpfz9t3", + "name": "hasDraft", + "presentable": false, + "required": false, + "system": false, + "type": "bool" + }, + { + "cascadeDelete": false, + "collectionId": "qjp8lygssgwyqyz", + "hidden": false, + "id": "a23wkj9x", + "maxSelect": 1, + "minSelect": 0, + "name": "lastRunId", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + }, + { + "hidden": false, + "id": "zivdxh23", + "maxSelect": 1, + "name": "lastRunStatus", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "pending", + "running", + "succeeded", + "failed" + ] + }, + { + "hidden": false, + "id": "u9bosu36", + "max": "", + "min": "", + "name": "lastRunTime", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "tovyif5ax6j62ur", + "indexes": [], + "listRule": null, + "name": "workflow", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "cascadeDelete": false, + "collectionId": "tovyif5ax6j62ur", + "hidden": false, + "id": "jka88auc", + "maxSelect": 1, + "minSelect": 0, + "name": "workflowId", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "z9fgvqkz", + "max": 0, + "min": 0, + "name": "nodeId", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "c2rm9omj", + "maxSize": 2000000, + "name": "node", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "he4cceqb", + "maxSize": 2000000, + "name": "outputs", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "hidden": false, + "id": "2yfxbxuf", + "name": "succeeded", + "presentable": false, + "required": false, + "system": false, + "type": "bool" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "bqnxb95f2cooowp", + "indexes": [], + "listRule": null, + "name": "workflow_output", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "hidden": false, + "id": "by9hetqi", + "maxSelect": 1, + "name": "source", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "workflow", + "upload" + ] + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "fugxf58p", + "max": 0, + "min": 0, + "name": "subjectAltNames", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "plmambpz", + "max": 0, + "min": 0, + "name": "certificate", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "49qvwxcg", + "max": 0, + "min": 0, + "name": "privateKey", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "agt7n5bb", + "max": 0, + "min": 0, + "name": "issuerCertificate", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "v40aqzpd", + "max": "", + "min": "", + "name": "effectAt", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "hidden": false, + "id": "zgpdby2k", + "max": "", + "min": "", + "name": "expireAt", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "exceptDomains": null, + "hidden": false, + "id": "ayyjy5ve", + "name": "acmeCertUrl", + "onlyDomains": null, + "presentable": false, + "required": false, + "system": false, + "type": "url" + }, + { + "exceptDomains": null, + "hidden": false, + "id": "3x5heo8e", + "name": "acmeCertStableUrl", + "onlyDomains": null, + "presentable": false, + "required": false, + "system": false, + "type": "url" + }, + { + "cascadeDelete": false, + "collectionId": "tovyif5ax6j62ur", + "hidden": false, + "id": "uvqfamb1", + "maxSelect": 1, + "minSelect": 0, + "name": "workflowId", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "uqldzldw", + "max": 0, + "min": 0, + "name": "workflowNodeId", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "cascadeDelete": false, + "collectionId": "bqnxb95f2cooowp", + "hidden": false, + "id": "2ohlr0yd", + "maxSelect": 1, + "minSelect": 0, + "name": "workflowOutputId", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + }, + { + "hidden": false, + "id": "klyf4nlq", + "max": "", + "min": "", + "name": "deleted", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "4szxr9x43tpj6np", + "indexes": [], + "listRule": null, + "name": "certificate", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "cascadeDelete": false, + "collectionId": "tovyif5ax6j62ur", + "hidden": false, + "id": "m8xfsyyy", + "maxSelect": 1, + "minSelect": 0, + "name": "workflowId", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + }, + { + "hidden": false, + "id": "qldmh0tw", + "maxSelect": 1, + "name": "status", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "pending", + "running", + "succeeded", + "failed" + ] + }, + { + "hidden": false, + "id": "jlroa3fk", + "maxSelect": 1, + "name": "trigger", + "presentable": false, + "required": false, + "system": false, + "type": "select", + "values": [ + "auto", + "manual" + ] + }, + { + "hidden": false, + "id": "k9xvtf89", + "max": "", + "min": "", + "name": "startedAt", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "hidden": false, + "id": "3ikum7mk", + "max": "", + "min": "", + "name": "endedAt", + "presentable": false, + "required": false, + "system": false, + "type": "date" + }, + { + "hidden": false, + "id": "2m9byaa9", + "maxSize": 2000000, + "name": "logs", + "presentable": false, + "required": false, + "system": false, + "type": "json" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "hvebkuxw", + "max": 0, + "min": 0, + "name": "error", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": false, + "type": "text" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": false, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": false, + "type": "autodate" + } + ], + "id": "qjp8lygssgwyqyz", + "indexes": [], + "listRule": null, + "name": "workflow_run", + "system": false, + "type": "base", + "updateRule": null, + "viewRule": null + }, + { + "authAlert": { + "emailTemplate": { + "body": "

Hello,

\n

We noticed a login to your {APP_NAME} account from a new location.

\n

If this was you, you may disregard this email.

\n

If this wasn't you, you should immediately change your {APP_NAME} account password to revoke access from all other locations.

\n

\n Thanks,
\n {APP_NAME} team\n

", + "subject": "Login from a new location" + }, + "enabled": true + }, + "authRule": "", + "authToken": { + "duration": 1209600 + }, + "confirmEmailChangeTemplate": { + "body": "

Hello,

\n

Click on the button below to confirm your new email address.

\n

\n Confirm new email\n

\n

If you didn't ask to change your email address, you can ignore this email.

\n

\n Thanks,
\n {APP_NAME} team\n

", + "subject": "Confirm your {APP_NAME} new email address" + }, + "createRule": null, + "deleteRule": null, + "emailChangeToken": { + "duration": 1800 + }, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "cost": 0, + "hidden": true, + "id": "password901924565", + "max": 0, + "min": 8, + "name": "password", + "pattern": "", + "presentable": false, + "required": true, + "system": true, + "type": "password" + }, + { + "autogeneratePattern": "[a-zA-Z0-9]{50}", + "hidden": true, + "id": "text2504183744", + "max": 60, + "min": 30, + "name": "tokenKey", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "exceptDomains": null, + "hidden": false, + "id": "email3885137012", + "name": "email", + "onlyDomains": null, + "presentable": false, + "required": true, + "system": true, + "type": "email" + }, + { + "hidden": false, + "id": "bool1547992806", + "name": "emailVisibility", + "presentable": false, + "required": false, + "system": true, + "type": "bool" + }, + { + "hidden": false, + "id": "bool256245529", + "name": "verified", + "presentable": false, + "required": false, + "system": true, + "type": "bool" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": true, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": true, + "type": "autodate" + } + ], + "fileToken": { + "duration": 120 + }, + "id": "pbc_3142635823", + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_tokenKey_pbc_3142635823` + "`" + ` ON ` + "`" + `_superusers` + "`" + ` (` + "`" + `tokenKey` + "`" + `)", + "CREATE UNIQUE INDEX ` + "`" + `idx_email_pbc_3142635823` + "`" + ` ON ` + "`" + `_superusers` + "`" + ` (` + "`" + `email` + "`" + `) WHERE ` + "`" + `email` + "`" + ` != ''" + ], + "listRule": null, + "manageRule": null, + "mfa": { + "duration": 1800, + "enabled": false, + "rule": "" + }, + "name": "_superusers", + "oauth2": { + "enabled": false, + "mappedFields": { + "avatarURL": "", + "id": "", + "name": "", + "username": "" + } + }, + "otp": { + "duration": 180, + "emailTemplate": { + "body": "

Hello,

\n

Your one-time password is: {OTP}

\n

If you didn't ask for the one-time password, you can ignore this email.

\n

\n Thanks,
\n {APP_NAME} team\n

", + "subject": "OTP for {APP_NAME}" + }, + "enabled": false, + "length": 8 + }, + "passwordAuth": { + "enabled": true, + "identityFields": [ + "email" + ] + }, + "passwordResetToken": { + "duration": 1800 + }, + "resetPasswordTemplate": { + "body": "

Hello,

\n

Click on the button below to reset your password.

\n

\n Reset password\n

\n

If you didn't ask to reset your password, you can ignore this email.

\n

\n Thanks,
\n {APP_NAME} team\n

", + "subject": "Reset your {APP_NAME} password" + }, + "system": true, + "type": "auth", + "updateRule": null, + "verificationTemplate": { + "body": "

Hello,

\n

Thank you for joining us at {APP_NAME}.

\n

Click on the button below to verify your email address.

\n

\n Verify\n

\n

\n Thanks,
\n {APP_NAME} team\n

", + "subject": "Verify your {APP_NAME} email" + }, + "verificationToken": { + "duration": 259200 + }, + "viewRule": null + }, + { + "createRule": null, + "deleteRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text455797646", + "max": 0, + "min": 0, + "name": "collectionRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text127846527", + "max": 0, + "min": 0, + "name": "recordRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text2462348188", + "max": 0, + "min": 0, + "name": "provider", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text1044722854", + "max": 0, + "min": 0, + "name": "providerId", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": true, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": true, + "type": "autodate" + } + ], + "id": "pbc_2281828961", + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_externalAuths_record_provider` + "`" + ` ON ` + "`" + `_externalAuths` + "`" + ` (collectionRef, recordRef, provider)", + "CREATE UNIQUE INDEX ` + "`" + `idx_externalAuths_collection_provider` + "`" + ` ON ` + "`" + `_externalAuths` + "`" + ` (collectionRef, provider, providerId)" + ], + "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", + "name": "_externalAuths", + "system": true, + "type": "base", + "updateRule": null, + "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text455797646", + "max": 0, + "min": 0, + "name": "collectionRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text127846527", + "max": 0, + "min": 0, + "name": "recordRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text1582905952", + "max": 0, + "min": 0, + "name": "method", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": true, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": true, + "type": "autodate" + } + ], + "id": "pbc_2279338944", + "indexes": [ + "CREATE INDEX ` + "`" + `idx_mfas_collectionRef_recordRef` + "`" + ` ON ` + "`" + `_mfas` + "`" + ` (collectionRef,recordRef)" + ], + "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", + "name": "_mfas", + "system": true, + "type": "base", + "updateRule": null, + "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" + }, + { + "createRule": null, + "deleteRule": null, + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text455797646", + "max": 0, + "min": 0, + "name": "collectionRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text127846527", + "max": 0, + "min": 0, + "name": "recordRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "cost": 8, + "hidden": true, + "id": "password901924565", + "max": 0, + "min": 0, + "name": "password", + "pattern": "", + "presentable": false, + "required": true, + "system": true, + "type": "password" + }, + { + "autogeneratePattern": "", + "hidden": true, + "id": "text3866985172", + "max": 0, + "min": 0, + "name": "sentTo", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": false, + "system": true, + "type": "text" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": true, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": true, + "type": "autodate" + } + ], + "id": "pbc_1638494021", + "indexes": [ + "CREATE INDEX ` + "`" + `idx_otps_collectionRef_recordRef` + "`" + ` ON ` + "`" + `_otps` + "`" + ` (collectionRef, recordRef)" + ], + "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", + "name": "_otps", + "system": true, + "type": "base", + "updateRule": null, + "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" + }, + { + "createRule": null, + "deleteRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", + "fields": [ + { + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text455797646", + "max": 0, + "min": 0, + "name": "collectionRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text127846527", + "max": 0, + "min": 0, + "name": "recordRef", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "autogeneratePattern": "", + "hidden": false, + "id": "text4228609354", + "max": 0, + "min": 0, + "name": "fingerprint", + "pattern": "", + "presentable": false, + "primaryKey": false, + "required": true, + "system": true, + "type": "text" + }, + { + "hidden": false, + "id": "autodate2990389176", + "name": "created", + "onCreate": true, + "onUpdate": false, + "presentable": false, + "system": true, + "type": "autodate" + }, + { + "hidden": false, + "id": "autodate3332085495", + "name": "updated", + "onCreate": true, + "onUpdate": true, + "presentable": false, + "system": true, + "type": "autodate" + } + ], + "id": "pbc_4275539003", + "indexes": [ + "CREATE UNIQUE INDEX ` + "`" + `idx_authOrigins_unique_pairs` + "`" + ` ON ` + "`" + `_authOrigins` + "`" + ` (collectionRef, recordRef, fingerprint)" + ], + "listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId", + "name": "_authOrigins", + "system": true, + "type": "base", + "updateRule": null, + "viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId" + } + ]` + + return app.ImportCollectionsByMarshaledJSON([]byte(jsonData), false) + }, func(app core.App) error { + return nil + }) +} diff --git a/migrations/1737141502_superusers_initial.go b/migrations/1737141502_superusers_initial.go new file mode 100644 index 00000000..a9dd9522 --- /dev/null +++ b/migrations/1737141502_superusers_initial.go @@ -0,0 +1,27 @@ +package migrations + +import ( + "github.com/pocketbase/pocketbase/core" + m "github.com/pocketbase/pocketbase/migrations" +) + +func init() { + m.Register(func(app core.App) error { + superusers, err := app.FindCollectionByNameOrId(core.CollectionNameSuperusers) + if err != nil { + return err + } + + record := core.NewRecord(superusers) + record.Set("email", "admin@certimate.fun") + record.Set("password", "1234567890") + return app.Save(record) + }, func(app core.App) error { + record, _ := app.FindAuthRecordByEmail(core.CollectionNameSuperusers, "admin@certimate.fun") + if record == nil { + return nil + } + + return app.Delete(record) + }) +} From ecde12ec23e8170ea65b7583d23bf86646b0c529 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 18 Jan 2025 05:45:38 +0800 Subject: [PATCH 05/16] feat(ui): improve ssl providers switch warning --- ui/src/i18n/locales/en/nls.settings.json | 2 +- ui/src/i18n/locales/zh/nls.settings.json | 2 +- ui/src/pages/settings/SettingsSSLProvider.tsx | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/src/i18n/locales/en/nls.settings.json b/ui/src/i18n/locales/en/nls.settings.json index 68b93ec5..7a12b408 100644 --- a/ui/src/i18n/locales/en/nls.settings.json +++ b/ui/src/i18n/locales/en/nls.settings.json @@ -77,8 +77,8 @@ "settings.sslprovider.form.provider.option.letsencrypt_staging.label": "Let's Encrypt Staging Environment", "settings.sslprovider.form.provider.option.zerossl.label": "ZeroSSL", "settings.sslprovider.form.provider.option.gts.label": "Google Trust Services", + "settings.sslprovider.form.provider.alert": "Attention: The certificate validity lifetime, certificate algorithm, domain names count, and support for wildcard domain names are allowed may vary among different providers. After switching service providers, please check whether the configuration of the workflows needs to be adjusted.", "settings.sslprovider.form.letsencrypt_staging_alert": "The staging environment can reduce the chance of your running up against rate limits.

Learn more:
https://letsencrypt.org/docs/staging-environment/", - "settings.sslprovider.form.letsencrypt_staging_warning": "Attention: Certificates from the staging environment are only for testing purposes.", "settings.sslprovider.form.zerossl_eab_kid.label": "EAB KID", "settings.sslprovider.form.zerossl_eab_kid.placeholder": "Please enter EAB KID", "settings.sslprovider.form.zerossl_eab_kid.tooltip": "For more information, see https://zerossl.com/documentation/acme/", diff --git a/ui/src/i18n/locales/zh/nls.settings.json b/ui/src/i18n/locales/zh/nls.settings.json index c8d4703a..a3958e80 100644 --- a/ui/src/i18n/locales/zh/nls.settings.json +++ b/ui/src/i18n/locales/zh/nls.settings.json @@ -77,8 +77,8 @@ "settings.sslprovider.form.provider.option.letsencrypt_staging.label": "Let's Encrypt 测试环境", "settings.sslprovider.form.provider.option.zerossl.label": "ZeroSSL", "settings.sslprovider.form.provider.option.gts.label": "Google Trust Services", + "settings.sslprovider.form.provider.alert": "注意:不同服务商所支持的证书有效期、证书算法、多域名数量上限、是否允许泛域名等可能不同,切换服务商后请注意检查已有工作流的配置是否需要调整。", "settings.sslprovider.form.letsencrypt_staging_alert": "测试环境比生产环境有更宽松的速率限制,可进行测试性部署。

点击下方链接了解更多:
https://letsencrypt.org/zh-cn/docs/staging-environment/", - "settings.sslprovider.form.letsencrypt_staging_warning": "警告:测试环境证书仅能用于测试目的。", "settings.sslprovider.form.zerossl_eab_kid.label": "EAB KID", "settings.sslprovider.form.zerossl_eab_kid.placeholder": "请输入 EAB KID", "settings.sslprovider.form.zerossl_eab_kid.tooltip": "这是什么?请参阅 https://zerossl.com/documentation/acme/", diff --git a/ui/src/pages/settings/SettingsSSLProvider.tsx b/ui/src/pages/settings/SettingsSSLProvider.tsx index c3a550f0..c082c4e7 100644 --- a/ui/src/pages/settings/SettingsSSLProvider.tsx +++ b/ui/src/pages/settings/SettingsSSLProvider.tsx @@ -97,10 +97,6 @@ const SSLProviderEditFormLetsEncryptStagingConfig = () => { } />
- - } /> - -