Skip to main content

Module remote

Module remote 

Source
Expand description

Remotes (SPEC 9.6 to 9.9): optional backup and sync targets for the store. None exists by default and none is privileged.

  • config: state/remotes.toml, machine-local.
  • folder: folder remotes, one subfolder per machine (repo-per-machine, mirror, archive); pull merges every sibling machine’s head through crate::store::merge.
  • git: git remotes through the system git CLI; credential is the auth = token helper; gh the optional GitHub CLI conveniences.
  • manifest: machine.json and EXPORT.json.
  • sync: push, pull and status of every remote alike, recorded in state/remote-status.toml; restore is restore --from.
  • sync_artifacts: sync tool conflict and temp names, reported and left alone.
  • unc: mapped drive letters resolved to UNC paths on Windows.

Modules§

config
state/remotes.toml (SPEC 9.6): this machine’s remotes. Machine-local and never synced, because URLs, mount paths and auth differ per machine; the store, the spec and the binary carry no remote. No remote exists until the user adds one, and none is ranked: they keep the order they were added in.
credential
surject git-credential (SPEC 9.6, auth = token): git’s credential helper protocol for one git remote. get answers with the remote’s username (default x-access-token) and the token stored in the OS keyring for that remote, and only for the protocol and host of the remote’s own URL; store and erase do nothing (git never writes the keyring through Surjection).
folder
Folder remotes (SPEC 9.6): a local or network directory holding one subfolder per machine, written only by that machine:
gh
GitHub conveniences (SPEC 9.7, optional, never required): “Create private repository” through gh repo create <name> --private when the GitHub CLI is installed and logged in. Any other host works through a plain git remote.
git
Git remotes (SPEC 9.6, 9.8): any git URL, through the system git CLI run in the store folder. The URL is passed to git unchanged; Surjection has no host-specific code paths besides the optional gh helper.
manifest
machine.json (SPEC 9.6): what one machine’s subfolder of a folder remote holds, written last, after objects, refs and exports. Readers trust only what it lists.
restore
restore --from and the app’s “Restore from remote…” (SPEC 9.5, 9.6, 11.9): a store from a folder remote’s machine, a bare repository, a mirror or a zip.
sync
Push, pull and status for every configured remote alike (SPEC 9.6 to 9.9), shared by the CLI and the app.
sync_artifacts
Sync tool artifacts under folder remotes (SPEC 9.6 table): conflict copies and temp files Dropbox, OneDrive, Google Drive, Syncthing and Resilio Sync leave behind. Readers accept only names of their exact grammar anyway; names that match a known pattern are also reported as sync_artifact_ignored. They are never read and never deleted: deleting a Resilio .Conflict file can delete the real file on a peer.
unc
Mapped drive letters as UNC paths (SPEC 9.6): a folder remote typed as Z:\Backups\surjection is kept as typed, but each push resolves it to \\server\share\Backups\surjection, so pushes work from processes that lack the mapping (elevated shells, scheduled tasks).