Skip to content
open.blog documentation
open.blog

Deploying

openblog build writes a complete static site to dist/. Anything that serves files can host it. The choice is between a static host (simplest, no server to run) and openblog serve on a machine you control (adds Studio, the editor, the view counter, and automatic publishing of scheduled posts).

Static host (Pages, Netlify, S3, ...)openblog serve
Pages, feeds, search, themesyesyes
Scheduled postson the next build after the date (schedule a build)automatic, within seconds
Studio (the editor)no (edit files, push)yes, with --admin
View counter and analyticsno (<ob-views> hides itself)yes
HTTPSprovidedput a reverse proxy in front
Published Knowledge Atlasonly if you build locally and upload dist/yes
Published claim evidenceonly if you build locally and upload dist/ (revision notes always)yes

A blog made with openblog init is a folder of Markdown, settings, and themes. It has no Rust code of its own: the openblog command does the building. The instructions below assume that layout. (If you instead work inside a clone of the open.blog repository, replace openblog build with cargo run --release -p openblog-cli -- build in the commands here. The repository's own blog is published to Netlify by .github/workflows/netlify-main.yml; its GitHub Pages address holds the documentation, from .github/workflows/docs-pages.yml.)

The Knowledge Atlas is not in the repository. With knowledgeAtlas.publish on, /atlas/ and /atlas.json come from the private atlas at .openblog/private/research/atlas.json, which is Git-ignored. A build that runs from a clone (GitHub Actions, Netlify, Cloudflare Pages, any CI) cannot read it and publishes an empty atlas; openblog build and openblog check warn when that happens. Only a build that can read the private atlas publishes it: openblog serve and Admin on the machine that holds it, or an openblog build run there whose dist/ you then upload.

Passage comparisons are not in the repository either. With comparisons.publish on, /comparisons/ and /comparisons.json come from .openblog/private/research/alignments.json, the library and the notebook, which are Git-ignored. A build from a clone publishes empty comparisons and warns.

Claim evidence is not in the repository either. With claimEvidence.publish on, the "Claims and evidence" sections and /claim-evidence.json come from .openblog/private/research/claims.json, which is Git-ignored. A build from a clone publishes no claims and warns; the revision notes written in posts' front matter are published either way.

Scheduled builds#

A post with a future date is left out of every build until a build runs after its time. On openblog serve that happens by itself: the server rebuilds the moment a post comes due, and with publish.auto (and the built pages in publish.paths) sends the result out. A site built somewhere else (GitHub Pages, Netlify, Cloudflare, ...) shows a scheduled post only when that host builds again after its time, so give it a scheduled build: the Pages workflow below runs once an hour, and Netlify and the others take a build hook called on a schedule. Studio says which applies under When it appears and in About this post's details (meta.schedule: self or next-send; GET publish also gives mode and nextDue).

GitHub Pages#

  1. Create the blog with the workflow included, or add it to an existing blog:

    openblog init my-blog --github-pages
    

    This writes .github/workflows/pages.yml. It installs openblog on the build machine (cached between runs), runs openblog build, and deploys dist/, on every push to main and once an hour so scheduled posts publish on time. Edit the cron line if you want a different rhythm.

  2. Push the blog to a GitHub repository.

  3. In the repository settings, under Pages, set Source to GitHub Actions.

  4. Set "url" in openblog.json to the address the site will have.

Two kinds of address are possible:

  • A custom domain, or a user.github.io user site: the site lives at the root. Add the domain to static/CNAME (one line) and configure it under Pages; the build copies the file to the site root. With "postPath": "/{slug}/", URLs imported from Hashnode stay identical.
  • A project site, https://user.github.io/repo/: set "url" to exactly that. The build reads the path from it and prefixes every root-relative link, asset, and the search index, while feeds and the sitemap use the full address. openblog serve honours the same prefix locally, so http://localhost:8080/repo/ previews what Pages will serve.

The build also writes a .nojekyll file so Pages serves everything as is.

Netlify#

Netlify builds from private repositories on its free tier and handles custom domains, so it is the natural choice when the repository is private. A clone of the engine repository (such as a fork) already contains netlify.toml and rust-toolchain.toml:

  1. In Netlify, add a new site from the repository. The settings come from netlify.toml: Netlify installs Rust, compiles the engine, runs openblog build, and publishes dist/. The first build takes several minutes; later ones reuse the cache.
  2. Set "url" in openblog.json to the site's address (the Netlify subdomain, or your custom domain once it is configured under Domain management).
  3. For scheduled posts, create a Netlify personal access token and add it as the GitHub repository secret NETLIFY_AUTH_TOKEN. Add the site's Project ID (shown under Project configuration → General → Project information) as NETLIFY_SITE_ID. .github/workflows/prepare-scheduled-publisher.yml compiles the Linux generator and packages the pinned deploy client for every main commit, then refreshes the artifact weekly. .github/workflows/netlify-schedule.yml reuses that exact-commit artifact once a day (06:23 UTC), runs openblog build, and uploads dist/ and the functions directly. Scheduled publication therefore avoids dependency installation, a remote Rust build, and Netlify build minutes. Edit the cron line for another cadence, and date scheduled posts for the rebuild time.

The file also sets cache headers for assets and CORS headers for the feeds and the latest-posts JSON. Aliases are plain redirect pages, so they need no Netlify redirects.

Admin hosted separately on Render#

This repository's Netlify configuration redirects /admin and /admin/* to https://openblog-o0o5.onrender.com/admin/, preserving nested paths. Replace that hostname in both rules when deploying your own Admin service. These are temporary (302) redirects, not proxy rewrites: the browser moves to Render, where login, cookies, and authenticated requests stay on the same origin. Public engagement routes under /api/ stay on Netlify.

On the Admin service itself, /admin and /admin/ answer a second 302, to /admin/studio/ (Studio; the old Admin was retired, ADR 0415), and so does any old Admin file such as /admin/admin.js. scripts/deployment-smoke.mjs expects exactly that, then 200 for /admin/studio/, /admin/sw.js and /admin/manifest.webmanifest. Files under <paths.web>/admin/ no longer replace the editor's own; only admin/icons/ is still read.

Keeping Admin requests off Netlify's proxy also avoids its 26-second proxy timeout for long-running operations. Do not change these rules to 200 rewrites without verifying Admin's Origin/Host checks and request timeouts. On Render, use OPENBLOG_BEHIND_PROXY=1 for secure session cookies, and follow the self-hosting and Render guidance below for credentials, persistent storage, and Git publishing.

Comments and persistent analytics on Netlify#

The repository includes an optional Netlify Function backed by Supabase. It adds moderated comments and lets the existing privacy-respecting view counter retain analytics across deploys. Run supabase/openblog.sql in a Supabase project, then follow the function setup guide to configure the server environment. The Supabase secret API key (SUPABASE_SECRET_KEY) remains in Netlify and is never an Admin or public-site setting. Existing SUPABASE_SERVICE_ROLE_KEY deployments remain supported.

After deployment, open Studio's Readers › How readers reach you, enable hosted engagement, enter the public /api endpoint, and save the matching write-only moderation token. New comments remain pending until an owner approves them in Studio's Readers, which also lists passage feedback (ADR 0105). To offer every moderation decision, with versions and an audit trail for comments, run the additive supabase/moderation.sql (and feedback.sql again if you use feedback) and set OPENBLOG_MODERATION_ENABLED=true (ADR 0106); see the function setup guide. Reader receipts, abuse reports, deletion requests and the retention run are a further opt-in step, engagement protection (ADR 0108), and so are readers' evidence and your correction decisions, evidence and correction decisions (ADR 0118). Tokens saved by Admin are bound to the endpoint origin, redirects are not followed, and Supabase-backed quotas limit public writes. The function also reads the generated comment-policy manifest from OPENBLOG_SITE_ORIGIN before comment access, so locked and hidden policies are enforced on the server as well as in the page UI. Set OPENBLOG_SITE_BASE_PATH when the published site lives below /. The existing local counter stays the default when hosted engagement is off.

Optional passage feedback#

Typed passage feedback (reader questions, suggested sources and corrections, and other interpretations, ADRs 0079 to 0081) is off by default and needs three explicit steps: run the additive migration supabase/feedback.sql, set OPENBLOG_FEEDBACK_ENABLED=true in Netlify, and set engagement.feedback to true in openblog.json. The migration only creates the private openblog_feedback table; existing comments, analytics and their tables are not changed. It also adds the private moderation audit table openblog_feedback_events and the function openblog_moderate_feedback (ADR 0083). Approved notes are published from content/reader-feedback.json in the repository, so the build needs no access to the hosted service. To roll back, unset OPENBLOG_FEEDBACK_ENABLED and redeploy, then, if you also want the data gone, export it and run supabase/feedback-rollback.sql, which drops only what the migration created. The function setup guide has the details. The engagement function is bundled with esbuild ([functions."engagement"] in netlify.toml) so it can share the feedback validator in web/components/.

Durable editorial workspace on ephemeral hosts#

By default, drafts and unpublished files live only on the Admin host's filesystem. Git publishing is not a draft backup. For an ephemeral Render service, opt into the separate Supabase workspace store; a public Netlify deployment still builds exclusively from Git. This does not change the engagement database or expose editorial data to Netlify. Keep your work safe on Render is the short list of what to create.

  1. In the existing Supabase project, run supabase/workspace.sql in the SQL editor. It creates one service-role-only revisioned manifest table and the private openblog-workspace Storage bucket. No public/anonymous access is granted, and a restrictive bucket policy excludes this bucket from broad authenticated policies.

  2. Set these server-only Render environment variables, never in openblog.json, client JavaScript, Netlify's public configuration, or Git:

    VariableValue
    OPENBLOG_WORKSPACE_SUPABASE_URLThe project's HTTPS origin, e.g. https://PROJECT.supabase.co
    OPENBLOG_WORKSPACE_SECRET_KEYA server-side Supabase secret key (sb_secret_…) or legacy service-role JWT (never an anon/publishable key)
    OPENBLOG_WORKSPACE_NAMESPACEA stable, unique blog identifier: 1–80 ASCII letters, digits, -, _

    Set all three, or none; a blank value counts as not set. Partial/invalid configuration fails startup rather than silently using local storage. Use a different namespace for a staging blog. Modern secret keys are sent only in apikey; legacy service-role JWTs additionally use Bearer authorization. The private bucket name is fixed; there is no default namespace, so the blog identifier must be explicitly supplied.

  3. Deploy the updated binary. The entrypoint must provision Admin login/provider/Git credentials before openblog serve --admin. Supabase does not back up these secrets. The Docker build and runtime both use Debian bookworm; building against a newer libc than the runtime supports can prevent the binary from starting. The image executes openblog help during its build to check runtime compatibility. If Render omits .git from its Docker context, the entrypoint recovers Git metadata from Render's RENDER_GIT_REPO_SLUG, RENDER_GIT_COMMIT, and RENDER_GIT_BRANCH. It fetches the exact shipped commit and checks the existing file contents before attaching HEAD; it does not replace files or create a synthetic publishing baseline. Private repositories require OPENBLOG_GIT_TOKEN or the SSH deploy key described below for that fetch. Non-Render images must include a valid Git checkout or explicitly provide these source identifiers. When opted in, Rust startup fetches publish.remote / publish.branch into its remote-tracking ref, verifies that HEAD is an ancestor, then uses a fast-forward-only merge with autostash disabled to prepare the published checkout. No shell JSON parsing, reset, checkout/discard, or separate fetch integration is required in the entrypoint. Restore and reconciliation finish before building, starting watchers, or opening HTTP. Startup fails visibly on unavailable storage, invalid data, or conflicting edits. Fetch failures, missing remote branches, local-only commits/divergence, insufficient shallow history, and dirty tracked/untracked files that prevent fast-forwarding fail visibly before contacting Supabase. Unrelated local files are retained. Resolve these failures manually without discarding unpublished work. Git fetch/merge commands have a 60-second timeout each, interactive prompts are disabled, and credential-bearing Git diagnostics are not echoed. With no configured Git remote, startup HEAD is the initial baseline. Default/non-opted-in serving never fetches or merges.

  4. Verify against the deployed service: create a draft, save an unpublished edit, upload an image/GPX, change a non-secret setting and personal preference, restart/redeploy Render, and confirm they survive. Also verify publishing still pushes the public Git branch. SQL application, environment configuration, and this live restart check are manual setup; repository changes alone do not configure the live service.

What is stored. UTF-8 database text records hold Markdown posts/pages/series/services and saved reviews (content/proof/), credit sidecars, the Landing page (content/landing.json) and its previous versions (.openblog/private/landing-history/), openblog.json, .gitignore, project Assistant skills and portable/private context/references, per-login presentation preferences, and typed editor trash. Images, GPX uploads, and pending GPX data use content-addressed objects in the private bucket. Only the explicitly selected .openblog/private/context/, .openblog/private/landing-history/ and .openblog/private/admin-preferences/ directories, plus the single research source library file .openblog/private/research/sources.json (up to 4 MiB) and the seasonal reminder record .openblog/private/seasonal.json, participate. Auth users/password hashes, sessions, analytics, provider/moderation/API keys, Git configuration/credentials, arbitrary .openblog/private/, themes, generated output, and other files are never backed up. Unknown configuration fields are rejected rather than risking storing an inline secret. Do not put secrets in authored documents, public settings, or the included context directories. Re-provision write-only credentials through environment variables or the host's secret setup after restart; saving one in Studio does not make that credential durable.

Acknowledgement and conflicts. Every authenticated Admin mutation completes its local filesystem transaction and synchronous durable manifest revision before returning success. Uploads finish before the atomic database compare-and-swap. A service outage, timeout, quota/size error or stale revision returns an explicit 503 / save NOT acknowledged; local changes may still exist, but subsequent writes stop until restart/reconciliation. Do not treat a failed save as backed up. Preserve/export that local version before replacing an ephemeral instance. A timeout can mean the commit actually succeeded: inspect the remote revision before retrying. Other instances cannot silently overwrite newer saves.

Git remains published truth. Restore records the published Git blob each edit replaced, checks the entire bundle first, and permits only matching baselines or already-identical results. New upstream edits or unrelated local edits cause a visible startup conflict, not an overwrite. Deletions/renames have tombstones; document, credit, context, track and setting changes share one manifest revision. Successful Git pushes retire published overlays; local-only publication is disabled in this mode. After a conflict, stop writers, preserve both versions, reconcile/export the namespace manifest with the current Git checkout, and restart. There is deliberately no automatic merge or “last writer wins.”

Limits and operating model. Run one active Admin instance per namespace. Revision CAS protects against overlapping instances, but is not collaborative multi-master editing. Each HTTP storage request has a 15-second timeout and no redirects; save/restore loops stop after a 90-second operation budget (plus at most one in-flight request). Maximums: 2,048 records/files, 2 MiB per UTF-8 text file, 16 MiB per upload, 64 MiB selected filesystem data, 8 MiB manifest, bounded directory traversal and relative paths. Tombstones count toward the record limit. Content/static/users path layout cannot change while enabled. Symlinks (including internal ones) are rejected, and the normal content lock spans the durability transaction. Filesystem access assumes trusted/cooperating OS processes; it does not defend against a hostile local account racing filesystem replacement.

Use Admin's API for mutations in this mode. CLI content creation/import/migration/publish commands are disabled when any workspace environment variable has a value; direct disk edits, external tools, and periodic file-watcher rebuilds are not durable acknowledgements. Stop the service to perform maintenance, then restart and reconcile before accepting edits. The store is a recoverable working overlay, not version history or a full-repository backup. Failed/uncommitted uploads and superseded objects are retained (no racing automatic GC); monitor the free-tier database/Storage quotas and remove only unreferenced objects while writers are stopped. Free Supabase projects may pause or exhaust quota: an outage blocks startup/saves rather than falling back to ephemeral storage.

For a blog made with openblog init (no engine source in the repository), use this build command instead, with dist as the publish directory:

curl https://sh.rustup.rs -sSf | sh -s -- -y && . "$HOME/.cargo/env" \
  && cargo install --git https://github.com/journey-to-code-org/open.blog openblog-cli \
  && openblog build

Publishing from the container with an SSH deploy key#

Instead of a token, the container can push with a write-enabled SSH deploy key registered on this one repository, so a leaked credential cannot reach any other repository. Mount the private key and a pinned GitHub known-hosts file as secret files (Render calls them secret files) and point to them:

  • OPENBLOG_GIT_SSH_KEY_PATH: the private deploy key.
  • OPENBLOG_GIT_SSH_KNOWN_HOSTS_PATH: GitHub's host keys, taken from GitHub's authenticated HTTPS metadata API. Refresh them when GitHub rotates keys; never disable host verification.

At startup the entrypoint copies the key to a private file (mode 600), requires strict host-key checking, and rewrites an https://github.com/... origin to git@github.com:.... Git metadata recovery on Render (scripts/container-git.sh) uses the same key for its first fetch. Startup fails if either file is unreadable, if the remote is not a GitHub repository, or if OPENBLOG_GIT_TOKEN is also set: configure only one credential method.

Execution gateway#

codeRunner is a browser-to-runner integration, not a code executor inside open.blog. Deploy the gateway on infrastructure isolated from the blog repository, Admin service, databases, deployment credentials, and private networks. The generated page makes this credential-free request:

POST /v1/execute
Content-Type: application/json

{"language":"python","source":"print(input())","stdin":"hello\n"}

Return JSON with exactly the useful execution outcome:

{"success":true,"stdout":"hello\n","stderr":"","exitCode":0}

success is a Boolean, stdout and stderr are strings, and exitCode is an integer or null. The browser caps source at 20,000 bytes, standard input at 8,000 bytes, the response body at 512,000 bytes, and displayed output at 64,000 bytes. It times out after 20 seconds, strips terminal control sequences, truncates output, and renders text rather than HTML. Those client checks are defense in depth, not server controls: independently enforce smaller source/output limits, compile and run deadlines, CPU, memory, PID, file, and disk quotas, per-client rate limits, a global concurrency cap, and an emergency disable switch.

Run every request in a fresh unprivileged workspace with no network, secrets, host mounts, Docker socket, package installation, or writable runtime image. Pin and patch the executor. Suitable gateway implementations include:

  • a self-hosted Piston deployment for a multi-language API;
  • a patched self-hosted Judge0 deployment behind an adapter that exposes only this narrow contract;
  • a pinned self-hosted Pyodide worker on a dedicated runner origin for Python. Pyodide and Web Workers still expose browser networking APIs unless the runner origin applies its own restrictive CSP, so WebAssembly is not an isolation boundary by itself.

Do not put Piston/Judge0 credentials in openblog.json or generated HTML. Keep them between the public gateway and executor. Configure only the public gateway URL and the exact languages it supports; a runnable fence for any other language remains static.

Cloudflare Pages, Vercel, and others#

Same shape: publish dist/, and build with either the clone command (cargo build --release -p openblog-cli --locked && ./target/release/openblog build) or the cargo install --git command above. Trigger a build on a schedule for scheduled posts: a build hook called from a cron job or a scheduled workflow, as with Netlify.

Self-hosting with openblog serve#

openblog user add you
openblog serve --admin --port 8080

Accounts made with openblog user add are owner accounts. openblog user add --co-writer <name> makes a sign-in that reaches only Writing together (Studio R14); people you invite from Studio get one of those, and choose their own password from the link.

Then put a reverse proxy with HTTPS in front (Caddy, nginx, Traefik, ...) and set, in openblog.json:

"admin": {
  "secureCookies": true,              // required over HTTPS
  "trustedProxies": ["127.0.0.1"]     // the proxy's address, exact IP (no ranges)
}

Three things the proxy must do, or logins and saves are refused as cross-origin and every visitor shares one login limit:

  • Pass the original Host header through. Caddy does by default. For nginx add proxy_set_header Host $host;.
  • Add X-Forwarded-For. Caddy does by default. For nginx add proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;.
  • Reach openblog serve on the address it listens on. Keep the default --host 127.0.0.1 when the proxy runs on the same machine, so only the proxy can reach the plain-HTTP port. Use --host 0.0.0.0 or the machine's private address only when the proxy is elsewhere, and firewall the port so it is not reachable from the internet.

A minimal nginx location:

location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Run the server under a process manager (systemd, a container, or a Windows service) so it restarts with the machine, and keep .openblog/ (users, trash, analytics) out of version control and in your backups. The admin editor has the full checklist.

A common hybrid: run openblog serve --admin privately for writing, and let the Pages workflow deploy dist/ for readers. The editor's Publish button commits and pushes for you; see Publishing from home.

Docker, and Render as a web service#

The repository ships a Dockerfile that builds the engine and serves the blog in the same image with openblog serve --admin: pages, the editor, the view counter, and the analytics dashboard in one process. It suits Render, Fly, a VPS with Docker, or a NAS.

docker build -t my-blog .
docker run -p 8080:8080 \
  -e OPENBLOG_ADMIN_USER=you -e OPENBLOG_ADMIN_PASSWORD='a long passphrase' \
  -e OPENBLOG_BEHIND_PROXY=1 my-blog
  • OPENBLOG_ADMIN_USER and OPENBLOG_ADMIN_PASSWORD create the login at start (or update its password), so a host without a persistent disk still has one.
  • OPENBLOG_BEHIND_PROXY=1 tells the server an HTTPS proxy is in front: cookies are marked Secure and the client address comes from X-Forwarded-For whatever the proxy's address is. Set it on any PaaS; leave it unset when you run the container directly on plain HTTP.
  • Mount a volume at /blog/.openblog to keep users, analytics, and the trash across restarts. It does not keep posts, drafts, or photos: those are in content/ and static/, outside that folder.
  • OPENBLOG_FILES_RESET=1 tells Admin that this server's files do not last, and 0 that they do. Without it, Admin goes by Render's own RENDER=true.

render.yaml at the repository root is a Render blueprint for exactly this: create a Blueprint from the repository, and Render asks for the settings marked sync: false.

Keep your work safe on Render#

With only the admin password filled in, nothing saved in Studio lasts. The service starts again from its image at every restart and deploy, and Render's free plan has no disk. An instance that went idle has to be started again too, and we expect it to lose the files the same way, though we have not watched it happen. Saved posts, drafts, photos, settings, and view counts go, and Publish cannot push because it has no credential. While that is so, Studio shows the owner a notice on Home and a sentence after each save.

The person setting up the blog creates three things:

  1. A GitHub credential that can push to the blog's repository. A fine-grained personal access token limited to that repository, with read and write access to its contents, goes in OPENBLOG_GIT_TOKEN. An SSH deploy key works instead, but not both. If a branch is protected, the credential has to be allowed through.
  2. A Supabase project with the workspace store. Run supabase/workspace.sql in its SQL editor. Put the project's address in OPENBLOG_WORKSPACE_SUPABASE_URL and a server-side secret key in OPENBLOG_WORKSPACE_SECRET_KEY.
  3. A name for this blog's stored work. Choose one and put it in OPENBLOG_WORKSPACE_NAMESPACE: 1 to 80 letters, digits, - or _. Keep it the same from then on, and use a different one for a staging blog.

Render asks for these four when the Blueprint is created. On an existing service, add them under Environment. The three workspace settings go together: blank is fine for all three, but filling in only some stops the server from starting, with a message that says why. The token may be left blank on a public repository. On a private repository the server needs it, or the SSH deploy key, just to start if Render's build leaves out the .git folder, because it then fetches the shipped commit from GitHub.

On another host that resets its files, the same settings go in that host's own environment. Set OPENBLOG_FILES_RESET=1 there so Admin tells the owner until they are in.

Then check it yourself, following step 4 of the durable workspace guide. No one has run this setup against a live Render service and a real Supabase project from this repository; only tests against a stand-in for Supabase have. The notice in Studio goes away once the workspace is on, but it does not prove the check passed. The three things to know afterwards:

  • A free Supabase project can pause or run out of quota. Saves and startup then stop with an error rather than quietly going back to the server's files.
  • Logins come back from the environment. Login sessions, analytics, and secrets saved in Admin are not stored in the workspace, so a restart signs everyone out and view counts start again.
  • A disk in render.yaml is not a substitute. It is mounted at /blog/.openblog, which does not hold posts, drafts, or photos.

The Dockerfile assumes the blog lives in a clone of the engine repository (the layout a fork has). For a blog made with openblog init, replace the build stage with cargo install --git https://github.com/journey-to-code-org/open.blog openblog-cli.

Railway: the editor and the hosted functions#

On Railway (or any host that runs containers and keeps a disk), the editor and the hosted functions can live together in one project, with no Netlify and no Supabase. The public site can still be built by GitHub Pages from the repository, or be served by the functions' container too.

  • Postgres, Railway's own.
  • The hosted functions (service/): one container that runs the very same code as the Netlify functions over that Postgres through PostgREST, the pair Supabase is made of: notes, views and moderation; greeting cards; gifts under the tree; push notices; quote requests; received Webmentions; social publishing. It needs DATABASE_URL and PGRST_JWT_SECRET (32 or more random characters, never shared: the service key is minted from it inside the container), plus each function's own settings (OPENBLOG_SITE_ID, OPENBLOG_SITE_ORIGIN, OPENBLOG_ADMIN_API_KEY, OPENBLOG_GREETINGS_*, OPENBLOG_GIFTS_*, OPENBLOG_PUSH_*, OPENBLOG_QUOTE_*, OPENBLOG_WEBMENTION_*, OPENBLOG_SOCIAL_*, as on Netlify). Leave out SUPABASE_URL and SUPABASE_SECRET_KEY: the container sets both itself.
    • The database is set up on start. service/migrate.sh adds the roles Supabase would have and applies each SQL file the service uses, once per change: openblog moderation greetings gifts, and the files of each optional feature switched on (push; quote quote-v2; webmention; social social-return social-queue social-history social-media social-ops). OPENBLOG_SERVICE_SQL replaces the list. social-cron.sql is never applied: it needs pg_cron.
    • The schedules run in the container: due greeting cards every hour, the quote retention sweep every day, and, with OPENBLOG_SOCIAL_ENABLED=true and OPENBLOG_SOCIAL_WORKER_KEY set, the social delivery worker every minute (what pg_cron did on Supabase).
    • Quote request photos are kept in a folder instead of Supabase Storage: add a Railway volume and set OPENBLOG_STORAGE_DIR to its mount path. Without it, a request with photos is refused as unavailable. Admin's thumbnails are short-lived signed links on the service's own https address (RAILWAY_PUBLIC_DOMAIN, or OPENBLOG_SERVICE_PUBLIC_URL for a custom domain); only an image is ever sent back through one.
    • The visitor's address comes from Railway's X-Real-IP; set OPENBLOG_TRUST_X_REAL_IP=false behind any other proxy.
  • The editor: openblog serve --admin with the site cloned onto a Railway volume, publishing back to GitHub with a token scoped to that one repository, and OPENBLOG_BEHIND_PROXY=1. Point OPENBLOG_GREETINGS_ENDPOINT, OPENBLOG_GIFTS_ENDPOINT, the push, quote, social and Webmention endpoints and the engagement endpoint at the functions' public https:// address. A health or smoke check of the editor should expect /admin/ to answer 302 to /admin/studio/ and /admin/studio/ to answer 200.

Build the functions' image from the repository root with docker build -f service/Dockerfile .. A site repository can pin both to one engine commit and build them itself, as Grammi's House does with Dockerfile.admin and Dockerfile.service (and scripts/setup-family-service.sh, which prints every variable). Limit each service's rebuilds to its own files (Railway's watch paths), or every save in the editor redeploys the editor.

Leaving Netlify altogether: the site from the same container#

service/Dockerfile.site builds the site with the engine and serves it from the functions' container (OPENBLOG_SITE_DIR), doing what netlify.toml did for the pages: /a/ is /a/index.html, /a moves to /a/, exact _redirects lines are real redirects, /admin and /admin/* go (302) to OPENBLOG_ADMIN_URL (the editor's https://…/admin/), the latest-posts JSON and the feeds can be read by scripts on other sites, anything missing is 404.html, and files revalidate by ETag. Every /api/ address is the functions', except the files the build itself writes there (/api/blog.json, /api/views.json).

The pages are as of the last build, so a post with a future date appears at the next one. Rebuild the service on a schedule: a GitHub Actions workflow that runs railway redeploy --service <name> --yes every hour with a RAILWAY_TOKEN secret, or a Railway cron service that does the same.

To move a site that is on Netlify: create the Postgres and the service, copy the function settings from Netlify (without the Supabase ones), point the site's engagement.endpoint and the editor's endpoints at the service, move the domain, then stop the Netlify site. What was in Supabase stays there: export the tables you want to keep (pg_dump --data-only -t 'public.openblog_*') and load them into the new Postgres after its first start.

Getting started for a new owner#

Studio can walk a new owner through a short Getting started the first time she signs in: turn on the writing helper (only when the site has no key), tell a few short stories, and let the helper learn how she sounds from them. One switch on the server decides whether it shows by itself:

OPENBLOG_STUDIO_ONBOARDINGWhat happens
off (or unset with nothing in openblog.json)Never shows by itself. It still runs from her name's menu, and its reminder in Write is off.
onShows once per account, at the first load that comes to Home, until that account reaches You're ready or chooses Skip the rest.
on:<round>As on, and once more for every account that finished a different round. The round is 1 to 32 of a-z, 0-9 and - (for example on:2026-11-20): change it to show Getting started to everyone again without a shell.
rehearseA practice run for whoever sets the site up: it opens at every load for every account and says so on every step. Stories and voice guides made in it are not kept and never appear in Your writing voice; no account is marked as finished. A key saved in it is kept (it belongs to the site).
  • It opens with About your blog while an account hasn't answered its questions (what the blog is about, seasons, sharing, comments, how much to see). The answers decide what Studio shows that account, and are kept per account in .openblog/private/admin-preferences/. In rehearse the answers apply to that window only. Accounts that already answered (or used the old Admin's Personalize) go straight to the steps. See Your first time.
  • The server's environment beats the site's file. The variable, when set, wins over studio.onboarding in openblog.json (which takes only "off" or "on"; a new site made with openblog init says "on"). An empty variable counts as not set. A value that isn't one of the four is treated as off, with one warning line when the server starts, in openblog check, and under For the person who set up your site › Getting started on Studio's Home. It never falls back to the file.
  • Set it in the host's settings, not in a file. open.blog reads no .env file. On Railway or Render add the variable to the service (changing it redeploys the editor); with openblog serve export it in the shell or the unit file that starts the server. It is read once, at start.
  • Handing a site over. Set rehearse, sign in as the owner's account and go through it yourself. Then set on (or a new round, on:<today>): at the next start the server deletes the practice run (onboarding: cleared practice in its log) and the owner gets the real one at her next sign-in. Leaving rehearse on by mistake loses nothing of hers, but nothing she tells is kept either, and the strip on every step says so.
  • Skipping the key step. With ANTHROPIC_API_KEY (or the key of whichever company the helper uses) in the server's environment, or a key already saved, Getting started has two steps and never mentions a key. Without one, she can paste a key (kept on the server, never shown again) or leave it for you.
  • Stories told out loud are offered only when something on the server can turn a recording into words: OPENBLOG_TRANSCRIBE_COMMAND (a program on the server; nothing leaves it), a helper whose company takes audio, or OPENAI_API_KEY in the server's environment, used for audio only. GEMINI_API_KEY works the same way when OPENBLOG_TRANSCRIBE_MODEL names the model to use. The recording is deleted from the server as soon as it has been heard, whatever the outcome.
  • Where it is kept. Each account's place is a small private file under .openblog/private/onboarding/ (never in Git, never built); her stories are ordinary private voice pieces. On a host whose disk is reset, keep .openblog on the volume (or use the workspace store), or Getting started comes back and the stories are gone; Home's details say so.
  • From a shell: openblog onboarding status lists every account; openblog onboarding reset <user> (or --all) shows it again at that account's next sign-in. Home's details offer the same as Show it again at next sign-in, with Undo. Neither touches her stories.

