Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ddc77a8
test: bring stale tests in line with current behaviour
dorukozgen Nov 18, 2026
6c08e88
test: give main-agent-models its full api mock
dorukozgen Nov 18, 2026
8436bd7
fix(backend): answer only requests addressed to the app's own host
dorukozgen Nov 18, 2026
79c63f5
feat(shell): give the renderer a per-run backend token
dorukozgen Nov 18, 2026
6d7f860
test(backend): build the access tests' client in the shared helper
dorukozgen Nov 18, 2026
4ee5a67
chore(backend): share the test log capture and drop an unused feature
dorukozgen Nov 18, 2026
d420f79
fix(app): send the per-run token on every backend request
dorukozgen Nov 18, 2026
0d6936e
fix(backend): require the per-run token on API requests
dorukozgen Nov 18, 2026
a43ea80
fix(workspace): send file actions the bodies the backend expects
dorukozgen Nov 18, 2026
e687bd3
fix(shell): remove the unused local access-token server
dorukozgen Nov 18, 2026
f47d21e
fix(shell): keep loopback traffic off environment proxies on Linux
dorukozgen Nov 18, 2026
f212498
fix(shell): keep a match-all no_proxy and lowercase entries
dorukozgen Nov 18, 2026
e3927b6
chore(telemetry): default product analytics to PostHog's EU region
dorukozgen Nov 18, 2026
1f46ce1
docs: name PostHog's EU region in the working notes
dorukozgen Nov 18, 2026
884ffc9
fix(app): serve the release UI from the binary with a content securit…
dorukozgen Nov 18, 2026
32200e5
fix(app): keep Preview on local dev servers and stop forms from navig…
dorukozgen Nov 18, 2026
0374786
fix(app): load images in chat replies and workspace markdown only on …
dorukozgen Nov 18, 2026
6832f62
fix(shell): give the Browser panel no access to the app's commands
dorukozgen Nov 18, 2026
8eb2d51
fix(shell): keep remote credentials out of PR traces, AI prompts and …
dorukozgen Nov 18, 2026
858fd39
fix(shell): check paths before opening them in an editor
dorukozgen Nov 18, 2026
0214616
fix(backend): don't let another program share the backend's port on W…
dorukozgen Nov 18, 2026
0b7d93f
revert: keep the default backend bind on Windows
dorukozgen Nov 18, 2026
4cdbe0a
test(backend): make the timeout and SSH-path tests hold on Windows
dorukozgen Nov 19, 2026
74eafad
ci: run every Rust test target even when one fails
dorukozgen Nov 19, 2026
b5604f9
fix(backend): run agent commands with the user's clean PATH on Windows
dorukozgen Nov 19, 2026
0cb211d
ci: correct the advisory test step comment
dorukozgen Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Only debug builds read `.env` at runtime. In a debug build
# (`npm run dev:tauri`), `dotenvy` loads it into the backend's process env
# at the top of `serve_with_routing_setup` so the Rust side picks it up via
# at the top of `serve` so the Rust side picks it up via
# `std::env::var`. Release builds never read it: a project's `.env` in the
# directory Fleetify is launched from must not configure the app. Existing
# shell env wins — set values here are a fallback.
Expand All @@ -12,12 +12,13 @@

# PostHog product analytics. Both halves should match so backend + frontend
# events flow into the same PostHog project. Keys are `phc_*` public keys
# by design; safe to embed in shipped binaries. Default host is US cloud —
# set the *_HOST pair to https://eu.i.posthog.com for EU residency.
# by design; safe to embed in shipped binaries. The default host is
# PostHog's EU cloud; a project in the US cloud sets both *_HOST values
# to https://us.i.posthog.com instead.
POSTHOG_API_KEY=
VITE_POSTHOG_KEY=
POSTHOG_HOST=https://us.i.posthog.com
VITE_POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_HOST=https://eu.i.posthog.com
VITE_POSTHOG_HOST=https://eu.i.posthog.com

# Not Diamond — Fleet-owned routing key for the "Auto" model picker. Read at
# runtime by the backend (std::env::var). Fleet's own key, independent of any
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ jobs:
# twice. -D warnings makes any lint a failure; the workspace is clean.
- name: Clippy (compile + lint)
run: cargo clippy --workspace --all-targets -- -D warnings
# Test stays ADVISORY: ~6 tests fail on the Windows runner from
# path-separator (`\` vs `/`) + env assumptions, unrelated to app logic.
# Test stays ADVISORY (continue-on-error) and runs on the Windows runner.
# Bounded so a test that hangs (binds a port / spawns a process and waits)
# can't wedge the job — continue-on-error keeps a timeout non-blocking.
# --no-fail-fast: a failing test target must not stop the rest from running.
- name: Test (advisory)
continue-on-error: true
timeout-minutes: 12
run: cargo test --workspace
run: cargo test --workspace --no-fail-fast
# Prebuilt cargo-audit binary — `cargo install --locked` compiles it from
# source (several minutes) and pushed the job past its timeout. This pulls
# a release binary in seconds. Bounded + continue-on-error so a slow or
Expand Down
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,26 +249,26 @@ sends.
| Channel | Vendor | Default | Toggle | Outbox |
|---|---|---|---|---|
| Dashboard sync | Fleetify cloud (`fleetify.dev`, WebSocket) | **ON** | Settings → Privacy → "Dashboard sync" | `~/.fleetify/telemetry-outbox.sqlite` |
| Product analytics | PostHog Cloud (US, HTTP `/batch`) | **OFF** | Settings → Privacy → "Product analytics" | `~/.fleetify/posthog-outbox.sqlite` |
| Product analytics | PostHog Cloud (EU, Frankfurt, HTTP `/batch`) | **OFF** | Settings → Privacy → "Product analytics" | `~/.fleetify/posthog-outbox.sqlite` |

