Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
133 lines (112 loc) · 5.49 KB
/
Copy path.env.example
File metadata and controls
133 lines (112 loc) · 5.49 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Every setting in backend/config.py appears here, commented out if it has a
# sensible default. tests/test_docs.py fails if one goes missing.
# Instance configuration
export COMPARIA_INSTANCE_NAME=fr
# Currency used to display model prices and conversation costs (ISO 4217).
# Rates are refreshed daily from the open-source Frankfurter API.
export DISPLAY_CURRENCY=EUR
# Optional manual USD -> display currency rate. Also enables currencies that are
# unavailable from the API and provides a fully offline mode. If no live,
# persisted, or manual rate exists, prices are displayed honestly in USD.
# export DISPLAY_CURRENCY_RATE_FROM_USD=0.86
# export EXCHANGE_RATE_API_URL=https://api.frankfurter.dev/v2
# export EXCHANGE_RATE_CACHE_SECONDS=86400
# Database
export COMPARIA_DB_URI=postgresql://comparia:comparia@localhost:5432/comparia
# Redis (optional - disables rate limiting if unset)
export COMPARIA_REDIS_HOST=localhost
# export COMPARIA_REDIS_PASSWORD=
# Provider keys, read once: the migration that first creates the OpenRouter,
# Hugging Face and Ordbogen endpoints copies them into the database. After that
# the endpoints own their keys and you edit them at /admin/llms/endpoints, so
# set these before your first `make db-migrate` or not at all.
# MOCK_RESPONSE=true skips real API calls entirely.
export OPENROUTER_API_KEY=
# export HF_INFERENCE_KEY=
# export ORDBOGEN_API_KEY=
# Web search API
export LINKUP_API_KEY=
# Security
# Spam protection (Altcha). Required unless LANGUIA_DEBUG=true (a dev-only key is
# auto-generated then). A generated key is fine for one dev process but wrong for
# anything with more than one replica or a restart you care about.
# Generate with: openssl rand -hex 32
# export ALTCHA_HMAC_KEY=
# Encrypts secrets stored in the database (the admins' 2FA secrets). Required
# outside debug; debug falls back to a fixed development key. Comma-separate
# several keys to rotate (first encrypts, all decrypt).
# Generate with: python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'
# export COMPARIA_ENCRYPTION_KEY=
# Mailing
export SMTP_HOST=smtp-relay.brevo.com
export SMTP_PORT=587
export SMTP_USERNAME="<brevo account email>"
export SMTP_PASSWORD="<SMTP key from Brevo Settings - SMTP & API>"
export EMAIL_FROM=
# export EMAIL_FROM_NAME=ComparIA
# export SMTP_STARTTLS=true
# Frontend base URL, used to build links in emails (e.g. login code)
# export COMPARIA_APP_URL="http://localhost:5173/"
# Origin the backend itself answers on, used for the OIDC redirect_uri. Deployed,
# the backend sits under /api of the app origin, so leaving this unset is right.
# In dev the two run on separate ports:
# export COMPARIA_API_URL="http://localhost:8008"
# Auth
# "anonymous_first" (default) or "sign_in_required"
# export AUTH_ACCESS_POLICY=anonymous_first
# export AUTH_DOMAIN_ALLOWLIST='["beta.gouv.fr"]'
# export AUTH_SESSION_LENGTH_DAYS=30
# export ANONYMOUS_SESSION_LENGTH_DAYS=30
# Login rate limits. The per-IP one is deliberately loose, so a school class
# behind one NAT is never locked out; the per-email one does the real work.
# export AUTH_EMAIL_REQUEST_PER_IP_PER_HOUR=2000
# export AUTH_EMAIL_REQUEST_PER_EMAIL_PER_HOUR=5
# export AUTH_OIDC_LOGIN_PER_IP_PER_HOUR=2000
# export AUTH_VERIFY_MAX_ATTEMPTS=5
# export AUTH_VERIFY_MAX_ATTEMPTS_PER_EMAIL=10
# Conversations one IP may start in a sliding hour, in all and with the same pair
# of models (0 turns a cap off). Shared by everyone behind one NAT. Defaults:
# an admin can override both on the Vérifications page.
# export RATELIMIT_CONVERSATIONS_PER_IP_PER_HOUR=20
# export RATELIMIT_CONVERSATIONS_SAME_MODELS_PER_IP_PER_HOUR=5
# Network boundaries. Trust forwarded IPs only when the backend is behind the
# stated number of reverse proxies. Extra CORS origins use a JSON list.
# export COMPARIA_TRUSTED_PROXY_COUNT=0
# Header an edge proxy (WAF, CDN) sets to the real client IP, for when
# X-Forwarded-For only holds the edge's own address. Set it only if the backend
# cannot be reached without going through that edge: it can be forged otherwise.
# export COMPARIA_CLIENT_IP_HEADER=x-tcp-ip
# export COMPARIA_CORS_ORIGINS='["http://localhost:3000"]'
# Bearer token protecting the Prometheus /metrics endpoint. Unset, the
# endpoint refuses every request outside debug.
# export METRICS_TOKEN=
# Admin
# Comma-separated list of emails to promote to admin role on startup (created if absent)
# export ADMIN_EMAILS='["admin@example.com"]'
# Ranking
# How often the leaderboard is recomputed, in seconds.
# export RANKING_INTERVAL_SECONDS=3600
# Vote count the public progress bar counts towards.
# export VOTES_OBJECTIVE=300000
# Dataset publishing. The schedule itself lives at /admin/publication.
# export DATASET_STATEMENT_TIMEOUT_MS=7200000
# Activity panel (/admin/activite): how long one of its queries may run, and
# how long its counts are kept before they are computed again.
# export ADMIN_ACTIVITY_STATEMENT_TIMEOUT_MS=15000
# export ADMIN_ACTIVITY_CACHE_SECONDS=300
# Response cache. Off by default. When on, a share of requests reuse a stored
# answer for the same (model, prompt) instead of calling the provider.
# export CACHE_ENABLED=false
# export CACHE_PROBABILITY=0.5
# export CACHE_TTL=172800
# export CACHE_MAX_RESPONSES=5
# Error reporting
# export SENTRY_DSN=
# export SENTRY_ENVIRONMENT=dev
# export SENTRY_SAMPLE_RATE=0.1
# Development
# export MOCK_RESPONSE=true
# export LANGUIA_DEBUG=true
# Session cookies are Secure by default; turn this off for local http:// dev
# export COMPARIA_COOKIE_SECURE=false
# export LOG_FORMAT="RAW"