mode: "server-agent"

log:
  level: info

auth:
  enable: true
  token:
    # Fixed token authentication mechanism
    publicToken: "${AUTH_TOKEN_PUBLIC_TOKEN:-xcontrol-public-token-2024}"
    refreshSecret: "${AUTH_TOKEN_REFRESH_SECRET:-xcontrol-refresh-secret-2024}"
    accessSecret: "${AUTH_TOKEN_ACCESS_SECRET:-xcontrol-access-secret-2024}"
    accessExpiry: "1h"
    refreshExpiry: "168h"
  oauth:
    redirectUrl: "${OAUTH_REDIRECT_URL}"
    frontendUrl: "${OAUTH_FRONTEND_URL:-https://console.svc.plus}"
    github:
      clientId: "${GITHUB_CLIENT_ID}"
      clientSecret: "${GITHUB_CLIENT_SECRET}"
    google:
      clientId: "${GOOGLE_CLIENT_ID}"
      clientSecret: "${GOOGLE_CLIENT_SECRET}"

server:
  addr: ":8080"
  readTimeout: 15s
  writeTimeout: 15s
  publicUrl: "https://accounts.svc.plus"
  allowedOrigins:
    - "https://dev.svc.plus"
    - "https://dev-homepage.svc.plus"
    - "https://www.svc.plus"
    - "https://global-homepage.svc.plus"
    - "https://accounts.svc.plus"
    - "https://console.svc.plus"
    - "https://localhost:8443"
    - "http://localhost:8080"
    - "http://127.0.0.1:8080"
    - "http://localhost:3001"
    - "http://127.0.0.1:3001"
    - "http://localhost:3000"
    - "http://127.0.0.1:3000"
    - "https://openclawdbot.svc.plus"
    - "http://localhost:18789"
    - "http://127.0.0.1:18789"
  tls:
    enabled: false
    certFile: ""
    keyFile: ""
    caFile: ""
    clientCAFile: ""
    redirectHttp: false

store:
  driver: "postgres"
  # 提示：本地默认从 .env 读取 POSTGRES_USER / POSTGRES_PASSWORD
  dsn: "postgres://postgres:otdcRLTJamszk3AE@127.0.0.1:15432/account?sslmode=disable"
  maxOpenConns: 30
  maxIdleConns: 10

session:
  ttl: 24h
  cache: "redis"
  redis:
    addr: "127.0.0.1:6379"
    password: ""

smtp:
  host: "smtp.example.com"
  port: 587
  username: "apikey"
  p: "s"
  from: "XControl Account <no-reply@example.com>"
  replyTo: ""
  timeout: 10s
  tls:
    mode: "auto"
    insecureSkipVerify: false

xray:
  sync:
    enabled: false
    interval: 5m
    outputPath: "/usr/local/etc/xray/config.json"
    templatePath: "account/config/xray.config.template.json"
    validateCommand: []
    restartCommand:
      - "systemctl"
      - "restart"
      - "xray.service"

agent:
  id: "account-primary"
  controllerUrl: "http://127.0.0.1:8080"
  apiToken: "replace-with-agent-token"
  httpTimeout: 15s
  statusInterval: 1m
  syncInterval: 5m
  tls:
    insecureSkipVerify: false

agents:
  credentials:
    - id: "account-primary"
      name: "Account Server (local agent)"
      token: "replace-with-agent-token"
      groups:
        - "default"

reviewAccount:
  enabled: true
  email: "review@svc.plus"
  name: "Review"
  password: "Review123!"
  groups:
    - "User"
    - "Beta"
    - "Review"
    - "ReadOnly Role"
  permissions:
    - "admin.settings.read"
    - "admin.users.metrics.read"
    - "admin.users.list.read"
    - "admin.agents.status.read"
    - "admin.blacklist.read"
