You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
8
8
9
9
### Added
10
10
11
+
- Per-repository `cdn` config field to proxy vendor CDNs that publish no public mirrors
12
+
- Per-repository `mtls` config field with client `cert`, `key` and optional `ca` for CDNs using mutual TLS
13
+
- Support for proxying entitled Red Hat content from `cdn.redhat.com` without client-side certificates
14
+
- Client config snippet for Red Hat Enterprise Linux on the landing page and in the README
15
+
- Top-level `branding` config field to customize the landing page title and description
16
+
- Landing page now shows the running pkgproxy version
11
17
- Container image now runs `serve` by default and loads bundled config from `$KO_DATA_PATH`
12
18
-`PKGPROXY_TRUST_PROXY` env var (and `--trust-proxy` flag) to opt in to X-Forwarded-For trust
13
19
-`PKGPROXY_HOST` env var to set the listen address without passing `--host` on the command line
14
20
15
21
### Changed
16
22
23
+
- Repositories must now define exactly one of `mirrors` or `cdn`; setting both is rejected
24
+
- Upstream URLs are validated at startup: they must be absolute and use `http` or `https`
17
25
-**Breaking:**`remote_ip` in access logs now reflects the direct connecting peer by default; set `PKGPROXY_TRUST_PROXY` to restore XFF-based IP extraction when running behind a reverse proxy
26
+
-**Breaking:** Removed the `--public-host` flag and `PKGPROXY_PUBLIC_HOST` env var; the landing page now fills in config snippet hostnames automatically — server-side from the request's `Host` header (works for `curl` too), further corrected client-side to the browser's own URL when that differs (e.g. behind a TLS-terminating reverse proxy)
18
27
- Upgraded Echo web framework to v5.1.1
19
28
- Config-file errors now list all default paths attempted, not just the last one
|`--public-host`|`PKGPROXY_PUBLIC_HOST`|| Public hostname (or `host:port`) shown in landing page config snippets. When set, the listen port is not appended. Useful when running behind a reverse proxy. |
37
36
|`--trust-proxy`|`PKGPROXY_TRUST_PROXY`|| Comma-separated list of trusted proxy sources for X-Forwarded-For. Accepted values: `none`, `loopback`, `private`, a CIDR (e.g. `10.0.0.0/8`), or a bare IP (promoted to `/32`/`/128`). Unset or empty means no XFF trust. |
38
37
|`--debug`||`false`| Enable debug logging |
39
38
40
39
Any flag with an env variable listed above can be set via the environment instead of passing the flag.
41
40
41
+
### Landing page hostname
42
+
43
+
The config snippets shown on the landing page (`GET /`) need pkgproxy's own
44
+
address, e.g. `baseurl=http://<pkgproxy>/fedora/...`. Rather than relying on a
45
+
server-side setting, this is filled in automatically, with no configuration
46
+
needed:
47
+
48
+
-**Server-side, from the request's `Host` header.** Every response — including
49
+
`curl` and other non-browser clients — already contains a working address
50
+
built from the `Host` header the request itself carried (the same header a
51
+
reverse proxy forwards by default). No JavaScript required.
52
+
-**Client-side, from the page's own URL.** In a browser, a small inline script
53
+
additionally corrects the address to `window.location.origin` if it differs
54
+
from the server-rendered one — which matters behind a reverse proxy that
55
+
changes the scheme (e.g. TLS termination), since the `Host` header alone
56
+
can't reveal that.
57
+
58
+
If a reverse proxy in front of pkgproxy does not forward the original `Host`
59
+
header, `curl` (or a browser with JavaScript disabled) will see whatever host
60
+
pkgproxy itself observed instead.
61
+
42
62
### Trusting X-Forwarded-For
43
63
44
64
By default pkgproxy ignores the `X-Forwarded-For` header and uses the direct connecting IP address for the `remote_ip` access-log field. This is the safe behavior when pkgproxy faces the internet directly or runs in a container without a reverse proxy in front of it.
@@ -66,8 +86,94 @@ Each repository supports the following options:
66
86
|-----|----------|-------------|
67
87
|`suffixes`| yes | File suffixes that are eligible for caching (e.g. `.rpm`, `.deb`). Use `"*"` to cache all files. |
68
88
|`exclude`| no | List of file names to exclude from caching, even when they match a suffix. Useful with the `"*"` wildcard suffix. |
69
-
|`mirrors`| yes | Ordered list of upstream mirror URLs |
70
-
|`retries`| no | Number of attempts per mirror before moving to the next one (default: `1`) |
89
+
|`mirrors`| yes*| Ordered list of upstream mirror URLs |
90
+
|`cdn`| yes*| Single upstream CDN URL, used instead of `mirrors`|
91
+
|`mtls`| no | Client certificate (`cert`), private key (`key`) and optional CA bundle (`ca`) used with a `cdn` requiring mutual TLS |
92
+
|`retries`| no | Number of attempts per upstream before moving to the next one (default: `1`) |
93
+
94
+
\* Each repository must define exactly one of `mirrors` or `cdn`; setting both is rejected.
95
+
96
+
### Landing page branding
97
+
98
+
The top-level `branding` key customizes the title and description shown on the
99
+
landing page (and the HTML `<title>`) served at `/`:
100
+
101
+
```yaml
102
+
branding:
103
+
title: Acme Package Mirror
104
+
description: Internal package cache for Acme Corp.
105
+
106
+
repositories:
107
+
...
108
+
```
109
+
110
+
Both fields are optional and independent — omitting `branding` entirely, or
111
+
leaving one of the two fields unset, falls back to the default "pkgproxy" title
112
+
and "Caching forward proxy for Linux package repositories." description. The
113
+
landing page also always shows the running pkgproxy version below the
114
+
description.
115
+
116
+
### CDN upstreams
117
+
118
+
Some vendors do not publish public mirrors and serve their packages from a single
119
+
CDN instead. Use `cdn` in place of `mirrors` for those repositories:
120
+
121
+
```yaml
122
+
repositories:
123
+
rhel:
124
+
suffixes:
125
+
- .rpm
126
+
cdn: https://cdn.redhat.com/
127
+
```
128
+
129
+
Requests are mapped the same way as for mirrors: the repository name is stripped
130
+
from the request path and the remainder is appended to the CDN URL, so
131
+
`/rhel/content/dist/rhel9/9/x86_64/baseos/os/`is fetched from
c.PersistentFlags().StringVar(&trustProxy, "trust-proxy", "", "comma-separated list of trusted proxy addresses for X-Forwarded-For: none, loopback, private, CIDR, or IP; overrides PKGPROXY_TRUST_PROXY.")
0 commit comments