ac29735d20
The contract requires the application to serve a wallet file and hand its URL and password to the data layer. Until now the only source was a filesystem path, which no container has: `*.ngw` is gitignored, `COPY . .` brings none, and nothing mounts one -- so a deployed instance served 404 where the contract expects bytes. `FESTIPOD_SHARED_WALLET_FILE_BASE64` carries the file itself. It is 810 bytes, and it is not a secret: by design the application hands it to every user who opens the app, so provisioning persistent storage would be guarding something public. One channel for both values, nothing to mount, and a new host needs only its variables. Precedence is deliberate and one-directional: the path always wins when set, and an unreadable path does NOT fall through to the base64 form. A deployment sets exactly one; both set is a leftover, not a fallback chain. Local development and the test harness only ever set the path, so they are untouched. A malformed value answers 500 and names the variable. Answering 404 would have made "configured wrong" indistinguishable from "not configured at all" -- the confusion this codebase has spent two days removing. Proven by serving the same wallet from each source in turn and comparing: identical size, identical sha256. The first attempt at that proof silently exercised the path branch, because Bun auto-loads `.env` and the variable was already there; the checksums matched for the wrong reason. Caught, cleared, and measured again.
51 lines
3.0 KiB
Bash
51 lines
3.0 KiB
Bash
# Festipod — variables d'environnement (exemple)
|
|
#
|
|
# Copier en `.env` et renseigner les valeurs.
|
|
# En dev (`bun run dev`) ET en prod (`bun run start`), l'app sert depuis src/ et
|
|
# lit ces variables au RUNTIME (via l'endpoint /festipod-config.json de src/index.ts).
|
|
#
|
|
# REQUIS POUR LES TESTS. La suite Cucumber tourne sous `node` (pas sous Bun), qui
|
|
# ne charge pas `.env` tout seul : le harness le lit explicitement et LÈVE UNE
|
|
# ERREUR NOMMÉE si le mot de passe ou le fichier manquent. Or `.env` ET `*.ngw`
|
|
# sont tous deux gitignorés — un clone frais n'a donc ni l'un ni l'autre et ne
|
|
# peut pas exécuter `@data`/`@e2e` tant que ces deux valeurs ne sont pas fournies.
|
|
|
|
# ── Portefeuille partagé (stopgap staging) ─────────────────────────────────
|
|
# Mot de passe du portefeuille partagé.
|
|
# VIDE => rien n'est passé à `configure({ sharedWallet })` => le SDK refuse de
|
|
# signer l'entrée et l'app affiche son panneau d'erreur au lieu de démarrer.
|
|
# REQUIS en staging (onboarding d'un appareil sans wallet) ET pour les tests.
|
|
FESTIPOD_SHARED_WALLET_PASSWORD=
|
|
|
|
# Chemin vers le fichier portefeuille partagé (.ngw), absolu ou relatif à la
|
|
# racine. Servi en téléchargement à /shared-wallet.ngw. C'est la forme du DEV
|
|
# LOCAL et du harness de TESTS : le fichier vit sur le disque de la machine.
|
|
FESTIPOD_SHARED_WALLET_FILE=/chemin/absolu/vers/festipod-wallet.ngw
|
|
|
|
# Contenu du portefeuille partagé (.ngw), encodé en base64 — deuxième source
|
|
# pour le même fichier. C'est la forme des DÉPLOIEMENTS (conteneur) : *.ngw est
|
|
# gitignoré, donc `COPY . .` n'en embarque aucun et rien n'en monte un ; le
|
|
# fichier n'étant pas un secret (l'app le sert à quiconque ouvre l'app), il
|
|
# voyage comme une variable de config. `FESTIPOD_SHARED_WALLET_FILE` est
|
|
# prioritaire quand les deux sont renseignées — voir le commentaire dans
|
|
# src/index.ts. Générer la valeur avec, p.ex., `base64 -w0 festipod-wallet.ngw`.
|
|
FESTIPOD_SHARED_WALLET_FILE_BASE64=
|
|
|
|
# ── Seed automatique (opt-in) ──────────────────────────────────────────────
|
|
# Non vide => l'app amorce des données de démo dans un wallet VIDE au 1er login.
|
|
# OFF par défaut : laisser vide en usage normal.
|
|
FESTIPOD_AUTO_SEED=
|
|
|
|
# ── Serveur ────────────────────────────────────────────────────────────────
|
|
# Port HTTP du serveur (défaut 3000).
|
|
PORT=3000
|
|
|
|
# NODE_ENV=production bascule `bun run start` (pas de HMR). En dev, laisser vide.
|
|
NODE_ENV=
|
|
|
|
# ── Outillage dev (facultatif) ─────────────────────────────────────────────
|
|
# Override du chemin local du polyfill @ng-eventually/sdk pour `pnpm run
|
|
# link:polyfill` (lien local réactif). Défaut = ../nextgraph/ng-eventually-js/packages/sdk.
|
|
NG_EVENTUALLY_LOCAL=
|
|
|