From 1d5ee041aa83abe076382776201a63b305db6e2a Mon Sep 17 00:00:00 2001 From: ExplodingDragon Date: Tue, 25 Nov 2025 00:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A0=E5=85=B3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/server/config.go | 12 +++--------- pkg/server.go | 4 ++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cmd/server/config.go b/cmd/server/config.go index 2ab2231..724c712 100644 --- a/cmd/server/config.go +++ b/cmd/server/config.go @@ -21,8 +21,10 @@ type Config struct { Bind string `yaml:"bind"` // HTTP 绑定 Domain string `yaml:"domain"` // 基础域名 + // todo: 拆分 alias 和 db Database ConfigDatabase `yaml:"database"` // 配置 - Event ConfigEvent `yaml:"event"` // 事件传递 + + Event ConfigEvent `yaml:"event"` // 事件传递 Auth ConfigAuth `yaml:"auth"` // 后端认证配置 @@ -81,14 +83,6 @@ type ConfigEvent struct { URL string `yaml:"url"` } -type ConfigProxy struct { - Enable bool `yaml:"enable"` // 是否允许反向代理 -} - -type ConfigRender struct { - Enable bool `yaml:"enable"` // 是否开启渲染器 -} - type ConfigCache struct { Meta string `yaml:"meta"` // 元数据缓存 MetaTTL time.Duration `yaml:"meta_ttl"` // 缓存时间 diff --git a/pkg/server.go b/pkg/server.go index 28d1610..47f681c 100644 --- a/pkg/server.go +++ b/pkg/server.go @@ -55,8 +55,8 @@ func NewPageServer( filterConfig map[string]map[string]any, ) (*Server, error) { svcMeta := core.NewServerMeta(client, backend, domain, cacheMeta, cacheMetaTTL) - pageMeta := core.NewPageDomain(svcMeta, core.NewDomainAlias(db.Child("config").Child("alias")), domain, defaultBranch) - globCache, err := lru.New[string, glob.Glob](256) + pageMeta := core.NewPageDomain(svcMeta, core.NewDomainAlias(db.Child("config", "alias")), domain, defaultBranch) + globCache, err := lru.New[string, glob.Glob](512) if err != nil { return nil, err }