license-server: make multi-product (add klipa alongside PromptBar)#3
Merged
Conversation
Ko-fi allows one webhook URL per account, so the license server has to serve every product sold on that account. Generalise it into a product registry: each product has its own Ed25519 signing key, license file extension, Ko-fi item match, and email copy. A license signed for one product can't validate another. PromptBar behaviour is unchanged - it reads the same PROMPTBAR_* env vars, signs with the same key, archives <email>.promptbar at the same path, and /activate with no product field still defaults to PromptBar (so the shipped PromptBar app keeps working). klipa is registered only when KLIPA_PRIVATE_KEY is set. env.example documents the klipa block and the HOME fix (gunicorn's control server needs a writable $HOME under systemd ProtectHome=read-only).
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.
Ko-fi allows one webhook URL per account, so this server has to serve every product sold on that account. Generalises
app.pyinto a product registry - each product has its own Ed25519 signing key, license file extension, Ko-fi item match, and email copy. A license signed for one product can't validate another.PromptBar behaviour is unchanged: same
PROMPTBAR_*env vars, same signing key, archives<email>.promptbarat the same path, and/activatewith noproductfield still defaults to PromptBar (so the shipped PromptBar app keeps working). klipa is registered only whenKLIPA_PRIVATE_KEYis set.env.exampledocuments klipa's block and theHOMEfix (gunicorn's control server needs a writable$HOMEunder systemdProtectHome=read-only).Validated on the Pi:
/healthlists both products, existing PromptBar admin license still activates unchanged, klipa issues + activates a signed license, both webhook item types route correctly, bad tokens rejected. Deployed and running.