Skip to content

Add Arch Linux pacman repository support - #436

Open
pinguinfuss wants to merge 4 commits into
git-pkgs:mainfrom
pinguinfuss:issue-263-arch-pacman
Open

pinguinfuss wants to merge 4 commits into
git-pkgs:mainfrom
pinguinfuss:issue-263-arch-pacman

Conversation

@pinguinfuss

Copy link
Copy Markdown
Contributor

Fixes #263.

Point pacman at /arch/archlinux/$repo/os/$arch and it works. More mirrors go under upstream.arch, and Arch Linux ARM works too.

Databases come unchanged from the metadata cache. Packages and their signatures come from the artifact cache. Signature checks pass, and installs keep working while the upstream is down. A database .sig gets refreshed together with its database, so an outdated one is never served.

Paths containing ? or # are now rejected. APK, RPM and Debian have the same bug; I'll fix those separately.

Outside the handler: a client that hangs up no longer cancels the fetch it started (up to 64 such fetches). pacman gives up after 10s without data, so big packages on slow mirrors never got cached.

Tested with real pacman in an archlinux container: -Sy, -S (incl. an epoch package) and -F, with the upstream up and down.

…connects. pacman gives up after 10 seconds without data, and since the proxy only starts sending once the whole file is stored, a large package on a slow upstream was cancelled on every try and never got cached. Client requests now mark their context so the shared fetch runs on context.WithoutCancel, still bounded by the artifact client timeout. Mirror jobs don't set the marker, so cancelling a job still aborts its fetches.
… geo.mirror.pkgbuild.com as the built-in archlinux repository and more mirrors configurable under upstream.arch. Databases and file lists go through the metadata cache byte for byte, and a database signature is refreshed together with its database so the two always match. Packages and package signatures go to the artifact cache and stay available offline. The path is passed through unchanged, so Arch Linux ARM's $arch/$repo layout works too. README, config example, configuration docs and the dashboard have pacman instructions.
…hat a fetch is tied to its client again, so nobody can start an unbounded number of large downloads and leave. A server test now checks that client requests actually get the detach marker.
…erved. When the database was refreshed and the signature refetch fails, the proxy answers 404 or 502 instead of falling back to the cached signature, which pacman would reject. Paths with a decoded ? or # are refused, since they would fetch one file and cache it under another name. The README now says that pacman -Sy only works offline with cache_metadata enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Arch Linux package repository proxy support

1 participant