# SyncTa technical notes For people who want to know how SyncTa works, script it, or build it. The [README](../README.md) is the user guide. ## How it works ``` iPhone / iPad / Mac Windows ┌────────────────────┐ HTTPS (LAN/hotspot) ┌──────────────────────────┐ │ Shortcuts: │ ──────────────────────▶ │ SyncTa.exe (tray app) │ │ DropTa │ pc-name.local:47230 │ • clipboard ⇄ │ │ CopyTa │ ◀────────────────────── │ • received files │ │ GetTa │ │ • queue (right-click) │ │ SyncTa Pair │ ── http :47231 ───────▶ │ • CA certificate │ └────────────────────┘ (certificate only) └──────────────────────────┘ ``` Apple devices can't run background listeners without an app, so delivery to them is **pull-based**: the *GetTa* shortcut fetches the queue and clipboard when you tap it, use Back Tap, or when an automation fires (for example *When I join my home Wi-Fi*). Pairing settings (address, port, token, certificate fingerprint) are saved by *SyncTa Pair* to `iCloud Drive/Shortcuts/SyncTa/config.json`, which is how every Apple device on the same Apple Account gets them. ## Files on Windows | What | Where | |---|---| | Received files | `Downloads` (configurable in `config.json`: `receive_dir`) | | Settings, token, certificates | `%APPDATA%\SyncTa` | | Send queue, logs | `%LOCALAPPDATA%\SyncTa` | | Windows 11 menu handler | `syncta_shell.dll` + `SyncTa.msix` next to `SyncTa.exe` | ## Commands | Command | What it does | |---|---| | *(none)* / double-click | Start the tray app (or, if it is running, show the pairing window) | | `SyncTa run` | Start the tray app quietly (used at sign-in) | | `SyncTa pair` | Show the pairing window | | `SyncTa send ` | Queue files for your Apple devices | | `SyncTa status` | Addresses, settings and queued files | | `SyncTa serve` | Server only, no tray or windows (scripts, CI) | | `SyncTa install` / `uninstall` | Start menu shortcut, sign-in startup and right-click menu (per user, no admin) | | `SyncTa win11-menu on\|off` | Windows 11 right-click entry (admin approval once, to trust the package certificate) | ## Security model - The API listens on your local networks only and requires a 256-bit bearer token, shared through the pairing QR code. - TLS uses a CA generated on your Windows computer. Its certificate carries **X.509 name constraints**: it can only vouch for `.local`, this computer's name and private IP ranges, so trusting it on your iPhone cannot let anyone impersonate real websites. - Port 47231 is plain HTTP and serves only the CA certificate and an instructions page. The pairing page (which contains the token) is only served to the Windows computer itself. - Clipboard content flagged by password managers (`ExcludeClipboardContentFromMonitorProcessing`, `CanIncludeInClipboardHistory = 0`) is never sent. - The Windows 11 menu entry is a COM handler (`syncta_shell.dll`) registered through a sparse package signed with the SyncTa certificate (`SyncTa.cer`, `CN=SyncTa`). Trusting it lets Windows install packages signed by that certificate; it is not trusted for anything else (not for websites or other code). The handler runs in a separate host process, never inside Explorer. - Releases are built by GitHub Actions from the tagged commit and carry a signed build attestation (`gh attestation verify SyncTa.exe -R Vapor-ex/SyncTa`) and `SHA256SUMS.txt`. ## API All routes require `Authorization: Bearer `. Base URL: `https://.local:47230/api/v1`. | Method | Path | Description | |---|---|---| | GET | `/ping` | Name and version | | GET | `/clipboard` | Windows clipboard text (`204` + `X-SyncTa-Reason: empty \| private \| disabled` when nothing to share) | | POST | `/clipboard` | Set the Windows clipboard: `text/plain` body or JSON `{"text": "…"}` | | POST | `/files` | Upload: `multipart/form-data` (any file fields) or raw body with `?name=` | | GET | `/queue` | Files queued for Apple devices: `[{"name", "size", "media"?}]` (`media: true` for photos and videos) | | GET | `/queue/{name}` | Download a queued file | | DELETE | `/queue/{name}` | Remove it after downloading | ## Building ```powershell cargo build --release --workspace # target\release\SyncTa.exe and syncta_shell.dll cargo test --workspace ``` Requires Rust (stable) and the MSVC build tools (the Windows SDK's resource compiler embeds the icon). - **Windows 11 menu package:** `tools/make-cert.ps1` creates the signing certificate once; `tools/make-package.ps1` builds and signs `SyncTa.msix` (needs the Windows SDK's `makeappx` and `signtool`). Releases do this in CI from repository secrets. - **Icons:** the logo lives in `assets/` as SVG. After changing it, regenerate the icon, PNGs, social preview and package logos with `python tools/make-icons.py` (needs Pillow). - **Shortcuts:** `python tools/make-shortcuts.py` generates the unsigned shortcuts; `shortcuts/release.sh` signs them on a Mac and commits them, and every release attaches the signed files. See [shortcuts.md](shortcuts.md). - **End-to-end test:** `python tests/e2e.py` (starts `SyncTa.exe serve` and exercises the API over strict TLS). - **Install page:** `docs/index.html` is served by GitHub Pages at https://vapor-ex.github.io/SyncTa/ (the pairing window's left QR code). Put iCloud links for the shortcuts there when you have them.