清理无关配置
This commit is contained in:
@@ -21,8 +21,10 @@ type Config struct {
|
|||||||
Bind string `yaml:"bind"` // HTTP 绑定
|
Bind string `yaml:"bind"` // HTTP 绑定
|
||||||
Domain string `yaml:"domain"` // 基础域名
|
Domain string `yaml:"domain"` // 基础域名
|
||||||
|
|
||||||
|
// todo: 拆分 alias 和 db
|
||||||
Database ConfigDatabase `yaml:"database"` // 配置
|
Database ConfigDatabase `yaml:"database"` // 配置
|
||||||
Event ConfigEvent `yaml:"event"` // 事件传递
|
|
||||||
|
Event ConfigEvent `yaml:"event"` // 事件传递
|
||||||
|
|
||||||
Auth ConfigAuth `yaml:"auth"` // 后端认证配置
|
Auth ConfigAuth `yaml:"auth"` // 后端认证配置
|
||||||
|
|
||||||
@@ -81,14 +83,6 @@ type ConfigEvent struct {
|
|||||||
URL string `yaml:"url"`
|
URL string `yaml:"url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigProxy struct {
|
|
||||||
Enable bool `yaml:"enable"` // 是否允许反向代理
|
|
||||||
}
|
|
||||||
|
|
||||||
type ConfigRender struct {
|
|
||||||
Enable bool `yaml:"enable"` // 是否开启渲染器
|
|
||||||
}
|
|
||||||
|
|
||||||
type ConfigCache struct {
|
type ConfigCache struct {
|
||||||
Meta string `yaml:"meta"` // 元数据缓存
|
Meta string `yaml:"meta"` // 元数据缓存
|
||||||
MetaTTL time.Duration `yaml:"meta_ttl"` // 缓存时间
|
MetaTTL time.Duration `yaml:"meta_ttl"` // 缓存时间
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ func NewPageServer(
|
|||||||
filterConfig map[string]map[string]any,
|
filterConfig map[string]map[string]any,
|
||||||
) (*Server, error) {
|
) (*Server, error) {
|
||||||
svcMeta := core.NewServerMeta(client, backend, domain, cacheMeta, cacheMetaTTL)
|
svcMeta := core.NewServerMeta(client, backend, domain, cacheMeta, cacheMetaTTL)
|
||||||
pageMeta := core.NewPageDomain(svcMeta, core.NewDomainAlias(db.Child("config").Child("alias")), domain, defaultBranch)
|
pageMeta := core.NewPageDomain(svcMeta, core.NewDomainAlias(db.Child("config", "alias")), domain, defaultBranch)
|
||||||
globCache, err := lru.New[string, glob.Glob](256)
|
globCache, err := lru.New[string, glob.Glob](512)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user