Proper modpack generations - #509
Conversation
Minecraft accepts numeric and dotted server host strings such as 0.0 and 127.0.0, but normalizeHost treated every such value as an IPv4 literal and threw when it did not contain four valid octets. Fall back to DNS normalization when IPv4 parsing does not apply.
6375016 to
b5993ac
Compare
Remove refresh from the wire protocol, share frame and pipeline handling, centralize generation publication and login state, and promote verified CAS objects through a target-local temporary file when storage roots use different filesystems.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6a470df5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public static final Path HOST_MODPACK_DIR = AUTOMODPACK_DIR.resolve("host-modpack"); | ||
| public static final Path HOST_CONTENT_MODPACK_DIR = HOST_MODPACK_DIR.resolve("main"); | ||
| public static final Path MODPACK_CONTENT_FILE = Path.of("automodpack-content.json"); | ||
| public static final Path SERVER_CONFIG_FILE = AUTOMODPACK_DIR.resolve("server-config.json"); |
There was a problem hiding this comment.
Migrate the server configuration before renaming it
When upgrading an existing installation, the configuration remains at automodpack/automodpack-server.json, but all runtime readers now use this new filename and no repository code imports the legacy file. Consequently readOrCreate silently creates defaults, discarding custom groups, network settings, and security options; the current server setup documentation also still directs operators to the legacy filename. Preserve or migrate the existing configuration before switching paths.
Useful? React with 👍 / 👎.
| modpackExecutor = new ModpackExecutor(); | ||
| var generation = modpackExecutor.publish(); |
There was a problem hiding this comment.
Initialize standalone generation metadata before publishing
When the standalone shadow JAR runs, loader Preload never initializes AM_VERSION, LOADER, LOADER_VERSION, or MC_VERSION, and this rewrite removed the standalone core-config read that previously populated them. Calling ModpackExecutor here therefore publishes a catalogue with all four metadata fields blank; notably, clients then treat the server AutoModpack version as unavailable and cannot honor version synchronization. Initialize these values from standalone configuration or artifact metadata before publishing.
Useful? React with 👍 / 👎.
| public static final Path SERVER_CERT_FILE = SERVER_DIR.resolve("certificate.crt"); | ||
| public static final Path SERVER_PRIVATE_KEY_FILE = SERVER_DIR.resolve("private-key.pem"); |
There was a problem hiding this comment.
Preserve the existing TLS certificate during the path move
On the first start after an upgrade, the existing certificate and key remain at automodpack/.private/cert.crt and key.pem, while TLS setup checks only these new paths and generates a replacement pair when they are absent. This makes every client that pinned the previous self-signed certificate reject the server with a pin mismatch, and it silently ignores operator-installed CA certificates at the still-documented legacy location. Migrate the existing pair before allowing a new certificate to be generated.
Useful? React with 👍 / 👎.
|
|
||
| private ModpackCandidate buildCandidate(Optional<GenerationStore.CurrentSnapshot> previous) throws IOException, CandidateBuildException { | ||
| validateConfiguration(); | ||
| prepareDirectories(); |
There was a problem hiding this comment.
Reuse the legacy modpack ID for the root generation
On the first generation after upgrading, the new generation store has no current pointer even though host-modpack/automodpack-content.json contains the previously published modpack ID. This branch generates a random replacement instead of importing that identity, and the only legacy-catalogue handling later deletes the old file. Existing clients therefore see the same server as a different modpack, lose seamless update continuity, and must install/manage a duplicate pack; seed the root generation from the legacy catalogue ID before generating a new one.
Useful? React with 👍 / 👎.
333c9db to
bdd6bfb
Compare
Overlap receipt-validated HMC profile preparation with server startup, deduplicate immutable asset objects across isolated target caches, and move crash cleanup into a detached lock-backed supervisor so killed runners cannot leave Java workers alive.
This PR rebuilds AutoModpack around immutable modpack generations and a shared content-addressed store.
Players can choose optional content, review changes, manage packs, restore preserved files, and repair installed packs offline. Server operators can safely publish or revert generations. Atomic updates, ownership records, and direct hash checks prevent partial installs and silent data loss.
The PR also improves the vanilla-style screens, all translations, storage cleanup, and end-to-end tests.