-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
70 lines (61 loc) · 3.43 KB
/
Copy path.env.example
File metadata and controls
70 lines (61 loc) · 3.43 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
# SQLpedia Environment Variables
# Copy this file to .env and fill in your values.
# In production, set these in Netlify -> Site settings -> Environment variables.
# Never commit real keys to git.
# ==============================================
# AI Provider (Google Gemini)
# ==============================================
# The SQL assistant uses Google Gemini. Create the API key in a Google AI
# Studio / Cloud project with NO billing account attached. That makes spend
# structurally impossible: when the free-tier quota is exhausted the API
# returns 429 and the site falls back to sample responses - it cannot be billed.
# Get a key at: https://aistudio.google.com/apikey
GEMINI_API_KEY=your-gemini-api-key-here
# Model is forced server-side (the client cannot choose). Verified on free tier:
# gemini-2.5-flash-lite (default, stable, low contention) and gemini-2.5-flash.
# Avoid gemini-2.0-flash (free tier = 0 -> 429) and gemini-flash-latest (503s).
# GEMINI_MODEL=gemini-2.5-flash-lite
# ==============================================
# Abuse protection
# ==============================================
# Comma-separated list of origins allowed to call the function. Include every
# domain the site is actually SERVED on (apex + www). Domains that 301-redirect
# to a canonical domain do not need listing (the browser lands on the canonical
# origin first), but listing them anyway is harmless and future-proof.
# For local dev also add your dev origin, e.g. http://localhost:8888
# ALLOWED_ORIGINS=https://sqlpedia.org,https://www.sqlpedia.org,https://sqlpedia.com,https://www.sqlpedia.com,https://sqlpedia.net,https://www.sqlpedia.net
# Cloudflare Turnstile (human check). Site key is public and goes in the
# frontend build; the secret key is verified inside the function.
# Get keys at: https://dash.cloudflare.com -> Turnstile (no DNS change needed)
TURNSTILE_SECRET_KEY=your-turnstile-secret-key-here
# Frontend build variable - must be prefixed with VITE_ to be exposed to the
# client. Set this in the build environment (Netlify) as well.
VITE_TURNSTILE_SITE_KEY=your-turnstile-site-key-here
# ==============================================
# Usage alerting (Slack)
# ==============================================
# Incoming webhook URL. The function posts here when the daily soft budget is
# encroached (>= threshold) and when the Gemini quota is exhausted.
# Create one at: https://api.slack.com/messaging/webhooks
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXX/YYY/ZZZ
# Soft daily request budget used ONLY for alerting (not a billing cap).
# Set this near the Gemini free-tier requests/day for the chosen model.
# DAILY_REQUEST_LIMIT=1000
# Percent of the budget at which the first "encroaching" alert fires.
# ALERT_THRESHOLD_PCT=80
# ==============================================
# Note on NODE_ENV
# ==============================================
# Not needed: VitePress/Vite set the mode automatically (dev vs build).
# Do NOT set NODE_ENV=production in Netlify - npm would skip devDependencies
# (vitepress, vite) and the build would fail.
# ==============================================
# Optional: Analytics
# ==============================================
# GA_MEASUREMENT_ID=G-XXXXXXXXXX
# ==============================================
# Notes
# ==============================================
# - Never commit .env to git
# - Use a no-billing Google project for the Gemini key (hard $0 ceiling)
# - Netlify Blobs (daily counter + cache) needs no configuration