Client (Python/JS):
- core/license.py: attivazione, validazione, deactivate (HTTP client + JWT decode)
- core/config.py: campi license_* + URL endpoint + costanti grace/revalidate
- api/bridge.py: get_init_data ritorna license status; activate_license/
deactivate_license/revalidate_license/open_purchase_page
- check_update riscritto: punta a musictools.djluza.com/api/latest con
Bearer token, URL di download firmato dal server solo se licensed
- webui: schermata di attivazione bloccante all'avvio; sezione Licenza
in Impostazioni con verifica/disattiva
Backend (server/):
- Cloudflare Worker + D1 + R2 (vedi server/README.md)
- Endpoints: /api/license/{activate,validate,deactivate}, /api/latest,
/api/webhook/lemonsqueezy, /api/health
- JWT HS256 con rotazione; max 3 attivazioni/licenza
- Generazione licenze via webhook Lemon Squeezy + email Resend
- Schema D1 in migrations/0001_init.sql
Memory: nuova musictools-commercial-launch.md, rimosso pending obsoleto
NON taggare finche backend non e' deployato (l'app e' bloccante)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
43 lines
1.3 KiB
TOML
43 lines
1.3 KiB
TOML
name = "musictools-api"
|
|
main = "src/worker.ts"
|
|
compatibility_date = "2026-01-01"
|
|
|
|
# Routes: musictools.djluza.com/api/* va a questo worker.
|
|
# Configurare nel dashboard Cloudflare DNS + Workers Routes
|
|
# oppure decommentare se zona gia mappata:
|
|
# routes = [
|
|
# { pattern = "musictools.djluza.com/api/*", zone_name = "djluza.com" }
|
|
# ]
|
|
|
|
# D1 database (sqlite gestito da Cloudflare).
|
|
# Crealo una volta con: npm run db:create
|
|
# Poi sostituisci database_id qui sotto con quello restituito.
|
|
[[d1_databases]]
|
|
binding = "DB"
|
|
database_name = "musictools-licenses"
|
|
database_id = "REPLACE_AFTER_db:create"
|
|
|
|
# R2 bucket dove conservi gli zip macOS/Windows.
|
|
# Cli: wrangler r2 bucket create musictools-builds
|
|
[[r2_buckets]]
|
|
binding = "BUILDS"
|
|
bucket_name = "musictools-builds"
|
|
|
|
# KV per rate-limiting (opzionale ma consigliato).
|
|
# Cli: wrangler kv:namespace create RATELIMIT
|
|
# [[kv_namespaces]]
|
|
# binding = "RATELIMIT"
|
|
# id = "REPLACE_ME"
|
|
|
|
# Variabili NON segrete.
|
|
[vars]
|
|
LATEST_VERSION = "v1.5.2"
|
|
MAX_ACTIVATIONS = "3"
|
|
TOKEN_TTL_DAYS = "30"
|
|
DOWNLOAD_URL_TTL_SECONDS = "300"
|
|
|
|
# Secrets (impostarli da CLI, NON in chiaro qui):
|
|
# wrangler secret put JWT_SECRET # HMAC key per i token offline
|
|
# wrangler secret put LEMONSQUEEZY_SIGNING_SECRET # verifica webhook
|
|
# wrangler secret put RESEND_API_KEY # invio email license-key
|