Skip to content

v0.3.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Dec 13:57
· 13 commits to main since this release
43e53f7

Until now, every save in TachyonCMS went live the moment you made it, and a post couldn't have a picture. v0.3.0 fixes both. You get drafts, versions, scheduled publishing and a trash you can restore from, plus uploads with image sizes, focal-point crops and storage on local disk, S3, Azure or Google Cloud.

We also went through the whole codebase looking for ways in, and fixed everything we found. That's why the upgrade section below is long. Most of it tightens what a caller can do or see, and a few of those changes need something from you before you upgrade. Read that section first.

It's still pre-alpha. The admin screen doesn't exist yet, so keep it off public networks for now.

Get it

  • Binaries for Linux (x86_64, arm64, static) and macOS (Intel, Apple silicon) are attached below.
  • Docker: docker pull ghcr.io/tachyon-cms/tachyoncms:v0.3.0. Set TACHYON_DATABASE_URL and TACHYON_PUBLIC_URL, and it serves on port 3000.

Before you upgrade from v0.2.0

Back up your database first. Then work down this list. Each item says what changed and what you need to do.

The upgrade rewrites big tables

tachyon serve runs the new migrations when it starts, and tachyon migrate runs them on their own if you'd rather do it first. Several of them touch every row of a table you already have content in:

  • every document gets a new published_updated_at column, filled from updated_at;
  • documents gets a new unique constraint, and relations gets a new column and a rebuilt primary key;
  • sessions.ip changes from text to an address type, and any stored value that isn't an address is dropped;
  • versions gets a new index (quick from v0.2.0, since that table starts empty).

Writes to those tables wait while each one runs. On a small install you won't notice. On a big one, plan a short maintenance window and run tachyon migrate in it.

Lockouts in force are cleared, and they now count per address

The old lockout columns on accounts are gone, so any account locked when you upgrade can sign in again straight away. From now on, lockout_attempts wrong passwords (5 by default) in lockout_window lock an account only for the address they came from. The owner can still sign in from anywhere else. Ten times that from any mix of addresses locks it for everyone, except a client that already has a live session on it. Twenty times that from one address, across any accounts, gets that address a 429 with Retry-After on login, password change and the email-change password check.

What to do: if TachyonCMS sits behind a reverse proxy or load balancer, set trusted_proxies now. Without it, every request seems to come from the proxy, so all your users share one address and one set of limits. Two new settings cover this:

  • trusted_proxies (env TACHYON_TRUSTED_PROXIES): addresses or CIDR ranges, like ["10.0.0.0/8"], whose forwarding header the server believes. It's empty by default, which means the connecting address is the client and every forwarding header is ignored.
  • client_ip_header (env TACHYON_CLIENT_IP_HEADER): which one header to read from a trusted proxy. One of x-forwarded-for (the default), forwarded, x-real-ip, cf-connecting-ip, true-client-ip or fly-client-ip. Anything else stops the server at startup.

X-Forwarded-For and Forwarded are read right to left, skipping your trusted proxies, and a malformed entry falls back to the last trusted hop, never to a value the client wrote. An IPv6 client counts by its /64.

Visitors can't write unless a rule says so

Create, update, delete and publish rules no longer let signed-out callers in just because they pass. A rule of true, or a filter, now means anyone signed in, and a visitor gets a 401. To keep a public form open to everyone, name {"signedIn": false} in the rule:

"create": {"or": [{"signedIn": true}, {"signedIn": false}]}

Read rules aren't affected.

A field with only a read rule can't be written by people it hides from

Say a form's email field has read: admin so only Admins see the answers. Until now, anyone could still send it. Now someone the field hides from gets the same 422 an unknown key gets. To keep a write-only field like that, give it its own create or update rule.

Managing users can't climb past your own role

