Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
338 lines (314 loc) · 16.3 KB
/
Copy path.env.example
File metadata and controls
338 lines (314 loc) · 16.3 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# ─────────────────────────────────────────────────
# Joidy — Environment Variables
# Copy this file to .env and fill in your values.
# NEVER commit .env to git.
# ─────────────────────────────────────────────────
# ── AI Providers (at least one required) ──────────
# Gemini: https://aistudio.google.com/app/apikey
GEMINI_API_KEY=
# OpenAI: https://platform.openai.com/api-keys
OPENAI_API_KEY=
# Custom base URL for OpenAI-compatible providers (StandardCompute, LiteLLM, vLLM...)
# Example: https://api.stdcmpt.com/v1
OPENAI_BASE_URL=
# Floor for max_tokens on LLM calls (0 = endpoint default). Reasoning routers
# like "standardcompute" spend max_tokens on hidden reasoning first.
LLM_MAX_TOKENS=0
# Anthropic: https://console.anthropic.com/
ANTHROPIC_API_KEY=
# OpenRouter: https://openrouter.ai/settings
OPENROUTER_API_KEY=
# Cohere: https://dashboard.cohere.com/api-keys
COHERE_API_KEY=
# Ollama (local models): http://localhost:11434
# NOTE: http:// is only accepted for loopback hosts (localhost, 127.0.0.0/8,
# ::1, host.docker.internal, host.containers.internal). Remote hosts must
# use https:// or the ai-service refuses to start (#1330).
OLLAMA_BASE_URL=http://host.docker.internal:11434
# Opt-out of the base-URL policy above (downgrades refusal to a warning).
# Needed only for cleartext http to a non-loopback host, e.g. Ollama in a
# sibling container: OLLAMA_BASE_URL=http://ollama:11434
#ALLOW_INSECURE_BASE_URLS=false
# Explicit egress proxy for provider HTTP clients. Ambient HTTP(S)_PROXY /
# ALL_PROXY variables are ignored by design; set this if providers must
# reach the internet through a proxy.
#PROVIDER_PROXY_URL=
# Model selection (format: "provider:model")
# Examples:
# gemini:gemini-2.0-flash
# openai:gpt-4
# anthropic:claude-3-opus-20240229
# ollama:llama3
# openrouter:anthropic/claude-3-opus
LLM_MODEL=gemini:gemini-2.0-flash
EMBEDDING_MODEL=gemini:models/text-embedding-004
# Provider call timeouts (seconds) — a degraded provider can never hang a
# request indefinitely.
#EMBED_TIMEOUT=30
#LLM_TIMEOUT=60
#CONNECT_TIMEOUT=5
# ai-service request bounds (#1324): caps on text length, batch size and
# result counts so a single request cannot burn provider quota or exhaust
# CPU/memory. Defaults shown; uncomment to tune.
#MAX_EMBED_CONTENT_CHARS=100000
#MAX_CLASSIFY_CONTENT_CHARS=10000
#MAX_CLASSIFY_TAG_ITEMS=100
#MAX_TAG_CHARS=100
#MAX_CHAT_MESSAGES=50
#MAX_CHAT_MESSAGE_CHARS=20000
#MAX_CHAT_CONTEXT_ITEMS=50
#MAX_CHAT_CONTEXT_ITEM_CHARS=500
#MAX_RAG_QUESTION_CHARS=1000
#MAX_RAG_TOP_K=20
#MAX_RECAP_NOTE_TITLES=50
#MAX_RECAP_TITLE_CHARS=200
#MAX_CLUSTER_NOTES=2000
#MAX_CLUSTER_MIN_SAMPLES=200
# ai-service provider retry, response cache and its own request rate limit
# (defaults shown).
#MAX_REQUESTS_PER_MINUTE=12
#AI_RETRY_MAX_ATTEMPTS=5
#AI_RETRY_BASE_DELAY_SECONDS=1.0
#AI_RETRY_MAX_DELAY_SECONDS=30.0
#CACHE_TTL_SECONDS=3600
#CACHE_MAX_SIZE=2048
# ── Obsidian Vault ────────────────────────────────
# Path to your Obsidian vault folder on the host.
# Supports ~ for home-relative paths (expanded by `joidy up`).
# Examples: ~/Documentos/notas/mi-vault or /home/username/Documents/MyVault
OBSIDIAN_VAULT_PATH=~/Documentos/notas/mi-vault
# Optional secret to validate /webhook/obsidian calls
OBSIDIAN_WEBHOOK_SECRET=
# ── GitHub OAuth (Device Flow) ──────────────────
# Get at: https://github.com/settings/developers
# Create new OAuth App for device flow
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Your OAuth redirect URL (for web flow fallback)
GITHUB_OAUTH_WEB_URL=
# ── GitHub PAT (legacy - prefer OAuth) ────────────────
# Personal Access Token with repo scope (legacy method)
GITHUB_TOKEN=
GITHUB_USERNAME=
# Webhook callback URL
GITHUB_WEBHOOK_URL=
# Shared secret GitHub signs webhook payloads with (X-Hub-Signature-256).
# Per-repo secrets created during webhook setup take precedence.
GITHUB_WEBHOOK_SECRET=
# ── Google OAuth (Calendar, Tasks, Gmail, Contacts) ─
# Create credentials at: https://console.cloud.google.com/apis/credentials
# Note: a production (verified) OAuth consent screen requires a public
# privacy policy URL — see PRIVACY.md in the repository.
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=http://localhost:8000/integrations/google/callback
# Optional (#42): Pub/Sub topic for Gmail push notifications, as a full
# resource name (projects/<project>/topics/<topic>). Create the topic in GCP
# and grant publish rights to gmail-api-push@system.gserviceaccount.com.
# Leave empty to disable POST /integrations/gmail/watch — the polling paths
# (GET /integrations/gmail/messages?since=…, GET /integrations/gmail/history)
# keep working without it.
GOOGLE_GMAIL_PUBSUB_TOPIC=
# ── Strava OAuth ──────────────────────────────────
# Create an app at: https://www.strava.com/settings/api
STRAVA_CLIENT_ID=
STRAVA_CLIENT_SECRET=
STRAVA_REDIRECT_URI=http://localhost:8000/integrations/strava/callback
# Optional: verify token for the webhook subscription handshake. Set any
# random string, then register it as the webhook verify_token in your Strava
# app settings — POST/GET /integrations/strava/webhook stay disabled (404)
# while empty.
STRAVA_WEBHOOK_VERIFY_TOKEN=
# ── Spotify OAuth ─────────────────────────────────
# Create an app at: https://developer.spotify.com/dashboard
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
SPOTIFY_REDIRECT_URI=http://localhost:8000/integrations/spotify/callback
# ── Telegram Bot (optional) ───────────────────────
# Create a bot via @BotFather on Telegram
# Leave empty to disable Telegram bot
TELEGRAM_BOT_TOKEN=
# Your Telegram user ID (only this user can talk to the bot)
# Get it from @userinfobot on Telegram
TELEGRAM_ALLOWED_USER_ID=
# Shared secret Telegram sends in X-Telegram-Bot-Api-Secret-Token on each
# webhook call. Optional but recommended; pass the same value as
# secret_token when registering the webhook (see README → Telegram Bot).
TELEGRAM_WEBHOOK_SECRET=
# ── Application ───────────────────────────────────
# Secret key for session signing (generate with: openssl rand -hex 32)
SECRET_KEY=change_this_to_a_random_secret_key
# Single-user login password. Prefer leaving this EMPTY — the first-run
# setup wizard (Settings → Setup) writes a bcrypt hash here automatically.
# A plaintext value still authenticates (deprecated backward-compat path,
# #1265) but logs a loud startup warning and will be removed in a future
# release. Required when APP_ENV=production.
# If you hand-write a bcrypt hash, write it VERBATIM ($2b$12$...) — do NOT
# use docker-compose "$$" escaping. AUTH_PASSWORD is read from this file
# directly, never through compose variable interpolation (#1456).
#AUTH_PASSWORD=
# bcrypt cost factor used when hashing AUTH_PASSWORD (default 12). Higher =
# slower logins but harder brute-force. Do not lower it in production.
#BCRYPT_ROUNDS=12
# Dedicated service credential for worker/n8n → API calls. Never reuse
# AUTH_PASSWORD. Auto-generated by `joidy up` / `make setup` when empty.
INTERNAL_API_TOKEN=
APP_ENV=development
# JWT lifecycle (#1285): access-token lifetime in minutes and refresh-token
# window in days. Defaults shown; refresh tokens rotate on each /auth/refresh.
#ACCESS_TOKEN_EXPIRE_MINUTES=720
#REFRESH_TOKEN_EXPIRE_DAYS=7
# Shared secret for internal API → ai-service calls (X-Internal-Secret
# header). Auto-generated by `joidy` / `make setup` / `make start`
# (openssl rand -hex 32). Required in production: with APP_ENV=production
# the ai-service refuses non-health requests when it is missing (#1277).
INTERNAL_SECRET=
# AI Service: set to false to disable all AI features (embeddings, chat,
# classification, semantic search). Defaults to false in production
# (docker-compose.yml) and true in development (docker-compose.dev.yml).
# To enable AI in production, also start the ai-service container:
# docker compose --profile ai up -d
AI_SERVICE_ENABLED=true
# ── Database (PostgreSQL) ─────────────────────────
# Required: set a strong password for the database user.
# Generate with: openssl rand -hex 24
POSTGRES_USER=joidy
POSTGRES_PASSWORD=
POSTGRES_DB=joidy
# DATABASE_URL is derived by docker compose from POSTGRES_* above — do NOT
# set it for a normal install. Set it explicitly only to point the stack at
# an external PostgreSQL instance:
#DATABASE_URL=postgresql+psycopg2://joidy:CHANGE_ME@your-db-host:5432/joidy
# ── Database Backups ──────────────────────────────
# `joidy up` starts a `backup` sidecar that runs `pg_dump -Fc` on a schedule
# and writes timestamped dumps to the backups dir with retention pruning.
# Set BACKUP_ENABLED=false to opt out. (Plain `docker compose up` and
# `make dev` never start it — it's behind the `backup` compose profile.)
BACKUP_ENABLED=true
# Cron expression "M H DOM MON DOW" or @hourly/@daily/@weekly/@monthly.
# Evaluated in USER_TIMEZONE. Default: every day at 03:00.
BACKUP_SCHEDULE=0 3 * * *
# Retention: keep every dump for this many days…
BACKUP_RETENTION_DAYS=14
# …plus the dump taken on BACKUP_WEEKLY_DAY (0=Sunday) for this many weeks.
BACKUP_RETENTION_WEEKS=4
#BACKUP_WEEKLY_DAY=0
# Host directory for dumps (default: <data dir>/backups).
#JOIDY_BACKUP_DIR=
# Take one backup as soon as the sidecar starts (useful to test the setup).
#BACKUP_ON_START=false
# Optional passphrase to encrypt dumps with AES-256-CBC (openssl) — files are
# written as *.dump.enc and `joidy restore` decrypts them with the same key.
# Without this, dumps are plaintext on disk (they contain the whole DB —
# see SECURITY.md). Losing this key makes encrypted dumps unrecoverable.
#BACKUP_ENCRYPTION_KEY=
# ── Monitoring (Grafana) ──────────────────────────
# Required only if using docker-compose.monitoring.yml
# Generate with: openssl rand -hex 24
GRAFANA_ADMIN_PASSWORD=
# Comma-separated allowed CORS origins (e.g. http://localhost:3000,https://joidy.app).
# In development, leave empty to allow all origins with credentials disabled.
CORS_ALLOWED_ORIGINS=
# Comma-separated IPs/CIDRs of trusted reverse proxies (e.g. 127.0.0.1,10.0.0.0/8).
# Required for the API to honor X-Forwarded-For when bucketing rate limits.
# Leave empty when the API is reached directly — spoofed XFF headers are ignored.
TRUSTED_PROXIES=
# ── Web Push (VAPID) ──────────────────────────────
# Generate keys with: npx web-push generate-vapid-keys
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_CLAIM_EMAIL=contacto@joidy.dev
# ── Ports (change if conflicts with existing services) ──
FRONTEND_PORT=3000
API_PORT=8000
# Address the published ports (frontend, api, n8n) bind to on the host.
# Default keeps Joidy reachable on localhost only (#1277); set to 0.0.0.0
# to expose it on your LAN.
#BIND_ADDR=127.0.0.1
# ai-service (8002) and worker (8001) have no published host port — they are
# reachable only on the internal compose network (#1277).
# ── Docker images (advanced: forks/mirrors/custom registries) ──
# Override to pull images from your own registry or pin a specific tag.
#DOCKER_REGISTRY=d4mag3
# IMAGE_TAG defaults to the mutable `latest`. For reproducible production
# installs pin it to a release (IMAGE_TAG=1.1.0-beta.8) or use the pinned
# overlay shipped with each release:
# docker compose -f docker-compose.yml -f docker-compose.release.yml up -d
# Strongest guarantee: pin by digest — set the full ref
# IMAGE_TAG=<tag> then override per-service image: lines in a local
# compose override with d4mag3/joidy-<svc>@sha256:<digest>
# (resolve digests via: docker buildx imagetools inspect d4mag3/joidy-api:<tag>)
#IMAGE_TAG=latest
#POSTGRES_IMAGE=pgvector/pgvector:pg16
# ── Power management (Settings → Servicios) ───────
# Opt-in (#1278): mounts the container engine socket into the API so the web UI
# can list and hibernate/wake/shutdown services. Disabled by default — the
# socket grants full control of the container engine; read the residual-risk
# section in SECURITY.md before enabling. When true, `joidy up` adds the
# docker-compose.power.yml overlay automatically; with plain compose use
# docker compose -f docker-compose.yml -f docker-compose.power.yml up -d
POWER_MANAGEMENT_ENABLED=false
# Host path to the container engine socket (only used when enabled).
# Docker: /var/run/docker.sock (default)
# Podman rootless: /run/user/$(id -u)/podman/podman.sock
# `joidy up` detects the right path automatically based on the engine.
#DOCKER_SOCK_PATH=/var/run/docker.sock
# GID of the group that owns the Docker socket (Docker only).
# Required on Linux when POWER_MANAGEMENT_ENABLED=true — the power overlay
# refuses to start without it.
# Find it with: getent group docker | cut -d: -f3
# `joidy up` detects it automatically when left empty.
# Not needed for Podman (rootless containers have socket access via UID mapping).
#DOCKER_GID=
# ── User Timezone ─────────────────────────────────
# IANA zone name for day-boundary calculations (streaks, gamification, mood).
# Defaults to UTC. Example: America/Santiago, Europe/Madrid.
USER_TIMEZONE=UTC
# ── Idle watchdog (auto-sleep) ────────────────────
# After this many minutes with no HTTP connections, active DB sessions or
# vault changes, `joidy idle` puts the stack to sleep (`joidy sleep` +
# frontend). Enable the watcher with: joidy idle enable
JOIDY_IDLE_TIMEOUT=15
# Poll interval (seconds) for the idle watcher.
#JOIDY_IDLE_POLL_SECONDS=60
# ── Advanced internals (safe defaults — rarely changed) ──
# Internal URLs the API uses to reach its sibling containers. docker compose
# sets these; override only when running services outside compose.
#AI_SERVICE_URL=http://ai-service:8002
#WORKER_URL=http://worker:8001
# Upload storage + size caps enforced by the API.
#UPLOAD_DIR=data/uploads
#UPLOAD_MAX_IMAGE_BYTES=10485760 # 10 MB
#UPLOAD_MAX_FILE_BYTES=52428800 # 50 MB
# Directory for application logs inside the api container.
#LOG_DIR=data/logs
# XP award table override, as a JSON object keyed by event name — merged
# over the built-in awards (see DEFAULT_XP_TABLE in
# api/services/gamification_engine.py for the full key list).
#XP_TABLE_JSON={"note_created":10,"note_edited":5,"daily_activity":15,"goal_completed":50}
# Embedding pipeline retry policy before a failure is dead-lettered.
#EMBEDDING_RETRY_MAX_ATTEMPTS=8
#EMBEDDING_RETRY_BASE_SECONDS=60
#
# Worker-service settings (API_URL, VAULT_PATH, EVENT_LOG_PATH,
# RENAME_MATCH_WINDOW, MAX_NOTE_FILE_SIZE, CALENDAR_SYNC_INTERVAL,
# WORKER_BIND_ADDR) are intentionally not listed: they are compose-internal
# wiring set by docker-compose.yml, not operator configuration.
# ── Dev frontend (docker-compose.dev.yml) ─────────
# Cap esbuild/vite parallelism in the dev container (GOMAXPROCS for the Go
# esbuild binary) so it cannot OOM-loop under the cgroup memory limit.
#ESBUILD_WORKERS=2
# ── n8n (opcional, compose profile "n8n") ─────────
# Hub de automatización. Arranca con `make n8n` (opt-in, igual que backup).
# UI en http://localhost:N8N_PORT. La clave cifra credenciales guardadas en n8n
# (genera una nueva: openssl rand -hex 32). Si está vacía, n8n genera una propia
# y la guarda en el volumen n8n_data — si el volumen se pierde, las credenciales
# desaparecen. Recomendado fijarla.
N8N_PORT=5678
# n8n image — defaults to the mutable `:latest`. Pin to a release (or digest)
# for reproducible installs, e.g. N8N_IMAGE=docker.n8n.io/n8nio/n8n:1.60.1
#N8N_IMAGE=docker.n8n.io/n8nio/n8n:latest
N8N_ENCRYPTION_KEY=
# URL pública para webhooks externos (Telegram/GitHub) si expones n8n fuera de
# localhost, p. ej. https://n8n.midominio.com/ — déjalo vacío para uso local.
#N8N_WEBHOOK_URL=