Skip to content

Commit 9f61cb9

Browse files
committed
install script: fail over to envkey-source-releases.s3.amazonaws.com (public S3 bucket controlled by EnvKey) for envkey-source binary if request to Github Releases fails--workaround for htting low Github rate limits
1 parent f4e1df6 commit 9f61cb9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ curl -s https://raw.githubusercontent.com/envkey/envkey-source/master/install.sh
1414

1515
***Note:** the install.sh script writes, then deletes a couple temporary files to the current directory during installation, so make sure you have write permissions for whatever directory you run this command in. In locked down environments, you may want to run it in `$HOME` to be safe.*
1616

17+
***Another Note:** the install.sh script downloads the appropriate envkey-source binary from Github Releases by default, but Github has a fairly low rate limit for unauthenticated requests. For added redundancy, it will fail over to envkey-source-releases.s3.amazonaws.com (an S3 bucket controlled by EnvKey) and download the binary from there if the request to Github Releases fails.*
18+
1719
**Install manually:**
1820

1921
Find the [release](https://github.com/envkey/envkey-source/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).

install.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,18 @@ cleanup () {
6666

6767
download_envkey () {
6868
echo "Downloading envkey-source binary for ${PLATFORM}-${ARCH}"
69-
url="https://github.com/envkey/envkey-source/releases/download/v${VERSION}/envkey-source_${VERSION}_${PLATFORM}_${ARCH}.tar.gz"
70-
echo "Downloading tarball from ${url}"
69+
url="https://github.com/envkey/envkey-source/releases/download/v${VERSION}/envkey-source_${VERSION}_${PLATFORM}_${ARCH}.tar.gz"
70+
71+
echo "Downloading tarball from Github Releases: ${url}"
7172
curl -s -L -o envkey-source.tar.gz "${url}"
7273

74+
if [ ! -f envkey-source.tar.gz ]; then
75+
echo "Couldn't load tarball from Github Releases: ${url}"
76+
url="https://envkey-source-releases.s3.amazonaws.com/envkey-source_${VERSION}_${PLATFORM}_${ARCH}.tar.gz"
77+
echo "Now attempting to load from s3 bucket backup: ${url}"
78+
curl -s -L -o envkey-source.tar.gz "${url}"
79+
fi
80+
7381
tar zxf envkey-source.tar.gz envkey-source.exe 2> /dev/null
7482
tar zxf envkey-source.tar.gz envkey-source 2> /dev/null
7583

0 commit comments

Comments
 (0)