-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
103 lines (94 loc) · 6.09 KB
/
Copy path.env.example
File metadata and controls
103 lines (94 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Gozar configuration template.
# Copy to `.env` and fill in real values. NEVER commit a populated `.env`.
# Every value below is read by gozar/core/config.py (prefix: GOZAR_).
# Placeholders only - no real secrets in this file.
# --- Runtime / observability -------------------------------------------------
GOZAR_APP_ENV=development # development | staging | production
GOZAR_LOG_LEVEL=info # debug | info | warn | error
# --- Network / ports ---------------------------------------------------------
GOZAR_HTTP_HOST=0.0.0.0
GOZAR_HTTP_PORT=8000
# --- Persistence -------------------------------------------------------------
# Async SQLAlchemy URL (PostgreSQL via asyncpg).
GOZAR_DATABASE_URL=postgresql+asyncpg://CHANGE_ME_USER:CHANGE_ME_PASSWORD@postgres:5432/gozar
GOZAR_REDIS_URL=redis://redis:6379/0
# --- Secret material (REQUIRED - generate strong, unique values) -------------
# 32-byte key, base64-encoded. Generate with:
# python -c "import os,base64;print(base64.b64encode(os.urandom(32)).decode())"
GOZAR_MASTER_KEY=CHANGE_ME_BASE64_32_BYTE_KEY
# Generate with: python -c "import secrets;print(secrets.token_urlsafe(48))"
GOZAR_JWT_SECRET=CHANGE_ME_JWT_SIGNING_SECRET
# Generate with: python -c "import secrets;print(secrets.token_urlsafe(48))"
GOZAR_TOKEN_PEPPER=CHANGE_ME_CLIENT_TOKEN_PEPPER
# --- Token lifetimes / renewal windows (seconds) -----------------------------
GOZAR_JWT_ACCESS_TTL_SECONDS=900
GOZAR_JWT_REFRESH_TTL_SECONDS=1209600
GOZAR_SUBSCRIPTION_RENEWAL_WINDOW_SECONDS=300
GOZAR_UPSTREAM_REQUEST_TIMEOUT_SECONDS=60
# --- Upstream provider resilience (retries + backoff) ------------------------
# Max attempts per upstream call, including the first try (1 disables retries).
GOZAR_UPSTREAM_MAX_ATTEMPTS=3
# Exponential backoff base delay (seconds) and cap between transient retries.
GOZAR_UPSTREAM_BACKOFF_BASE_SECONDS=0.5
GOZAR_UPSTREAM_BACKOFF_MAX_SECONDS=10
# --- Operator credential policy (config-driven; no magic numbers in code) ----
GOZAR_PASSWORD_MIN_LENGTH=12
GOZAR_PASSWORD_REQUIRE_UPPERCASE=true
GOZAR_PASSWORD_REQUIRE_LOWERCASE=true
GOZAR_PASSWORD_REQUIRE_DIGIT=true
GOZAR_PASSWORD_REQUIRE_SYMBOL=true
GOZAR_USERNAME_MIN_LENGTH=3
# --- Provider configuration --------------------------------------------------
# Gozar ships documented, working built-in defaults for every supported provider
# (base URLs and, for the subscription providers, the public OAuth client ids /
# authorize / token / redirect / scopes). A fresh deployment can connect a ChatGPT
# (Codex) or Claude subscription WITHOUT setting anything below - the operator just
# completes the provider's OAuth consent in a browser.
#
# The variables below are OPTIONAL overrides. Leave them unset to use the built-in
# defaults. If you set GOZAR_PROVIDER_OAUTH, only the fields you include override
# the defaults (per-field merge), so you can override just a client_id if needed.
#
# Built-in defaults (for reference - you do NOT need to copy these):
# base URLs : openai=https://api.openai.com/v1
# openrouter=https://openrouter.ai/api/v1
# codex=https://chatgpt.com/backend-api/codex
# anthropic=https://api.anthropic.com
# codex OAuth: authorize=https://auth.openai.com/oauth/authorize
# token=https://auth.openai.com/oauth/token
# client_id=app_EMoamEEZ73f0CkXaXp7hrann
# redirect_uri=http://localhost:1455/auth/callback
# anthropic OAuth: authorize=https://claude.ai/oauth/authorize
# token=https://platform.claude.com/v1/oauth/token
# client_id=9d1c250a-e61b-44d9-88ed-5944d1962f5e
# redirect_uri=http://localhost:53692/callback
#
# IMPORTANT (subscription connect / redirect_uri): the public OAuth clients above
# only permit a LOOPBACK redirect (codex: http://localhost:1455/auth/callback,
# anthropic: http://localhost:53692/callback). Gozar is a web app, so it cannot
# receive that loopback callback directly. The operator completes the provider's
# consent in a browser and then PASTES the resulting authorization code (or the
# full redirect URL) back into the console; complete_subscription_connect exchanges
# it using the same redirect_uri that was used to build the authorize URL. Override
# the redirect_uri only if you have registered a different one with the provider.
#
# Optional base-URL override (JSON map of provider id -> upstream base URL):
# GOZAR_PROVIDER_BASE_URLS={"openai":"https://api.openai.com/v1"}
#
# Optional OAuth override (JSON map of provider id -> partial OAuth metadata):
# GOZAR_PROVIDER_OAUTH={"codex":{"client_id":"your-own-client-id"}}
#
# JSON map of provider id -> list of model ids that provider can serve. Drives the
# models advertised by GET /v1/models (model names are never hardcoded in logic).
#
# For providers with a real live model-listing endpoint (openai, openrouter), Gozar
# queries that endpoint directly with a connected API-key credential and caches the
# result in Redis for GOZAR_PROVIDER_MODELS_CACHE_TTL_SECONDS; the list below is only
# the fallback used when that live lookup is unavailable. Codex (ChatGPT subscription)
# and Anthropic's subscription OAuth have no such live listing endpoint, so for them
# this list is the bootstrap default. Operators can replace a provider's fallback
# catalog from the Dashboard or PUT /api/models/providers/{provider}; that runtime
# override takes effect immediately without restarting the backend.
GOZAR_PROVIDER_MODELS={"openai":["gpt-5.5","gpt-5.5-pro","gpt-5.4","gpt-5.4-pro","gpt-5.4-mini","gpt-5.4-nano","gpt-5.3-codex","gpt-5.2","gpt-5.2-pro","gpt-5.1","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5-pro","o3-pro","o3","gpt-4.1","gpt-4.1-mini","gpt-4o-mini","gpt-oss-120b","gpt-oss-20b","text-embedding-3-small","text-embedding-3-large","text-embedding-ada-002"],"openrouter":["openai/text-embedding-3-small","openai/text-embedding-3-large"],"anthropic":["claude-fable-5","claude-opus-4-8","claude-sonnet-5","claude-haiku-4-5"],"codex":["gpt-5.5","gpt-5.4","gpt-5.4-mini","gpt-5.3-codex-spark"]}
# How long a provider's live model listing is cached, in seconds (0 disables caching).
GOZAR_PROVIDER_MODELS_CACHE_TTL_SECONDS=300