# RESTful 服务配置 server: mode: debug # server mode: release, debug, test,默认 release healthz: true # 是否开启健康检查,如果开启会安装 /healthz 路由,默认 true middlewares: recovery,secure,nocache,cors # 加载的 gin 中间件列表,多个中间件,逗号(,)隔开 # GRPC 服务配置 grpc: bind-address: 0.0.0.0 # grpc 安全模式的 IP 地址,默认 0.0.0.0 bind-port: 8081 # grpc 安全模式的端口号,默认 8081 # HTTP 配置 insecure: bind-address: 0.0.0.0 # 绑定的不安全 IP 地址,设置为 0.0.0.0 表示使用全部网络接口,默认为 127.0.0.1 bind-port: 8080 # 提供非安全认证的监听端口,默认为 8080 # HTTPS 配置 secure: bind-address: 0.0.0.0 # HTTPS 安全模式的 IP 地址,默认为 0.0.0.0 bind-port: 8443 # 使用 HTTPS 安全模式的端口号,设置为 0 表示不启用 HTTPS,默认为 8443 tls: #cert-dir: .iam/cert # TLS 证书所在的目录,默认值为 /var/run/iam #pair-name: iam # TLS 私钥对名称,默认 iam cert-key: cert-file: # 包含 x509 证书的文件路径,用 HTTPS 认证 private-key-file: # TLS 私钥 # PGSQL 数据库相关配置 pgsql: host: 10.0.0.3 # MySQL 机器 ip 和端口,默认 127.0.0.1:3306 username: root # MySQL 用户名(建议授权最小权限集) password: root # MySQL 用户密码 database: duyong # 系统所用的数据库名 max-idle-connections: 100 # MySQL 最大空闲连接数,默认 100 max-open-connections: 100 # MySQL 最大打开的连接数,默认 100 max-connection-life-time: 10s # 空闲连接最大存活时间,默认 10s log-level: 4 # GORM log level, 1: silent, 2:error, 3:warn, 4:info jwt: realm: JWT # jwt 标识 key: dfVpOK8LZeJLZHYmHdb1VdyRrACKpqoo # 服务端密钥 timeout: 24h # token 过期时间(小时) max-refresh: 24h # token 更新时间(小时) log: name: iam # Logger的名字 development: true # 是否是开发模式。如果是开发模式,会对DPanicLevel进行堆栈跟踪。 level: debug # 日志级别,优先级从低到高依次为:debug, info, warn, error, dpanic, panic, fatal。 format: console # 支持的日志输出格式,目前支持console和json两种。console其实就是text格式。 enable-color: true # 是否开启颜色输出,true:是,false:否 disable-caller: false # 是否开启 caller,如果开启会在日志中显示调用日志所在的文件、函数和行号 disable-stacktrace: false # 是否再panic及以上级别禁止打印堆栈信息 output-paths: ./logs/iam.log,stdout # 支持输出到多个输出,逗号分开。支持输出到标准输出(stdout)和文件。 error-output-paths: ./logs/error.log # zap内部(非业务)错误日志输出路径,多个输出,逗号分开 feature: enable-metrics: true # 开启 metrics, router: /metrics profiling: true # 开启性能分析, 可以通过 :/debug/pprof/地址查看程序栈、线程等系统信息,默认值为 true