Repository navigation
CMS Harness 0.4.0
Ready for real use
0.4 is about running a site for real: on Postgres or SQLite, under its own domain with HTTPS, with an assistant that asks before anything goes live, can be left to do things at set times, and can call other companies' services without ever holding their keys.
New
- The assistant asks before it publishes. It sends a publish request: a card in the chat and a row on the Publish page, and a person decides. A standing approval, in the admin's own words, lets it publish directly.
- Things done at set times. "Every morning at 8, sum up yesterday's orders": a routine is an instruction the assistant carries out by itself at its time, then waits for a yes (or publishes, with a standing approval). The Environment page lists routines and their runs.
- SQLite or Postgres. Set
HC_DATABASE_URLand the whole environment is on Postgres; the first start moves everything across by itself, and back again. TLS to Postgres assslmodesays. The whole test suite passes on both. - Its own domain, HTTPS by itself.
HC_TLS=autoserves HTTPS on 443 and 80 with certificates from Let's Encrypt, renewed on their own. Each surface can be on its own subdomain (teacher.example.com) with one wildcard DNS record. - Outside services. In Settings → Outside services a builder registers a payment, text-message, map or AI service with its address and key. Functions call it with
services.call(name, path, …); the server puts the key on, sends only to that address, never into the private network, and takes the key out of the answer. Keys are stored encrypted and never shown again.services.sign,services.verifyandservices.hmacsign and check (Alipay RSA2, WeChat Pay, Alibaba Cloud, AWS SigV4, Tencent TC3) without the key leaving the server. A trial run sends nothing and signs nothing. - Bring in a project you have. Upload a built site or web app as a zip (or
wrap_project): it becomes a surface, its back-end calls point at the surface's functions, andcheck_endlists what is left to fill in. - Pages that follow the data. A list's
cursorand/changes?after=…(pulled, or streamed withEventSource) give what changed since, under the same read rules. - Change many records at once.
change_recordssets fields, runs a small script per record, deletes or hands records over, up to 10,000 in one batch, as drafts a person publishes with one click. Releases can be listed and undone. Every record has a version, and a change made on an old one is refused instead of overwriting. - Members upload files of their own (opened only by who may see the record), end every session, and change their password.
- Functions share code through imports, write up to 500 records in one call, read and set members' attributes, see the request as it was sent, and can be called by a timer. A function that only reads runs beside the others.
- Rules look further:
exists(…), a relation's fields (record.article.dept),now,todayandin. - Collections can keep no history and stay out of search (sensor readings, logs), take indexes over two or three fields, and list without counting (
total: false). - Notifications reach DingTalk, Slack, Discord, Telegram, Teams, Google Chat, Bark, ntfy, ServerChan and PushPlus too.
Faster
- Pages and API reads have database connections of their own and do not wait for writes.
- Answers are gzipped; a cached page asks the database nothing.
- Publishing reads and writes in batches: 20,000 drafts with a unique field, a relation and links went from 178 s to 5.3 s on Postgres, and from 2.2 s to 0.5 s on SQLite.
- A stream of logins no longer grows a small server's memory: on a 1-CPU, 256 MB server, two bursts of 300 login attempts, 64 at a time, peaked at 67 MB.
Notes for upgrading
- Building from source needs Rust 1.98 or newer. The database is migrated on start.
- The assistant now asks before publishing. Give it a standing approval in the chat if you want the old behaviour.
- Outside services' keys are encrypted with
HC_SECRET_KEY, or asecret.keythe server makes in its data folder. It is not in backups: take it along when moving to a new server, and give servers sharing one database the same one, or the keys must be entered again. HC_TLS=autoneeds ports 80 and 443 andHC_ORIGINset to thehttps://address.- The new notification formats follow each service's documentation and were not tried against live robots: use Send a test after adding one.
Details: README · SECURITY.md
Full Changelog: v0.3.1...v0.4.0