跳到主要内容

准备配置

提示

配置文件中,env 为当前环境,dependHouYidependRabbit 为是否依赖后羿和月兔组件,server.name 为当前组件名称,server.httpEndpointserver.grpcEndpoint 为当前组件的 http 和 grpc 地址,server.network 为当前组件的网络类型,server.metadata 为当前组件的描述和背景,httpgrpc 为当前组件的 http 和 grpc 配置,cache 为当前组件的缓存配置,database 为当前组件的数据库配置,bizDatabase 为当前组件的业务数据库配置,alarmDatabase 为当前组件的告警数据库配置,log 为当前组件的日志配置,oauth2 为当前组件的 oauth2 配置,email_config 为当前组件的邮件配置,oss 为当前组件的 oss 配置

palace 配置文件
env: dev
dependHouYi: true
dependRabbit: true
server:
name: 'Palace'
metadata:
description: palace是moon监控系列的监控平台,用于管理告警、监控、配置、日志、数据源等
background: 寓意为月宫,表示moon系列的统一管理平台

http:
addr: 0.0.0.0:8000
timeout: 50s

grpc:
addr: 0.0.0.0:9000
timeout: 50s

jwt:
sign_key: 'moon-sign_key'
issuer: 'moon-palace'
expire: 3600s

allow_list:
- /api.admin.authorization.Authorization/Login
- /api.admin.authorization.Authorization/Captcha
- /api.admin.authorization.Authorization/CreatePassword
- /api.Health/Check
- /api.Alert/Hook
- /api.admin.authorization.Authorization/VerifyEmail
- /api.admin.authorization.Authorization/SetEmailWithLogin

cache:
driver: 'redis'
redis:
network: 'tcp'
addr: redis.middleware.svc.cluster.local:6379
db: 0
password: 'lQz8OMgje7UyoD'
read_timeout: 0.2s
write_timeout: 0.2s
dial_timeout: 0.2s

database:
driver: 'mysql'
debug: false
dsn: 'root:FfVodQL2BLo02H@tcp(mysql.middleware.svc.cluster.local:3306)/moon?charset=utf8mb4&parseTime=True&loc=Local'

bizDatabase:
driver: 'mysql'
debug: false
dsn: 'root:FfVodQL2BLo02H@tcp(mysql.middleware.svc.cluster.local:3306)/'

alarmDatabase:
driver: 'mysql'
debug: false
dsn: 'root:FfVodQL2BLo02H@tcp(mysql.middleware.svc.cluster.local:3306)/'

log:
type: 'slog'
level: 'debug'
slog:
json: true

oauth2:
redirect_uri: 'https://moon.aide-cloud.cn'
github:
client_id: ''
client_secret: ''
callback_uri: 'https://moon.aide-cloud.cn/api/auth/github/callback'
scopes:
- 'user'
- 'email'
gitee:
client_id: ''
client_secret: ''
callback_uri: 'https://moon.aide-cloud.cn/api/auth/gitee/callback'
scopes:
- 'user_info'
- 'emails'

email_config:
host: smtp.163.com
port: 25
user:
pass:

oss:
type: 'local'
limitSize:
yml:
max: 524228
yaml:
max: 524228
local:
path: './data/moon_oss'
url: https://moon.aide-cloud.cn/api
downloadPre: '/file/download'