docs(ops): stop the compose header contradicting itself, and name the four variables step 2 dropped (#204) #210
@@ -57,8 +57,10 @@
|
||||
# (#190). Everything else is written out, so there is one place to look and one
|
||||
# thing that can be wrong.
|
||||
#
|
||||
# Required stack environment variables. All must be set in Portainer for this
|
||||
# stack. All are secrets except DEMO_MODE:
|
||||
# The stack environment variables this file reads. Each entry says whether it is
|
||||
# required and when — there is no blanket rule, because three are unused while
|
||||
# DEMO_MODE is `true`, three are optional, and DEMO_MODE and SMTP_FROM are not
|
||||
# secrets at all:
|
||||
#
|
||||
# DEMO_MODE `true` or `false`, exactly. Whether real payments are
|
||||
# taken. Not a secret — it is here rather than written
|
||||
|
||||
@@ -60,9 +60,13 @@ Everything here is lost when the stack is deleted, and the rollback in step 8 is
|
||||
|
||||
**The stack name**, exactly as Portainer shows it. If it is not `redefined-designs`, note that — the new stack must be created with that name, because the stack name becomes the compose project name and reusing QA's would make Compose reconcile the two against each other.
|
||||
|
||||
**Every stack environment variable, name and value.** They belong to the stack, and deleting it discards them. This is the step whose omission is felt hardest: the compose file interpolates `DEMO_MODE`, `DB_PASSWORD`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_FROM`, `ADMIN_GATE_SECRET`, `PAYPAL_CLIENT_ID`, `PAYPAL_CLIENT_SECRET` and `PAYPAL_WEBHOOK_ID`, and an unset one substitutes to an empty string rather than failing. A missing `DB_PASSWORD` cannot authenticate against its own data directory, and none of this is recoverable from anything in this repository.
|
||||
**Every stack environment variable, name and value.** They belong to the stack, and deleting it discards them. This is the step whose omission is felt hardest. The compose file interpolates thirteen names — `DEMO_MODE`, `DB_PASSWORD`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_FROM`, `ADMIN_GATE_SECRET`, `PAYPAL_CLIENT_ID`, `PAYPAL_CLIENT_SECRET`, `PAYPAL_WEBHOOK_ID`, `USPS_CLIENT_ID`, `USPS_CLIENT_SECRET`, `UPLOADS_BASE_URL` and `BACKUP_PASSPHRASE` — and an unset one substitutes to an empty string rather than failing. None of it is recoverable from anything in this repository. Take everything the stack holds rather than working from this list; it is here to say how much there is, and it is checked against the file rather than from memory.
|
||||
|
||||
`DEMO_MODE` is the odd one out and the easiest to miss, because it is the only one that is not a secret. It must be exactly `true` or `false`. There is no default in the compose file, deliberately (#190) — a default would decide whether the shop takes money on the operator's behalf, silently, whichever way it pointed — so an unset `DEMO_MODE` refuses to boot rather than guessing. Production is `true` for now, the interim from #191; setting it to `false` is what restores real payments, and doing that without all three PayPal secrets present crash-loops the container.
|
||||
`USPS_CLIENT_ID` and `USPS_CLIENT_SECRET` deserve naming because losing them is the one failure here that is completely silent. Address validation is skipped when they are empty rather than failing, so checkout keeps working and quietly stops validating addresses. Nothing in step 7 catches it, and there is no crash loop to notice.
|
||||
|
||||
A missing `DB_PASSWORD` does not fail the way you would expect either: the app never reaches a connection attempt. It refuses at boot, and the message names `PGPASSWORD` rather than the variable you set, because the compose file injects it as `PGPASSWORD=${DB_PASSWORD}`. Grep the log for the name in the error, not the name in Portainer.
|
||||
|
||||
`DEMO_MODE` is the odd one out and the easiest to miss, because it is the only one that is a setting rather than a credential. It must be exactly `true` or `false`. There is no default in the compose file, deliberately (#190) — a default would decide whether the shop takes money on the operator's behalf, silently, whichever way it pointed — so an unset `DEMO_MODE` refuses to boot rather than guessing. Production is `true` for now, the interim from #191; setting it to `false` is what restores real payments, and doing that without all three PayPal secrets present crash-loops the container.
|
||||
|
||||
Copy them somewhere before you delete anything.
|
||||
|
||||
@@ -221,14 +225,28 @@ Migration output must appear *before* `listening on 3000`, and `listening on 300
|
||||
|
||||
**What a crash loop looks like, and it is the likeliest outcome of a missed step 2.** A `[config] refusing to start` block, then the whole boot sequence again, repeating.
|
||||
|
||||
While production is in the demo interim, the likeliest one is `DEMO_MODE` itself:
|
||||
Miss step 2 wholesale and it is two problems, led by a name you never typed:
|
||||
|
||||
```
|
||||
[config] refusing to start — 2 problem(s) with the environment:
|
||||
[config] - PGPASSWORD is required and is not set.
|
||||
[config] - DEMO_MODE is required and must be exactly 'true' or 'false'. It decides whether real payments are taken, so it has to be stated rather than inherited.
|
||||
```
|
||||
|
||||
Carry `DB_PASSWORD` across and only `DEMO_MODE` is left, which is the single likeliest form during the demo interim:
|
||||
|
||||
```
|
||||
[config] refusing to start — 1 problem(s) with the environment:
|
||||
[config] - DEMO_MODE is required and must be exactly 'true' or 'false'.
|
||||
[config] - DEMO_MODE is required and must be exactly 'true' or 'false'. It decides whether real payments are taken, so it has to be stated rather than inherited.
|
||||
```
|
||||
|
||||
The other form appears once `DEMO_MODE` is `false` and real payments are on:
|
||||
A value that was set but mistyped reads differently, and the quotes are the only thing that distinguishes `true ` with a trailing space from `true`:
|
||||
|
||||
```
|
||||
[config] - DEMO_MODE must be exactly 'true' or 'false', but is 'True'. Anything else used to be read as demo mode, which meant a typo here quietly stopped the shop charging anyone.
|
||||
```
|
||||
|
||||
The PayPal form appears once `DEMO_MODE` is `false` and real payments are on:
|
||||
|
||||
```
|
||||
[config] refusing to start — 3 problem(s) with the environment:
|
||||
|
||||
Reference in New Issue
Block a user