Skip to content

CMS Harness 0.3.0

Choose a tag to compare

@github-actions github-actions released this 27 Nov 05:58
· 170 commits to main since this release

More than a website

0.3 turns the harness from a website with an admin into an environment: one program that holds the data, the back end, and a screen for each kind of user. Everything is still a draft until a person publishes it.

New

  • Surfaces (端). The site is the first one. The assistant builds another for each kind of user (/teacher/, /student/), each with its own pages and its own rule for who may enter, over data the whole environment shares. The system guards the door.
  • Server functions. A site file under _fn/ is code the server runs: _fn/order.js answers at /_fn/order. It runs in a sandbox (QuickJS) with no network, files or timers, with caps on time and memory, and one run is one transaction. run_function tries a draft without writing anything.
  • Rules as conditions. read, create, update and delete on a collection take a keyword or a condition such as record.owner == member.id or member.kind == 'teacher'. A read rule also filters every list, total and search result.
  • Member attributes and token login. Members carry attributes a builder defines; rules, doors, pages and functions read them. Clients without cookies (mini programs, apps) log in with "session": "token".
  • Notifications. Paste the webhook address of a Feishu (Lark) or WeCom group robot, or an address of your own, in Settings → Notifications. Messages go out on submissions, publishes and sign-ups, and a function sends its own with notify().
  • Photos need no preparing. Uploads are stored upright, without EXIF, at 2560 pixels at most, and compressed. img() writes a whole responsive image tag.
  • Protection built in. Rate limits, scanner paths, AI crawlers and scripting tools, and an in-browser proof of work, in front of everything the environment serves. It has no page and no setting in the admin: its level is set in the code.
  • The assistant checks its own work with check_page, keeps a task list, and may take 100 steps a turn.
  • Managing data. Every list can be searched, exported as CSV, and filled from a CSV as drafts. aggregate_records totals a collection.
  • Settings is one row a setting, each showing its current value.

Notes for upgrading

  • Building from source needs Rust 1.98 or newer.
  • The database is migrated on start. Pictures uploaded before 0.3 are left as they are.
  • The Feishu and WeCom message formats follow their documentation and were not tried against live robots before this release: use Send a test after adding one.

Details: README · SECURITY.md

Full Changelog: v0.2.1...v0.3.0