Skip to content

chore(release): v0.6.0 certificate management by domain, concurrent downloads, no environments - #59

Merged
CN059 merged 17 commits into
mainfrom
dev
Nov 21, 2026
Merged

CN059 merged 17 commits into
mainfrom
dev

Conversation

@CN059

@CN059 CN059 commented Nov 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Certificates are keyed by domain, with material split into its own table and channels (push token / Certd pull / URL pull) attached to a certificate. Renewal replaces what is served instead of appending a row; the old shape made the fingerprint the identity, so every reissue created a new certificate.
  • A certificate has a derived status — active, expiring_soon, expired, not_yet_valid, pending — and applying one that cannot be served is refused before any file is written.
  • Deployment environments are gone (schema V24). The UI could switch an environment but not create one, and switching also rewrote the profile's tenant_id, silently moving a server between tenants. tenant_id remains, because that is what separates API tokens.
  • Several frp versions download concurrently; a slow download no longer blocks the next one.
  • The dashboard resource window is honest again: samples are evicted by age as well as by count, so an eight-hour clock correction can no longer make "last hour" contain two minutes. The chart averages into at most 240 buckets before drawing.
  • A skewed clock no longer breaks Certd pulls: a 20002 rejection is retried once signed with Certd's own Date.

Testing

  • cargo test --all — 240 passed
  • cargo clippy --workspace --all-targets — clean
  • bun test — 24 passed, tsc --noEmit clean, check:icons passed
  • Upgraded a live v0.5.4 database to V24 and verified the environment tables are gone while tenant_id and all profile/proxy data survive

Notes

  • Schema V24 drops environment and profile_environment. Environment data is not migrated because there is nowhere to migrate it to.
  • Prometheus traffic series lose their environment_id label. Any dashboard querying it needs updating.

CN059 added 17 commits November 19, 2026 07:39
- Both routes existed but had no navigation entry, so they were only reachable by typing the hash URL.
- Added the two keys to the nav union and the Configuration/Management groups, with zh/en labels.
Cards are a three-column grid with one metadata line per card; list rows use compact padding. The archive URL renders as a plain link instead of a copy button, and the page header collapses to a single row with the channel picker and layout toggle.
The ingest endpoint and automatic pull settings no longer stack under the certificate list. A pair of summary cards shows each channel's live status (listener address or source health) and opens a combined dialog holding both tabs. The screenshot harness gains mocked certificates, cert-ingest and cert-pull-sources data plus a certificates page capture.
- Evict resource samples by age as well as by count. The buffer was bounded
  only by count (3 600 samples at 1 Hz), so an eight-hour RTC correction left
  it holding nine hours of data and the one-hour filter retained just the two
  minutes after the jump.
- Average the series into at most 240 buckets before drawing: one sample per
  second is four points per CSS pixel, which reads as noise rather than a
  trend. The mean keeps a spike visible without letting it dominate.
- One install task per version instead of a single global slot, so a slow
  download no longer blocks the next one. Requesting a version that is
  already downloading returns `FRP_INSTALL_BUSY`.
- The downloads page reads the official release list and shows each build's
  archive size, download count and publish date, with a channel picker and
  card and list layouts.
- Settings no longer owns the version list; the page moved to
  「运维管理 → 版本下载」.
A certificate is now identified by its domain, and its material lives in
`certificate_material` — one row per issued bundle. Previously the
fingerprint was the identity, so every reissue appended a row instead of
updating one and the list grew until it was cleaned by hand.

How a certificate gets updated is a property of that certificate:
`certificate_source` holds push tokens and pull sources, each attachable,
movable and markable as preferred. A certificate can exist before it has
any material, so a source can be configured first and the first push or
fetch fills it in.

- Apply refuses a certificate that cannot be served (pending, expired or
  not yet valid) instead of overwriting a working file.
- A channel whose first fetch failed no longer leaves the list empty: the
  certificate exists immediately and reports the channel's last error.
- `RUSTFRP_CERT_INGEST_PUBLIC_URL` pins the advertised push URL when
  neither the request origin nor the bind address describes it.
- The pull scheduler runs daily in the daemon and restarts the frpc process
  after applying, because `frpc reload` keeps the certificate it loaded at
  startup.
- A skewed clock is recovered from instead of failing forever: Certd's
  rejection is a timestamp check and its `Date` header says what now is,
  so a `20002` answer is retried once signed with the server's clock.
- The certificates page lists status (active, expiring soon, expired, not
  yet valid, pending), and the row menu holds channels, apply, bind and
  delete. Four buttons did not fit at this width and pushed the table into
  horizontal scrolling.