See Getting started for what the owner sees.

Studio's words for every site on a host#

A host serving many sites can set Studio's words once for all of them: point each site's server at the same JSON file with OPENBLOG_STUDIO_WORDS_PATH (for example OPENBLOG_STUDIO_WORDS_PATH=/etc/openblog/studio-words.json holding { "vars": { "helper": "Hillside Web Care" } }). The variable is read when the server starts; the file is read each time Studio opens, so editing it needs no restart. A site's own studio.words wins per key. A file that can't be read, isn't JSON, is over 64 KiB or has more than 500 entries is set aside as a whole and reported in Studio's Home details and by openblog check as a warning. See Studio's words.

A theme that is not in the repository#

Builds in CI only see committed files. If a theme is kept out of the repository (private fonts, a design you do not want to publish), either commit it after all, add a workflow step that checks the theme out from a private repository into themes/<name>/ (a second actions/checkout with a deploy key or token), or build locally and upload dist/ instead of building in CI. A missing theme fails the build with "theme name not found".

Moving URLs#

When a post's address changes, keep the old one working with aliases in its front matter:

aliases:
  - /old-slug/
  - /2024/03/original-title/

Each alias becomes a small page that redirects to the post, carries a canonical link to the new address, and is excluded from the sitemap. An alias that collides with a real page fails the build instead of overwriting it. Pages support aliases too.

