diff --git a/internal/conf/config.yaml b/internal/conf/config.yaml index 00c31e8d..307e8451 100644 --- a/internal/conf/config.yaml +++ b/internal/conf/config.yaml @@ -1,4 +1,5 @@ App: # APP基础设置项 + RunMode: debug AttachmentIncomeRate: 0.8 MaxCommentCount: 10 DefaultContextTimeout: 60 @@ -12,6 +13,36 @@ Server: # 服务设置 WriteTimeout: 60 Features: Default: [] +WebServer: # Web服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +AdminServer: # Admin后台运维服务 + HttpIp: 0.0.0.0 + HttpPort: 8014 + ReadTimeout: 60 + WriteTimeout: 60 +SpaceXServer: # SpaceX服务 + HttpIp: 0.0.0.0 + HttpPort: 8012 + ReadTimeout: 60 + WriteTimeout: 60 +BotServer: # Bot服务 + HttpIp: 0.0.0.0 + HttpPort: 8016 + ReadTimeout: 60 + WriteTimeout: 60 +LocalossServer: # Localoss服务 + HttpIp: 0.0.0.0 + HttpPort: 8018 + ReadTimeout: 60 + WriteTimeout: 60 +DocsServer: # 开发文档服务 + HttpIp: 0.0.0.0 + HttpPort: 8011 + ReadTimeout: 60 + WriteTimeout: 60 SmsJuhe: Gateway: https://v.juhe.cn/sms/send Key: diff --git a/internal/service/service.go b/internal/service/service.go index a17476aa..c1f8aa94 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -58,14 +58,15 @@ func MaxSidSize(ss []Service) int { } func newService() (ss []Service) { - ss = append(ss, newWebService()) - // add oldWebService if not depredcated OldWebService cfg.Not("Deprecated:OldWeb", func() { ss = append(ss, newOldWebService()) }) - + // add all service if declared in features on config.yaml cfg.In(cfg.Actions{ + "Web": func() { + ss = append(ss, newWebService()) + }, "Admin": func() { ss = append(ss, newAdminService()) }, @@ -75,10 +76,9 @@ func newService() (ss []Service) { "Bot": func() { ss = append(ss, newBotService()) }, - "LocalOSS": func() { + "NativeOBS": func() { ss = append(ss, newLocalossService()) }, }) - return }