packagefirewall

package
v4.26.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AddonHint = "requires the " + AddonName

AddonHint is the one-line reason shown next to an ecosystem the caller has not unlocked.

View Source
const AddonName = "Package Firewall add-on"

AddonName is the paid add-on that unlocks every registry that is not free.

Variables

This section is empty.

Functions

func AddonNote added in v4.2.0

func AddonNote(eco Ecosystem) string

AddonNote is extra guidance for a setup that configures more than one firewall prefix with different entitlements. The aur command also stages the pacman mirrorlist for the official Arch repositories (the /arch prefix), and that part needs the add-on while AUR does not.

func ConfigPaths

func ConfigPaths(eco Ecosystem, home string) []string

ConfigPaths returns the candidate config files inspected for an ecosystem. (Go is detected separately via netrc + the GOPROXY environment.)

func IsFree added in v4.2.0

func IsFree(id string) bool

IsFree reports whether the ecosystem id (the firewall's, such as "aur" or "go-dev") needs no add-on.

func ProxyURL

func ProxyURL(base string, eco Ecosystem) string

func ProxyURLWithSlash

func ProxyURLWithSlash(base string, eco Ecosystem) string

func RequireWriter

func RequireWriter(eco Ecosystem) error

Types

type ConfigFile

type ConfigFile struct {
	Path       string
	Content    string
	Structured bool
	// Merge, when set, computes the new file content from the file's existing
	// content (read by the writer) instead of replacing it. Used to fold the
	// firewall settings into a user's real config non-destructively (paru.conf,
	// yay config.json). The writer backs up the original before writing.
	Merge func(existing string) (string, error)
	// Marker is an alternative ownership needle used when reversing a Structured
	// write whose content never names the proxy host — a credentials file, which
	// carries only the org id and the secret. Without it uninstall declines to
	// touch the file and the credential stays on disk.
	Marker string
}

func ConfigFiles

func ConfigFiles(eco Ecosystem, opts ConfigOptions) ([]ConfigFile, error)

type ConfigOptions

type ConfigOptions struct {
	HomeDir  string
	ProxyURL string
	OrgID    string
	APIKey   string
}

type Detected

type Detected struct {
	Ecosystem  Ecosystem
	Configured bool
	Path       string // the config file that matched, when Configured
}

Detected reports whether a package manager's config points at the firewall.

func Detect

func Detect(home, proxyHost string) []Detected

Detect scans each ecosystem's config files for the firewall host and returns the per-ecosystem result. Ecosystems without an automatic writer are skipped.

type Ecosystem

type Ecosystem struct {
	ID          string
	Command     string
	DisplayName string
	Prefix      string
	// Free is true for the registries every org may use without the add-on. The
	// firewall serves go-dev and aur free; every other registry, including the Go
	// proxy, needs the Package Firewall add-on.
	Free       bool
	LiveWriter bool
}

func All

func All() []Ecosystem

func ByCommand

func ByCommand(command string) (Ecosystem, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL