feat(provision): make MODEL + FIAT_CODE configurable with sane defaults
Default FIAT_CODE per-model (sintra=EUR, douro/tejo=GTQ, batm3=USD) to match the flake's fiatCodeForModel table; both overridable via env var. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
997968ae06
commit
1655b1db04
1 changed files with 18 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
# Provision a running bitSpire ATM (live USB, QEMU VM, or installed Sintra)
|
# Provision a running bitSpire ATM (live USB, QEMU VM, or installed Sintra)
|
||||||
# with LNbits nostr-transport credentials. The ATM speaks to LNbits over
|
# with LNbits nostr-transport credentials. The ATM speaks to LNbits over
|
||||||
# kind-21000 NIP-44 v2 events on a relay — there is no out-of-band token,
|
# kind-21000 NIP-44 v2 events on a relay — there is no out-of-band token,
|
||||||
# the ATM's nostr private key IS the credential.
|
# the ATM's nostr private key IS the credential. # pragma: allowlist secret
|
||||||
#
|
#
|
||||||
# Required environment variables (or edit defaults below):
|
# Required environment variables (or edit defaults below):
|
||||||
# LNBITS_SERVER_PUBKEY Hex pubkey published by the LNbits server at startup.
|
# LNBITS_SERVER_PUBKEY Hex pubkey published by the LNbits server at startup.
|
||||||
|
|
@ -25,6 +25,21 @@ ATM_HOST="${1:-localhost}"
|
||||||
ATM_SSH_PORT="${2:-2222}"
|
ATM_SSH_PORT="${2:-2222}"
|
||||||
ATM_USER="lamassu"
|
ATM_USER="lamassu"
|
||||||
|
|
||||||
|
# Machine model + fiat. Model is operator-set; fiat defaults per-model to
|
||||||
|
# match the flake's fiatCodeForModel table (sintra=EUR, douro/tejo=GTQ,
|
||||||
|
# batm3=USD). Operators can override either via env var.
|
||||||
|
MODEL="${MODEL:-sintra}"
|
||||||
|
case "${FIAT_CODE:-}" in
|
||||||
|
"")
|
||||||
|
case "$MODEL" in
|
||||||
|
sintra) FIAT_CODE=EUR ;;
|
||||||
|
douro|tejo) FIAT_CODE=GTQ ;;
|
||||||
|
batm3) FIAT_CODE=USD ;;
|
||||||
|
*) FIAT_CODE=USD ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo "=== Provisioning bitSpire ATM at $ATM_HOST:$ATM_SSH_PORT ==="
|
echo "=== Provisioning bitSpire ATM at $ATM_HOST:$ATM_SSH_PORT ==="
|
||||||
|
|
||||||
# Step 1: Discover the host IP as seen from the ATM.
|
# Step 1: Discover the host IP as seen from the ATM.
|
||||||
|
|
@ -84,8 +99,8 @@ VITE_LNBITS_HTTP_URL=$LNBITS_HTTP_URL
|
||||||
VITE_ATM_PRIVATE_KEY=$ATM_PRIVATE_KEY
|
VITE_ATM_PRIVATE_KEY=$ATM_PRIVATE_KEY
|
||||||
|
|
||||||
# Machine configuration
|
# Machine configuration
|
||||||
VITE_LAMASSU_MACHINE_MODEL=sintra
|
VITE_LAMASSU_MACHINE_MODEL=$MODEL
|
||||||
VITE_LAMASSU_FIAT_CODE=USD
|
VITE_LAMASSU_FIAT_CODE=$FIAT_CODE
|
||||||
|
|
||||||
# Force production mode
|
# Force production mode
|
||||||
ELECTRON_FORCE_PROD=1
|
ELECTRON_FORCE_PROD=1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue