Repository navigation
feat(flatpak): carry notesd and notesctl only - #294
Merged
Merged
Conversation
Plan 0011, Phase 2 (ADR-0050): the Flatpak holds notesd, notesctl, the launcher and the Background helper, and no window. It drops the window's permissions (wayland, fallback-x11, ipc, dri, pulseaudio), the desktop entry and the MyGo and NSGo builds, and its AppStream component becomes a console-application that provides notesctl. The launcher starts notesd as before, waits for the Background request, and ends with notesctl status. notesctl gains status (notesd, its vaults, their sync, the hubs, the background setting, or why notesd is not running), background [on|off] (ADR-0033's setting, on by default) and hub pair. The Flatpak's files move from internal/desktop/system to the UI-free internal/flatpakapp.
bketelsen
force-pushed
the
feat/flatpak-notesd-only
branch
from
November 26, 2026 10:47
f2cd7af to
6b2d9e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plan 0011, Phase 2, "The Flatpak carries notesd" (ADR-0050, on #292).
org.frostyard.Frostnotesnow holds notesd,notesctl, the launcher and the Background helper, and no window: a desktop edits its vault folders with any editor of Markdown files, Obsidian among them, and notesd syncs them. The desktop clients' code stays in the repository; Phase 3 removes it. This PR links ADR-0050, which lands with #292: merge it after #292.What the Flatpak holds.
/app/bin/frostnotes(the launcher),/app/bin/notesd,/app/bin/notesctl,/app/libexec/frostnotes-request-background, the metainfo and the icons. No MyGo or NSGo client, no--mygo, and no desktop entry. App ID, data directory, socket path and the device-token rules of ADR-0045 are unchanged.Permissions. Kept:
--share=network(the hub),--talk-name=org.freedesktop.secrets(the device token),--filesystem=home(vault folders, watched and written in place). Dropped, because only the window used them:--socket=waylandand--socket=fallback-x11(a display),--share=ipc(X11 shared memory),--device=dri(the GPU that drew the window),--socket=pulseaudio(sound).The launcher.
flatpak run org.frostyard.Frostnotesreplaces a notesd of an older build (ADR-0032, unchanged), starts notesd throughflatpak-spawn --latest-version frostnotes --notesdwhen none answers (once per data directory, as before), then runs the Background request and waits for it (with no window, its sandbox ends when it exits, and the portal drops a request whose caller left the bus), and lastexecsnotesctl status, whose output and exit status are the launcher's.--notesdand--background(the autostart entry's command line) are as before; the off line innotesd.lognow namesnotesctl background on. Any other option (--mygo) exits 2 and says Frostnotes has no window;--helpnames the setup.Background activity (ADR-0033's setting) is on by default and is a
notesctlcommand,notesctl background [on|off], not a launcher flag:notesctlis the setup's one command line, it runs in the app's sandbox with the same config and state directories, it waits for the portal's answer and reads it back, and its Go code has tests onrpctest. Off does not stop a running notesd (it says so: until logout ornotesctl shutdown). A refusal namesflatpak permission-set background background org.frostyard.Frostnotes yes, since without a desktop entry GNOME Settings does not list the app.Desktop entry and metainfo. No desktop entry: it would open nothing. AppStream requires a
desktop-applicationto name a desktop entry as its launchable, so the component is aconsole-application, which must provide a binary (notesctl); the icon is named as astockicon soappstreamcli composecaches it and the OCI labels carry it to flatpak-index (whose runbook asks only for the metainfo and icons).appstreamcli validate --no-net --pedanticpasses locally (1 pedantic note, the same as before: an uppercase letter in the ID). The one screenshot,docs/images/notesctl-setup.png, is a terminal picture ofvault add,hub join,sync status,lsandstatus: the real output of the built notesd andnotesctl, run in the Flatpak's environment (its socket path and setting files,FROSTNOTES_SECRETS=file, no session bus) against a hub notesd on loopback, with a stand-in Background helper that grants, and the temporary directories shown as/home/anaand/run/user/1000. It was drawn by a throwaway Go program, not committed. Consequences: the app grid shows no Frostnotes; GNOME Settings' Apps does not list it; whether GNOME's Background Apps menu lists the notesd is not checked.notesctl. Already there:vault add(--create,--name),hub join URL NAME(pairs when needed, waits for approval, re-pairs once on a revoked token),sync status|conflicts|leave. Added:notesctl status: whether notesd answers, each vault with its sync, the paired hubs, and in the Flatpak the background setting; when notesd does not answer, the last 10 lines ofnotesd.logand, after the launcher's portal failure, the 3-step fix; exits non-zero then.--jsontoo.notesctl background [on|off].notesctl hub pair URL [--device NAME]: pair, or pair again, without joining a vault (the windows' "Pair again").internal/desktop/vaultswas not reused:hub joinalready has its pairing, approval and re-pair rules, with tests. The Flatpak's files (paths,notesd.log's end, the background setting) moved frominternal/desktop/systemto a UI-freeinternal/flatpakapp(ChangeandAskletnotesctlwait for the helper);internal/desktop/systemnames them for the clients, unchanged in behaviour.What an existing install sees after the update. The same app ID, data directory, socket and Secret Service item, so its vaults and pairing stay. The autostart entry that the portal wrote runs
frostnotes --background, which the launcher still takes, so notesd starts at the next login. A background setting a window turned off stays off. The app's desktop entry goes. A notesd of the old build keeps running until logout or the nextflatpak run org.frostyard.Frostnotes. The update removes permissions only, which needs no consent.Also.
make flatpak-sourcesno longer reads the NSGo module (go-sources.json: 228 lines removed, nothing added).stamp-version.shno longer stampsNSGO_VERSION. CI's export job gains a step that checks the bundle: the 4 programs, no client or desktop entry, nosockets=/devices=in its metadata, and a composedconsole-applicationwith a cached icon.packaging/nsgo/build-rc.shcopies this launcher, so the NSGo preview now starts notesd and no window;docs/development.mdsays so, and Phase 3 removes the preview. Plan 0011's status is not edited.Risk tier
Risk tier: 3 —
risk:highpaths:packaging/flatpak/org.frostyard.Frostnotes.json(L1): builds./cmd/notesd ./cmd/notesctlonly (no MyGo tag or ldflag, no NSGo build), drops 5 window permissions and adds none, and installs no desktop entry. Safe: only removals infinish-args; app ID, runtime, Go pin and sources are unchanged; the test commands check what/appholds.packaging/flatpak/frostnotes.sh(L1): the default path no longerexecs a window; it waits for the Background helper andexecsnotesctl status.--notesd,--background, the update replacement and every bound are unchanged. Safe: the smoke test covers each path, and the old autostart entries'--backgroundstill works.packaging/flatpak/request-background.py(L1): docstrings, comments and the request'sreasontext only; no logic changed.packaging/flatpak/stamp-version.sh(L1): removes theNSGO_VERSIONstamp, whose manifest line is gone. Safe:TestStampVersion*ininternal/packagecheckstill pass..github/workflows/flatpak.yml(L1 and L2): adds onerunstep to the export job that reads the built bundle withostree; no new action, permission, secret or trigger.Docs housekeeping
design/app.md"The Flatpak" names ADR-0050 and plan 0011's Phase 2AGENTS.mdmap)Verification
make checkgreen (host): exit 0 onf2cd7afmake flatpak-sourcesrun (the script changed, notgo.mod)FROSTNOTES_BIN_DIR=… sh packaging/flatpak/smoke-test.sh): "smoke test passed"appstreamcli validate --no-net --pedanticon the metainfo: passed, 1 pedantic notecheck-readme.mjs(coref99acfd, in the nsl machine):ok README.md (app, 905 words)actionlint .github/workflows/flatpak.yml: no findingsNot run here: the Flatpak build itself (the Makefile has no target for it; CI's Flatpak job builds and tests it), and nothing on a real desktop: plan 0011's Phase 2 "Done when" (a clean install with
notesctlalone, a logout and login, and an existing install's update) still needs a desktop run.