arc-kernel 0.1.3__tar.gz → 0.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/Install.md +79 -41
  2. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/PKG-INFO +11 -1
  3. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/README.md +9 -0
  4. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/__init__.py +1 -1
  5. arc_kernel-0.1.6/arc/backup.py +852 -0
  6. arc_kernel-0.1.6/arc/backupcmd.py +537 -0
  7. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/cli.py +302 -94
  8. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/deploy.py +128 -12
  9. arc_kernel-0.1.6/arc/deploy_settings.py +55 -0
  10. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/doctor.py +64 -10
  11. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/errors.py +7 -5
  12. arc_kernel-0.1.6/arc/expiring.py +59 -0
  13. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/log.py +42 -10
  14. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/log_collector.py +4 -2
  15. arc_kernel-0.1.6/arc/masterkeycmd.py +254 -0
  16. arc_kernel-0.1.6/arc/permissions.py +189 -0
  17. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/runtime.py +8 -0
  18. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/secrets.py +20 -0
  19. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/settings.py +210 -27
  20. arc_kernel-0.1.6/arc/store.py +505 -0
  21. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/tracing.py +11 -14
  22. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/tz.py +3 -3
  23. arc_kernel-0.1.6/arc/uuid7.py +78 -0
  24. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/docs/arc-kernel.MD +18 -8
  25. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/pyproject.toml +2 -1
  26. arc_kernel-0.1.6/tests/test_backup.py +565 -0
  27. arc_kernel-0.1.6/tests/test_backup_cli.py +660 -0
  28. arc_kernel-0.1.6/tests/test_cli_restart.py +148 -0
  29. arc_kernel-0.1.6/tests/test_cli_settings_list.py +172 -0
  30. arc_kernel-0.1.6/tests/test_cli_settings_set.py +144 -0
  31. arc_kernel-0.1.6/tests/test_deploy_settings.py +110 -0
  32. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_deploy_split.py +149 -0
  33. arc_kernel-0.1.6/tests/test_doctor_cpu.py +144 -0
  34. arc_kernel-0.1.6/tests/test_expiring.py +93 -0
  35. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_log_collector.py +19 -0
  36. arc_kernel-0.1.6/tests/test_master_key.py +315 -0
  37. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_new_plugin_scaffold.py +20 -0
  38. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_nginx_routes.py +83 -2
  39. arc_kernel-0.1.6/tests/test_operator_only_settings.py +85 -0
  40. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_permissions.py +158 -1
  41. arc_kernel-0.1.6/tests/test_setting_descriptions.py +576 -0
  42. arc_kernel-0.1.6/tests/test_setting_types.py +212 -0
  43. arc_kernel-0.1.6/tests/test_settings_who_and_when.py +71 -0
  44. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_uuid7.py +58 -7
  45. arc_kernel-0.1.3/arc/backup.py +0 -501
  46. arc_kernel-0.1.3/arc/backupcmd.py +0 -305
  47. arc_kernel-0.1.3/arc/permissions.py +0 -120
  48. arc_kernel-0.1.3/arc/store.py +0 -288
  49. arc_kernel-0.1.3/arc/uuid7.py +0 -57
  50. arc_kernel-0.1.3/tests/test_backup.py +0 -490
  51. arc_kernel-0.1.3/tests/test_backup_cli.py +0 -329
  52. arc_kernel-0.1.3/tests/test_cli_restart.py +0 -77
  53. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/.gitignore +0 -0
  54. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/LICENSE +0 -0
  55. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/_state.py +0 -0
  56. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/codec.py +0 -0
  57. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/crypto.py +0 -0
  58. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/errorscmd.py +0 -0
  59. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/events.py +0 -0
  60. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/health.py +0 -0
  61. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/healthcmd.py +0 -0
  62. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/kernel.py +0 -0
  63. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/metrics.py +0 -0
  64. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/plugin_cli.py +0 -0
  65. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/py.typed +0 -0
  66. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/registry.py +0 -0
  67. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/resolver.py +0 -0
  68. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/sizing.py +0 -0
  69. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/status.py +0 -0
  70. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/stubs.py +0 -0
  71. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/supervision.py +0 -0
  72. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/arc/update.py +0 -0
  73. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/setup.sh +0 -0
  74. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/__init__.py +0 -0
  75. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/conftest.py +0 -0
  76. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_boot.py +0 -0
  77. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_cli_perform.py +0 -0
  78. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_cli_run_console.py +0 -0
  79. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_connection_budget.py +0 -0
  80. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_connection_plan_cli.py +0 -0
  81. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_crypto.py +0 -0
  82. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_deploy_sizing.py +0 -0
  83. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_errors.py +0 -0
  84. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_errors_cmd.py +0 -0
  85. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_events.py +0 -0
  86. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_kernel.py +0 -0
  87. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_log.py +0 -0
  88. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_logs_serve.py +0 -0
  89. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_metrics.py +0 -0
  90. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_nginx_metrics.py +0 -0
  91. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_process_registry.py +0 -0
  92. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_resolver_versions.py +0 -0
  93. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_run_async.py +0 -0
  94. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_run_lock.py +0 -0
  95. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_secrets_provider.py +0 -0
  96. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_settings.py +0 -0
  97. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_status.py +0 -0
  98. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_supervision.py +0 -0
  99. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_tracing.py +0 -0
  100. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_tz.py +0 -0
  101. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_update.py +0 -0
  102. {arc_kernel-0.1.3 → arc_kernel-0.1.6}/tests/test_worker_count.py +0 -0
