6ab43a168e
Compiles to a 3.4 MB fat jar via shadow plugin. Entrypoint with CLI dispatch (pull/push subcommands) + FlatLaf init. Real sync logic stubbed; lands in subsequent commits per task plan. Build via containerized gradle (8.10.2 + jdk21) to sidestep the Kotlin 2.1 + JDK 26 compiler crash. Documented in README. CI workflow tags-only release artifact upload prepared (needs RELEASE_TOKEN secret in repo settings before first tag).
82 lines
3.2 KiB
Markdown
82 lines
3.2 KiB
Markdown
# cloud-installer
|
||
|
||
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-installer.jar pull \
|
||
--url=https://cloud.timemachine.center \
|
||
--pack-folder=$INST_MC_DIR
|
||
|
||
Post-exit command:
|
||
"$INST_JAVA" -jar /path/to/cloud-installer.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-installer.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 17–21 (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-installer-<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-installer** (this) | Per-user sync — player-modified configs, JourneyMap waypoints, screenshots |
|
||
| **frazclient** | Cracked-launcher orchestration — JDK, vanilla MC, Fabric, then invokes both jars |
|
||
|
||
cloud-installer 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.
|