Files
photoreport/apps/desktop
spark e6b5f2e390
ci / rust (pull_request) Successful in 11m45s
ci / typescript (pull_request) Failing after 14m55s
Let a Windows release, a Linux or Windows cable, and a future Developer ID join the desktop build.
The installer job was waiting on a commented matrix row, USB stayed on Image Capture, face detection could not read the Windows CPU, and notarisation had nowhere to put an Apple account.
2026-11-26 15:09:36 +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 (Library → USB): a short PTP session lists the card and downloads what was asked, then closes so the body can shoot. macOS uses Image Capture (camera_mac.m). Linux uses libgphoto2. Windows uses the portable-device API. EOS Utility must not hold the cable. The Mac build is the one that sets the camera clock.
  • 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 release build also reads that same public key from updater-pubkey.txt when the variable is unset, and checks again in the background, so the installed app replaces itself. A debug build without the variable 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.