feat: update to go1.24 & support listening https (#1002)

* feat: support listening https

* refactor

* modernize

* support snake case in config

* more precise control of config fields

* update goreleaser config

* remove kubeyaml

* fix: expose agent_secret

* chore
This commit is contained in:
UUBulb
2025-02-28 22:02:54 +08:00
committed by GitHub
parent e770398a11
commit 1d2f8d24f6
28 changed files with 321 additions and 175 deletions

View File

@@ -1,7 +1,7 @@
package model
import (
"github.com/nezhahq/nezha/pkg/utils"
"github.com/goccy/go-json"
"gorm.io/gorm"
)
@@ -39,7 +39,7 @@ func (d DDNSProfile) TableName() string {
}
func (d *DDNSProfile) BeforeSave(tx *gorm.DB) error {
if data, err := utils.Json.Marshal(d.Domains); err != nil {
if data, err := json.Marshal(d.Domains); err != nil {
return err
} else {
d.DomainsRaw = string(data)
@@ -48,5 +48,5 @@ func (d *DDNSProfile) BeforeSave(tx *gorm.DB) error {
}
func (d *DDNSProfile) AfterFind(tx *gorm.DB) error {
return utils.Json.Unmarshal([]byte(d.DomainsRaw), &d.Domains)
return json.Unmarshal([]byte(d.DomainsRaw), &d.Domains)
}