-
Notifications
You must be signed in to change notification settings - Fork 2
Added branding for landing page #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,27 @@ podman run --rm -p 8080:8080 -e PKGPROXY_HOST=0.0.0.0 --volume ./cache:/ko-app/c | |
|
|
||
| Any flag with an env variable listed above can be set via the environment instead of passing the flag. | ||
|
|
||
| ### Landing page hostname | ||
|
|
||
| The config snippets shown on the landing page (`GET /`) need pkgproxy's own | ||
| address, e.g. `baseurl=http://<pkgproxy>/fedora/...`. Rather than relying on a | ||
| server-side setting, this is filled in automatically, with no configuration | ||
| needed: | ||
|
|
||
| - **Server-side, from the request's `Host` header.** Every response — including | ||
| `curl` and other non-browser clients — already contains a working address | ||
| built from the `Host` header the request itself carried (the same header a | ||
| reverse proxy forwards by default). No JavaScript required. | ||
| - **Client-side, from the page's own URL.** In a browser, a small inline script | ||
| additionally corrects the address to `window.location.origin` if it differs | ||
| from the server-rendered one — which matters behind a reverse proxy that | ||
| changes the scheme (e.g. TLS termination), since the `Host` header alone | ||
| can't reveal that. | ||
|
|
||
| If a reverse proxy in front of pkgproxy does not forward the original `Host` | ||
| header, `curl` (or a browser with JavaScript disabled) will see whatever host | ||
| pkgproxy itself observed instead. | ||
|
|
||
| ### Trusting X-Forwarded-For | ||
|
|
||
| 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. | ||
|
|
@@ -69,6 +90,26 @@ Each repository supports the following options: | |
| | `mirrors` | yes | Ordered list of upstream mirror URLs | | ||
| | `retries` | no | Number of attempts per mirror before moving to the next one (default: `1`) | | ||
|
|
||
| ### Landing page branding | ||
|
|
||
| The top-level `branding` key customizes the title and description shown on the | ||
| landing page (and the HTML `<title>`) served at `/`: | ||
|
|
||
| ```yaml | ||
| branding: | ||
| title: Acme Package Mirror | ||
| description: Internal package cache for Acme Corp. | ||
|
|
||
| repositories: | ||
| ... | ||
| ``` | ||
|
|
||
| Both fields are optional and independent — omitting `branding` entirely, or | ||
| leaving one of the two fields unset, falls back to the default "pkgproxy" title | ||
| and "Caching forward proxy for Linux package repositories." description. The | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you link here to the defaults defined in the |
||
| landing page also always shows the running pkgproxy version below the | ||
| description. | ||
|
|
||
| ### Mirror retries | ||
|
|
||
| Some upstream mirrors (e.g. `download.fedoraproject.org`) act as redirectors that | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| --- | ||
| branding: | ||
| title: Pkgproxy Application | ||
| description: Caching forward proxy for Linux package repositories | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I'm including the |
||
|
|
||
| repositories: | ||
| almalinux: | ||
| suffixes: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mentioned this before but I don't really see how this is true with the code of this PR. I also don't really think that this is something that I would want as I often use browsers that don't support Javascript.
I think this entire section of the
README.mdis not needed.