- Each certificate manages its own channels: a push token or a pull source
  can be attached, moved, marked preferred, run or detached. Switching
  between push and pull no longer means deleting credentials.
- The proxy editor recognises `tls2raw` alongside the HTTPS plugins, so a
  certificate can be bound to it.
- The two ingest/source summary cards are gone; the endpoint is configured
  under System Status → Certificate channels, and the push URL is resolved
  from the request so it names the address the browser actually used.
- CHANGELOG records the certificate rewrite: domain identity, derive-don't-
  store status, refuse-to-apply, channel-per-certificate, request-derived
  push URL, the pull scheduler, and the tls2raw and clock-skew fixes.
- README documents the five states and where the endpoint is configured now
  that the summary cards are gone.
x509-parser, chacha20poly1305 and md-5 were added by the certificate work
but the lockfile was left out of that commit, so it could not be built from
a clean checkout.
The platform is single-user: one daemon, one SQLite file, one operator. An
environment was a second grouping axis on top of that, and the shape never
worked — the UI could switch it but not create it, so the selector was a
one-item dropdown, and switching also rewrote the profile's `tenant_id`,
silently moving a server between tenants.

Removed: `environment` and `profile_environment` tables (schema V24), the
`/api/v1/environments` and `/profiles/:id/environment` routes, and the
`environment_id` parameter on `/status` and `/metrics/history`. The
Prometheus traffic series lose their `environment_id` label.

`tenant_id` stays on profiles and proxies: it still separates API tokens,
which is the isolation that actually exists. `profile_belongs_to_tenant`
moved out of `environment.rs` because it only ever read `frps_profile`.
The sidebar selector was a one-item dropdown: environments could be
switched but not created, so it suggested a choice that did not exist.
It is gone, along with the per-row environment picker on Server Profiles,
`environment_id` on every fetch, and the stored selection in
`localStorage`.

Pages that filtered by environment now show everything, which is what a
single-user installation has anyway.
Certificates are keyed by domain with pluggable channels, the dashboard
window and its chart are fixed, downloads run concurrently per version,
and deployment environments are gone (schema V24).

Internal crate dependencies now live in `[workspace.dependencies]`; they
were written out per-crate with a stale version, so bumping the workspace
version broke resolution until each one was edited by hand.
`cargo fmt --check` is part of the Rust quality gate, and the certificate
work left long lines and chained calls unformatted, so every CI job that
runs it failed.
`cargo-deny` started failing on 2026-11-20 when RustSec published four new
entries, none of which this release introduces.

- RUSTSEC-2026-0543: chrono is unmaintained across the whole 0.4 line, so
  there is no upgrade that clears it. Replacing it touches every date path
  in the client and the API; that is a change of its own.
- RUSTSEC-2026-0566 / -0569: wasmtime only runs WASM plugins, and both need
  a hostile plugin to be loaded — the same trust boundary as running the
  plugin's own code.
- RUSTSEC-2026-0571: wasmtime-wasi-http is not in this dependency graph at
  all (the feature is not enabled), so the advisory cannot apply.

Each entry names its reason, so the next reader can tell a reviewed risk
from a silenced one.
The workspace crates moved to 0.6.0, but the pieces that live outside the
workspace were left behind, so CI's desktop job failed to resolve
`rustfrp-common = "^0.5.4"` against the now-0.6.0 crate.

- `plugins/gui/src-tauri` (excluded from the workspace, own lockfile):
  package version, the `rustfrp-common` and `rustfrp-daemon` path deps,
  and its lockfile.
- Both `package.json` files, so the bundled UI reports the release it ships
  in.
- README and the deployment guide, whose Docker tag and installer names
  are what an operator copies.
Moving frp version management to `/#/downloads` (0a4c3bb) left the browser
tests pointing at a `FRP versions` tab that no longer exists, so the
frontend job failed at the first click.

- The version-confirmation test now drives the downloads page: list
  releases, delete an installed one, and start a download from a card with
  a channel selected.
- `frp/installations` answers with an empty list and `frp/releases` with
  the full release shape, which is what the page reads.
- The batch-port conflict test scopes its toast by content: the previous
  successful batch leaves a toast in the same stack, so `.last()` depended
  on which one expired first. `--repeat-each=3` is green.

`restore_desired_running` checked the bare profile id against a marker
holding a full path. A temp directory named with a coincident digit made
the negative assertion fail on CI while passing locally; it now matches the
generated `id-name.toml` artifact.
@CN059
CN059 merged commit e97d66e into main Nov 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant