From 0649a15c892ba677bdfa33f2ba8bd4599f3d24c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A1=D0=B0?= =?UTF-8?q?=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Sun, 26 Oct 2025 15:43:34 +0300 Subject: [PATCH] feature: setting certs for subscription whule generating --- main.go | 14 ++++++++++++++ web/service/setting.go | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/main.go b/main.go index 8ab8b13f..94b23bc8 100644 --- a/main.go +++ b/main.go @@ -321,6 +321,20 @@ func updateCert(publicKey string, privateKey string) { } else { fmt.Println("set certificate private key success") } + + err = settingService.SetSubCertFile(publicKey) + if err != nil { + fmt.Println("set certificate for subscription public key failed:", err) + } else { + fmt.Println("set certificate for subscription public key success") + } + + err = settingService.SetSubKeyFile(privateKey) + if err != nil { + fmt.Println("set certificate for subscription private key failed:", err) + } else { + fmt.Println("set certificate for subscription private key success") + } } else { fmt.Println("both public and private key should be entered.") } diff --git a/web/service/setting.go b/web/service/setting.go index c8ce7896..56db346d 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -479,10 +479,18 @@ func (s *SettingService) GetSubDomain() (string, error) { return s.getString("subDomain") } +func (s *SettingService) SetSubCertFile(subCertFile string) error { + return s.setString("subCertFile", subCertFile) +} + func (s *SettingService) GetSubCertFile() (string, error) { return s.getString("subCertFile") } +func (s *SettingService) SetSubKeyFile(subKeyFile string) error { + return s.setString("subKeyFile", subKeyFile) +} + func (s *SettingService) GetSubKeyFile() (string, error) { return s.getString("subKeyFile") }