feature: setting certs for subscription whule generating

This commit is contained in:
Дмитрий Саенко 2025-10-26 15:43:34 +03:00
parent dad9e37cdb
commit 0649a15c89
2 changed files with 22 additions and 0 deletions

14
main.go
View file

@ -321,6 +321,20 @@ func updateCert(publicKey string, privateKey string) {
} else { } else {
fmt.Println("set certificate private key success") 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 { } else {
fmt.Println("both public and private key should be entered.") fmt.Println("both public and private key should be entered.")
} }

View file

@ -479,10 +479,18 @@ func (s *SettingService) GetSubDomain() (string, error) {
return s.getString("subDomain") return s.getString("subDomain")
} }
func (s *SettingService) SetSubCertFile(subCertFile string) error {
return s.setString("subCertFile", subCertFile)
}
func (s *SettingService) GetSubCertFile() (string, error) { func (s *SettingService) GetSubCertFile() (string, error) {
return s.getString("subCertFile") return s.getString("subCertFile")
} }
func (s *SettingService) SetSubKeyFile(subKeyFile string) error {
return s.setString("subKeyFile", subKeyFile)
}
func (s *SettingService) GetSubKeyFile() (string, error) { func (s *SettingService) GetSubKeyFile() (string, error) {
return s.getString("subKeyFile") return s.getString("subKeyFile")
} }