Skip to content

Commit

Permalink
add download page to website
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Martens <[email protected]>
  • Loading branch information
JanMa authored and naphelps committed May 10, 2024
1 parent bb70c6f commit 154c647
Show file tree
Hide file tree
Showing 4 changed files with 435 additions and 4 deletions.
14 changes: 10 additions & 4 deletions website/content/docs/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ There are several options to install OpenBao:

## Package manager

OpenBao manages packages for Ubuntu, Debian, Fedora, RHEL, Amazon
Linux, and other distributions. Follow the instructions at [OpenBao
Tutorials][learn-vault-install] to add our PGP key, add a repository, and
install.
:::info

OpenBao does not yet have a package repository. For now you need to download and
install packages manually.

:::

OpenBao manages packages for Ubuntu, Debian, Fedora, RHEL, Amazon Linux, and
other distributions. [Download](/downloads) the appropriate package for your
operating system and architecture.

## Precompiled binaries

Expand Down
153 changes: 153 additions & 0 deletions website/src/components/Releases/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
interface Release {
assets: {
linux: {
deb: string[];
rpm: string[];
binary: string[];
docker: string[];
};
darwin: {
binary: string[];
};
freebsd: {
binary: string[];
};
netbsd: {
binary: string[];
};
openbsd: {
binary: string[];
};
windows: {
binary: string[];
};
};
}

interface Releases {
[key: string]: Release;
}

interface GHRelease {
tag_name: string;
assets: GHAsset[];
}

interface GHAsset {
browser_download_url: string;
}

export function GetReleases(response): Releases {
const releases: GHRelease[] = response as GHRelease[];
const result: Releases = {};

releases.forEach((r) => {
const version = r.tag_name;

var release = {
assets: {
linux: {
deb: [],
rpm: [],
binary: [],
docker: [],
},
darwin: {
binary: [],
},
freebsd: {
binary: [],
},
netbsd: {
binary: [],
},
openbsd: {
binary: [],
},
windows: {
binary: [],
},
},
} as Release;
for (var a of r.assets) {
if (a.browser_download_url.includes("windows")) {
release.assets.windows.binary.push(a.browser_download_url);
}
if (a.browser_download_url.includes("openbsd")) {
release.assets.openbsd.binary.push(a.browser_download_url);
}
if (a.browser_download_url.includes("netbsd")) {
release.assets.netbsd.binary.push(a.browser_download_url);
}
if (a.browser_download_url.includes("freebsd")) {
release.assets.freebsd.binary.push(a.browser_download_url);
}
if (a.browser_download_url.includes("darwin")) {
release.assets.darwin.binary.push(a.browser_download_url);
}
if (a.browser_download_url.includes("docker")) {
release.assets.linux.docker.push(a.browser_download_url);
// docker urls also contain "linux", so contiune if we find it
continue;
}
if (a.browser_download_url.includes("rpm")) {
release.assets.linux.rpm.push(a.browser_download_url);
}
if (a.browser_download_url.includes("deb")) {
release.assets.linux.deb.push(a.browser_download_url);
}
if (a.browser_download_url.includes("linux")) {
release.assets.linux.binary.push(a.browser_download_url);
}
}
result[version] = release;
});

return result;
}

export function AssetArchitecture(url: string): string {
if (url.includes("amd64")) {
return "amd64";
}
if (url.includes("arm64")) {
return "arm64";
}
if (url.includes("armhf")) {
return "armhf";
}
if (url.includes("armv7hl")) {
return "armv7hl";
}
if (url.includes("arm")) {
return "arm";
}
if (url.includes("riscv64")) {
return "riscv64";
}
if (url.includes("aarch64")) {
return "aarch64";
}
if (url.includes("x86_64")) {
return "x86_64";
}
return "<none>";
}

export function OsPrettyPrint(name: string): string {
switch (name) {
case "linux":
return "Linux";
case "darwin":
return "MacOS";
case "freebsd":
return "FreeBSD";
case "openbsd":
return "OpenBSD";
case "netbsd":
return "NetBSD";
case "windows":
return "Windows";
}
return "";
}
Loading

0 comments on commit 154c647

Please sign in to comment.