Files
spark 202497cf3e
ci / rust (push) Successful in 8m35s
desktop-release / build (--target universal-apple-darwin, dmg,app, darwin-universal, macos) (push) Successful in 16m0s
ci / typescript (push) Successful in 12m10s
desktop-release / build (deb,appimage, linux-x86_64, ubuntu-latest) (push) Successful in 27m5s
feat(desktop): install a new shell as soon as it is published (#248)
feat(desktop): install a new shell as soon as it is published
2026-11-07 15:07:52 +00:00
..

apps/desktop

Tauri 2 shell around apps/app: the same interface as the web, running natively.

The window loads the web app from the server (PHOTOREPORT_APP_URL at build time, default https://app.next.photoreport.pt). The desktop app is therefore always on the latest version: every web deploy updates it, and the installer only needs rebuilding when the native shell itself changes. tauri dev still uses the local dev server.

What the shell adds today:

  • Sign-in through the browser (device authorization): the desktop never sees the password.
  • Refresh token in the OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service). Without a keychain the session stays in memory and ends when the app closes.
  • Local FTP server for cameras (src/ftp.rs, Library → FTP local). See below.
  • USB tether (src/camera.rs + camera_mac.m, Library → USB): pulses the PTP session so the body stays shootable (no permanent computer/busy screen), pulls new shots to the open event, syncs the clock. EOS Utility must not hold the cable.
  • Local catalogue (src/catalog.rs, Preferências → Catálogo local). See below.
  • Works without network: when the server can't be reached at start-up, the window opens the copy of the web app bundled in the installer (photo engine included), so the catalogue, local FTP and editing originals on disk go on; edits wait in the offline queue.
  • Updates itself (src/updater.rs): a new shell version installs itself and the app restarts.

Replaces PhotoReport_Studio (Flutter) and the archived bridge.photoreport.pt.

Local catalogue

Folders on the computer (archive, card copies, Photo Mechanic ingest folders) whose photos the app knows by their SHA-256, the fingerprint the server keeps for every photo. Any photo of those folders that is also on the server opens in the editor from disk, at full resolution, with no download. JPEG, HEIC/TIFF/PNG and the usual RAW files are indexed; hidden folders and Lightroom preview caches (*.lrdata) are skipped. Re-indexing only reads files whose size or date changed. The catalogue only reads: nothing is moved, renamed or deleted. Settings and the cache are in the app's config folder (catalog.json, catalog-cache.json, local-index.json).

Updates

The web app inside the window updates with every web deploy. The shell checks <API>/v1/desktop/update/{target}/{arch}/{version} at start and about once a minute, and installs a newer signed shell at once; the API reads the latest desktop-v* release on Gitea (DESKTOP_RELEASES_API, DESKTOP_RELEASES_TOKEN, read-only) and passes the installer through, so the private repository stays private. Installers are signed with the release key (tauri signer generate): the private key and its password are the Gitea secrets TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD, the public key is the variable TAURI_UPDATER_PUBKEY (compiled into the app as PHOTOREPORT_UPDATER_PUBKEY). A build without the public key never updates itself.

Local FTP (camera → this computer → event)

FTP local in the Library starts an FTP server on the computer (passive ports 50000–50100). Configurar sets, like the old Studio:

  • the port (default 2121);
  • one or more logins, as simple as you like on a private network (e.g. 1dx / 1dx);
  • the ingest folder the camera writes to (default ~/Desktop/ingest);
  • the work folder originals move to once the server has them (default ~/Desktop/{year}/{date} - {event});
  • whether it starts with the app.

Settings are saved in the app's config folder (ftp.json, readable by the user only). The panel shows the computer's network addresses to type into the camera. The camera and the computer must be on the same network. The first time, macOS asks whether to accept incoming connections: Allow.

  • JPEG only; other files (RAW) stay in the ingest folder.
  • A photo counts as complete when the FTP session reports it finished, or when it has stopped changing.
  • Each one is sent to the event chosen in the panel, through the same resumable upload as Importar. The event's IPTC template is applied on the server.
  • Once the server has it, the original moves to the event's work folder. Nothing is deleted.
  • Whatever did not go (no network, app closed) stays in ingest and goes on the next start or with "Reenviar".
  • The feed runs while you work in any module, not only the Library.
  • The window can only read photos inside the ingest folder (ftp_read checks the path).

Plain FTP is unencrypted. It is meant for the local network only: do not forward the port on the router.

Develop

pnpm --filter @photoreport/desktop dev        # runs the web app dev server and opens the native window

Linux needs libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libsecret-1-dev. The shell is outside the root Cargo workspace because of those system libraries.

Release

Tag desktop-vX.Y.Z -> .gitea/workflows/desktop-release.yml. macOS and Windows installers need runners on those systems (see the workflow header).

On a Mac, without a runner: bash infra/desktop/build-macos.sh. It installs what is missing (Rust, pnpm, the wasm tools), builds the photo engine and the app, and opens the folder with PhotoReport_<version>_universal.dmg. The build is not signed: the first time, open it with right-click → Open. Signing and notarisation need an Apple Developer ID.