Skip to content

port(linux): upload extension, Secret Service SFTP passwords and permanent-failure retries on 2.0 - #93

Open
kalopsia-space wants to merge 4 commits into
linux-2.0from
port/linux-2.0-uploader-v2
Open

kalopsia-space wants to merge 4 commits into
linux-2.0from
port/linux-2.0-uploader-v2

Conversation

@kalopsia-space

Copy link
Copy Markdown
Collaborator

Phase B uploader port for the 2.0 catch-up. 2.0's uploader only knew the Windows bundle and Windows Credential Manager, so on Linux it looked for FTHR Uploader.exe under ~/AppData/Local and refused to save SFTP passwords.

Changes

  • Linux upload extension bundle (core/upload_manager.py): pick the bundle by platform. Linux uses FTHR-Uploader-linux.fthrplugin with the FTHR-Uploader entrypoint, installed under $XDG_DATA_HOME/FTHR Clips/plugins (~/.local/share). The Linux hash comes from EXPECTED_UPLOADER_LINUX_BUNDLE_SHA256, which tools/build_linux_uploader.py writes during build_linux.sh; a build without that binding refuses to install with a message that says why. Activation restores the executable bit that zip drops, and uploader settings.json (Catbox userhash, auth header) is written 0600. Windows keeps the exact previous spec and write path.
  • SFTP passwords in the Secret Service keyring (FTHR_Uploader/sftp_provider.py): select keyring's SecretService backend explicitly (no plaintext or chained fallback), probe it first, and name the missing keyring when no daemon is running. The settings note names the store per platform.
  • No retries on permanent upload failures (FTHR_Uploader/upload_runtime.py): restores the linux fix that a 4xx response is not retried.

The bundle hash is a build output, so no Linux hash is committed: the AppImage build binds the bundle it ships.

These are the parked port/linux-2.0-uploader commits, cherry-picked onto the current linux-2.0 without conflicts.

Testing

  • Uploader suites (test_uploader_plugin_boundary, test_sftp_provider, test_upload_manager_retry, test_uploader_builders, test_optional_uploader_runtime and the other upload tests) pass locally with an isolated HOME.
  • Full suite against linux-2.0 (both runs exclude test_game_detection_popup.py, the segfault fix(tests): stop the game detection popup tests segfaulting Ubuntu CI #85 fixes): same failure set as the base. The one extra failure, test_binary_exists, comes from the worktree having no engine build.
  • tools/build_linux_uploader.py builds and seals FTHR-Uploader-linux.fthrplugin locally (71 payload ELF files unpacked for the glibc gate).

2.0's uploader spec only knew the Windows bundle (FTHR-Uploader.fthrplugin,
'FTHR Uploader.exe', the Windows hash) and stored plugins under LOCALAPPDATA,
which on Linux resolved to ~/AppData/Local. Pick the bundle by platform:
Linux uses FTHR-Uploader-linux.fthrplugin with the FTHR-Uploader entrypoint
and lives under XDG_DATA_HOME (~/.local/share).

The Linux hash is read with getattr because the committed 2.0 manifest has
no Linux binding yet; an empty binding fails closed with a message that says
why, instead of installing an unverified bundle. Activation restores the
executable bit zip archives drop, and uploader settings.json (Catbox
userhash, server auth header) is written owner-only on POSIX, as on linux.
Windows keeps the exact previous spec and write path.
Restore the linux branch fix 2.0 does not have: a 4xx response from Catbox
or a custom server (file too large, bad auth) was retried three times with
5/15/45 s back-off before failing. Only 429 and 5xx are transient; other
HTTP statuses now fail on the first attempt. Non-HTTP errors keep retrying.
2.0 refused saved SFTP passwords anywhere but Windows Credential Manager.
On Linux select keyring's SecretService backend explicitly (SecretStorage
and jeepney, no plaintext or chained fallback) and probe it first: when no
Secret Service daemon is running or D-Bus activatable, saving, reading and
forgetting fail with a message naming the missing keyring rather than a
generic vault error. Other non-Windows platforms are refused outright.

The settings note names the store for the platform. Tests use a stand-in
backend and never talk to a real Secret Service.
Windows file modes have no executable bit, so the Linux activation test
cannot observe the chmod there even with sys.platform patched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant