1
0
mirror of synced 2026-02-06 10:55:56 +00:00

fix(install-script): support github api auth

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
This commit is contained in:
Raffael Sahli
2023-01-11 08:05:49 +00:00
parent a9f53b4f1a
commit d1b4851fbe
2 changed files with 6 additions and 2 deletions

View File

@@ -9,6 +9,10 @@ To install the latest release run:
curl -s https://raw.githubusercontent.com/fluxcd/flux2/main/install/flux.sh | sudo bash
```
**Note**: You may export an env `GITHUB_TOKEN` which is a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
to avoid running into Github API rate limiting while executing the install script.
This is recommended if you execute the install script multiple times within the same rate limting window.
The install script does the following:
* attempts to detect your OS
* downloads and unpacks the release tar file in a temporary directory

View File

@@ -112,10 +112,10 @@ download() {
case $DOWNLOADER in
curl)
curl -o "$1" -sfL "$2"
curl -u user:$GITHUB_TOKEN -o "$1" -sfL "$2"
;;
wget)
wget -qO "$1" "$2"
wget --auth-no-challenge --user=user --password=$GITHUB_TOKEN -qO "$1" "$2"
;;
*)
fatal "Incorrect executable '${DOWNLOADER}'"