postplan-aryan
v0.4.0
Published
Publish a self-contained HTML document and get a link. Convex + S3 backend. Fork of postplan (MIT, t3dotgg).
Readme
postplan-aryan
Publish a self-contained HTML document and get a link back. A fork of postplan (MIT, t3dotgg) with the express + Postgres + S3 server replaced by Convex functions and tables.
npx postplan-aryan auth set <api-key> --api-url https://<your-deployment>.convex.site
npx postplan-aryan upload plan.htmlThe CLI is upstream's, unmodified. No deployment is baked into the published
package: it reads --api-url, then POSTPLAN_API_URL, then
~/.postplan/config.json. Point it at your own instance.
Where uploads go
Uploads go to whichever instance you configured — not postplan.dev. Run
auth set once per machine; without it the CLI falls back to postplan.dev,
which is somebody else's server.
The instance stores each document in its S3 bucket and serves it at
/d/<draftId>. Re-uploading the same file path updates that URL in place and
bumps the version, so a link you already sent keeps working and keeps showing the
latest. --new starts a separate draft instead.
Draft ids are random and unguessable, and there is no listing URL: a link leads to
one document and nothing else. /d/<id>/raw returns the source.
Self-hosting
You need a Convex project and an S3 bucket. No Postgres, no Railway.
npm install- Copy
.env.exampleto.env.localand fill in your deployment. - Set the server env vars on your deployment:
npx convex env set --prod S3_BUCKET <bucket>
npx convex env set --prod S3_REGION <region>
npx convex env set --prod S3_PREFIX <prefix>
npx convex env set --prod S3_ACCESS_KEY_ID <key>
npx convex env set --prod S3_SECRET_ACCESS_KEY <secret>
npx convex env set --prod POSTPLAN_PUBLIC_BASE_URL https://<deployment>.convex.site
npx convex env set --prod POSTPLAN_API_KEY <a long random string>Set POSTPLAN_API_KEY. With it unset the upload endpoint is open, and anyone
who learns your deployment URL can write HTML into your bucket and have it served
from your origin.
npx convex deploy
Give the bucket a private prefix for drafts; they are reachable only through
/d/<draftId>. Use an IAM user scoped to that prefix, with no ListBucket.
What changed from upstream
express+pg+@aws-sdk/client-s3+joseare gone; Convex serves the API and holds drafts and versions.- HTML goes to S3 addressed by content hash, so re-uploading identical HTML is idempotent.
src/html-policy.jsis unchanged apart fromBuffer.byteLengthbecomingTextEncoder, since Convex is V8 without Node globals. It is still enforced server side.