These apply to anyone with the users ability who isn't an Admin:

  • Only an Admin can grant the admin role, create or edit a role with abilities they don't hold themselves, reset an Admin's password, or change or delete an account whose role can do more than theirs.
  • You can't change your own role.
  • You can only hand out a role that access rules don't let further than your own.
  • A profile field that a rule trusts, as in {"team": "$user.team"}, can only be set to your own value or emptied. Defaults filled in on create count too.
  • When any rule reads a profile field, you can in practice only reach accounts with your own role, unless every such rule lets your role in outright.

What to do: if a non-Admin manager does any of this today, either make them an Admin or have an Admin do it.

Heading anchors start with h-

Rendered heading ids now carry a prefix: <h2 id="h-config">, h-intro-2, h-heading. That stops a heading from shadowing a page global such as window.config or clashing with your own ids. If you link to #config by hand, or have CSS or JavaScript that targets heading ids, switch to the h- form.

References come in pages

GET /api/{collection}/{id}/references used to answer every reference at once. Now it takes limit (default 10, anything above 100 counts as 100) and page, and answers docs, limit, page and hasNextPage. Any other parameter is a 400. If your code expected everything in one answer, page through it.

Writes refuse query parameters they don't know

POST, PATCH and DELETE on documents now answer 400 "unknown query parameter …" for anything they don't take. v0.2.0 ignored them. Drop stray parameters from your write calls.

Hidden fields and collections look exactly like missing ones

A field or collection you can't read now gets the same answer as one that doesn't exist. Code that relied on the old answers will see these changes:

  • Filtering or sorting on a hidden field is a 400 "unknown field". It used to be a 403.
  • Selecting or populating a hidden field is a 400, as for an unknown one, and so is selecting a virtual field whose path reaches something hidden.
  • A filter through a link into a collection you can't read is a 400 "collection x doesn't exist". It used to match nothing.
  • A write that names a field you can't read gets the 422 an unknown key gets. A field you can read but not write still gets a 403 naming it.
  • An unknown key sent as null is now reported as unknown.
  • Replacing a whole group or list that holds a field you can't see is a 403 naming the group or list.
  • On an upload write, an unknown or hidden key is a 422 before the file is looked at, not a 415 or 413.
  • GET /api/admin/collections without the Schemas ability, keys included, now gets a pruned view: only fields you can read, with access rules, filters, storage settings and other internals removed. Before, a key without the admin scope got a 403. An unreadable collection is left out of the list and is a 404 by slug.

Error lists have a ceiling

A 422 lists at most 1,000 errors, then one entry: {"path": "", "message": "and more errors, not listed"}. Each object lists at most 100 unknown fields, then unknown field, and N more not listed. Errors on fields you can't see become one entry, "a field you can't see needs fixing; ask someone who can see it". If you show every error to your editors, you'll now see at most these.

Passwords and email addresses are checked harder

  • A password that's one character repeated, or the account's own email, is refused with a 422 at setup, password change, user create and admin reset.
  • Email addresses with control characters, bidi overrides, invisible format characters (zero-width spaces, soft hyphens, variation selectors and the like), or <, > or " are refused.

What to do: a document that already stores such an address in an email field fails its next save with "expected an email address" until someone fixes the address. Sign-in isn't affected. If you've collected addresses through a public form, check for odd characters before your editors hit this.

Conflicting writes answer 409

A deadlock or serialization failure on any write is now a 409, "Another change to the same documents got in the way; try again.", where it used to be a 500. It's safe to retry, so do.

Database connections have limits

  • Statements on the serving pool stop after 35 seconds (a request gets 30), and a transaction left idle ends after 10 minutes. Schema changes, index builds and migrations lift the statement limit for themselves.
  • If you put a connection pooler such as PgBouncer in front of Postgres, it must use session pooling. Transaction pooling would hand the server's per-connection limits and advisory locks to someone else.
  • A join field returns at most 1,000 documents per call, and hasNextPage stays right.

A collection called folders stays yours

