Commit Graph
125 Commits
Author SHA1 Message Date
raucao 55e1155e8e ci: document the runner setup (I3)
CI / test (push) Successful in 1m43s
CI / test (pull_request) Successful in 49s
The cache only works when the job container shares the host network (a
bridge job cannot reach the runner's cache server through a host
firewall); record that, force_pull and node_download so the runner can be
rebuilt without rediscovering them.
2026-11-30 11:34:19 +04:00
raucao 1ee4930f2b ci: run the job on a custom Arch image (I3)
CI / test (push) Successful in 3m40s
CI / test (pull_request) Successful in 49s
The ubuntu-latest runner image ships GTK 4.22, which cannot satisfy the
crate's v4_24/v1_10 features (they want GTK >= 4.23 / libadwaita >= 1.10,
newer than the latest stable GNOME release), so the first CI run failed
compiling gdk4-sys. The GNOME OS SDK is no better.

Build a regent-ci image (build-aux/ci/) from Arch with the GTK/libadwaita
headers, a rustup-pinned toolchain and the static cargo-deny binary baked
in, register a repo-level runner with the matching label, and drop the
apt/rustup/install-action steps.

Bump url to 2.5.9 (RUSTSEC-2026-0592), which the cargo-deny step would
otherwise fail on.
2026-11-30 11:18:36 +04:00
raucao b42f9b925a chore: fix the clippy gate, guard the vault version, add CI (I3)
CI / test (pull_request) Failing after 2m31s
CI / test (push) Failing after 2m41s
2026-11-30 10:31:00 +04:00
raucao 4076f6707b approval: disclose NIP-04 requests with a legacy banner (I2) 2026-11-30 10:31:00 +04:00
raucao 5e071a8d9e main: read the pairing URI from stdin with --pair - (I1) 2026-11-30 10:31:00 +04:00
raucao b5a88b6c4c icons: bound inline data URLs before decoding (L7) 2026-11-30 10:31:00 +04:00
raucao fc4eab35c9 store: create private (0700) directories (L6) 2026-11-30 10:31:00 +04:00
raucao f4487f4425 headless: refuse shared passphrase files; wipe secret buffers (L5) 2026-11-30 10:31:00 +04:00
raucao e67963d86b signer: serialize the pairing dialog through the approval queue (L4) 2026-11-30 10:31:00 +04:00
raucao 6e1f35ef62 store: pin the unlocked-vault gate for change/export (L3) 2026-11-30 10:31:00 +04:00
raucao 9c886b7493 ui: confirm export passwords, mask imports, expire copied secrets (L2) 2026-11-30 10:31:00 +04:00
raucao 910554c8d6 signer: rotate the pairing secret on every new pairing (L1) 2026-11-30 10:31:00 +04:00
raucao b4fe138641 store: serialize vault mutations and write unique temp files (M9) 2026-11-30 10:31:00 +04:00
raucao 0f983ff558 signer: drop strangers silently and dispatch with bounded concurrency (M8) 2026-11-30 10:31:00 +04:00
raucao 75f4998ced sanitize: strip control and bidi characters from client text (M7) 2026-11-30 10:31:00 +04:00
raucao 5d750fb0d3 policy: share the auto-approval limit with the running signer (M6) 2026-11-30 10:31:00 +04:00
raucao 5a9fc6ee18 state: lock the vault on suspend and count sleep in the auto-lock (M5) 2026-11-30 10:31:00 +04:00
raucao 35c52c12cf signer: validate client relays and scope responses to the arrival relay (M3) 2026-11-30 10:31:00 +04:00
raucao dd089e1855 app: take an unconditional single-instance lock (M4)
Both the GUI (in startup) and headless take an unconditional flock on regent.lock (0600); a refused instance short-circuits activate/open so it cannot pair.
2026-11-30 10:31:00 +04:00
raucao 8df0357d13 icons: harden the HTTPS fetch against SSRF (M2)
The single HTTPS fetch now sets no_proxy, rejects URL userinfo on every hop, and allow-lists IPv6 to 2000::/3 minus the special ranges; IPv4 rejects all of 0.0.0.0/8.
2026-11-30 10:31:00 +04:00
raucao c435fccd8f signer: store a permission only once the request is answered (M1)
gate() no longer writes apps.json; authorize_inner re-checks the app's identity (and its stored permission) after the last await and only then stores 'always', so a revoke or rebind during a prompt denies.
2026-11-30 10:31:00 +04:00
raucao 890f934e4a icons: gate image dimensions before decoding (H3)
decode() reads the container header and refuses anything over 1024x1024 before gdk::Texture::from_bytes allocates it; preview_icon no longer caches a pre-consent texture.
2026-11-30 10:31:00 +04:00
raucao 55f069e978 approval: disclose what sign_event/encrypt cannot show in full (H2)
The dialog now shows the client-requested created_at and warns (adw::Banner) when content, tags, tag values or an encrypt message exceed what it can show, and offers the full encrypt message. incoming() rejects a malformed kind/content/tags instead of coercing them.
2026-11-30 10:31:00 +04:00
raucao a5a1788319 signer: drop replayed and stale NIP-46 requests (H1)
kind:24133 is ephemeral, so every relay delivery of a captured request reached the responder again. A ReplayGuard in the responder loop now drops an event whose created_at is outside a 120 s window (or predates this run) and any event id already seen.
2026-11-30 10:31:00 +04:00
raucao 12b78c848c Merge pull request 'Add the release tooling (Gitea + AUR + Nostr)' (#7) from dev/releases into main
Reviewed-on: #7
2026-11-29 20:35:06 +00:00
raucao 3cb7cb617f Release signing: GPG for the tag and tarball, SSH for the commit
Corrects the signing scheme. The release itself — the annotated tag and a
detached signature over the tarball — is GPG-signed; the release commit is
SSH-signed. Because the GPG key lives on a laptop and the build runs on the
build host, the single script becomes three stages split across two machines:

  prepare <ver>  build host: bump, build, meson dist, SSH-signed commit
  sign    <ver>  laptop:     GPG-sign the tarball and the tag
  publish <ver>  laptop:     Gitea release, AUR, Nostr

The GPG key never touches the build host, and only dist/ travels: the laptop
pulls it over SSH. The two signing formats are set per git command
(-c gpg.format=ssh|openpgp), so neither depends on a machine's global config.

- release.sh: prepare/sign/publish subcommands; SSH commit, GPG tag + detached
  tarball signature; REGENT_SSH_SIGNING_KEY / REGENT_GPG_KEY; a release.env
  handoff that pins the tagged commit; optional dist/ pull.
- AUR regent: the .asc in source and validpgpkeys pinned to _fingerprint.
- .ngit/release.yaml: the .asc and an exported public key, replacing the SSH
  .sig and allowed_signers.
- README, doc/dev/releasing.md, AGENTS.md updated for the split.
2026-11-30 00:28:52 +04:00
raucao ba3d07d7d7 Move the release docs into doc/dev/releasing.md
The release process is a maintainer's job, not part of local development, so it
gets its own document. development.md now just points at it (and the README's
documentation list gains an entry).
2026-11-30 00:08:54 +04:00
raucao 07a7976711 Add the release tooling (Gitea + AUR + Nostr)
build-aux/release.sh cuts a release from main: it bumps the version in
meson.build/Cargo.toml/Cargo.lock, generates the AppStream release entry from
CHANGELOG.md, builds and signs the distribution tarball, tags it, and publishes
to Gitea (gt release create), the AUR, and Nostr (ngit release publish). Every
outward-facing step is skippable (--no-push/--no-release/--no-aur/--no-nostr),
so a build can be prepared and reviewed before it goes anywhere.

Signing is SSH-only (git's gpg.format=ssh): an annotated tag plus an
ssh-keygen -Y sign detached signature over the tarball. That lets the key stay
on a laptop — run the script under ssh -A and the forwarded agent signs, so the
key material never lands on the build host.

Also:
- CHANGELOG.md: the single source of release notes (Keep a Changelog).
- build-aux/gen-metainfo-releases.py: generates the metainfo <releases> block
  from it, translating the version dialect (1.0.0-beta.1 -> 1.0.0~beta.1, with
  type=development) and exposing --notes for the release notes text.
- build-aux/aur/{regent,regent-git}: the AUR recipes (release tarball and VCS).
- build-aux/regent-dev: the working-tree package, renamed from regent-git to
  make room for the AUR regent-git; deploy-dev.sh --pkg builds this one.
- .ngit/release.yaml: the NIP-82 release manifest (Blossom mirror at
  blossom.kosmos.org), replacing the hand-rolled NIP-94/30063/32267 plan.
- Docs: README (install + verify), doc/dev/development.md (Releasing),
  AGENTS.md (Releases).

This adds tooling only: it cuts no tag and publishes nothing.
2026-11-29 23:57:07 +04:00
raucao 0d9aaad3da Note the canonical Gitea repo and its Nostr mirror
The repo is announced on Nostr now (NIP-34, through `ngit`), so the notes say
which side is which: `origin` is Gitea and every branch tracks it, Gitea is
advertised in the announcement as both the homepage and a clone URL, and pushing
a branch to Nostr is the separate `git push nostr` that also copies the git data
to the GRASP hosts. Also records the two repo relays (repo events go nowhere
else), and the `ngit init` trap that renames the Gitea remote to `gitea-kosmos`
and points `origin` at Nostr. The header no longer calls the repo private — it
isn't.
2026-11-29 23:32:37 +04:00
raucao 1b981212fb Merge pull request 'Add a trademark policy for the name and logo' (#6) from chore/license into main
Reviewed-on: #6
2026-11-29 19:21:42 +00:00
raucao 3b12bc6a9c Add a trademark policy for the name and logo
The code stays Unlicense (public domain); this is additive. A copyright
license grants no rights to a name or logo — the Unlicense is silent on
trademarks, so those were never given away, and a name is not copyrightable
at all. The one gap was the artwork: the icon SVGs sat inside a public-domain
repo with no notice of their own, so anyone could read the dedication as
covering them.

TRADEMARK.md (based on the Model Trademark Guidelines) claims the word
"Regent", the app and symbolic icons and the application id; it permits
nominative use and unmodified redistribution, and requires a fork to pick its
own name and icon. No registration is claimed — "™", not "®". The icons stay
under the Unlicense; the policy only governs using them as a mark.

README, the About dialog and the AGENTS.md hard rule now state the split.
2026-11-29 23:18:45 +04:00
raucao 03656db08c Re-fetch a profile on demand, and let an equal kind-0 fill in new fields
An identity with a valid NIP-05 address never showed it, however often the
profile was re-fetched. `put_metadata` only stored a *strictly* newer kind-0, so
`nip05` — a field added to `Profile` after the cached entries were written — was
refused along with the very event that carries it. The same comparison meant
`fetched_at` never advanced for an unchanged profile, so `needs_refresh` stayed
true and every start re-fetched it again.

The writer now answers two questions separately. Do we *have* this version? A
newer or equal `created_at` says yes: the clock moves and the answer counts.
Whose *content* does the entry hold? A newer version replaces it; an equal one is
the same version re-fetched, which is what backfills a field added later. Two
versions in the same second are settled by the lower event id — NIP-01's rule for
replaceable events — in the merge map and in the cache (`kind0_id`), so a relay
serving only one of them cannot make what we hold flip; an entry written before
that id was kept adopts the next equal-`created_at` answer. An older version is
still refused, which is the point of the watermark. `put_relay_list` stays strict
deliberately: its attempt clock moves on every call, so nothing can be stranded
there — and if a kind-10002-derived field is ever added, it has to become `>=` at
the same time.

The NIP-05 parser takes the email-ish local part now (`. _ % + -`, any case), as
clients in the wild use; it only reaches a percent-encoded query parameter. The
domain half stays strict, because that is what becomes the outbound request.

On top of that, the identities list can re-fetch one profile on demand: "Re-fetch
profile" (`AppState::refetch_profile`) loosens the 7-day discovery TTL, the 1-day
directory-fallback backoff and the 1-day NIP-05 backoff for that key, and a
per-key claim (`profile_fetch_in_flight`, claimed by automatic refreshes too, held
with a self-healing bound and released by comparing the stamp this call wrote)
keeps repeated clicks from opening parallel rounds. It cannot make anything worse:
the cached name, picture, relay list and watermarks are untouched, a profile is
stored only when it is newer than `kind0_at`, and an address can only be
*un*-verified by a definitive non-match.

The fetch reports what it found — `FetchOutcome::{Updated,UpToDate,NotFound}`,
decided by comparing what the app shows before and after — and the menu answers
with it ("Profile updated" / "Profile is up to date" / "No profile found"),
dismissing the "checking" toast rather than outranking it: libadwaita shows one
toast at a time, and a high-priority one only pushes the previous toast back into
the queue, where it would return stale.
2026-11-29 23:05:58 +04:00
raucao 681e112803 Merge pull request 'Rewrite the README and split out the docs' (#5) from doc/readme into main
Reviewed-on: #5
2026-11-29 18:59:18 +00:00
raucao e9f587c43a Require REGENT_BUILD_HOST instead of defaulting to a specific machine
The wrapper fell back to one hard-coded build host when the variable was
unset, so it silently only worked on that one machine. It now exits with a
clear message pointing at the variable, and the dev doc marks it required
(REGENT_REPO_PATH keeps its `~/src/regent` default).
2026-11-29 22:55:26 +04:00
raucao 9484c56665 Generalize the deploy instructions in the dev doc
The "Testing on another machine" section hard-coded the build host (`nuc-zt`)
and repo path (`~/src/regent`), so it read as notes for one particular setup.
It is now "Deploying to another machine": the two scripts are described
generically, the copy-paste uses `BUILD_HOST` / `PATH/TO/regent` placeholders,
and the `REGENT_BUILD_HOST` and `REGENT_REPO_PATH` overrides are documented
(with the old values noted as their defaults). `--emit` joins the on-host
list, and the narrative is build-host/test-machine rather than naming specific
machines.
2026-11-29 22:49:12 +04:00
raucao 680229138d Rewrite the README in Marco's style and split out the docs
The README mixed a short introduction with the build steps, the nightly
build, headless mode, CLI pairing and the two-machine deploy workflow, all
in one file. It now opens with the app icon and a prose description, then
Status, Installation (build from source for now, AUR planned), Repositories
& Contributions (Gitea and ngit), Documentation, License and Contact — the
shape Marco's README uses.

The build, test, validation and dev-deploy material moves to
doc/dev/development.md, and headless mode plus `regent --pair` to
doc/advanced.md, both linked from the README.

The description is also more accurate: Regent runs on GNOME and other Linux
desktops (not GNOME only), requests covered by an "Allow always" permission
are answered without a prompt (so not *every* request is shown), and several
keys can be held and used in parallel.
2026-11-29 22:40:21 +04:00
raucao ca7ba5d8d7 Show identity keys in one style, and verify NIP-05 before showing it
Every key in the app is now the same kind of thing: `plain::key` /
`.key-value` renders it in the monospace font at the size the label already
has, as a fixed `head…tail` cut, so a column of them lines up. Deliberately
not libadwaita's `.monospace`, which also switches to the code size and, on an
`AdwActionRow`, takes the field name with it. The identities list shows the
name over the key alone (it used to be "Profile · npub" on one line, where a
long profile name ate the key's tail), and the switcher keeps its own shorter
npub cut and renders it at `.caption`: a key is never body-sized there, and the
row's bold *name* stays the loudest thing in it.

The switcher's second line prefers a NIP-05 address — but only one the domain
has confirmed for exactly this key, because a kind-0's `nip05` is
self-declared and that line is where an identity is identified.
`store::nip05` parses the address strictly (it becomes an HTTPS request, so a
sloppy parse would be an SSRF), asks
`https://<domain>/.well-known/nostr.json?name=<local>` through the icons'
hardened fetch — now split into `fetch_https(url, Content)`, the app's single
HTTP path — and shows the address only while `nip05_ok == nip05`. A
re-declared or forged address is unverified again immediately, a slow answer
for a changed one is dropped, and a failed check costs a day.

Names are no longer invented: no "Identity 3" and no "Imported 1". The create
dialog starts empty, import carries a Name field that is prefilled from a
cached profile as soon as the pasted string decodes to a key, and an empty
field stores no label at all. A discovered profile name trumps the label for
display (`identity_label`), which is what happens for a key imported before
its profile was known — the label itself is never overwritten.
2026-11-29 16:33:53 +04:00
raucao 549829b0c0 Fetch real identity profiles and avatars through directory relays
An identity showed initials and often no name, while a client application's
icon was fetched, cached and rendered. Two reasons: profiles were fetched only
from Regent's configured relays — a members-only NIP-46 relay with no profiles
— and `Filter::limit(0)` caps the *stored* events a relay answers with to zero,
so that fetch received nothing at all even where profiles existed.

Discovery now goes through a measured directory set (directory.yabu.me,
purplepag.es, profiles.nostr1.com; `PROFILE_RELAYS`, overridable with
`REGENT_PROFILE_RELAYS`, else `REGENT_RELAYS` so an overridden run stays
offline). One REQ per author per relay: purplepag.es silently under-returns a
multi-author filter (8 of 20 keys batched, 15 of 20 per author), and its union
with the others is the same 15/20, so more relays buy availability, not
coverage. Three EOSE-capped waves on one ephemeral client — the identity's
kind-10002 and profile from the directory, then kind-0 from its own
write/unmarked relays, then the directory again if those served nothing — feed
one newest-wins map per kind. A relay is connected only when a wave will use it,
so a warm outbox opens no socket to the directory at all.

`profiles.json` keeps the outbox and its clocks: `write_relays` with the
kind-10002's `created_at` as a watermark, a 7-day TTL on discovery *attempts*
(so an identity that publishes no 10002 is re-discovered weekly, not on every
start), and a 1-day backoff on the directory fallback (a missing profile never
advances `fetched_at`, so `needs_refresh` stays true). A far-future `created_at`
is refused, so a relay cannot pin a watermark out of reach.

The picture is cached and rendered like a client icon: same hardened
`IconStore`, same 0600 files, decoded on the main loop. Identity avatars are
*not* behind `load-app-icons` — that switch is about a not-yet-trusted client's
URL — so the icon gc's live set grows to clients plus vault identities,
`forget_textures` clears the one-shot hydration claims it used to leave behind,
and removing a key forgets its avatar immediately. The switcher, the identities
list, the Connect dialog and the approval dialog's "Signing as" field draw it;
the Apps page's row stays text-only (that avatar was dropped deliberately in
d4bb9d5).

The gossip path in nostr-sdk was considered and rejected: its store is
in-process, it builds one filter per relay with the whole author set, and it
needs the same directory set anyway. Gitea issue #1.
2026-11-29 14:47:00 +04:00
raucao a9d51db400 Sort the app list by approval time, newest first
list_for now orders an identity's apps by approved_at descending, so the
Apps page shows the app just paired at the top instead of wherever it
landed in apps.json. Whole-second timestamps tie, so the stable sort is
reversed to keep the later pairing first among equals; entries written
before approved_at existed carry 0 and sink to the bottom.

apps.json still stores insertion order — this is a view rule, and every
consumer of list_for (the Apps page, Forget all, the Connect dialog's
count, the identities window's revocation list) wants the same order.
2026-11-28 21:06:49 +04:00
raucao d4bb9d5978 Drop the identity avatar from the app's "Signing as" row
The per-app detail row in the Apps page no longer carries an identity avatar.
The approval dialog and the Connect dialog keep theirs; the expanded details
row is back to plain text.
2026-11-28 16:35:51 +04:00
raucao 1cc2dd1319 Let the user name an app that declares no metadata
A client that sends no metadata — the bunker direction often sends none —
leaves only an npub, and there was no way to name it.

Add `App.label`, the user's own name, kept separate from the client's `name`:
`approve` rebuilds the entry on every pairing, so a label stored in `name`
would be lost the next time a metadata-less client reconnects. `display_name()`
prefers the label, and `AppRegistry::client()` returns it, so the approval
dialog and the activity log show what the user calls the app; a declared name
that differs stays visible as a "Declared name" row.

The "wants to connect" dialog asks for a name, right under "Application", when
the client declared none. The answer to a prompt becomes
`Answer { decision, name }` so the name reaches the responder's `approve`
(headless `--pair` passes none). `approve` preserves an existing label when the
dialog collected none.

The Apps page gets a per-app `view-more` menu — Rename… and Revoke — replacing
the visible Revoke suffix, and a rename dialog.
2026-11-28 16:29:11 +04:00
raucao 35fd7614ad Draw the signing identity's avatar like a client app's
The approval dialog showed a client avatar on the "Application" field but no
identity avatar on "Signing as", and the Connect dialog's and the Apps page's
"Signing as" rows had none either.

Add `plain::avatar`/`plain::set_avatar` — initials of the name, or libadwaita's
glyph when there is none, with a cached image when there is one — and use it for
the client fields and the identity fields alike, so the identity's
avatar/placeholder is drawn exactly like a client application's. The Connect
dialog keeps its avatar widget and repoints it on refresh, since the row is
built once.

Identities have no cached image yet (fetching kind-0 pictures is a later
change), so they show initials for now; the texture lookup is already in place.
2026-11-28 15:59:22 +04:00
raucao 0d98a53fce Raise the identities window instead of an "is ready" notification
GNOME Shell's focus-stealing prevention shows a "<app> is ready" notification
instead of raising an already-mapped window that has no valid activation token;
only a window mapped for the first time is focused in the default `smart`
mode. That is why it only happened after adding the first identity: on first
run the identities window *is* the app and is already mapped, and once a key is
added the next "Manage identities" re-presents it.

Make the identities window transient for the main window while that is
visible, so it is focused together with its parent. With no visible main window
(first run, last key removed) it stays a standalone window, as before.
2026-11-28 15:34:00 +04:00
raucao fca9851d8f Go back to the alert-style add/import dialogs, in a taller window
The plain `AdwDialog`s with the accept button in the header bar are not
wanted; restore the `AdwAlertDialog` versions of "Create an identity key" and
"Import an identity key".

The clipping they were meant to fix was the window height, not the dialog
style: the identities window is a fixed size and GTK never resizes a mapped
window, so its default has to fit the first-run empty state and the dialogs.
Keep the taller window (420x560); the width goes back to the original 420.

Reverts most of the previous commit.
2026-11-28 15:18:58 +04:00
raucao ab09201a2e Fit the identities window and its add/import dialogs
The identities window is a fixed size and GTK never resizes a mapped window,
so its default has to fit the first-run empty state. At 420x480 it did not:
the `AdwStatusPage` overflowed (its buttons were cut off), and so did the
"Create an identity key" / "Import an identity key" dialogs, which are
presented as overlays inside the same window.

- Size the window 480x560. 480 wide also drops the empty state's description
  from four lines to three.
- Rebuild create/import as plain `AdwDialog`s in the "Connect an app" shape: a
  header bar with Cancel and the accept button over a scrolling body. An
  `AdwAlertDialog`'s message area only *propagates* its natural height
  (`adw-alert-dialog.c`), so a form taller than the window grows past it and is
  clipped instead of scrolling. The new dialog's body scrolls and its buttons
  stay pinned.
- Keep the dialog open when creating/importing fails, so a passphrase mismatch
  can be corrected (the old alert closed before reporting the error).

Rename/export/remove stay `AdwAlertDialog`s: they are single-field or one-line
and fit.
2026-11-28 15:01:12 +04:00
raucao a8dd45b890 Keep the nostrconnect:// handler on the stable build
With both builds installed, both desktop files claimed
`x-scheme-handler/nostrconnect`, and the nightly deploy left the default
unset — so which app opened a link was decided by GIO's handler order, and
the nightly (whose vault has its own, often empty, identity) could end up
receiving links it could not pair.

The nightly desktop file no longer declares the scheme: system
integrations belong to the installed release. The nightly still accepts a
`nostrconnect://` argument (`HANDLES_OPEN`) and pairs through "Connect an
app…", it is just never the default handler.

GIO keeps honouring a `mimeapps.list` default even after the desktop file
stops claiming the scheme (verified), so `regent-deploy` also hands a stale
nightly association back by dropping the entry, leaving the stable build as
the only remaining handler.

Fix the second half too: a link-opened pairing presents no "Connect an app"
dialog, so `ConnectDialog::report_error` was parenting its alert to that
never-presented dialog (`self.window()` is `None`), and any failure — a bad
URI, or a build with no identity key — was silent. It now falls back to
`Windows::visible_parent()`, like every other pointer route.
2026-11-28 14:24:34 +04:00
raucao 5ff4d5d0f0 Add a nightly .Devel build profile and icon
A `-Dprofile=development` build is a separate application identity: the app
id carries a `.Devel` suffix, and the desktop file, AppStream id, icon,
GSettings schema id/path, GResource bundle name, D-Bus name and data
directories all follow, with a `regent-devel` binary so it installs beside
the stable one instead of replacing it. The Rust side switches `APP_ID` on
a cargo `devel` feature (a feature, not an env var, so the shared cargo
target dir cannot return a binary built for the other profile); the
metadata files become `.in` templates configured from `app_id`.

The nightly uses the banded nightly app icon and libadwaita's striped
`devel` header bar. The dev deploy selects it with
`REGENT_PROFILE=development`; the release `--pkg` build stays stable, and a
nightly install leaves the `nostrconnect://` scheme handler to the stable
build.

Two Meson details this depends on: the GResource prefix is fixed by
`resources.gresource.xml` (not the resource id) and is shared by both
profiles, and `gnome.compile_schemas()` scans the source directory, so the
generated schema is compiled by a `glib-compile-schemas` target instead.
2026-11-28 13:44:44 +04:00
raucao c71f110f6f Run in the background, with a status icon and autostart
Closing the main window now asks whether to keep Regent running in the
background or to quit, and remembers the choice (reversible in
Preferences). A backgrounded Regent still answers requests: the approval
drain presents the hidden window for a prompt and hides it again once the
whole request is answered, so the application that asked regains focus.
The two-window invariant becomes "the main window is presentable exactly
when the responder can serve prompts". With no key, or a stopped signer,
closing still quits.

A StatusNotifierItem (ksni) adds Show/Hide Regent, Preferences and Quit;
it is menu-only on activate, because GNOME's AppIndicator extension waits
out the double-click interval whenever an Activate method exists. A new
"Background" preference group carries the close action, the icon toggle
and start-at-login, which registers with org.freedesktop.portal.Background
(so GNOME lists the app under Background Apps) and starts it with
--background.

Also: dialogs parent to the visible window rather than the primary one, a
signer start-failure dialog is suppressed while the window is hidden, and
the Requests group moves to the bottom of Preferences.
2026-11-28 12:42:18 +04:00
raucao 767046b159 Simplify the app-icon preference wording
Drop the "Appearance" group description and shorten the switch byline to
"Fetch and show app icons when pairing".
2026-11-26 23:13:49 +04:00
raucao eee77b9f76 Label metadata-less clients by their key and preview icons at consent
Connecting noStrudel by pasting Regent's bunker:// code showed "(unnamed)" and
no icon. noStrudel (through applesauce-signers) only sends client metadata in
the client-initiated direction: fromBunkerURI is called without metadata, so its
connect request is [remote, secret, perms] and there is no metadata for Regent to
read. That direction cannot be fixed here, but it should not render as broken.

- The approval dialog and the Apps row fall back to the shortened npub and build
  the AdwAvatar with show_initials(false) instead of feeding the
  "(unnamed)"/"Unnamed application" placeholder into the initials, which showed
  as "(" / "U".
- parse_client_uri and client_info treat empty name/url/image (and perms) as
  absent. Clients that always emit name=&url=&image=&perms= used to store
  url: Some(""), which rendered an empty byline instead of the npub fallback.
- The approval dialog now fetches the client's declared icon before approval,
  but only when load-app-icons is on. AppState::preview_icon is memory-only: no
  disk cache is written for an unapproved app, so a denial leaves nothing behind.
  This turns M11's blanket no-fetch-before-consent rule into a user setting.

Adds tests for empty query and connect metadata values.
2026-11-26 22:57:47 +04:00