Move paid unlock from Gumroad to self-hosted Ko-fi licensing#7
Merged
Conversation
klipa's direct-download paywall verified license keys against Gumroad, but the app now sells on Ko-fi - which has no license-key API. Switch to the same self-hosted, email-based flow already used by PromptBar. App side (license.rs): - Activation now takes the buyer's Ko-fi email from the clipboard, POSTs it to the license server's /activate, and verifies the returned Ed25519-signed license offline against an embedded public key. Checks product, email, and min_version. Re-verifies every 14 days to honour refunds, with offline grace on network failure. - Drop the Gumroad verify call and product-id build var; add the license endpoint + purchase URL (Ko-fi) as source defaults, overridable at build time. - Verification uses ed25519-compact (tiny, dependency-light) + base64. Canonical message matches the Python signer byte-for-byte; a test with a real server-signed blob proves it and rejects tampering. http.rs: replace form-encoded post_form with JSON post_json for /activate. Config/docs: release.yml drops KLIPA_GUMROAD_PRODUCT_ID; menu label, README, welcome page, packaging README and release-secrets runbook updated; add scripts/pi-license-server/README.md documenting the shared multi-product server and klipa's keypair/env. App Store build is unaffected: the license feature is compiled out there.
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.
Why
klipa's direct-download paywall verified license keys against Gumroad, but the app now sells on Ko-fi, which has no license-key API. Buyers coming from the site got keys the app couldn't validate. This switches klipa to the same self-hosted, email-based flow PromptBar already uses.
How
App (
license.rs):/activate, and verifies the returned Ed25519-signed license offline against an embedded public key. Validates product, email, andmin_version; re-verifies every 14 days (refund handling) with offline grace.licenses.peterdsp.devendpoint are now source defaults, overridable at build time.ed25519-compact(tiny, dependency-light) + existingbase64. The canonical signed message matches the Python signer byte-for-byte - a unit test using a real server-signed blob proves the cross-language match and rejects tampering / wrong email.http.rs: replaces form-encodedpost_formwith JSONpost_json.Server: the shared multi-product license server (
PromptBar/scripts/pi-license-server/) now signs both PromptBar and klipa from the one Ko-fi webhook, keyed by shop item. Deployed + validated on the Pi.scripts/pi-license-server/README.mddocuments klipa's slice.Config/docs:
release.ymldropsKLIPA_GUMROAD_PRODUCT_ID(GitHub variable deleted;KLIPA_PURCHASE_URLrepointed to Ko-fi); menu label, root README, welcome page, packaging README, and release-secrets runbook updated.Testing
cargo test -p klipa-ui- 8 pass, incl. the real-signature verify/tamper test.mas,mas weather, and no-default-features.