From f1e1f6e8d8827dc11657248a908c06aa2e22b207 Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 23:02:06 +0100 Subject: [PATCH 1/2] [repo] F23: the relay's Nix checks on the hub's NixOS runner (package and VM test); the flake's licence is CPAL-1.0 --- .fabrica/artifex/nix-check.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .fabrica/artifex/nix-check.yaml diff --git a/.fabrica/artifex/nix-check.yaml b/.fabrica/artifex/nix-check.yaml new file mode 100644 index 0000000..3d29e15 --- /dev/null +++ b/.fabrica/artifex/nix-check.yaml @@ -0,0 +1,16 @@ +# Tabellarius: the relay's Nix checks on the hub's NixOS runner (F23, .agents/features/home-relay.md). By hand only +# (Artifex → nix-check, or the hub's POST /api/runs with pipeline nix-check and a ref), on every branch that touches +# deploy/, crates/relay or flake.nix, and always before the relay is deployed or updated on the server. It builds and +# switches nothing on the server: the package is a sandboxed build (with the crates' tests), the VM test runs in +# its own VMs (a server with the module behind Caddy, a client that uses every route and checks that no client +# address is kept anywhere). +name: nix-check +on: + manual: true +runner: nixos +steps: + - id: package + nix: .#packages.x86_64-linux.default + - id: relay-keeps-no-address + needs: [package] + nix: .#checks.x86_64-linux.relay-keeps-no-address From 308e63999bf1bdd4912533d36d91c8f0915abaad Mon Sep 17 00:00:00 2001 From: mnovak Date: Wed, 2 Dec 2026 23:25:37 +0100 Subject: [PATCH 2/2] [repo] F23: version 0.1.0 for the first deployed relay; how to deploy it from a tag, check it and roll it back --- .agents/features/home-relay.md | 21 +++++++++++++++++++-- Cargo.lock | 6 +++--- Cargo.toml | 2 +- flake.nix | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.agents/features/home-relay.md b/.agents/features/home-relay.md index 911b5a0..edec865 100644 --- a/.agents/features/home-relay.md +++ b/.agents/features/home-relay.md @@ -61,8 +61,25 @@ Two machines: `server` with the module (TLS from Caddy's internal CA instead of mistake (a wrong token, a malformed request), and fills a mailbox to its 507. Then the test greps the server's whole journal and `/var/log` for the client's address and fails if it appears. -**Not run here.** This machine has neither Nix nor WSL. The module and the test are written to be -run with `nix flake check` on Linux, and the PR says so. Mark's server is the first real run. +**Run on the hub (2026-12-02).** `.fabrica/artifex/nix-check.yaml` builds the package (with the crates' tests) and +runs this VM test on Fabrica's NixOS runner. First run r54ed0gn5tcqs at f1e1f6e: package 11 min, VM test 10 min, +both exit 0. Run it again on every change to `deploy/`, `crates/relay` or `flake.nix`, and before every deploy. + +### Deploying on the home server (2026-12-02) +The relay is deployed by the server's operator from a **tag** of this repository, never from a branch: the flake +input pins the tag, so the code that runs is the code tagged and published (`docs/VERIFY.md`). +- **The flake input:** `tabellarius.url = "git+https://gitea.marek-novak.cz/mnovak/Amicitia-Tabellarius.git?ref=refs/tags/vX.Y.Z";` + and `imports = [ tabellarius.nixosModules.default ];`. +- **The service:** `services.tabellarius = { enable = true; domain = ""; };` The caps keep their defaults + (1 GiB of waiting blobs, 100 000 mailboxes, 10 000 invites); `wake = true` (UnifiedPush wake-ups, F25b). +- **The proxy:** the module turns on `services.caddy` with one virtual host. On a server whose Caddy is already + the NixOS module, it is one more host in the same Caddy; a server with another proxy on 443 must proxy the + name to `127.0.0.1:8470` itself, with no access log and without `X-Forwarded-For`, `X-Real-IP` and `Forwarded`. +- **DNS and TLS:** one A/AAAA name for the relay. Caddy gets its certificate by HTTP-01, so port 80 must reach it. +- **After deploying:** `curl -s https:///version` answers the relay's version, and `https:///join` serves the join page; `journalctl -u + tabellarius` shows the one start line and nothing per request; no file under `/var/log` names a client. +- **Rollback:** point the input at the previous tag and switch. The database (`/var/lib/tabellarius/relay.db`) + keeps only waiting ciphertext; it stays across versions unless `docs/PROTOCOL.md` says otherwise. ## 3. Risks - **Privacy:** the logs are the risk this feature exists to close. The VM test is its proof, once diff --git a/Cargo.lock b/Cargo.lock index 96f345f..37e8444 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2297,7 +2297,7 @@ checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] name = "tabellarius-client" -version = "0.0.0" +version = "0.1.0" dependencies = [ "axum", "base64 0.22.1", @@ -2318,7 +2318,7 @@ dependencies = [ [[package]] name = "tabellarius-protocol" -version = "0.0.0" +version = "0.1.0" dependencies = [ "base64 0.22.1", "proptest", @@ -2329,7 +2329,7 @@ dependencies = [ [[package]] name = "tabellarius-relay" -version = "0.0.0" +version = "0.1.0" dependencies = [ "axum", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index 962456a..6588f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["crates/protocol", "crates/client", "crates/relay"] [workspace.package] -version = "0.0.0" +version = "0.1.0" edition = "2021" publish = false diff --git a/flake.nix b/flake.nix index 48350f6..d92a07f 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ packages = forAll (pkgs: { default = pkgs.rustPlatform.buildRustPackage { pname = "tabellarius"; - version = "0.0.0"; + version = "0.1.0"; src = pkgs.lib.cleanSource ./.; cargoLock.lockFile = ./Cargo.lock; doCheck = true;