feat: add VITE_MAINTENANCE_MODE env var for service screen

Set VITE_MAINTENANCE_MODE=true in .env to show an "Under Service"
screen and block all transactions. No hardware init, no Lightning
connection — just a static screen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-03-28 00:50:34 -04:00
commit ca6d8c4f68
5 changed files with 34 additions and 3 deletions

View file

@ -33,6 +33,16 @@ onMounted(async () => {
})
}
// Check maintenance mode before initializing anything
const config = isElectron ? await window.electronAPI?.getConfig() : null
const maintenanceMode =
config?.maintenanceMode || import.meta.env.VITE_MAINTENANCE_MODE === 'true'
if (maintenanceMode) {
atmStore.initError = 'maintenance'
return
}
try {
if (isElectron) {
await atmStore.initializeForProduction()
@ -88,11 +98,20 @@ function toggleLiveServices() {
<line x1="12" y1="9" x2="12" y2="13" />
<line x1="12" y1="17" x2="12.01" y2="17" />
</svg>
<h1 class="text-2xl lg:text-[3.5rem] font-bold">ATM Unavailable</h1>
<h1 class="text-2xl lg:text-[3.5rem] font-bold">
{{ atmStore.initError === 'maintenance' ? 'Under Service' : 'ATM Unavailable' }}
</h1>
<p class="max-w-md text-center text-base lg:text-2xl text-muted-foreground">
This machine is temporarily out of service. Please try again later or use another machine.
{{
atmStore.initError === 'maintenance'
? 'This machine is currently being serviced. We will be back shortly.'
: 'This machine is temporarily out of service. Please try again later or use another machine.'
}}
</p>
<p v-if="atmStore.debugMode" class="max-w-lg text-center font-mono text-sm text-destructive">
<p
v-if="atmStore.debugMode && atmStore.initError !== 'maintenance'"
class="max-w-lg text-center font-mono text-sm text-destructive"
>
{{ atmStore.initError }}
</p>
</div>

View file

@ -15,6 +15,7 @@ export interface RuntimeConfig {
cassettes?: string
allowMockFallback: boolean
operatorPubkeys: string
maintenanceMode: boolean
}
export interface AtmSecrets {