- api/cloud_session.py: new module — JWT validation (Directus HS256), Heimdall provision+tier-resolve, CloudUser+SessionFeatures dataclasses, compute_features() tier→feature-flag mapping, require_tier() dependency factory, get_session() FastAPI dependency (local-mode transparent passthrough) - api/main.py: remove _DB_PATH singleton; all endpoints receive session via Depends(get_session); shared_store (sellers/comps) and user_store (listings/ saved_searches) created per-request from session.shared_db / session.user_db; pages capped to features.max_pages; saved_searches limit enforced for free tier; /api/session endpoint exposes tier+features to frontend; _trigger_scraper_enrichment receives shared_db Path (background thread creates its own Store) - app/platforms/ebay/adapter.py, scraper.py: rename store→shared_store parameter (adapters only touch sellers+comps, never listings — naming reflects this) - app/trust/__init__.py: rename store→shared_store (TrustScorer reads sellers+comps from shared DB; listing staging fields come from caller) - app/db/store.py: refresh_seller_categories gains listing_store param for split-DB mode (reads listings from user_store, writes categories to self) - web/src/stores/session.ts: new Pinia store — bootstrap() fetches /api/session, exposes tier+features reactively; falls back to full-access local defaults - web/src/App.vue: call session.bootstrap() on mount - web/src/views/SearchView.vue: import session store; pages buttons disabled+greyed above features.max_pages with upgrade tooltip - compose.cloud.yml: add CLOUD_MODE=true + CLOUD_DATA_ROOT env; fix volume mount - docker/web/nginx.cloud.conf: forward X-CF-Session header from Caddy to API - .env.example: document cloud env vars (CLOUD_MODE, DIRECTUS_JWT_SECRET, etc.)
48 lines
2.6 KiB
Text
48 lines
2.6 KiB
Text
# Snipe works out of the box with the scraper (no credentials needed).
|
|
# Set eBay API credentials to unlock full trust scores —
|
|
# account age and category history signals require the eBay Browse API.
|
|
# Without credentials the app logs a warning and falls back to the scraper.
|
|
|
|
# ── eBay Developer Keys — Production ──────────────────────────────────────────
|
|
# From https://developer.ebay.com/my/keys (Production tab)
|
|
EBAY_APP_ID=
|
|
EBAY_DEV_ID=
|
|
EBAY_CERT_ID=
|
|
|
|
# ── eBay Developer Keys — Sandbox ─────────────────────────────────────────────
|
|
# From https://developer.ebay.com/my/keys (Sandbox tab)
|
|
EBAY_SANDBOX_APP_ID=
|
|
EBAY_SANDBOX_DEV_ID=
|
|
EBAY_SANDBOX_CERT_ID=
|
|
|
|
# ── Active environment ─────────────────────────────────────────────────────────
|
|
# production | sandbox
|
|
EBAY_ENV=production
|
|
|
|
# ── eBay Account Deletion Webhook ──────────────────────────────────────────────
|
|
# Register endpoint at https://developer.ebay.com/my/notification — required for
|
|
# production key activation. Set EBAY_NOTIFICATION_ENDPOINT to the public HTTPS
|
|
# URL eBay will POST to (e.g. https://snipe.circuitforge.tech/api/ebay/account-deletion).
|
|
EBAY_NOTIFICATION_TOKEN=
|
|
EBAY_NOTIFICATION_ENDPOINT=
|
|
# Set to false during sandbox/registration (no production token available yet).
|
|
# Set to true once production credentials are active — enforces ECDSA verification.
|
|
EBAY_WEBHOOK_VERIFY_SIGNATURES=true
|
|
|
|
# ── Database ───────────────────────────────────────────────────────────────────
|
|
SNIPE_DB=data/snipe.db
|
|
|
|
# ── Cloud mode (managed / menagerie instance only) ─────────────────────────────
|
|
# Leave unset for self-hosted / local use. When set, per-user DB isolation
|
|
# and Heimdall licensing are enabled. compose.cloud.yml sets CLOUD_MODE=true
|
|
# automatically — only set manually if running without Docker.
|
|
|
|
# CLOUD_MODE=true
|
|
# CLOUD_DATA_ROOT=/devl/snipe-cloud-data
|
|
|
|
# JWT secret from cf-directus (must match Directus SECRET env var exactly).
|
|
# DIRECTUS_JWT_SECRET=
|
|
|
|
# Heimdall license server — for tier resolution and free-key auto-provisioning.
|
|
# HEIMDALL_URL=https://license.circuitforge.tech
|
|
# HEIMDALL_ADMIN_TOKEN=
|