feat(share): public share-link backend (/api/share + /s/[id]) - #10
Merged
Conversation
Adds the server half of the desktop 复制链接 (copy-link) feature: - POST /api/share — stores the selected conversation snapshot and returns a https://franklin.run/s/<id> URL. Public + CORS-enabled (the desktop renderer has a local wallet, no web session), size/message capped, only inline data: images travel (local 127.0.0.1 media is stripped). - /s/[id] — public, read-only, noindex render of a shared conversation, reusing the /try MessageContent renderer, with a CTA back to Franklin. - share-store.ts — immutable snapshots under a public franklin-share/ GCS prefix (unguessable ~96-bit id); local-dev fs fallback, mirroring franklin-store. Deploy required for the desktop button to work live.
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.
What
The server half of the Franklin Desktop 复制链接 / Copy-link feature. The desktop app already has the button; it POSTs the selected conversation to `franklin.run/api/share` and copies the returned URL — but that route doesn't exist in production yet, so today the button shows "分享失败". This PR adds it.
Changes
Security model
Unguessable id + immutable snapshot = you can only ever read what you were handed a link to. Open-create is acceptable for now; add rate-limiting before a wide public launch.
Deploy
Requires deploy to franklin.run for the desktop button to work live. Local test: `FRANKLIN_STORE_LOCAL=1 npm run dev` and point the desktop at `http://localhost:3000/api/share\`.