This release brings built-in folders, and they live in a collection with the slug folders. If you already made a collection with that slug, the upgrade leaves it exactly as it is: same schema, same rules, same behaviour. Built-in folders stay off on that install, the server logs why when it starts, and turning folders: true on any collection is a 409 that says the slug is taken. There's nothing for you to do. Collections can't be renamed yet, so on that install built-in folders stay off.

Markdown output escapes directive attributes

In ?format=markdown output, text inside a block directive's attributes is now backslash-escaped the same way body text is. Markdown you send in is read either way, old unescaped attributes included. If you parse the Markdown output yourself, expect the escapes.

If you ran a build of main

These changed after the media library landed on main, so they only matter if you deployed main between releases:

  • The JSON part of a multipart upload is now called _data. The name main used before still works, but send _data from now on.
  • Client uploads must send every header in the upload instructions' request.headers, exactly as given. S3 and Google Cloud Storage now sign content-disposition: attachment, and Google Cloud Storage also signs x-goog-content-length-range. A client that hard-coded only content-type gets turned away by the bucket.
  • A storage public_url on the CMS's own host, on any port, or on a host under it, stops the server at startup. Serve the bucket from a separate host.
  • jobs.workers must leave 3 * workers + 1 connections in the pool, where it used to be 2 * workers + 1, and database_pool must be at least 3.

What's new

  • Drafts. Turn on drafts for a collection or global and every save lands on a draft. Readers keep seeing the published copy until someone with the publish right publishes it, and ?draft=true reads the draft for anyone with readDrafts. A draft save no longer moves the updatedAt that published readers see, so nobody can watch which posts you're working on.
  • Versions. With versions on, every save and publish keeps a copy. List them, read one, diff any two, restore one, and cap how many you keep with maxVersions.
  • Scheduled publishing. PUT /api/{collection}/{id}/schedule publishes or unpublishes at a set time. A jobs worker runs it, and a job runs once even across several servers.
  • A trash you can get back from. List what's trashed, restore it (it's checked against today's schema), or purge it. New rights readDrafts, readVersions and publish, and a <collection>:publish key scope, come with all of this, and /api/access reports them.
  • Uploads. Give a collection upload options and each document holds a file. Image sizes are made in the background, in WebP and AVIF if you like, cropped around a focal point you can move later without uploading again. Paste a URL and the server fetches it, refusing private and internal addresses on every redirect. Point at files with an upload field or an upload node in rich text, which renders as <picture> with a srcset per format.
  • Storage where you want it. Local disk, S3 (R2 and MinIO included), Azure Blob and Google Cloud Storage. Credentials come only from the environment. Public buckets can serve files directly, private ones get short-lived signed links, and big files can go straight from the browser to the bucket.
  • Uploads that can't hurt you. GPS and other metadata are stripped, decompression bombs are capped at max_pixels, bytes hidden after an image ends are cut, SVGs are sanitised, and anything that could run a script is served sandboxed or as a download.
  • Folders. A built-in folders collection, made at startup, for sorting files and documents.
  • Big schema changes don't time out. A change past 2,000 rows (documents, trashed ones and their versions) goes to a job worker. You get 202 Accepted with the job in the body and a Location header pointing at GET /api/admin/jobs/{id}, which needs the schemas right. Once the job is done or failed, result holds what the request would have answered. Once the database holds more than 100,000 documents, a change that builds an index runs as a job too, and so does creating a collection with a unique or filterable field (a schema_create job). With workers = 0, those jobs wait for another server to pick them up.
  • Read it, change it, send it back. A document read at the default depth, links populated, now saves straight back. Populated links count as their IDs, and the id, createdAt, updatedAt, status and publishedAt a read adds go back unchanged. PATCH never publishes: a bad status is told to use POST /api/{collection}/{id}/publish.
  • Markdown saves keep what you couldn't see. A Markdown read leaves out links and nodes to documents you can't read. Send it back and those now go back in, near where they were, so fixing a typo can't delete an editor's link you never knew was there.
  • Narrowing a link field doesn't freeze old documents. After you take a collection off a rich-text field's relationTo or upload.collections with "confirm": true, links already stored to it stay, and they no longer block saves that don't send that text. A stale link you do send is still a 422 naming it, even when you send the text back unchanged, so remove the link to save it. A Markdown save puts hidden stale nodes back like any other hidden node.
  • Sessions show where they signed in. GET /api/auth/sessions shows each session's sign-in address, worked out with the same trusted_proxies rules. Only the session's owner sees it.

