Repository navigation
v0.3.1
Security fixes and a clean-up of the code after a security audit and a code-quality audit of v0.3.0. No critical or high severity issues were found. Upgrading is recommended, especially if pull-through caching is on.
Security
- Pull-through no longer adds upstream content to repositories created locally. A repository created by
modelctl push,hf uploador the API never goes to the upstream hub, so someone who registers the same name upstream cannot add branches or revisions to it. For names the registry does not hold at all, use--pull-through-allowto keep internal namespaces from being fetched. - Request bodies are bounded in size and time. An unauthenticated client could make the server write large files to its temporary directory through the web sign-in form.
- Pull-through is bounded. At most 64 fetches wait (beyond that the answer is
503withRetry-After), revisions are validated before the upstream is asked, and--pull-through-max-file-bytesoptionally limits file size. - The upstream token is only sent to the configured upstream host, and redirects or pagination links to loopback, private or link-local addresses are refused.
- A signed upload URL stops working when the token that obtained it is revoked or loses the write role.
- The database file is created owner-only (
0600) on Linux and macOS. - Files the upstream keeps in git are only reused from content that was itself mirrored.
modelctl pullstops at the listed size, and file paths containing control characters are refused on write.
New
modelctl verifyre-hashes stored files and reports any that are missing or damaged. See the operations guide for the repair steps.- A flag for every non-secret server setting, for example
--backup-interval,--s3-bucketand--pull-through-allow. The environment variables still work; secrets remain environment-only. --max-blob-bytesoptionally limits the size of an uploaded file.
Fixed
REGISTRY_REQUIRE_AUTH=yes(andon) left downloads open, because onlytrueand1were understood.yes,no,onandoffare now accepted, and an unrecognised value stops the server from starting.modelctl restore --replacekeeps the old database's write-ahead log with the old database, and a failed restore puts the old database back.- Two backups taken in the same second no longer overwrite each other.
- A file that finished fetching at the wrong moment could briefly be reported as missing (
404). - Background fetches and scheduled backups are stopped and waited for at shutdown, before the database closes.
- A local failure during pull-through is reported as
500with a generic message, not as an upstream failure that included a server path. A failing upstream during a mirror is now502with the reason. - A database failure is no longer reported as "already exists" or as a bad token.
modelctl token createcould print an empty token and exit 0 if the answer could not be read.- File listings no longer wait behind large downloads in pull-through.
Upgrade notes
Nothing in the data directory changes, and a v0.3.0 data directory opens as it is. Things you may notice:
- An unrecognised value in a boolean setting (
REGISTRY_REQUIRE_AUTH,REGISTRY_REQUIRE_ADMIN_TOKEN,REGISTRY_PULL_THROUGH,REGISTRY_S3_REDIRECT,REGISTRY_RESTORE_IF_EMPTY) now stops start-up with a message naming the setting. - The example
compose.yamlpublishes the port on127.0.0.1only; change the port mapping to expose it. - A supplied admin token shorter than 32 characters logs a warning at start. It still works.
- Mirroring from another registry that redirects downloads to a bucket on a private address is refused; turn
REGISTRY_S3_REDIRECToff on the source registry. GET /api/v1/backups/snapshotis the address for a snapshot; the v0.3.0 addressGET /api/v1/backup/snapshotstill works.delete,gcandbackup nowanswers can carry awarningfield.
Full Changelog: v0.3.0...v0.3.1