Skip to content

Rust off Rails 0.7.6

Latest

Choose a tag to compare

@danielcj danielcj released this 05 Dec 00:56
4e96f14

What's new

  • Two RustSec advisories fixed in the template. url 2.5.9 and cookie 0.18.3 (RUSTSEC-2026-0592, RUSTSEC-2026-0594); cargo deny fails on both in an app made from 0.7.5. Every app should run the one-line update below.
  • A webhooks part. cargo offrails add-part webhooks adds POST /webhooks/{provider} for Stripe- and GitHub-style signed webhooks: the signature is checked over the raw body before anything else, a replayed delivery is stored once and does nothing, and the work runs in a job. The framework's parts now match the samples repo exactly, and CI fails if they drift.
  • Upgrade steps that hold up for older apps. Two real upgrades (an app from 0.6.2 and the samples host from 0.7.0, both to 0.7.5) found gaps in the steps; they're filled in, including how to compare an app from before 0.7.1 with the template.
  • No false drift notice after installing with the installer, and stack.md's version table matches the template again.
  • CI runs weekly and tests the installer on macOS, so a crate release that breaks a part fails here within a week, without a push.

Breaking changes

None.

Upgrading

Upgrading an app to 0.7.6, in order (each step's Detect/Converge/Prove is in the entry it names below; upgrade is the whole procedure):

  1. Dependencies: cargo update -p url -p cookie (url 2.5.9 and cookie 0.18.3, below). On Windows, check how the app builds SQLite file URLs (same entry).
  2. Move to the template's patch versions, cargo update -p anyhow -p clap -p sha2 -p pin-project-lite (Template dependency updates, below). Required if cargo deny reports pin-project-lite as yanked; otherwise optional.
  3. Optional, apps with the jobs part that want webhooks: update-part jobs, then add-part webhooks (Parts resynced from samples, below).
  4. Optional tidying: rm .offrails/.sha256 if it exists (Drift notice on identical docs, below).
  5. cargo offrails verify --fast.

Full list of changes

  • Drift notice on identical docs (hooks/fingerprint.sh, tools/offrails-gen/src/newapp.rs; #15). install.sh writes the tarball checksum to ~/.offrails/<version>/.sha256, vendoring from there copied it into .offrails/, and the fingerprint counted it, so the session-start hook said ".offrails/ and the installed plugin are both , but their docs differ" when they didn't (found upgrading a real app from 0.6.2 to 0.7.5). The fingerprint now skips a top-level .sha256, and vendoring (offrails-gen vendor, new, and the rsync line in upgrade) no longer copies it. Tests: tools/ci/test-hooks.sh (the fingerprint ignores .sha256 and VERSION, and still sees a changed doc) and vendoring_skips_the_installer_checksum. App migration (optional): Detect: test -f .offrails/.sha256. Converge: rm .offrails/.sha256 (the next re-vendor drops it anyway). Prove it: a new session prints no drift notice when the app vendors the installed release.

  • Upgrade steps for apps built from the guides before 0.7.1 (#16). Two migration steps assumed the template's file layout (found upgrading a real app from 0.6.2 to 0.7.5). 0.7.4's IPv6 rate-limit step grepped one file (src/controllers/application.rs) for rate_limit_ip; it now searches src/ and says to add the function wherever the app defines ClientIp, importing it from there in the copied test. 0.7.2's ordered list never added the cargo offrails alias, which every later Prove it step runs; it is now step 1 for apps from before 0.7.1. CONTRIBUTING.md gains a rule for migration steps: Detect searches src/, not one file, and Converge names the symbol as well as its template path. App migration: none (docs only).

  • stack.md: "Verified against" re-dated to template 0.7.5 (#22). The table still said 2026-10-12 and listed sqlx 0.9.0 and axum-server 0.8.0. The rows the template uses now show its 0.7.5 lock (sqlx 0.9.1, axum-server 0.9.2, tokio 1.54.1, uuid 1.29.3, clap 4.6.8, rand 0.10.4, rustls 0.23.46), which test-template.sh builds and tests on both databases; the paragraph says which rows still come from the 2026-10-12 reference app and what the date means. The README's release steps now say to update a row when a release moves its crate to a new major or minor version. App migration: none (docs only; the table is orientation, not a pin).

  • url 2.5.9 and cookie 0.18.3 (template/app/Cargo.lock; #27). RUSTSEC-2026-0592 (url) and RUSTSEC-2026-0594 (cookie, through axum-extra) were published after 0.7.5, and cargo deny fails on both. url 2.5.9 also rejects a SQLite URL with a Windows path in backslashes (sqlite://C:\... is InvalidPort), so the dev-dashboard part and three file-database tests now build sqlite://C:/... with forward slashes, which SQLite on Windows accepts. App migration: Detect: cargo deny --locked check advisories names either advisory, or grep -A1 '^name = "url"$' Cargo.lock shows 2.5.8 or older. Converge: cargo update -p url -p cookie. On Windows, if the app builds a SQLite URL from a path (grep -rn 'sqlite://{' src tests), add .to_string().replace('\\', "/") after .display(); the dev dashboard's is in src/kernel/dashboard/history.rs (cargo offrails update-part dev-dashboard --framework $FW). Prove it: cargo deny --locked check passes and cargo offrails verify --fast is green (on Windows too, if the app runs there).

  • Upgrade steps: eight gaps from upgrading the samples host from 0.7.0 to 0.7.5 (upgrade, and the 0.7.1, 0.7.3 and 0.7.5 entries below). upgrade step 3 now says how to compare an app from before 0.7.1 with the template: generate a reference app of the new release with the app's names and parts, and diff against that (the old diff was empty, or every renamed file). Step 7 settles the decision line: one YYYY-MM-DD: upgraded to framework <version> per release crossed, which is what the CHANGELOG's Prove it steps look for. Step 8 reconciles every section of AGENTS.md with the blueprint, not only NEVER and Post-upgrade checks, so Quick commands stop going stale. In 0.7.3, step 11 (security review) gets a Detect/Converge/Prove for each change (APP_ENV refusal, proxy hops, /static immutability, escaped cache prefixes) and names the right file for the old APP_ENV test (src/config.rs, not tests/app/kernel_test.rs); Layouts and components lists the files it left out (_nav.html, the gallery and components_test mods, the /dev tile, the app.css and app.js changes, regenerating docs/routes.md); Brand says to delete assets/brand/og.html. In 0.7.5, cargo update -p rand was ambiguous (the lock file has three versions of rand): it is -p rand@0.10, and axum-server@0.9.2 matches the template. 0.7.1's Spans by default gets a Detect/Converge. App migration: none (docs only).

  • Parts resynced from samples, with a webhooks part and a CI check (#28; parts from samples main as of rust-off-rails/samples#10). template/parts/SOURCE named samples 393408b, but the dev-dashboard and jobs parts held later samples changes copied by hand, and samples had a part the framework didn't ship. tools/sync-parts.sh now brings them in from samples main:

    • webhooks (new, depends on jobs). POST /webhooks/{provider} verifies the provider's HMAC over the raw body (GitHub X-Hub-Signature-256, Stripe Stripe-Signature), compares in constant time, refuses timestamps over 5 minutes old, stores each event once under a unique (provider, event_id) taken from signed bytes, answers 2xx and hands the work to a process_webhook job; handle is the app's one extension point. A provider without APP_WEBHOOK_<PROVIDER>_SECRET answers 404, every refusal is the same bare 401, and repeated failures from one client get 429. It adds the hmac and constant_time_eq crates. It is the rule in security → CSRF, built and tested; the template, the samples and parts tables, the interview, new and upgrade step 7b list it.
    • jobs: four samples: anchors in src/jobs/mod.rs (worker mods, worker dispatch, worker config, worker names) and one in src/jobs/recurring.rs (recurring), so a part can ship a worker and a cron entry.
    • CI: tools/ci/check-parts-source.sh (in docs-and-plugin) re-runs the sync from the samples commit in SOURCE, fails when template/parts/ differs, and fails when that commit isn't on samples main. A part changes in samples first, then gets synced.

    App migration (an app with the jobs part that wants webhooks): Detect: grep -rn 'samples: worker mods' src/jobs/mod.rs finds nothing. Converge: cargo offrails update-part jobs --framework "$FW" (it adds the five anchors), or add them by hand where the template's src/jobs/mod.rs and src/jobs/recurring.rs have them; then cargo offrails add-part webhooks --dry-run. Prove it: cargo offrails add-part webhooks, then cargo offrails verify --fast. Apps without jobs, or that don't want webhooks: nothing to do.

  • CI and release chores (#20, #21, #24, #25). CI also runs every Monday and on demand, so a crate release that breaks a part or a snippet fails here without a push; the scheduled run skips the docs, secrets and installer jobs, which change only with the repo. template-os no longer retries failed tests: the shared dev-dashboard state it covered for was fixed in 0.7.3, and a retry hid any new flaky test on macOS and Windows. A new installer-macos job runs test-install.sh with the system openssl, curl and shasum first on PATH, as on a new Mac. release.sh prints the steps that update rustoffrails.org after a release, and its dirty-tree error says how to release from a clean worktree. CONTRIBUTING says which database runs on which OS in CI, and to cite samples changes by PR, not by commit hash. App migration: none.

  • bin/setup-tailwind retries the download (template/app/bin/setup-tailwind, frontend-htmx). GitHub's release downloads failed now and then in CI (curl exit 22, HTTP 618); both curl calls now pass --retry 4 --retry-all-errors. App migration (optional): Detect: grep -c 'retry-all-errors' bin/setup-tailwind prints 0. Converge: add --retry 4 --retry-all-errors after curl -sSLf on both lines. Prove it: rm bin/tailwindcss && bin/setup-tailwind fetches and verifies it.

  • Template dependency updates (template/app/Cargo.lock). Patch releases from Dependabot: anyhow 1.0.105, clap 4.6.10, sha2 0.11.3 (Dependabot proposed 0.11.2, which was yanked), and pin-project-lite 0.2.19 (0.2.17 was yanked on 2026-12-04, and cargo deny fails on a yanked crate); the template's suite passes unchanged on both databases. CI's pinned actions move to codeql-action 4.39.5 and install-action 2.90.11. App migration: optional; nothing is fixed by it. Detect: cargo tree -i clap --depth 0 shows 4.6.8 or older; cargo deny --locked check advisories reporting a yanked pin-project-lite makes this step required. Converge: cargo update -p anyhow -p clap -p sha2 -p pin-project-lite. Prove it: cargo offrails verify --fast.