New settings

Setting Env Default What it does
database_pool TACHYON_DATABASE_POOL 10 Connections in the server's pool, from 3 to 1000.
trusted_proxies TACHYON_TRUSTED_PROXIES empty Proxies whose client-address header is believed.
client_ip_header TACHYON_CLIENT_IP_HEADER x-forwarded-for The one header read from a trusted proxy.
[jobs] workers TACHYON_JOBS__WORKERS 2 Job workers on this server, at most 16; 0 leaves jobs to other servers.
[uploads] max_file_size TACHYON_UPLOADS__MAX_FILE_SIZE 25MB The biggest upload.
[uploads] max_pixels TACHYON_UPLOADS__MAX_PIXELS 50000000 The most pixels any decode may hold, counted across frames.
[uploads] temp_dir TACHYON_UPLOADS__TEMP_DIR /var/tmp/tachyon Where uploads are spooled.
[uploads] timeout TACHYON_UPLOADS__TIMEOUT 10m How long an upload may take.
[storage.<name>] TACHYON_STORAGE__<NAME>__* local ./uploads Where files go; credentials only from the environment.

The workers have to leave room for requests: database_pool must be at least 3 * workers + 1. The defaults (10 and 2) fit. If yours don't, the server won't start, and it tells you exactly what to change:

jobs.workers is 4, but the database pool has 10 connections; each worker can hold three and requests need one, so use at most 3 or raise database_pool to 13

The spool directory is created 0700. A symlink, one owned by another user, or one other users can write to stops the server at startup with a message saying how to fix it. Every duration setting is capped at 3,650 days.

Fixes

  • /api/access no longer offers draft writes that are always a 403. With no draft reads at all, update and delete are false; with readDrafts as a filter or own-only, they're "conditional". Globals and field answers follow the same rule. Profile fields a rule trusts are reported the way the write routes judge them.
  • Filters on createdAt and updatedAt compare to the microsecond on every operator, so a value copied from a read finds its own document, and cursor paging over them has no gaps. A raw + in a URL offset now gets a 400 telling you to send %2B.
  • Lowering maxVersions gets a 409 that says it only deletes old versions, instead of claiming fields would change. Thanks to @bfs2021.
  • A title longer than 200 bytes no longer fails its create on a generated slug. The slug is cut to 200 bytes on a character boundary.
  • A document with millions of inbound links no longer reads them all for every page of /references. Paging happens in the database.
  • Checking a document's links is linear: 60,000 links take well under a second, down from 22.
  • Schema changes no longer lock writes to every collection while a unique index builds. Indexes are built concurrently first, and orphans are swept at startup.
  • Schema saves made inside requests share the connections the workers leave, and one that can't start within 5 seconds gets a 409, "another schema change or index build is running; try again in a moment". Creating a collection whose slug is taken is a 409 straight away.
  • A lost commit answer no longer drops a new unique index while the unique schema stays stored, and a change won't commit a unique field whose index another server dropped.
  • media is a free collection slug again. upload-instructions is reserved instead.

Security hardening

Sign-in and accounts:

  • Each login attempt is counted before the password is checked, so a burst of parallel logins gets no more tries than the limit. A locked account and an unknown email answer the same, in the same time.
  • Wrong current passwords on a password change or email change count toward the lockout.
  • Password hashing waits for a turn from a gate sized to the machine's cores. With no turn after 2 seconds, you get a 429 with Retry-After: 1, "Too many passwords are being checked right now; try again in a moment.", and it doesn't count toward the lockout.
  • A new password, yours or one an Admin sets, signs out every other session and revokes every API key the account has. A new email signs out your other sessions.
  • A login that raced a password change can't keep a session made with the old password.
  • Expired and idle sessions are deleted by an hourly sweep.

Headers and the network:

  • When public_url is https, every answer, 404s and timeouts included, carries Strict-Transport-Security: max-age=31536000. Browsers will then insist on https for that host for a year.
  • A signed-in answer with no Cache-Control gets no-store, and so do login answers and new API key secrets. Every answer carries X-Content-Type-Options: nosniff, X-Frame-Options: DENY and Referrer-Policy: no-referrer. Thanks to @jdotc1 for both.
  • A deeply nested blob: Origin header could crash the whole server through the url crate (RUSTSEC-2026-0592). url is updated, and any Origin that isn't http:// or https:// is refused before it's parsed. rustls-webpki, webpki-roots, webpki-root-certs and ctutils are updated past their advisories too.
  • Server-side fetches refuse the Azure WireServer address, 168.63.129.16, along with private and internal ranges.

Who sees what:

  • Version history follows the document. /versions, /diff and restore judge the published copy as well as the draft, so another Author can't read your unpublished post's history, and a document nobody can see is a 404.
  • A version restore follows the same file-field rules as an update, so it can't rename a file you may not rename.
  • A key ending in the marker used for hidden fields can no longer tell a hidden field from a missing one.
  • Validation errors on fields you can't see no longer count toward the 1,000-error ceiling, so the count can't hint at them.
  • Routes that judge other collections' rules, like the schema list and folders, load your profile, so $user rules no longer fail closed there.

Uploads:

  • An upload can't take over the URL of another file's image size. Every name a file is served under counts as taken, and a size name that would clash is numbered apart, like logo-40x30-1.png.
  • Every type the file route sandboxes, except sanitised SVG, is stored in buckets with Content-Disposition: attachment, so a public bucket URL can't run HTML or XML. Existing objects are stored again by a one-time job.
  • Changing filenameCompoundIndex re-scopes files, and a change that would leave two documents serving one name is a 409 listing the names.
  • New upload instructions give up only your own earlier pending upload, not another editor's.
  • Whole-file reads for SVG sanitising and image probes wait their turn with decoding, so they can't run the server out of memory.

Input that cost too much:

  • A body of many unknown keys took quadratic time to refuse: 20,000 keys took 9 seconds. A body of millions of bad rows answered gigabytes of errors. Version diffs over long lists and rich-text directives with many attributes were quadratic too. All of them are now linear and capped.

Supply chain:

  • cargo deny check advisories runs on every pull request, daily on a schedule, and in the release before anything is built.
  • A release now waits in a release environment, tags only after every target has built and passed, and pull-request dry runs get read-only tokens.
  • The vendored avif-decode is checked in CI against the published crate plus one patch file.
  • Every binary records its dependency tree, each archive has an SPDX SBOM, the checksums are signed with cosign, the archives and the image carry build provenance, and the image is signed.

Thanks

To @foothillsdigital, who became a maintainer during this release and reviewed every fix that went into its last stretch. To @jdotc1 for the security headers, the no-store on secrets and a clearer README (#60, #61, #191). And to @bfs2021 for an honest maxVersions message (#188). There are more good first issues waiting.

Verify a download

cosign verify-blob \
  --certificate-identity 'https://github.com/tachyon-cms/tachyoncms/.github/workflows/release.yml@refs/heads/main' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  --bundle checksums.txt.sigstore.json checksums.txt
sha256sum --check --ignore-missing checksums.txt

Full changes: v0.2.0...v0.3.0