security: Đóng gói và bảo vệ khóa giải mã nội bộ trong binary, gỡ bỏ hoàn toàn khỏi cấu hình và tài liệu

This commit is contained in:
ongtrieuhau
2026-10-27 03:46:27 -07:00
parent f3230fcd9d
commit bc16c720cf
6 changed files with 22 additions and 60 deletions
+1 -12
View File
@@ -30,9 +30,6 @@ func HandleGetAdminConfig(w http.ResponseWriter, r *http.Request) {
if respCfg.Updater.Token != "" {
respCfg.Updater.Token = "••••••••"
}
if respCfg.License.CryptoKey != "" {
respCfg.License.CryptoKey = "••••••••"
}
_ = json.NewEncoder(w).Encode(map[string]interface{}{
"success": true,
@@ -83,15 +80,7 @@ func HandleSaveAdminConfig(w http.ResponseWriter, r *http.Request) {
input.Updater.Token = enc
}
// Handle License Crypto Key
if input.License.CryptoKey == "" || input.License.CryptoKey == "••••••••" {
input.License.CryptoKey = current.License.CryptoKey
input.DecryptedCryptoKey = current.DecryptedCryptoKey
} else {
input.DecryptedCryptoKey = input.License.CryptoKey
enc, _ := config.Encrypt(input.License.CryptoKey)
input.License.CryptoKey = enc
}
// Handle License Key
if input.License.Key == "" {
input.License.Key = current.License.Key
}