### PostHog integration

- **Code:** backend module at `crates/fleetify-backend/src/services/telemetry/posthog/`; frontend wrapper at `src/lib/posthog.ts`.
- **Fan-out:** the existing `services/telemetry/emitters.rs::enqueue_payload` writes to both the Fleetify cloud outbox AND the PostHog outbox (the latter via `posthog::enqueue_if_enabled`, gated on a runtime `AtomicBool`).
- **distinct_id:** the persisted `device_id` from `device.json` is reused on both sides. Frontend `posthog.identify(user_id)` runs at sign-in, at each launch while signed in, and at opt-in, and only while product analytics is on; it merges the anonymous person into the authenticated one via `$anon_distinct_id`, with the id only (`before_send` strips `$set` / `$set_once`).
- **Env keys:** `POSTHOG_API_KEY` (Rust, runtime `std::env::var`) and `VITE_POSTHOG_KEY` (Vite, `import.meta.env`). Unset → backend `init` short-circuits and the renderer wrapper no-ops. `POSTHOG_HOST` / `VITE_POSTHOG_HOST` default to `https://us.i.posthog.com`.
- **Env keys:** `POSTHOG_API_KEY` (Rust, runtime `std::env::var`) and `VITE_POSTHOG_KEY` (Vite, `import.meta.env`). Unset → backend `init` short-circuits and the renderer wrapper no-ops. `POSTHOG_HOST` / `VITE_POSTHOG_HOST` default to `https://eu.i.posthog.com`.
- **Runtime gate:** `telemetry_set_posthog_enabled` Tauri command persists the flag in `fleet.config.json::telemetry.posthog_enabled` AND flips the backend's `ENABLED` atomic live. Live opt-out stops new sends within ~10 s; the renderer's `optOut()` opts posthog-js out at once and drops every request it would still make, queued events and retries included.

### Local dev

Single source of truth is a `.env` file in the workspace root (gitignored — `.env.example` is the committed template). `dotenvy::dotenv()` runs at the top of `serve_with_routing_setup` so the Rust backend picks up the keys via `std::env::var`; Vite reads the same `.env` natively for the renderer.
Single source of truth is a `.env` file in the workspace root (gitignored — `.env.example` is the committed template). `dotenvy::dotenv()` runs at the top of `serve` so the Rust backend picks up the keys via `std::env::var`; Vite reads the same `.env` natively for the renderer.

```
# .env (gitignored)
POSTHOG_API_KEY=phc_yourtestprojectkey
VITE_POSTHOG_KEY=phc_yourtestprojectkey
POSTHOG_HOST=https://us.i.posthog.com
VITE_POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_HOST=https://eu.i.posthog.com
VITE_POSTHOG_HOST=https://eu.i.posthog.com
```

Then just run `npm run dev:tauri:wt` — no shell env juggling, no `cargo clean` needed because the keys are read at runtime now (was `option_env!` baked-at-compile, dropped in favour of runtime resolution). Shell-set env vars still win over `.env` so CI / production injection paths are unchanged.
Expand Down
16 changes: 1 addition & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fleetify-core = { path = "crates/fleetify-core" }
fleetify-backend = { path = "crates/fleetify-backend" }
tokio = { version = "1", features = ["full"] }
axum = { version = "0.8", features = ["ws"] }
tower-http = { version = "0.6", features = ["fs", "cors", "trace"] }
tower-http = { version = "0.6", features = ["trace"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
Expand Down Expand Up @@ -65,14 +65,15 @@ incremental = true
# unaffected (it strips symbols).
debug = "line-tables-only"

# Vendored fork of tauri-runtime-wry 2.11.2 with two changes, documented in
# Vendored fork of tauri-runtime-wry 2.11.2 with three changes, documented in
# vendor/tauri-runtime-wry/FLEETIFY_PATCH.md: the Linux embedded browser
# (right-panel webview) can be positioned instead of stacking full-width at the
# bottom of the window (upstream bug: tauri-apps/tauri #13071 / #10420), and on
# bottom of the window (upstream bug: tauri-apps/tauri #13071 / #10420), on
# WebKitGTK a frame inside the app can't use the app page's IPC permissions
# through postMessage. Everything else is a verbatim copy of the published
# crate. Remove this patch (and the vendor/ dir) once upstream fixes both. The
# version must stay equal to the tauri-runtime-wry that `tauri` pulls in, or
# Cargo will ignore the patch.
# through postMessage, and the embedded browser gets no Tauri IPC at all.
# Everything else is a verbatim copy of the published crate. Remove this patch
# (and the vendor/ dir) once upstream covers all three. The version must stay
# equal to the tauri-runtime-wry that `tauri` pulls in, or Cargo will ignore
# the patch.
[patch.crates-io]
tauri-runtime-wry = { path = "vendor/tauri-runtime-wry" }
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ cargo tauri build
`fleetify-backend` is library-only — no `main.rs`. The Tauri shell calls
`fleetify_backend::serve(addr, static_dir).await` from its `setup` hook;
the server runs as a tokio task in the same process. Sign-in lives in
the Tauri shell (`shell::auth`); the bearer is exposed to the backend
via `127.0.0.1:8770` (loopback bearer-bridge) so the React UI can use
the cookie-less OIDC flow without leaking the token across IPC. The 3
the Tauri shell (`shell::auth`), which holds the access token. The React
UI asks for it over IPC (`auth_get_access_token`); the telemetry client
gets it in-process from `shell::auth`. The 3
MCP-server binaries connect upward to `127.0.0.1:8765/api/sessions/...`
when the user's session invokes their tools.

Expand Down
Loading
Loading