Files
pika/config.postgresql.yaml
2025-12-15 22:10:28 +08:00

58 lines
1.7 KiB
YAML

database:
enabled: true
type: postgres
postgres:
hostname: pika-postgresql
port: 5432
username: pika
password: pika
database: pika
show_sql: false
log:
level: debug # 日志等级 debug,info,waring,error
filename: ./logs/pika.log
server:
addr: "0.0.0.0:8080"
ip_extractor: "x-forwarded-for"
ip_trust_list: "0.0.0.0/0"
App:
JWT:
Secret: "" # 替换为任意 UUID 字符串
ExpiresHours: 168 # 7天
# Basic Auth 用户配置(使用 bcrypt 加密)
# 生成密码命令: htpasswd -nBC 12 '' | tr -d ':\n'
# 或使用 Go: bcrypt.GenerateFromPassword([]byte("your_password"), bcrypt.DefaultCost)
Users:
admin: "$2y$12$7DXcOiX1D59xNTIn5riUKusAPLP88LxxoczWmUT83MBj5EFznbp8a" # 默认密码: admin123
# OIDC 认证配置(可选)
OIDC:
Enabled: false
Issuer: "https://your-oidc-provider.com"
ClientID: "your-client-id"
ClientSecret: "your-client-secret"
RedirectURL: "http://localhost:8080/oidc/callback" # 前端回调页面
# GitHub OAuth 认证配置(可选)
# 创建 GitHub OAuth App: https://github.com/settings/developers
GitHub:
Enabled: false
ClientID: "your-github-client-id"
ClientSecret: "your-github-client-secret"
RedirectURL: "http://localhost:8080/github/callback" # 前端回调页面
AllowedUsers: # 允许登录的 GitHub 用户名白名单,不配置或留空则允许所有用户
- "your-github-username"
- "another-username"
GeoIP:
Enabled: false
DBPath: "./GeoLite2-City.mmdb"
VictoriaMetrics:
Enabled: true
URL: "http://victoriametrics:8428"
RetentionDays: 7 # 数据保留时长
WriteTimeout: 60 # 写超时时间(秒)
QueryTimeout: 60 # 读超时时间(秒)