Files
cloud-sync/README.md
T
claude-timemachine ed4115cba8
CI / build (push) Failing after 3s
CI / release (push) Has been skipped
rename: cloud-installer → cloud-sync
'installer' implied one-way install (matching packwiz-installer); this
tool is bidirectional sync (pull on launch, push on exit). Aligns with
the existing automc <scope>-<role> pattern: cloud-svc ↔ cloud-sync,
matching mc-router, mc-wrapper, gate-waker.

Gitea repo renamed via API (id 2974 preserved); jar filename now
cloud-sync-<version>.jar. Build verified post-rename.
2026-06-02 20:25:27 +02:00

82 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# cloud-sync
Single-jar Kotlin client for [`cloud-svc`](https://git.timemachine.center/Timemachine/cloud-svc). Drops into Prism / MMC / ATLauncher / frazclient pre-launch + post-exit hooks alongside [`packwiz-installer-bootstrap`](https://github.com/packwiz/packwiz-installer-bootstrap). One tool, all launchers, no Python dependency on the client side.
## Status
**Skeleton.** Build works, jar runs, CLI parses subcommands. Real sync logic + conflict UI land in subsequent commits. See [`DESIGN.md` in cloud-svc](https://git.timemachine.center/Timemachine/cloud-svc/src/branch/main/DESIGN.md) for the underlying contract this jar implements.
## Usage (planned)
In Prism's instance settings → Custom commands:
```
Pre-launch command:
"$INST_JAVA" -jar /path/to/cloud-sync.jar pull \
--url=https://cloud.timemachine.center \
--pack-folder=$INST_MC_DIR
Post-exit command:
"$INST_JAVA" -jar /path/to/cloud-sync.jar push \
--url=https://cloud.timemachine.center \
--pack-folder=$INST_MC_DIR
```
Token comes from `$INST_MC_DIR/.cloud-token` (paste once from your Discord-bot DM), `--token <STR>`, or `CLOUD_TOKEN` env.
## CLI
```
java -jar cloud-sync.jar <subcommand> [flags]
Subcommands:
pull Fetch user's cloud state, apply conflict resolution, write to instance.
push Walk instance, build snapshot, upload changed files.
Flags:
--url <URL> cloud-svc base URL (required)
--pack-folder <DIR> instance dir to sync into/from (default: ".")
--token <STR> bearer token (or use --token-file)
--token-file <PATH> read token from this file (default: <pack-folder>/.cloud-token)
-g, --no-gui headless mode; conflicts auto-resolve to remote-wins
-V, --version print version
-h, --help print this help
```
## Build
Requires JDK 1721 (JDK 26 currently breaks Kotlin 2.1's compiler). Easiest: containerized via podman/docker.
```bash
podman run --rm -v "$PWD":/work:Z -w /work docker.io/gradle:8.10.2-jdk21 \
gradle --no-daemon shadowJar
```
Output: `build/libs/cloud-sync-<version>.jar`. Single fat jar; ship as-is.
For local development with a matching JDK installed:
```bash
./gradlew shadowJar
```
## UI
Swing + [FlatLaf](https://www.formdev.com/flatlaf/) (`FlatMacDarkLaf` theme). Closest visual match to Prism's Qt look in pure Java. Falls back to system look-and-feel if FlatLaf init fails (e.g., on bare-bones X servers).
Conflict resolution dialog: per-file [keep local | use remote | skip] radio buttons + "use all local/remote" + Cancel/Continue. Headless mode (`-g`) defaults all conflicts to remote-wins (Steam's default).
## Where this fits in the automc stack
| Tool | What it owns |
|---|---|
| **packwiz-installer-bootstrap** | Mod sync — jars, configs shipped by the modpack, options.txt baseline |
| **cloud-sync** (this) | Per-user sync — player-modified configs, JourneyMap waypoints, screenshots |
| **frazclient** | Cracked-launcher orchestration — JDK, vanilla MC, Fabric, then invokes both jars |
cloud-sync and packwiz-installer-bootstrap are deliberately **separate jars** so players can disable cloud sync without affecting modpack sync (or vice versa) by just commenting out the line in Prism's hook config.
## License
MIT.