# Configuration All settings come from environment variables, read once by `api/config.py` (from `.env` in development). In the code, a setting is always `config.NAME`, where `NAME` is the variable. An empty setting disables what needs it; the API still starts. `.env.example` lists every variable. A test fails if a setting is missing from it or from this page. ## Access tokens Tokens that callers send to the API (`Authorization: Bearer `). See [Architecture › Access](architecture.md#access). | Variable | Used by | |---|---| | `ADMIN_TOKEN` | administrators: accepted by every route | | `APP_TOKEN` | RewakeApp, RewakeInfo and the Chrome extension, from one of `APP_ORIGINS` | | `AIRTABLE_AUTOMATION_TOKEN` | Airtable automations, for `/internal/scripts/*` only | | `HELLOPRO_TOKEN` | HelloPro, for its product feed | | `MACHINIO_TOKEN` | Machinio, for its product feed | | `U3000_SHEET_WEBHOOK_TOKEN` | the UltiMate 3000 price sheet's Apps Script (webhook) | `APP_ORIGINS` (in `config.py`, not an environment variable) lists the sites allowed with `APP_TOKEN`: app.rewake.fr, sav.rewake.fr, info.rewake.fr. ## Storage and logs | Variable | Default | Content | |---|---|---| | `DATA_DIR` | `/home/rewake/DB` | persistent data (PDF counters, photos, invoices…); `TEMP_PDFS_DIR`, `PHOTOS_DIR` and `INVOICES_BACKUP_DIR` are inside it | | `LOG_DIR` | `/home/rewake/logs` | `api.log` (`LOG_FILE`, rotated at 10 MB, 5 files kept) | | `LOG_LEVEL` | `INFO` | | | `LOG_FORMAT` | `json` | `console` for readable logs while developing | | `PRICING_GRID_PATH` | `DATA_DIR/pricing_grid.json` | the discount grid, saved from RewakeApp | | `AI_DB_PATH` | `DATA_DIR/ai.sqlite` | AI settings, usage and feedback | | `U3000_IMAGES_DIR` | `DATA_DIR/ultimate3000` | pictures of UltiMate 3000 offers | ## Worker | Variable | Default | | |---|---|---| | `REDIS_URL` | `redis://localhost:6379/0` | job queue, script history, caches | | `OCR_URL` | `http://ocr:8000` | the label OCR service | ## Airtable | Variable | | |---|---| | `AIRTABLE_BASE_ID` | the main base (`app…`); development and production bases differ | | `AIRTABLE_TOKEN` | personal access token, scopes `data.records:read/write`, `schema.bases:read` | `AIRTABLE_CONFIGURED` is true when both are set. ## Shopify | Variable | Default | | |---|---|---| | `SHOPIFY_SHOP_DOMAIN` | | `.myshopify.com` | | `SHOPIFY_API_VERSION` | `2026-04` | | | `SHOPIFY_CLIENT_ID`, `SHOPIFY_CLIENT_SECRET` | | the Dev Dashboard app; the API gets and renews its own access token. Scopes: `read_products`, `write_products`, `write_inventory`, `read_files`, `write_files` | | `SHOPIFY_LOCATION_ID` | | the location whose stock the API sets (it differs between stores: `GET /admin/api//locations.json`) | | `SHOPIFY_PDF_METAFIELD_NAMESPACE` | `custom` | the product metafield holding the documentation PDF | | `SHOPIFY_PDF_METAFIELD_KEY` | `pdf_descriptif` | | | `SHOPIFY_PDF_SOURCE_METAFIELD_KEY` | `pdf_descriptif_airtable_id` | which Airtable attachment that PDF came from | `AIRTABLE_SHOPIFY_CONFIGURED` is true when Airtable and the Shopify domain and app are set. ## Scheduled scripts Times are Europe/Paris. | Variable | Default | | |---|---|---| | `SHOPIFY_CATALOG_RECONCILIATION_INTERVAL_SECONDS` | `3600` | Airtable ↔ Shopify comparison | | `AIRTABLE_CATALOG_STATS_HOUR`, `AIRTABLE_CATALOG_STATS_MINUTE` | `20`, `42` | daily catalog statistics | ## Google | Variable | Default | | |---|---|---| | `GOOGLE_APPLICATION_CREDENTIALS` | | path to the service account's JSON key (Gmail drafts and alerts, Google Sheets) | | `ALERT_EMAIL_SENDER` | `tech@rewake.fr` | a Workspace mailbox the service account may send as | | `ALERT_EMAIL_RECIPIENTS` | none | comma-separated; empty means no alert e-mail is sent | ## AI | Variable | | |---|---| | `ANTHROPIC_API_KEY` (or `ANTHROPIC_AUTH_TOKEN`) | Claude models | | `OPENROUTER_API_KEY` | other models, through OpenRouter | A provider without its key is skipped; with none, AI features answer "not configured". ## Public pages | Variable | Default | |---|---| | `REPRISE_FORM_URL` | `https://rewake.fr/pages/reprise` (the buy-back form linked in e-mails) | ## UltiMate 3000 offers | Variable | Default | | |---|---|---| | `U3000_PRICE_SHEET_ID` | | the Google Sheet with the price grid (shared with the service account) | | `U3000_SPACE_URL` | `https://rewake.fr/pages/ultimate3000` | the client space | | `U3000_INFO_URL` | `https://info.rewake.fr` | where the offer page and its picture are served | | `U3000_N8N_CLIENT_LINK_URL`, `U3000_N8N_OFFER_URL` | | n8n webhooks sending the e-mails; empty means only logged | | `U3000_N8N_SECRET` | | n8n Header Auth credential (`X-API-Key`) | | `CHROMIUM_PATH` | found on the `PATH` | the browser that takes the offer picture | ## Auction tracker The worker copies the auction tracker's followed lots into their own Airtable base every minute. | Variable | | |---|---| | `AUCTIONS_API_URL`, `AUCTIONS_API_TOKEN` | the auction-price-tracker API | | `AUCTIONS_AIRTABLE_BASE_ID`, `AUCTIONS_AIRTABLE_TOKEN` | the auctions base (`schema.bases:read/write` to create its tables) | `AUCTIONS_SYNC_CONFIGURED` is true when the URL and the base are set. ## Payroll reminder Every morning the worker asks RewakeApp to send the monthly payroll reminder (the app decides the day). | Variable | Default | | |---|---|---| | `APP_BASE_URL` | | RewakeApp's address | | `PAYROLL_CRON_TOKEN` | | the same value as in RewakeApp | `PAYROLL_REMINDER_CONFIGURED` is true when both are set. ## Deployment | Variable | Default | | |---|---|---| | `TAG` | `latest` | the image tag `docker compose` runs (see [Deployment](deployment.md)) | | `DOCS_PORT` | `3003` | where the documentation site listens on the server (Traefik routes to it) |