Repository navigation
Add Modrinth, keyless CurseForge, and adopting existing servers - #1
Conversation
cargo test failed to compile on Windows: the amp and command controller test modules write #!/bin/sh scripts and chmod them through std::os::unix::fs::PermissionsExt. Gate both modules on cfg(all(test, unix)). With the suite compiling, 13 more tests failed on Windows because they assume a Unix host rather than because of the code under test: the secrets tests (and two profile tests that store a key) read the master key from /dev/urandom, several profile tests compare against POSIX absolute paths that Windows resolves onto a drive, and two path-safety tests rely on /etc/passwd being absolute. Mark those tests cfg(unix) without changing any assertion. Linux runs exactly the same tests as before. Document in the README which tests are Unix-only.
src/cli/mod.rs had no tests. Cover the clap definition itself (debug_assert) and the parsed fields for list, update, plan, create, apikey, versions and the single-server commands, plus the error paths: missing or unknown subcommand, unexpected positionals, a missing --set value and a non-numeric or negative --timeout-ms.
doctor.rs carried a verbatim copy of validate.rs's issue_summary. Keep the one in validate.rs, expose it to the cli module, and call it from doctor so both commands print the same summary line. Output is unchanged. Add a test for the summary covering no issues, warnings only, errors only and a mixed, unordered list.
Cover a drop folder that holds a zip next to other files (a text file, a partial download, a file merely named "zip"): only the zip is a version. An empty drop folder lists no versions and fails to resolve "latest" instead of picking a non-archive file.
Show the ci workflow status and the latest release at the top, and add a short install / create / plan / update / rollback walkthrough before the detailed sections. Note that the stable v0.1.0 release predates pack-owned folder sync, .packctlignore and the default packs/ drop folder, which are only in the rolling build until the next tag.
Providers
- Fix the CurseForge client against the real API: unwrap the {"data": ...}
envelope and verify downloads with SHA-1 + size (the API never sends
SHA-256).
- Use the community proxy api.curse.tools when no API key is configured.
A personal key is only ever sent to api.curseforge.com, downloads must
come from *.forgecdn.net, and files whose author disabled third-party
distribution are refused instead of guessed.
- Add a Modrinth provider that installs the server side of a .mrpack in
staging with sha1/sha512/size-verified downloads, overrides and
server-overrides, and reports the required loader.
- Generalize project ids to strings; existing profiles keep parsing.
Adopt
- New `packctl adopt --as <version> | --detect` records a hand-installed
server as a known pack version without wiping it. Edited and added
files move to the overlay or .packctlignore; --apply snapshots first so
rollback undoes it.
Safety
- Refuse updates that would delete or overwrite files packctl never
installed, or overwrite live edits with the overlay, unless
--force-sync is given. Re-check after the server stops and under the
lock.
- Identical live files are no longer rewritten on a first update, and
plans with no file work still commit state.
- Protect packctl's own files (.packctl/, .packctl.toml, .packctlignore,
overlay, drop folder) from pack content.
CLI and project
- Add --to, --json output, shell completions, exit codes, a build-stamped
--version, and graceful broken-pipe handling.
- Add LICENSE (MIT), CHANGELOG, CONTRIBUTING, SECURITY, issue and PR
templates, dependabot, and cargo-deny.
- Rework CI and the release/rolling workflows: multi-OS tests,
attestations, checksums, and a rolling tag that never moves backwards.
- Rewrite the README with real examples and split details into docs/.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
331b02e to
c710953
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 331b02ef00
ℹ️ 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".
- Satisfy clippy::needless_bool (new in Rust 1.100) in the Modrinth live-file reuse check. - Resolve the no-op `true` command through PATH in controller tests; macOS has it only in /usr/bin, not /bin. - Drop the redundant package.homepage (same as repository).
adopt treated '#' lines, blank lines and trailing whitespace as formatting. Inside a TOML triple-quoted string, a YAML block or quoted scalar, a backslash continuation or a Forge '<' list they are data, so an edit there was accepted as "reformatted only" and lost on the next upstream change. Files that may hold such strings are now never cosmetic, which keeps them in the overlay.
What and why
This branch makes packctl usable by anyone, not just admins with their own CurseForge key, and makes it safe to point at a server that was installed by hand.
Providers
{"data": ...}envelope and expected SHA-256 hashes the API never sends, so it could not work against the real API. Downloads are now checked with SHA-1 plus the expected size.api.curse.tools, which returns the same JSON as the official API.api.curseforge.com.*.forgecdn.net, so the proxy can only point at real CurseForge files..mrpackin staging.overrides/and thenserver-overrides/are applied on top.project_id = 925200profiles still parse.Adopt (
packctl adopt --as <version>or--detect).packctlignore;--apply.--applysnapshots first, sorollbackundoes it.--detectscores candidate versions by mod hashes. This works for local and Modrinth packs; CurseForge needs--as.Safety
--force-syncis given. So are updates where the overlay would overwrite a live edit. The checks run again after the server stops and under the update lock. The error points topackctl adopt..packctl/,.packctl.toml,.packctlignore, the overlay, and the drop folder.CLI and project
--to <version>,--jsonoutput, shell completions, distinct exit codes, a build-stamped--version, and no panic when output is piped to something likehead.install.sh.docs/.This PR also carries the five earlier commits on this branch (README badges, Windows test gating, CLI parsing tests, shared
issue_summary, local provider zip test).Notes for reviewers
CHANGELOG.mdanddocs/providers.md.adoptdone while the server was stopped. This matches the documented behavior, but it may be worth revisiting.docs/demo.tapeand thedemoworkflow, but it has not been rendered yet.Checklist
cargo fmt --all --checkpassescargo clippy --locked --all-targets --all-features -- -D warningspasses (on Windows; Linux is covered by CI)cargo test --locked --workspace --all-featurespasses (544 tests on Windows;#[cfg(unix)]tests are covered by CI)normalize_relative/safe_join; nothing touches the live server before the snapshotCHANGELOG.mdhas an entry under## [Unreleased](user-visible changes only)--helptext are updated where behavior changed