Chronos/DBWaitlist

Changelog / Chronos Gateway

Chronos Gateway 0.3.0

The image can start its engine again; MySQL and MariaDB; Undo a merged run

With Chronos DB 0.5.012 changesDownloads

  • The image can start its engine again. In the 0.2.11 image the engine (/usr/local/bin/chronos) had mode 0700 and belonged to root, while the image runs as user 65532: the gateway started, and then POST /v1/connect answered running /usr/local/bin/chronos attach: Permission denied (os error 13). The image now sets both programs to 0755 whatever the build machine's files had, and the release build fails if either is anything else. The installer's binaries were never affected.
  • MySQL and MariaDB. POST /v1/connect/check and POST /v1/connect take a mysql:// or mariadb:// URL (MySQL 8.0 or later, MariaDB 10.5 or later), and runs then work as beside Postgres: a world per run holding one tenant's rows, the rules, approvals, and a write to the database in one transaction with every row locked and compared. Agents write the same SQL (the engine's, Postgres's dialect) whatever the database. Not yet beside MySQL: binary columns, act_as, and GATEWAY_FOLLOW. The check says each of these per table or as a warning. The console's connect step takes either URL.
  • Undo a merged run. POST /v1/runs/:id/undo puts back every row the run wrote, as it was before, through the database as any merge goes: each row locked and compared, one transaction. preview: true says what would go back, in words, and which rows changed since; skip_changed: true leaves those and undoes the rest. A run becomes undone or partly_undone, and merge.undone or merge.undo_conflict is sent. A run keeps its merges' ids (merges). Beside Postgres, MySQL and MariaDB, for 30 days after the merge, with engine 0.5.0 or later. The preview names the tables the database would change besides the run's own (a cascade; Postgres only) and the effects that aren't undone, and an undo that would cascade needs allow_cascade. The console's run page has an Undo button: always the preview first, then one button. Not yet: an Undo button in Slack.
  • Runs add rows to AUTO_INCREMENT tables beside MySQL and MariaDB, with engine 0.4.12 or later: the row has a provisional id (negative) in the run, and MySQL's own once merged. The check's inserts is false only where the column is narrower than INT or is BIGINT UNSIGNED. Generated columns are attached (listed as generated), and a column with an expression default (DEFAULT CURRENT_TIMESTAMP) is no longer refused as one.
  • A run's reads are checked against MySQL and MariaDB, with engine 0.4.11 or later: a row a run read that changed in the database since holds its merge, as beside Postgres. The gateway asks the engine whether it can; with an older engine the default rules leave check_reads off, and PUT /v1/policy refuses to turn it on.
  • MongoDB. POST /v1/connect/check and POST /v1/connect take a mongodb:// URL (MongoDB 5.0 or later, a replica set), with an engine built with MongoDB (0.5.0 or later). A collection is attached as a table of _id, the fields named in fields (the tenant's among them), and the rest of each document. Runs work as beside Postgres: a world per run holding one tenant's documents, the rules, approvals, undo, and a write to MongoDB in one transaction with every document compared, only the changed fields sent. A run has MongoDB's own tools over MCP and POST /v1/runs/:id/mongo (find, count, insert, update_one, update_many, delete_one, delete_many), each run as SQL in its world, and SQL as before. Changes read by field path. Not yet beside MongoDB: $regex, aggregate, date ranges in filters, array elements changed one by one, masks on a field that isn't a column, sharded clusters, act_as, GATEWAY_FOLLOW. The console's connect step takes the URL.
  • MongoDB's tools, fixed before any release: an update or delete with no filter is refused (it matched every document); two updates of one document at once no longer undo each other; a sort by several fields is an array, which keeps its order; {"_id": 1} projects only _id; a string _id of 24 hex digits stays a string on insert; mongodb+srv:// URLs connect (the driver lacked DNS seed-list support).
  • Several databases behind one gateway. POST /v1/connect {name, ...} connects one more database beside the first, each with its own engine, tenant column, rules, labels and masks. A run names its database (source), and requests name theirs with X-Chronos-Source or ?source=; without one they mean the first, so nothing changes for a gateway with one database. GET /v1/sources lists them, events say source, and the console has a picker. The start-up settings, the model reviewer and Chronos Cloud's link are the first database's only.
  • High availability. With GATEWAY_STORE_URL the gateway keeps its store in a Postgres, and several gateways sharing it and one data folder take turns leading: the leader runs the engines, the others send their requests to it, and when it is lost another leads within about 15 seconds. GATEWAY_NODE_URL says how they reach each other. The Helm chart has ha.enabled. See docs/high-availability.md for what it needs and its limits. Without the setting nothing changes: SQLite, one gateway.
  • A run whose world was lost when the engine stopped hard (unmerged work isn't kept through a crash) now says so: 409 world_lost, the run failed, run.failed sent. Before, its calls answered the engine's own 404.
  • Extension points (src/ext.rs): a binary can build more into the gateway at fixed points (an approval about to merge, webhook formats, endpoints, the leader's work). The open gateway has none built in; its command line is now cli::run, which such a binary starts with its own. An approval an extension holds for more people answers waiting, and the console and the widget say so.
  • Sign-in can be built in beside OpenID Connect's (src/ext.rs: sign_in, login, person): the gateway then has sign-in without GATEWAY_OIDC_ISSUER, with who may approve and who is an admin from GATEWAY_SSO_ALLOW and GATEWAY_SSO_ADMINS (the GATEWAY_OIDC_ names still work). An extension may say who a person is to a directory, asked at each request, so access taken away there ends at once. Nothing changes for OpenID Connect.
Chronos Gateway 0.3.0 · Chronos