L'utente ha un hosting Virtualmin esistente (musictools.djluza.com)
con Apache + Node 20 + MariaDB + PM2. Tutta l'infrastruttura
Cloudflare (Workers/D1/R2/Pages) e' rimpiazzata con un backend
Express che gira sul server gia' presente, a costo zero.
Cambia:
- server/src/*.ts (Workers) -> server/src/*.js (Node ESM puro)
- D1 (sqlite) -> MariaDB 10.11 via mysql2/promise
- R2 (storage) -> filesystem locale ~/builds/ + signed URL HMAC
- wrangler.toml -> ecosystem.config.cjs (PM2)
- Aggiunto src/migrate.js: runner SQL idempotente
Endpoints invariati - l'app desktop non vede differenze:
- POST /api/license/{activate,validate,deactivate}
- GET /api/latest, /api/download
- POST /api/webhook/lemonsqueezy
- GET /api/health
README riscritto con istruzioni complete: creazione DB,
deploy via rsync/git, config Apache reverse proxy via
Virtualmin, gestione PM2, backup, workflow release.
Email rimane su Resend (deliverability) - free tier sufficiente.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
36 lines
927 B
Bash
36 lines
927 B
Bash
# Copia questo file in `.env` sul server (non committarlo!) e compila.
|
|
|
|
# ---- Server ----
|
|
PORT=4002
|
|
HOST=127.0.0.1
|
|
LATEST_VERSION=v1.5.2
|
|
PUBLIC_BASE_URL=https://musictools.djluza.com
|
|
|
|
# ---- DB (MariaDB locale) ----
|
|
DB_HOST=127.0.0.1
|
|
DB_PORT=3306
|
|
DB_NAME=musictools_licenses
|
|
DB_USER=musictools
|
|
DB_PASS=cambiami
|
|
|
|
# ---- Licenze ----
|
|
JWT_SECRET=cambiami_con_openssl_rand_base64_32
|
|
MAX_ACTIVATIONS=3
|
|
TOKEN_TTL_DAYS=30
|
|
DOWNLOAD_URL_TTL_SECONDS=300
|
|
|
|
# ---- Lemon Squeezy ----
|
|
# Dal dashboard LS: Settings > Webhooks > Signing Secret
|
|
LEMONSQUEEZY_SIGNING_SECRET=cambiami
|
|
|
|
# ---- Resend ----
|
|
# Dal dashboard Resend: API Keys
|
|
RESEND_API_KEY=cambiami
|
|
EMAIL_FROM=MusicTools <noreply@djluza.com>
|
|
|
|
# ---- Storage builds ----
|
|
# Dove conservi i binari macOS/Windows da servire agli utenti.
|
|
# Default: ../builds rispetto a server/. Puoi metterlo dove vuoi
|
|
# purche' il processo Node abbia accesso lettura.
|
|
BUILDS_DIR=/home/musictools/builds
|