mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 02:42:51 +00:00
feature: setting certs for subscription whule generating
This commit is contained in:
parent
dad9e37cdb
commit
0649a15c89
2 changed files with 22 additions and 0 deletions
14
main.go
14
main.go
|
|
@ -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.")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue