mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
fix: config fields not generated on first startup (#1016)
* fix: config fields not generated on first startup * cleanup * fix reference * replace yaml module * remove duplicated fields * remove yaml.v3 as a direct dependency * update dependency * chore
This commit is contained in:
@@ -11,9 +11,9 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/patrickmn/go-cache"
|
||||
"gopkg.in/yaml.v3"
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/nezhahq/nezha/model"
|
||||
"github.com/nezhahq/nezha/pkg/utils"
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
var Version = "debug"
|
||||
|
||||
var (
|
||||
Conf *model.Config
|
||||
Cache *cache.Cache
|
||||
DB *gorm.DB
|
||||
Loc *time.Location
|
||||
@@ -69,15 +68,6 @@ func InitFrontendTemplates() {
|
||||
}
|
||||
}
|
||||
|
||||
// InitConfigFromPath 从给出的文件路径中加载配置
|
||||
func InitConfigFromPath(path string) {
|
||||
Conf = &model.Config{}
|
||||
err := Conf.Read(path, FrontendTemplates)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// InitDBFromPath 从给出的文件路径中加载数据库
|
||||
func InitDBFromPath(path string) {
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user