docs: the quickstart commands no longer start, now that a receipt key is required - #30
Merged
Merged
Conversation
Making OREOCHAIN_RECEIPT_KEY required turned both start lines in server/README.md into commands that refuse to start. Someone following the quickstart would have met a refusal on their first minute and had no reason to expect it, since the page's own list of what the gateway refuses did not mention the key. The first block generates a key alongside the API key. The development block uses OREOCHAIN_EPHEMERAL_RECEIPT_KEY, which exists for exactly that case, and says in one paragraph why it is development-only. .env.example gains the other half of the same trap: the file ships PINATA_JWT= and OREOCHAIN_RECEIPT_KEY= as empty lines, directly above the _FILE twins a compose deployment uses, under a note saying setting both is an error. It works because readSecret() tests truthiness, so an empty line is not "set" — which is worth writing down, both for an operator about to fill one in and for anyone tempted to tighten that check to `name in env`. All four cases were run against this tree: the development line starts, the generated-key line starts, both-set is refused by name, and an empty line beside a _FILE mount starts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by LPH · project thread
Before: #29 made
OREOCHAIN_RECEIPT_KEYrequired, which was the right call — a throwaway key disowns every receipt at the next restart, and a holder cannot tell that from a forgery. But it turned both commands inserver/README.md's "Run it" section into commands that do not run. Someone following the quickstart met an immediate exit and a refusal naming a variable the page had not mentioned, on their first minute with the project. The same page's own list of what the gateway refuses to start without — no API keys, no pinning credential, a wildcard CORS origin — did not include the key either.After: the first block generates a receipt key beside the API key it already generated. The development block uses
OREOCHAIN_EPHEMERAL_RECEIPT_KEY, which exists for exactly this case, with a paragraph on why it is development-only and whatnpm run devsets. The refusal list mentions the key.How
.env.examplegets the other half of the same trap. The file shipsPINATA_JWT=andOREOCHAIN_RECEIPT_KEY=as empty lines directly above the_FILEtwins a compose deployment mounts, under a note saying that setting both is an error. That combination works —readSecret()atserver/config.mjs:33testsif (env[name]), so an empty line is not "set" — but it reads like a contradiction, and it is a trap in two directions: an operator who fills the plain line in while keeping the secret mount now gets a refusal to start, and anyone tightening that check toname in env, which reads like the stricter and safer version, breaks every compose deployment at once. The note now says to leave the line empty rather than delete it, and why.No code changed. The test count is unchanged at 505.
Tests
Documentation is only worth anything if the commands in it run, so all four were run against this tree rather than read:
OREOCHAIN_EPHEMERAL_RECEIPT_KEY=true/healthanswersOREOCHAIN_RECEIPT_KEY/healthanswersOREOCHAIN_RECEIPT_KEYand_FILEsetOREOCHAIN_RECEIPT_KEY=line beside a_FILEmount.env.examplenow promises