@@ -25,7 +25,7 @@ Most of the time is spent waiting on package downloads; the ARC steps themselves
25
25
  9. [Build the Admin UI](#9-build-the-admin-ui)
26
26
  10. [Start ARC](#10-start-arc)
27
27
 
28
- Then: [verify](#verify-everything), [keep it running and put it on the internet](#keep-it-running-and-put-it-on-the-internet), [troubleshooting](#troubleshooting), [updating](#updating).
28
+ Then: [verify](#verify-everything), [keep it running and put it on the internet](#keep-it-running-and-put-it-on-the-internet), [troubleshooting](#troubleshooting), [updating](#updating), [upgrading PostgreSQL from 14](#upgrading-postgresql-from-14).
29
29
 
30
30
  ---
31
31
 
@@ -37,13 +37,13 @@ Then: [verify](#verify-everything), [keep it running and put it on the internet]
37
37
  | Python | the kernel and every plugin | **3.12 or newer** (`uv` can fetch it for you) |
38
38
  | [uv](https://docs.astral.sh/uv/) | builds the project environment (`arc init` / `arc install` call `uv sync`); supplies Python 3.12 if needed | any recent version |
39
39
  | git | `arc init` and `arc install` clone repositories | any |
40
- | PostgreSQL | all data (the `pgdb` plugin) | **14 tested.** 13+ should work, see the note in step 4. |
40
+ | PostgreSQL | all data (the `pgdb` plugin) | **14 and 18 tested** (14.24 and 18.6). 13 and 15 to 17 should work, see the note in step 4. PostgreSQL 14's last release is 12 November 2026. |
41
41
  | Redis or Valkey | caching, locks, rate limiting, background jobs (the `redix` and `lineup` plugins) | Redis 6.0 tested. Valkey is supported but was not tested. |
42
42
  | Node.js + Yarn 1 | **only** to build the Admin UI | Node 20 (the UI pins `20.20.2` in `.nvmrc`), Yarn 1.x ("classic") |
43
43
 
44
44
  You do not need a compiler or any `-dev` libraries: every Python dependency installs from a prebuilt wheel.
45
45
 
46
- **How this guide was checked.** The steps below were run from an empty directory against a freshly initialised, private PostgreSQL 14.24 and Redis 6.0.16, on Ubuntu 22.04 with Python 3.12, Node 20.20.2 and Yarn 1.22.22 — ending in a real login and successful calls to the Admin API. In that run the repositories were cloned from local copies confirmed to be at the same commits as GitHub's `main`. Step 3 was then checked separately against the published PyPI package, version 0.1.1: `pip install arc-kernel` inside a Python 3.12 virtualenv, `uv tool install arc-kernel`, and the failure quoted there on Python 3.10; then `arc init` with the kernel cloned straight from GitHub (it wrote `.vscode/settings.json` and `.gitignore` excluded the settings store), `arc install` of `pgdb` from GitHub, and `arc doctor` (the later steps were not repeated on that second project). Things that were **not** run are marked *(not run)*: `arc deploy prod` (system-wide units, nginx and certbot — its units were checked with `systemd-analyze verify` and unit tests only), the server-wide `setup.sh`, Valkey, and every OS other than Ubuntu. `arc deploy dev` was run against a scratch project and driven through crash tests under a real `systemd --user` manager, and `arc deploy dev --enable` was used to switch a running server from the old single `arc run` unit (about 9 seconds of downtime for the switch).
46
+ **How this guide was checked.** The steps below were run from an empty directory against a freshly initialised, private PostgreSQL 14.24 and Redis 6.0.16, on Ubuntu 22.04 with Python 3.12, Node 20.20.2 and Yarn 1.22.22 — ending in a real login and successful calls to the Admin API. In that run the repositories were cloned from local copies confirmed to be at the same commits as GitHub's `main`. Step 3 was then checked separately against the published PyPI package, version 0.1.1: `pip install arc-kernel` inside a Python 3.12 virtualenv, `uv tool install arc-kernel`, and the failure quoted there on Python 3.10; then `arc init` with the kernel cloned straight from GitHub (it wrote `.vscode/settings.json` and `.gitignore` excluded the settings store), `arc install` of `pgdb` from GitHub, and `arc doctor` (the later steps were not repeated on that second project). Things that were **not** run are marked *(not run)*: `arc deploy prod` (system-wide units, nginx and certbot — its units were checked with `systemd-analyze verify` and unit tests only), the server-wide `setup.sh`, Valkey, and every OS other than Ubuntu. `arc deploy dev` was run against a scratch project and driven through crash tests under a real `systemd --user` manager, and `arc deploy dev --enable` was used to switch a running server from the old single `arc run` unit (about 9 seconds of downtime for the switch). PostgreSQL 18.6 (the official container image) was then checked separately against a private copy of a project: the whole integration suite, every plugin's migration onto an empty database, `arc doctor --deep` and `arc health`, a real login, Admin API writes with audit history and trash, a foreign-key refusal, a background job with a signed file download, and `arc backup create`, `verify` and `restore` into a new database. The reference project's own server was then upgraded from 14 to 18.6 in place with `pg_upgradecluster` (see [Upgrading PostgreSQL from 14](#upgrading-postgresql-from-14)), and its integration suite passed on the upgraded server. Step 1's apt commands for 18 were run on that machine, which already had 14, so a clean machine with only 18 was not; the role and database of step 4 were created by hand in the 18 container. 13 and 15 to 17 were not run.
47
47
 
48
48
  ---
49
49
 
@@ -53,9 +53,13 @@ On Ubuntu or Debian:
53
53
 
54
54
  ```bash
55
55
  sudo apt update
56
- sudo apt install -y git curl postgresql redis-server
56
+ sudo apt install -y git curl redis-server postgresql-common
57
+ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y # adds the PostgreSQL project's apt repository
58
+ sudo apt install -y postgresql-18 postgresql-client-18
57
59
  ```
58
60
 
61
+ PostgreSQL 18 comes from the PostgreSQL project's own apt repository because Ubuntu 22.04's repositories only carry 14, whose last release is 12 November 2026. The helper script adds the repository and its signing key (the PostgreSQL project's key, fingerprint `B97B 0AFC AA1A 47F0 44F2 44A0 7FCC 7D46 ACCC 4CF8`). Installing `postgresql-client-18` matters: PostgreSQL's own backup tools refuse to dump a server newer than themselves, and when several versions are installed `pg_dump` resolves to the newest. If you would rather use the distribution's version, `sudo apt install -y git curl postgresql redis-server` still works (14 on Ubuntu 22.04, which is also tested); [Upgrading PostgreSQL from 14](#upgrading-postgresql-from-14) covers moving later.
62
+
59
63
  Make sure both servers are running:
60
64
 
61
65
  ```bash
@@ -66,7 +70,7 @@ redis-cli ping
66
70
 
67
71
  `pg_isready` should say `accepting connections` and `redis-cli ping` should answer `PONG`.
68
72
 
69
- > **Other systems** *(not run)*. ARC needs PostgreSQL's **`pgcrypto`** extension. On Debian and Ubuntu it ships inside the main `postgresql` package. On Fedora/RHEL install `postgresql-contrib` as well. On macOS, `brew install postgresql@14 redis` works the same way. For Valkey, install it in place of Redis — ARC talks to either, and `arc redix connect` accepts `redis-cli` or `valkey-cli`.
73
+ > **Other systems** *(not run)*. ARC needs PostgreSQL's **`pgcrypto`** extension. On Debian and Ubuntu it ships inside the main server package. On Fedora/RHEL install `postgresql18-contrib` as well. On macOS, `brew install postgresql@18 redis` works the same way. For Valkey, install it in place of Redis — ARC talks to either, and `arc redix connect` accepts `redis-cli` or `valkey-cli`.
70
74
 
71
75
  **Node.js and Yarn** — only needed for step 9. Install Node 20 from your package manager, [nodesource](https://github.com/nodesource/distributions) or [nvm](https://github.com/nvm-sh/nvm), then:
72
76
 
@@ -149,7 +153,9 @@ Generate the password with `openssl rand -hex 16` so it contains nothing that ne
149
153
  - role owns the database → works, no superuser needed
150
154
  - database owned by someone else → fails with `permission denied to create extension "pgcrypto"`
151
155
 
152
- ARC does not need a superuser, `CREATEDB`, or `CREATEROLE` — and you should not grant them. Only PostgreSQL 14 was tested. Trusted extensions were introduced in PostgreSQL 13, so 13 should behave the same, but on 12 and older you would need a superuser to create the extension first.
156
+ ARC does not need a superuser, `CREATEDB`, or `CREATEROLE` — and you should not grant them. This was verified on PostgreSQL 14 and 18 (on 18 the database owner installed `pgcrypto` in an empty database). Trusted extensions were introduced in PostgreSQL 13, so 13 should behave the same, but on 12 and older you would need a superuser to create the extension first.
157
+
158
+ **PostgreSQL 18 and newer generate ids natively.** Every table's `id` is a UUIDv7 made by a database function, `arc_uuid_generate_v7()`. When `arc pgdb migrate` runs on PostgreSQL 18 or newer, that function becomes a thin wrapper over the server's own `uuidv7()`: about three times faster, and ids made in one session come out strictly in order. On 14 to 17 it keeps its own implementation, which is the reason `pgcrypto` is needed there; that one also keeps ids made in one session in order, by writing the elapsed part of the millisecond into the bits after the timestamp. A server upgraded in place keeps the old implementation until the next `arc pgdb migrate`; either way, ids made before and after sort together by time.
153
159
 
154
160
  Check that the role can log in over TCP:
155
161
 
@@ -216,7 +222,7 @@ Database name: arc
216
222
  User: arc
217
223
  Password (blank for none):
218
224
  Connecting to 127.0.0.1:5432/arc...
219
- Connected — PostgreSQL 14.24 ...
225
+ Connected — PostgreSQL 18.6 ...
220
226
  ```
221
227
 
222
228
  (The password is typed blind — nothing is echoed.)
@@ -453,6 +459,7 @@ For an office at `203.0.113.0/24`: `arc settings set gateway_rate_limit_exempt 2
453
459
  | `gateway_metrics_token` | Left empty, the app serves `/metrics` to anyone who can reach its port. The nginx site `arc deploy prod` writes already restricts `/metrics` (and anything under it) to this machine, so the internet gets a 403; this token is a second gate, and the only one if you front the app some other way. |
454
460
  | `nginx_login_rate`, `nginx_login_burst`, `nginx_login_allow` | The per-address limit on `/login` in the nginx site `arc deploy prod` writes. Rate: `10` or `10r/s` (per second) or `300r/m` (default `10r/s`); burst: how many logins beyond the rate one address may make at once, 0 to 1000 (default 50); allow: comma-separated IP addresses or CIDR ranges that are **not limited at all**, e.g. `203.0.113.0/24,10.1.2.3`. Read when `arc deploy prod` runs, so re-run it after changing them; a bad value stops the command before anything is installed. |
455
461
  | `gateway_max_json_body_bytes` | The largest **JSON** request body the gateway will decode, in bytes (default 2 MiB = 2097152); a bigger one gets `413` `{"error": "JSON body too large", "limit_bytes": …}` before any decoding starts. Decoding runs on the event loop and holds the GIL, so a big body pauses every other request on that web worker: about 7 ms per MB of ordinary JSON (10 MB: ~70 ms to decode, ~90 ms pause through the real gateway). It cannot be moved off the loop - a thread still holds the GIL (60 ms pause), a process pool is no better (66 ms, and slower overall) - so it is bounded. It applies to every route: an upload route's own `max_body_bytes` (e.g. `/files/upload`, 60 MB) lets big files in, and files are not decoded as JSON; the general `gateway_max_body_bytes` (10 MB) still applies to everything else. **If a client of yours posts JSON bodies over 2 MiB** (a bulk import in one call), raise this, or better send the file to an upload route and process it as a background job; `0` removes this ceiling. Restart to apply. |
462
+ | `gateway_max_inflight_body_bytes` | The most bytes of request bodies one web worker holds in memory at once (bodies over 64 KB; default 256 MiB = 268435456, `0` = no bound). A body is read whole before its handler runs, so a crowd of big uploads is a crowd of big allocations: about 0.7 MB of memory per MB of body (four anonymous 59 MB uploads took a worker from 425 to 594 MB). A request that does not fit waits up to 5 s for room, then gets `503` with `Retry-After: 2`; a body bigger than the whole bound is let in on its own. Two things work with it: a caller relay would refuse (no sign-in, wrong role) is refused **before** a large body is read, so an anonymous crowd cannot fill the bound, and an early reply no longer makes nginx answer `502`. Size it from RAM: web workers × this should stay well under what the machine can spare. `/metrics`: `arc_gateway_inflight_body_bytes` (in memory now), `arc_gateway_inflight_body_waiting`, `arc_gateway_inflight_body_rejected_total`. Restart to apply. |
456
463
  | `error_tracking_dsn`, `error_tracking_environment`, `error_tracking_max_per_minute` | Where errors are sent besides the log and `/metrics`: a Sentry or GlitchTip DSN (**secret**; needs `uv add sentry-sdk`), the environment name they are filed under (default `production`), and the most events per bug per minute sent there (default 10, `0` = no limit). Unset DSN = errors are only counted and written to `logs/errors.jsonl`. Restart to apply. See *Know when it breaks*. |
457
464
  | `tracing_export_timeout_seconds`, `tracing_shutdown_timeout_seconds` | Only matter when `tracing_otlp_endpoint` is set. The first (1 to 60, default 3) is how long one batch of spans, retries included, may spend reaching the collector before it is dropped; the second (0 to 30, default 5, `0` = do not wait) is how long a **stopping** process waits for the spans still queued before giving up on them. Keep the second well under the 30 s a systemd unit gets to stop: with the collector unreachable and traffic flowing, OpenTelemetry's own shutdown waits for every queued batch to fail, and `arc restart` ends in a kill after 30 s (measured: 30 s with 32 clients connected, against about 2 s idle). Failed exports are logged once a minute per kind of failure, saying how many more were held back. Restart to apply. |
458
465
  | `redix_max_connections`, `redix_pool_wait_ms` | The most connections each process (web worker, queue worker, scheduler) opens to Redis/Valkey, at least 1 (default 512; opened only when needed), and how long a call waits for a free one when they are all in use before failing (default 1000 ms, `0` = fail at once). A busy web worker needs about one per request in flight; redis-py's own limit is 100, and past it every rate-limit check and session-cache lookup failed and fell back (to an in-process counter, to the database). Keep processes × `redix_max_connections` under the server's `maxclients` (10000 by default). `arc_redix_pool_wait_timeouts_total` above zero on `/metrics` means calls ran out of patience: raise it. (`/metrics` adds the processes up, so `arc_redix_pool_max_connections` reads processes × this setting: 3584 for 7 processes at 512.) Restart to apply. |
@@ -460,7 +467,7 @@ For an office at `203.0.113.0/24`: `arc settings set gateway_rate_limit_exempt 2
460
467
  | `nginx_read_timeout` | Seconds nginx waits for the app on an ordinary request before answering `504`, 1 to 3600 (default 60). WebSocket routes keep their own one-hour idle timeout whatever this is. Raise it only for a route that really needs longer, and better still make that work a background job. Read when `arc deploy prod` runs, so re-run it after changing it; a bad value stops the command before anything is installed. |
461
468
  | `deploy_metrics_allow` | Comma-separated IP addresses or CIDR ranges, e.g. `203.0.113.7,10.0.0.0/24`, that may read `/metrics` through that nginx site besides this machine (your Prometheus server). Read when `arc deploy prod` runs, so re-run it after changing this; a bad value stops the command before anything is installed. A scraper on the same machine can use `127.0.0.1:8001/metrics` directly. |
462
469
  | `authn_login_throttle` | What a source address pays for **failed** logins, **one JSON object**; a key you leave out keeps its default: `{"max_failures": 60, "window_seconds": 60, "failure_delay_ms": 250}`. After `max_failures` failed logins from one address in a window, further attempts from it get `429` (`too_many_failures`) until the window passes, before any password hashing is spent on them (0 turns the budget off). **Successful logins do not count**, so an office behind one address is not affected, while someone trying passwords or spraying usernames fails nearly every time and runs out. `failure_delay_ms` is a pause before any failure is reported (0 turns it off). A failure is treated identically whether or not the account exists (same count, same pause, same message): an unknown username that cost more or less than a known one would show an attacker which accounts exist. Addresses in `gateway_rate_limit_exempt` are not held to the budget. Read at startup. |
463
- | `authn_argon2` | Password hashing, **one JSON object**; a key you leave out keeps its default: `{"memory_mb": 64, "time_cost": 3, "parallelism": 4, "max_concurrent": 2}`. `memory_mb` is the memory one hash uses (19 to 4096), `time_cost` the passes over it, `parallelism` the threads one hash uses, `max_concurrent` how many hashes one web worker runs at once. Peak memory per worker is `memory_mb` × `max_concurrent`; a few more hashes wait and the rest get `503` with `Retry-After`, so a login flood cannot run the server out of memory. **On a machine short of memory**, use OWASP's smallest profile: `arc settings set authn_argon2 '{"memory_mb": 19, "time_cost": 2, "parallelism": 1}'`, then restart. Existing hashes keep verifying with their own parameters and are replaced by one made under the new settings at the owner's next login. Measured with 2 web workers and 48 concurrent wrong-password logins: before, the workers grew by 1,098 MB (the run was stopped there to protect the machine) and a bystander's p99 was 266 ms; now +263 MB at the default and +47 MB with the 19 MiB profile, p99 96 ms and 37 ms. A bad value stops startup with a message naming the key. |
470
+ | `authn_argon2` | Password hashing, **one JSON object**; a key you leave out keeps its default: `{"memory_mb": 64, "time_cost": 3, "parallelism": 1, "max_concurrent": 2}`. `memory_mb` is the memory one hash uses (19 to 4096), `time_cost` the passes over it, `parallelism` the threads one hash uses, `max_concurrent` how many hashes one web worker runs at once. **What makes a password costly to crack is the memory and the passes; `parallelism` only spreads the same work over more threads** (OWASP's Argon2id profiles all use 1), so it is the setting that decides how much of the machine a flood of logins can take: web workers × `max_concurrent` × `parallelism` threads at once. Measured on a 12-core machine, one hash at 64 MiB and 3 passes takes **66 ms on 4 threads and 163 ms on 1**; four at once cost 326 CPU-ms each on 4 threads and 214 on 1. The default was 4 threads: 2 web workers × 2 hashes × 4 = 16 threads, and a flood of logins for accounts that do not exist took 9 to 10 of the 12 cores. At 1 it is 4 threads, a third of that machine, with the same strength; a login takes about 100 ms longer, and the most logins a second the server can do is web workers × `max_concurrent` ÷ the time one takes (2 × 2 ÷ 0.23 s ≈ 17 a second here; an office signing in at nine is a few a second). `arc doctor --deep` warns when a deployment could use more than half of the cores for it. **Passwords stored before the default changed** (made at `parallelism` 4) keep working: they verify as before, and that user's next login stores a new one. Peak memory per worker is `memory_mb` × `max_concurrent`; a few more hashes wait and the rest get `503` with `Retry-After`, so a login flood cannot run the server out of memory. **On a machine short of memory**, use OWASP's smallest profile: `arc settings set authn_argon2 '{"memory_mb": 19, "time_cost": 2, "parallelism": 1}'`, then restart. Existing hashes keep verifying with their own parameters and are replaced by one made under the new settings at the owner's next login. Measured with 2 web workers and 48 concurrent wrong-password logins: before, the workers grew by 1,098 MB (the run was stopped there to protect the machine) and a bystander's p99 was 266 ms; now +263 MB at the default and +47 MB with the 19 MiB profile, p99 96 ms and 37 ms. A bad value stops startup with a message naming the key. |
464
471
  | `provider` under `[secrets]` in `.arc/arc.toml` | `local_file` (the default) keeps secrets encrypted in `.arc/arc.store.db`. **`env`** reads each one from an environment variable and stores nothing: `ARC_SECRET_PGDB_DSN`, `ARC_SECRET_REDIX_URL`, `ARC_SECRET_AUTHN_CSRF_SECRET`, `ARC_SECRET_FILER_SIGNING_SECRET`, … (the setting's name in capitals). `arc settings set … --secret` then refuses and names the variable to set, and a secret that is not set stays unset: ARC will not invent a CSRF or signing secret per worker. **Every ARC process needs the variables**, for example through an `EnvironmentFile=` line in each systemd unit (`arc deploy` does not write one). `.arc/arc.mkey` is still a file: it protects `arc.encrypt()` data, not these secrets. Any other value is an error at startup and in `arc doctor`; it used to be ignored, silently leaving the secrets in the local file. Tested: the gateway ran with all four secrets supplied only through the environment. |
465
472
  | *permissions of `.arc/`* | New projects are private from the start (`.arc/` mode 700; the settings store and master key 600). A project created before that has `.arc/` readable by every local user: `arc doctor` says so, and **`arc doctor --fix`** repairs it. It is never changed silently, because a setup that shares `.arc/` with another account through a group must be able to keep doing that. |
466
473
  | `gateway_access_log` | Where each request's access line goes. `file` (the default) writes it to `logs/gateway.jsonl` only; `console` also prints it through `arc run` (handy on a dev machine, but at thousands of requests per second that relay becomes the bottleneck); `off` disables the line. Request metrics are kept in every mode. Restart to apply. |
@@ -475,61 +482,67 @@ Keep `arc run` on `127.0.0.1` (the default) and let nginx be the only public lis
475
482
 
476
483
  ## Back it up, and prove you can restore it
477
484
 
478
- A database dump alone cannot bring an instance back. Without `.arc/arc.mkey` every secret in the settings store is lost for good, and without the uploaded files every upload is gone. `arc backup create` writes **one file** with all of it:
485
+ A database dump alone cannot bring an instance back: without the master key every secret in the settings store is lost for good, and without the uploaded files every upload is gone. `arc backup` writes a **timestamped folder with three separate archives**, so each part can be kept, copied and restored on its own:
479
486
 
480
- | Inside the file | What it is |
481
- |---|---|
482
- | `database.dump` | the whole PostgreSQL database (`pg_dump`, custom format) |
483
- | `state/arc.store.db` | the settings store, as a consistent snapshot (taken with SQLite's own backup call, not a copy of a file that may be mid-write) |
484
- | `state/arc.toml`, `state/plugins.lock`, `config/` | project config and which plugin versions were running |
485
- | `files/` | the filer's local files (read after the database was dumped, so every row in the dump has its file) |
486
- | `key.enc` | the master key, encrypted with your passphrase (scrypt + AES-256-GCM) |
487
- | `manifest.json` | what is inside, and a SHA-256 for every member; written last |
487
+ ```
488
+ backups/20261202T091500Z/
489
+ db-20261202T091500Z.tar.zst.enc the whole PostgreSQL database (pg_dump, custom format)
490
+ files-20261202T091500Z.tar.zst.enc the filer's local files (read after the dump, so every row has its file)
491
+ settings-20261202T091500Z.tar.zst.enc the settings store (a consistent SQLite snapshot; secrets stay encrypted inside it),
492
+ config/*.toml, arc.toml and plugins.lock
493
+ key.enc the master key, wrapped with your passphrase (scrypt + AES-256-GCM)
494
+ manifest.json what is in the folder, with a SHA-256 for every archive
495
+ ```
488
496
 
489
- **Not inside:** the code (`arc/`, `plugins/`: reinstall it from your repositories at the versions in `plugins.lock`), logs, `.venv`, and files kept in S3 (`filer_default_storage = s3`; the command says so; use the bucket's versioning or replication).
497
+ Each archive is compressed (zstd) and then encrypted with AES-256-GCM under a key derived from the **master key**. `--no-encrypt` writes plain `.tar.zst` files instead (`key.enc` is still written: the database and settings still hold values only the master key can read). A restore refuses a file that was cut short, extended, reordered or altered, and says which master key it needs.
498
+
499
+ **Not inside:** the code (`arc/`, `plugins/`: reinstall it from your repositories at the versions in `plugins.lock`), logs, `.venv`, and files kept in S3 or Crate (`filer_default_storage`; the command says so; use the bucket's versioning or replication).
490
500
 
491
501
  ```bash
492
- export ARC_BACKUP_PASSPHRASE='a long passphrase, at least 12 characters' # or --passphrase-file, or it asks
493
- arc backup create --keep 14 # backups/full/arc-backup-<project>-<time>.tar, and delete all but the newest 14
494
- arc backup verify backups/full/arc-backup-shop-20261107T020000Z.tar
502
+ export ARC_BACKUP_PASSPHRASE='a long passphrase, at least 12 characters' # or --passphrase-file, or it asks (twice)
503
+ arc backup # all three, encrypted
504
+ arc backup --db --settings # only some: --db, --files, --settings
505
+ arc backup --keep 14 # afterwards delete all but the newest 14 backup folders
506
+ arc backup --no-encrypt # plain archives (a restore warns, and cannot tell if they were tampered with)
495
507
  ```
496
508
 
497
- `create` never overwrites a backup, refuses a short passphrase before it dumps anything, adds `backups/full/*` to `.gitignore`, and needs `pg_dump` on the machine (`apt install postgresql-client`). `verify` re-reads every checksum, opens the key with your passphrase, checks that the settings store is intact and that the database dump is a readable `pg_dump` archive. It exits 1 on any problem, so it can sit in a schedule.
509
+ It never overwrites a backup, refuses a short passphrase before it dumps anything, adds `backups/*` to `.gitignore`, and needs `pg_dump` on the machine (`apt install postgresql-client`), at the same major version as the server or newer: PostgreSQL's own tools refuse to dump a newer server (`aborting because of server version mismatch`), so after moving to a newer PostgreSQL install its client tools too (on Ubuntu 22.04 the distribution's `postgresql-client` is version 14; the PostgreSQL apt repository has the others).
498
510
 
499
- **What the passphrase protects.** Only the master key. The database dump and the files are not encrypted (they hold your business data and password hashes), and the checksums detect damage, not tampering. Keep the file on encrypted storage, or encrypt it before it leaves the machine, for example `age -p -o backup.tar.age backup.tar`. **Lose the passphrase and the secrets cannot be recovered**; store it somewhere other than the server it protects.
511
+ **What protects what.** The archives are protected by the master key; `key.enc` is the master key protected by your passphrase. Keep `key.enc` and the passphrase somewhere other than the archives: anyone with both can read everything, and **lose both (or the key itself) and the backup cannot be opened**: there is no recovery. A plain (`--no-encrypt`) archive is protected by nothing: its checksums detect damage, not tampering.
500
512
 
501
513
  **Keep a copy somewhere else.** A backup on the same disk as the database is not a backup. Copy it off the machine (`rsync`, `rclone`, an object-store bucket with versioning). Schedule it, for example from cron as the project's owner, with the passphrase in a file only that user can read:
502
514
 
503
515
  ```bash
504
516
  # /etc/cron.d/arc-backup (the passphrase file: mode 600, owned by the project owner, outside the project)
505
- 30 2 * * * shop cd /srv/shop && "$(command -v arc)" backup create --passphrase-file /etc/arc/backup.pass --keep 14 && rsync -a backups/full/ backup-host:/srv/arc-backups/shop/
517
+ 30 2 * * * shop cd /srv/shop && "$(command -v arc)" backup --passphrase-file /etc/arc/backup.pass --keep 14 && rsync -a backups/ backup-host:/srv/arc-backups/shop/
506
518
  ```
507
519
 
508
- ### The restore drill
520
+ ### Restoring
509
521
 
510
- Do this once now, and again after any large change; a backup nobody has restored is a hope. It uses a **new empty database and a new directory**, so it cannot touch the live site:
522
+ `arc restore` restores into **the project you run it in**: on a new machine, install arc, run `arc init` (optionally with the old master key: `--master-key-file`), set `pgdb_dsn` to the new, empty database, then:
511
523
 
512
524
  ```bash
513
- createdb -O shop shop_restore_test # an empty database (as a role that may create one)
514
- arc backup restore backups/full/arc-backup-shop-20261107T020000Z.tar \
515
- --into /srv/shop-restore-test \
516
- --database-url postgresql://shop:PASSWORD@localhost/shop_restore_test
525
+ arc restore backups/20261202T091500Z/db-20261202T091500Z.tar.zst.enc # the database only (the default)
526
+ arc restore DB_FILE --files FILES_FILE # database and files
527
+ arc restore DB_FILE --settings SETTINGS_FILE # database and settings
528
+ arc restore --files FILES_FILE --settings SETTINGS_FILE # no database: files and settings only
529
+ arc restore DB_FILE --check # read and verify everything, change nothing
517
530
  ```
518
531
 
519
- It verifies every checksum and decrypts the key **before it writes anything**; a wrong passphrase or a damaged file changes nothing. Then bring the code back and look at it:
532
+ - **The database** goes into the one `pgdb_dsn` names (never anywhere else), refuses a target that already has tables unless `--force` (which replaces them), restores without the original owners and grants, and stops at the first error rather than leave a half-restored database. A dump `pg_restore` cannot read is caught before anything changes.
533
+ - **Files** go where this project keeps them (`filer_local_root`, else `files/`); a file that already exists is left alone unless `--force`.
534
+ - **Settings** are merged: a key in the backup overwrites the same key here, keys only here stay. `config/*.toml` are written over this project's. `arc.toml` and `plugins.lock` are **not** restored: they say which project this is and which plugins its code has.
535
+ - **Secrets are never restored by default** (nor are operator-only settings such as `restart_command` and `filer_local_root`). `--secrets` restores them, after a warning, and asks for confirmation (`--yes` for scripts). They include connection strings such as `pgdb_dsn` and `redix_url` that point at the *backup's* servers: remap them afterwards, or skip them with `--exclude pgdb_dsn --exclude redix_url` (repeatable, or comma-separated).
520
536
 
521
- ```bash
522
- cd /srv/shop-restore-test
523
- # reinstall arc/ and plugins/ from your repositories at the versions in .arc/plugins.lock, then:
524
- arc doctor && arc pgdb status && arc status
525
- arc run --port 8011 # a different port, then sign in as a real user
526
- ```
537
+ **Which master key opens the backup.** The key this project already has is tried first (each archive records a one-way fingerprint of its key, so this costs nothing); if it is the backup's key too, there are no prompts. Otherwise you are asked for the backup's master key (hidden prompt, or `--key-file` with the 64-hex key, or the backup's `key.enc` plus its passphrase). A wrong key changes nothing.
527
538
 
528
- The restored project's `pgdb_dsn` points at the database you named, never the original, and an absolute `filer_local_root` is repointed at where the files now are. When you are satisfied: `dropdb shop_restore_test && rm -rf /srv/shop-restore-test`.
539
+ When a **database** is restored with another project's key, this project **adopts that key**: values the old project encrypted with `arc.encrypt()` live in the restored database and only open with it. Every secret already stored here is re-encrypted under the new key (the same routine as `arc master-key rotate`), requests that read a secret during the switch can fail, and the key this project had is shown **once** at the end (or written to `--old-key-file PATH`, required when output is not a terminal). A files-only or settings-only restore never changes this project's key: the key only opens the backup, and any secrets restored are re-encrypted under the key this project keeps.
529
540
 
530
- Restore refuses to guess: it needs `--database-url` explicitly (a backup never goes back to its original database on its own), refuses a target that already has tables or a directory that already has `.arc/` unless you pass `--force` (which replaces them), restores without the original owners and grants (so a new machine without the old role works) and stops at the first error rather than leave a half-restored database, and rejects archive paths that would write outside the target directory. `--skip-database` / `--skip-files` restore only part. To restore **into production** after a disaster, point `--database-url` at the new empty production database and `--into` at the new project directory.
541
+ Do the drill once now, and again after any large change; a backup nobody has restored is a hope. Use a **new empty database and a new directory**, so it cannot touch the live site. After a restore, reinstall the code, then `arc doctor`, `arc pgdb status` and `arc status`, and restart so every process reads the restored state.
531
542
 
532
- **Measured.** On this project's own data (a 205-route gateway, 2,673 uploaded files): the backup was 20.8 MiB, 2,682 members, made in 2.0 s and verified in 0.9 s. The restore is exercised automatically (`tests/integration/test_backup_restore_drill.py`, 13 tests) against a private PostgreSQL server started for the test: a project is backed up with the real commands, restored into a *different* database and directory, then booted, its rows read back and a secret decrypted with the restored key; a live database is refused, a wrong passphrase and a flipped byte change nothing, and a dump `pg_restore` cannot read is caught by `verify`. Not run: a restore on a second machine, a backup of a multi-gigabyte database (the time and size grow with it), and the `cron` line above.
543
+ **The master key** can be chosen when a project is created (`arc init`, prompt or `--master-key-file`, so a new site can use the old site's key from the start) and changed later with `arc master-key rotate`.
544
+
545
+ **Tested.** The restore is exercised automatically (`tests/integration/test_backup_restore_drill.py`) against a private PostgreSQL server started for the test: a project is backed up with the real command, restored into a *different* running project (its own key and database), then booted, its rows read back, and a value the old project encrypted with `arc.encrypt()` decrypted with the adopted key; a database in use is refused, a wrong key, a flipped byte and a dump `pg_restore` cannot read change nothing. Not run: a restore on a second machine, a backup of a multi-gigabyte database (the time and size grow with it), and the `cron` line above.
533
546
 
534
547
  ---
535
548
 
@@ -563,6 +576,8 @@ The output looks like this (illustrative values):
563
576
 
564
577
  Two more counters say when Redis is not keeping up, rather than when the app is failing: `arc_gateway_rate_limit_fallbacks_total` (request-limit checks Redis could not answer, decided from each web worker's own counter instead, so the limit is per worker until it recovers) and `arc_redix_pool_wait_timeouts_total` (calls that gave up waiting for a free Redis connection; see `redix_max_connections`). Either rising means look at Redis, or the pool size, before anything else.
565
578
 
579
+ And for request bodies: `arc_gateway_inflight_body_bytes` is what the web workers hold in memory for uploads and large posts right now, `arc_gateway_inflight_body_waiting` how many requests are waiting for room, and `arc_gateway_inflight_body_rejected_total` how many were told to come back (`503`). Rejections that keep rising mean either a flood of big uploads or a bound (`gateway_max_inflight_body_bytes`) too small for the RAM you have.
580
+
566
581
  **Sentry or GlitchTip (optional).** The SDK is not a dependency of ARC; install it, give it the project's DSN, restart:
567
582
 
568
583
  ```bash
@@ -580,7 +595,7 @@ Boot says so if the DSN is set and the package is missing (errors are still coun
580
595
  | The site answers and can reach its dependencies | An external uptime monitor on `GET https://app.example.com/readyz` (`200` = PostgreSQL and Redis answered; `/healthz` only says the process is alive) | an outage, or the database or Redis being unreachable |
581
596
  | Something is failing | cron, hourly: `arc errors --hours 1 --check` | a new bug, a job failing every run |
582
597
  | The processes are what was deployed | `arc status` (exits 1 on a failed unit or a wrong count) | a dead worker or scheduler |
583
- | The backup is still good | `arc backup verify` on the newest file after each backup | a backup that stopped being written or is damaged |
598
+ | The backup is still good | `arc restore <newest db file> --check` after each backup (reads and authenticates everything, changes nothing) | a backup that stopped being written or is damaged |
584
599
  | Trends and rates | Prometheus scraping `/metrics` (from this machine, or from an address in `deploy_metrics_allow`) | error rate, 5xx share, database pool saturation |
585
600
 
586
601
  ```bash
@@ -616,6 +631,9 @@ groups:
616
631
  **`permission denied to create extension "pgcrypto"`** during `arc pgdb migrate`
617
632
  The database is not owned by the role ARC connects as. Fix it with `sudo -u postgres psql -c 'ALTER DATABASE arc OWNER TO arc'`, or recreate it as in step 4.
618
633
 
634
+ **`pg_dump: error: aborting because of server version mismatch`** from `arc backup` or `arc pgdb backup`
635
+ The backup tool is older than the server: PostgreSQL's own tools refuse to dump a newer server. Install `postgresql-client-<server major>` (on Ubuntu 22.04 from the PostgreSQL apt repository, see step 1). Both commands print this advice under the tool's own error line, and exit with code 1.
636
+
619
637
  **`'pgdb_dsn' is not set`** (or `Warning: arc stubs failed to regenerate IDE stubs` while installing)
620
638
  You have not run `arc pgdb setup` yet. Harmless until you do. The same applies to `redix_url` and `arc redix setup`.
621
639
 
@@ -674,3 +692,23 @@ arc restart
674
692
  `arc update` runs `git pull --ff-only` on the kernel and every enabled plugin, skipping any with uncommitted changes. It does **not** touch the database or the running process: review `arc pgdb plan` for schema changes that came with the update, apply them with `arc pgdb migrate`, then `arc restart` once you are ready for the new code to take effect. (`arc restart` needs `restart_command`; `arc deploy dev` sets it.)
675
693
 
676
694
  Use `arc build` after you add a plugin dependency by hand or change the Admin UI's source; it re-resolves dependencies and rebuilds frontends.
695
+
696
+ ---
697
+
698
+ ## Upgrading PostgreSQL from 14
699
+
700
+ PostgreSQL 14's last release is 12 November 2026. This is the procedure that was run on the reference project's server (two databases, 528 MB), with Debian and Ubuntu's own `pg_upgradecluster`. It dumps the old cluster and restores it into a new one with the same port, locale and configuration, and leaves the old cluster on disk.
701
+
702
+ 1. **Take your own dumps first.** The old cluster is the main way back, but keep an independent copy: `sudo -u postgres pg_dumpall --globals-only > globals.sql`, then `pg_dump -Fc` for each database, and check each with `pg_restore --list`. Note the row count of every table if you want to compare afterwards.
703
+ 2. **Install 18 beside 14** (step 1). Nothing is removed, and no second cluster is created while `14/main` exists.
704
+ 3. **Stop ARC** so nothing writes during the dump: `systemctl --user stop arc-<project>.target` for a per-user deployment, or `sudo systemctl stop arc-<project>.target` for a system one.
705
+ 4. **Upgrade:** `sudo pg_upgradecluster -v 18 -m dump 14 main`. The new cluster takes port 5432. The old one moves to port 5433, stops, and is set to manual start so it cannot grab a port at boot. Passwords, extensions (`pgcrypto` moves from 1.3 to 1.4), roles, `max_connections` and the other settings come across.
706
+ 5. **Start ARC and check:** `arc pgdb status` shows the new version, `arc status` says `Everything matches`, `/readyz` answers 200. Nothing in ARC's settings changes, because the address is the same.
707
+ 6. **Run `arc pgdb migrate`.** It reports no schema changes, but re-installs the id function (`arc_uuid_generate_v7()`) as a wrapper over the native `uuidv7()`: about three times faster, and ids made in one session come out strictly in order. On 14 to 17 the function keeps its own implementation (and needs `pgcrypto`), which keeps ids in order too; ids from before and after the switch sort together by time.
708
+ 7. **Keep the old cluster for a while**, then `sudo pg_dropcluster 14 main` and `sudo apt purge postgresql-14 postgresql-client-14`.
709
+
710
+ **Measured.** On the reference project about 45 seconds passed between stopping ARC and the site answering again, and every table in both databases had the same row count before and after.
711
+
712
+ **Going back.** Until you drop it, the old cluster still holds everything up to the upgrade. Stop ARC and the new cluster (`sudo pg_ctlcluster 18 main stop`), swap the ports (`sudo pg_conftool 18 main set port 5433`, `sudo pg_conftool 14 main set port 5432`), start the old one (`sudo pg_ctlcluster 14 main start`) and start ARC. Anything written after the upgrade stays on 18.
713
+
714
+ **Bigger databases.** `pg_upgradecluster -m upgrade` (binary `pg_upgrade`) is faster for a large database. It was not run here.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: arc-kernel
3
- Version: 0.1.3
3
+ Version: 0.1.6
4
4
  Summary: ARC kernel — capability-based Python platform
5
5
  Project-URL: Homepage, https://github.com/vignesh-ramsh/arc
6
6
  Project-URL: Repository, https://github.com/vignesh-ramsh/arc
@@ -26,6 +26,7 @@ Requires-Dist: packaging>=23.0
26
26
  Requires-Dist: rich>=13.0
27
27
  Requires-Dist: tomlkit>=0.12
28
28
  Requires-Dist: typer>=0.12
29
+ Requires-Dist: zstandard>=0.22
29
30
  Description-Content-Type: text/markdown
30
31
 
31
32
  # kernel
@@ -75,8 +76,10 @@ arc init [project_name] --kernel-repo <git-url-or-path> [--kernel-branch main] [
75
76
  arc install <git-url> [--branch BRANCH] [--name NAME]
76
77
  arc build [-p/--plugin NAME] [--no-lock]
77
78
  arc settings get <key> [--reveal]
79
+ arc settings list [--secrets]
78
80
  arc settings set <key> <value> [--secret]
79
81
  arc settings delete <key>
82
+ arc settings access-log [--key K] [--limit N]
80
83
  arc plugin list
81
84
  arc plugin enable <name>
82
85
  arc plugin disable <name>
@@ -85,6 +88,13 @@ arc plugin disable <name>
85
88
  `ARC_KERNEL_REPO` env var can be set once so `--kernel-repo` doesn't need to
86
89
  be typed on every `arc init`.
87
90
 
91
+ **Secrets are CLI-only.** `arc settings list` shows ordinary settings and never
92
+ a secret; `arc settings list --secrets` shows only secrets, with every value
93
+ masked (`********`); `arc settings get <key> --reveal` is the one way to see a
94
+ secret's value, and each reveal is recorded (who, which key, when) and read
95
+ back with `arc settings access-log`. The admin console neither lists, reveals,
96
+ creates nor edits a secret.
97
+
88
98
  ## Plugin manifest format
89
99
 
90
100
  Every plugin repo has, at its root:
@@ -45,8 +45,10 @@ arc init [project_name] --kernel-repo <git-url-or-path> [--kernel-branch main] [
45
45
  arc install <git-url> [--branch BRANCH] [--name NAME]
46
46
  arc build [-p/--plugin NAME] [--no-lock]
47
47
  arc settings get <key> [--reveal]
48
+ arc settings list [--secrets]
48
49
  arc settings set <key> <value> [--secret]
49
50
  arc settings delete <key>
51
+ arc settings access-log [--key K] [--limit N]
50
52
  arc plugin list
51
53
  arc plugin enable <name>
52
54
  arc plugin disable <name>
@@ -55,6 +57,13 @@ arc plugin disable <name>
55
57
  `ARC_KERNEL_REPO` env var can be set once so `--kernel-repo` doesn't need to
56
58
  be typed on every `arc init`.
57
59
 
60
+ **Secrets are CLI-only.** `arc settings list` shows ordinary settings and never
61
+ a secret; `arc settings list --secrets` shows only secrets, with every value
62
+ masked (`********`); `arc settings get <key> --reveal` is the one way to see a
63
+ secret's value, and each reveal is recorded (who, which key, when) and read
64
+ back with `arc settings access-log`. The admin console neither lists, reveals,
65
+ creates nor edits a secret.
66
+
58
67
  ## Plugin manifest format
59
68
 
60
69
  Every plugin repo has, at its root:
@@ -28,7 +28,7 @@ from .kernel import ( # noqa: F401
28
28
  from .resolver import BootPlan, PluginSpec, ResolutionError # noqa: F401
29
29
  from .runtime import BootError, boot, find_project_root, shutdown # noqa: F401
30
30
 
31
- __version__ = "0.1.3"
31
+ __version__ = "0.1.6"
32
32
 
33
33
 
34
34
  def __getattr__(name: str) -> Any: