Address the Pigsty intranet repository over HTTP
Decision date: 2026-12-03
Status Released in v1.12.0, including offline path handling from7696ed9ef744.
Current reference Adding repositories and offline bootstrap.
Scope The intranet address used bypig repo addandpig repo set, and the file URL registered bypig repo boot.
Decision
Use the same HTTP endpoint for the built-in local module on EL, Debian and Ubuntu. The caller supplies the admin node’s IPv4 address with -I or --admin-ip. The default is 127.0.0.1.
Context
In v1.11.0 the EL catalog pointed to file:///www/pigsty. Its Debian counterpart contained the Pigsty template variable ${admin_ip}. Ansible resolves that variable in a Pigsty deployment. Standalone PIG passed it through to APT, which tried to resolve the literal hostname. EL catalog · Debian catalog
Alternatives
A file URL on both platforms would require each client to have its own copy of the repository. Switching EL from file to HTTP only when the flag is present would give an explicit -I 127.0.0.1 a different meaning from its default.
Contract
PIG matches catalog signing policy against the original definition and selects the regional URL. It replaces the literal ${admin_ip} token before checking APT trust conflicts or writing the module file. Fixed URLs retain their configured addresses. The intranet entries use trusted=yes on APT and gpgcheck=0 on EL.
repo boot registers the extracted directory through an absolute file URL. It resolves a relative target against the caller’s working directory and escapes characters that the package manager would interpret in a URL. It can run before an HTTP server is available. Both workflows write the same per-platform local module file.
Impact
On EL, repo add local writes the HTTP source from the built-in catalog. Without -u, this can run before the HTTP server starts. An existing catalog that explicitly names file:///www/pigsty keeps its filesystem source and its historical trust setting. To adopt the HTTP endpoint, replace that entry with the template or refresh a stock catalog after upgrading the CLI. Older PIG binaries lack the token expansion.
Verification
The focused tests and Linux acceptance binary use source revision 1b6e677a0e5502f50a78de3e2ea3c8999e4c47e1.
With a Linux arm64 build, isolated Debian 12 and Rocky 9 clients ran pig repo set local -I 127.0.0.2 --region default. APT fetched the package index and DNF fetched primary metadata from that loopback address. Both clients produced identical files for the omitted address and an explicit 127.0.0.1.
At 4f7f2815035b, the Linux arm64 build above ran pig repo boot -p pkg.tgz -d './weekly repo/#100%,$releasever'. With networking disabled, APT on Debian 12 and DNF on Rocky 9 each installed a package from the extracted directory.
Status
The implementation and native package-manager checks are complete. Published versions are listed in the release notes.