iam.yaml 3.0 KB

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