Changing postPath moves every post at once; add an alias for the old address to each post you care about, or keep postPath as it was.

Signing in with a pass#

If people already sign in somewhere you run, such as a client portal, that place can send them straight into the editor with no second password (ADR 0436). It hands each person a pass: a short note, signed with a key only it and the editor hold, good once and for two minutes.

  1. Make a long random key, 32 characters or more, and give it to both sides. On the editor it is the environment variable OPENBLOG_PASS_KEY. Keep it out of openblog.json and out of git; it is as sensitive as an owner's password.

  2. Say where people come from, and whether that is the only way in:

    "admin": {
      "passes": {
        "from": "https://portal.example.com/",
        "fromName": "your Example portal",
        "only": true      // no name-and-password sign-in at all
      }
    }
    
  3. The other system sends the person's browser to https://<the editor>/admin/enter?pass=<pass>.

A pass is v1.<claims>.<signature>. The claims are JSON, base64url without padding:

ClaimWhat it is
audThe editor's host as visitors type it, like studio.example.com
expWhen the pass stops working, in seconds since 1970. At most two minutes ahead
jtiA random id, 16 to 128 letters, digits, - or _. The editor takes each id once
subThe account to sign in as: 1 to 32 lowercase letters, digits, ., _ or -

The signature is HMAC-SHA256 of the text v1.<claims> under the key, base64url without padding. In Node:

import { createHmac, randomBytes } from "node:crypto";
const claims = Buffer.from(JSON.stringify({
  aud: "studio.example.com",
  exp: Math.floor(Date.now() / 1000) + 60,
  jti: randomBytes(16).toString("hex"),
  sub: "dale-elk",
})).toString("base64url");
const pass = `v1.${claims}.${createHmac("sha256", key).update(`v1.${claims}`).digest("base64url")}`;

The first pass naming an account makes it. openblog user list shows it as "comes in with a pass"; it has no password and can't be given one. It reaches what an owner reaches. openblog user remove <name> ends its access at once. A pass never opens an account that signs in with a password: one naming such an account is refused.

With only: true, keep no password accounts you rely on: nobody can use them. To get in without the other system (it is down, or you are setting things up), turn only off, restart, and sign in with a password account as usual.

View this page's source