Repository navigation
feat(distribution): Flathub (Flatpak) GUI path #232
Description
Final acceptance (local Flatpak E2E)
Done bar for the packaging work here. Store listing can come after.
- build/install locally with org.flatpak.Builder (
flathub-build --installor equivalent) -
flatpak run org.libredb.Studiostarts the GUI - walk the main screens (login/workspace, connections, editor, results)
- add a sample PostgreSQL connection over TCP
- run a query (e.g.
SELECT 1) and see rows in the results grid - leave a short note or screenshot on this issue
Context
We already ship Docker, Helm, npx, Homebrew, .deb/.rpm and Snap (server daemon). Flathub is still missing. Snap-style headless wont fly there. Flathub wants sandboxed graphical desktop apps; console software is rejected.
Related: epic #108, desktop spike #115, recommendation in docs/DESKTOP_WRAPPER_SPIKE.md. Flathub is listed there as follow-up after a Tauri GUI + AppImage.
Blocked by: desktop wrapper PoC + AppImage on GitHub Releases. If that follow-up issue isnt open yet, open/link it first. This issue does not implement the wrapper itself.
Approach
Ship a real desktop shell (Tauri v2 sidecar per the spike; Electron only if WebKitGTK/Monaco fails on Linux). Publish AppImage from release CI. Flatpak manifest pulls that AppImage like Beekeeper does (type: file, unpack, install desktop/metainfo/icons), with x-checker-data pointed at GitHub Releases.
Proposed app id: org.libredb.Studio (verify via libredb.org). Fallback only if needed: io.github.libredb.libredb-studio.
Reference packaging: https://github.com/flathub/io.beekeeperstudio.Studio/blob/master/io.beekeeperstudio.Studio.yml
Trying to rebuild the whole Next.js app offline on Flathub is a bad fit. Reusing the release AppImage matches what similar SQL IDEs already do.
Rough finish-args: network, wayland + fallback-x11, dri, ipc. Prefer portals for files; document any host overrides (local sqlite is a known Flatpak pain, same as Beekeeper).
First login on Flatpak uses the desktop wrapper auth handoff (no password-from-logs UX). Bootstrap file/log remains fallback only.
Decided: Flatpak/desktop path uses STORAGE_PROVIDER=sqlite (same idea as the snap), with STORAGE_SQLITE_PATH under the Flatpak data dir so connections survive restarts. Wrapper should set that on sidecar launch. Tabs still live in the webview localStorage profile.
CI / automation (two places)
Upstream (libredb/libredb-studio):
- smoke-build the manifest with
flatpak/flatpak-github-actions/flatpak-builder@v6in a privilegedghcr.io/flathub-infra/flatpak-github-actionscontainer - native matrix: ubuntu-24.04 (x86_64) + ubuntu-24.04-arm (aarch64)
- uploads a .flatpak artifact for sanity checks
- does not publish to Flathub; do not wire
flat-managerat Flathub
Flathub app repo (flathub/org.libredb.Studio after merge):
- only flathub org actions +
peter-evans/create-pull-requestare allowed there (https://docs.flathub.org/docs/for-app-authors/github-actions) - version bumps via External Data Checker +
x-checker-data(merge manually after a quick test) - first submission: PR against
flathub/flathubbase branchnew-pr, title likeAdd org.libredb.Studio(https://docs.flathub.org/docs/for-app-authors/submission)
Docs for the actions themselves: https://github.com/flatpak/flatpak-github-actions
Work bits
- desktop wrapper + AppImage release artifact (blocker)
- flatpak manifest template in-repo (optional, source of truth ends up on Flathub)
- local Builder build +
flatpak-builder-linton manifest/repo - upstream flatpak-builder@v6 smoke CI (both arches)
- local E2E above
- Flathub submission PR (maintainer opens it by hand per Flathub docs)
- domain verification token at
https://libredb.org/.well-known/org.flathub.VerifiedApps.txt -
docs/DISTRIBUTION.mdFlathub section +distribution/channels.yamlentry
Out of scope
- packaging the Snap daemon as a Flatpak
- console-application metainfo
- deploying to Flathub via
flat-managerfrom this repo
Refs
- https://docs.flathub.org/docs/for-app-authors/requirements
- https://docs.flathub.org/docs/for-app-authors/submission
- https://docs.flathub.org/docs/for-app-authors/maintenance
- https://docs.flathub.org/docs/for-app-authors/github-actions
- https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines
- https://flathub.org/apps/io.beekeeperstudio.Studio
docs/DESKTOP_WRAPPER_SPIKE.md
Activity
cevheri commentedon Jul 28, 2026
Local Flatpak E2E - done
The packaging work is in #235: the Tauri v2 desktop shell (
desktop/), the AppImage release job,and the Flathub manifest (
packaging/flatpak/). Everything below was run on this machine againstthe manifest and the AppImage that PR produces.
Environment: Ubuntu 24.04 x86_64, X11 session;
flatpak-builder1.4.9 andflatpak-builder-lint3.0.0 from
org.flatpak.Builder;org.gnome.Platform//50+org.gnome.Sdk//50; PostgreSQL 18 on127.0.0.1:5433.Done bar
scripts/build-flatpak-local.sh <appimage> --installrenders both manifests, validates the metainfo (appstreamcli validate: pass),lints the release manifest (pass), builds, installs, and lints the exported repo (pass). The
AppImage it repacks is 144 MB and its own
--smokeboots the bundled server out of theextracted AppDir and gets 200 from
/api/db/health.flatpak run org.libredb.Studiostarts the GUI - splash, then the workspace, with nologin prompt: the shell reads the password the zero-config first run persisted in
~/.var/app/org.libredb.Studio/data/org.libredb.Studio/auth-bootstrap.jsonand hands it to/api/auth/login. Zero error lines in the app log.results panel, admin dashboard. Screenshots below.
127.0.0.1:5433, userpostgres, databasecompanyos. "Test Connection" answered Connected successfully (55ms) from inside thesandbox, and the schema loaded with 58 tables and row counts.
SELECT 1 AS ok, current_database() AS dbreturned
1 rows - 1ms,ok = 1,db = companyos.Note on how the walkthrough was driven: the WebKitGTK window has no scriptable input on this box (no
xdotool/ydotool), so the clicking part of the connection-and-query walkthrough was done againstthe same sidecar the Flatpak app was running (
http://127.0.0.1:<port>) from a browser, and theresult then verified inside the app's own window after a restart. The screenshot above is the Flatpak
window itself:
Local PostgreSQL (TCP)selected,POSTGRES - LOCAL - Online, 58 tables in theexplorer.
What the run turned up (all fixed in #235)
hashed symlinks under
payload/.next/node_modules- the server logged "Ready" and then failedevery request with
Failed to load external module ssh2-<hash>.flatpak-builderstrips binaries by default, which turned the bundledbetter_sqlite3.nodeinto"object file has no loadable segments" and took SQLite storage down while the app looked healthy.
The module now sets
strip: false/no-debuginfo: true.SecurewheneverNODE_ENV=production; libsoup (the cookie storebehind WebKitGTK) discards such a cookie over http instead of ignoring the flag the way Chromium
does on localhost, so the handoff signed in and then bounced between
/loginand/forever.Secureis now omitted only for loopback-over-http requests.linuxdeployneedsAPPIMAGE_EXTRACT_AND_RUN=1,patchelfandlibrsvg2-dev, and hard-fails onsharp's Alpine libvips build (
libc.musl-x86_64.so.1).appstream-external-screenshot-url,appstream-remote-icon-not-mirrored)can only pass inside Flathub's own pipeline, which rewrites media URLs to
dl.flathub.org. Theyare listed in
packaging/flatpak/lint-exceptions.jsonwith the reason; everything else the linterreports stays a hard failure.
Still open on this issue
new-pr, titleAdd org.libredb.Studio) - a maintainer step. Checklist inpackaging/flatpak/README.md. Worth saying in that PR up front that the manifest repacks thereleased AppImage rather than building from source, and why.
https://libredb.org/.well-known/org.flathub.VerifiedApps.txt-Flathub only issues it after the submission exists, so it is a libredb-website follow-up.
<release>entry inorg.libredb.Studio.metainfo.xmlfor whichever version first ships toFlathub (the External Data Checker maintains the manifest sources, not the release list).
test(auth): expose headers() in every next/headers module mock (#232)
docs(distribution): add the desktop AppImage to the channel inventory (…
feat(distribution): desktop shell, AppImage release artifact and Flat…
cevheri commentedon Jul 28, 2026
Flathub submission opened as a draft: flathub/flathub#9538
It stays draft until 0.9.60 ships, because the manifest references that release's AppImage and the two sha256 values are placeholders until then. Before marking it ready:
The domain token for https://libredb.org/.well-known/org.flathub.VerifiedApps.txt is issued from the developer portal after the app repository exists, so that stays a follow-up on libredb-website.
feat(auth): add AUTH_COOKIE_SECURE to allow login over plain HTTP
feat(auth): add AUTH_COOKIE_SECURE to allow login over plain HTTP
feat(auth): add AUTH_COOKIE_SECURE to allow login over plain HTTP (#236)
cevheri commentedon Jul 30, 2026
Outcome: the Flatpak GUI path shipped, the Flathub listing did not
Closing this. Everything in scope was built and verified; the one part that depended on a third party did not go our way, and there is no version of it left to work on.
Shipped
desktop/), released as an AppImage (x64 + arm64) since 0.9.60 and as a GUI.debsince 0.9.62. Both are hard gates onpublish-release, and both carry SLSA build provenance.packaging/flatpak/, plusflatpak-smoke.yml, which builds the AppImage and repacks it on both architectures.org.flatpak.Builderbuild and install,flatpak run org.libredb.Studiostarting the GUI, a walk through login/workspace/connections/editor/results, a PostgreSQL connection over TCP and aSELECT 1returning rows. The walkthrough video is on the submission PR.https://libredb.org/.well-known/org.flathub.VerifiedApps.txt(no token: Flathub only issues one after publication).docs/DISTRIBUTION.mdsection and thedistribution/channels.yamlentry.Not shipped: the Flathub listing
The submission, flathub/flathub#9538, was declined on 2026-07-30 under Flathub's generative AI policy. The reviewer's position was that developing with an AI code assistant disqualifies the app, independently of who designed, reviewed and released it. We closed the PR ourselves rather than argue it:
flathub/flathub#9538 (comment)
That comment leaves the verifiable record on the thread - repository public since 2025-12-23, MIT, 62 releases, 100% line coverage as a hard merge gate, and 21 live distribution channels.
Where Flatpak users go instead
FlatPark, live since 0.9.62 (#241) with the developer-approved flag. Same app id, same sandbox policy. It pins the GUI
.debasextra-datarather than repacking the AppImage:What stays in the tree
packaging/flatpak/is kept, not deleted.flatpak-smoke.ymlis now its only consumer and is real coverage of the desktop AppImage. It is marked dormant inpackaging/flatpak/README.mdand the channel isdeprecatedinchannels.yaml, both pointing at the closing comment above (#252).Reopening this would need a from-source Flatpak build, which is a separate and independent blocker: Flathub requires submissions to be built entirely from source, and
flatpak-node-generatorhas no Bun support. That is a new issue if we ever want it, not this one.