Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Installation Guide

## Container Configuration

Use the `HARBOR_ENCRYPTION_KEY` container environment variable as a base64-encoded 32-byte key for AES-256 encryption. This securely stores your harbor login password.

If you intend to run the CLI as a container, it is advised
to set the following environment variables and to create an alias
and append the alias to your .zshrc or .bashrc file

```shell
echo "export HARBOR_CLI_CONFIG=\$HOME/.config/harbor-cli" >> ~/.zshrc
echo "export HARBOR_ENCRYPTION_KEY=\$(cat <path_to_32bit_private_key_file> | base64)" >> ~/.zshrc
echo "alias harbor='docker run -ti --rm -v \$HARBOR_CLI_CONFIG:/root/.config/harbor-cli -e HARBOR_ENCRYPTION_KEY=\$HARBOR_ENCRYPTION_KEY registry.goharbor.io/harbor-cli/harbor-cli'" >> ~/.zshrc
source ~/.zshrc # or restart your terminal
```

## Homebrew
```bash
brew install harbor-cli
```

Otherwise, you can download the binary from the [releases page](https://github.com/goharbor/harbor-cli/releases).

### Package based Installation

You can also install Harbor CLI using platform specific packages from the releases page.

#### Debian/Ubuntu(.deb)

> Replace `<version>` with the desired release version (e.g., v0.x.x).

```bash
wget https://github.com/goharbor/harbor-cli/releases/download/<version>/harbor-cli_<version>_linux_amd64.deb
sudo dpkg -i harbor-cli_<version>_linux_amd64.deb
```

#### Fedora/CentOS(.rpm)

> Replace `<version>` with the desired release version (e.g., v0.x.x).

```bash
wget https://github.com/goharbor/harbor-cli/releases/download/<version>/harbor-cli_<version>_linux_amd64.rpm
sudo rpm -i harbor-cli_<version>_linux_amd64.rpm
```

#### Alpine(.apk)

> Replace `<version>` with the desired release version (e.g., v0.x.x).

```bash
wget https://github.com/goharbor/harbor-cli/releases/download/<version>/harbor-cli_<version>_linux_amd64.apk
sudo apk add --allow-untrusted harbor-cli_<version>_linux_amd64.apk
```

#### APT repository

Harbor CLI provides an APT repository for Debian/Ubuntu systems.

1. Add the repository:

```bash
echo "deb [trusted=yes] https://goharbor.github.io/harbor-cli/buildDirs/stable /" | sudo tee /etc/apt/sources.list.d/harbor-cli.list
```

2. Update package index:

```bash
sudo apt update
```

3. Install Harbor CLI:

```bash
sudo apt install harbor-cli
```
Comment on lines +62 to +76
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesnt work rn due to some error in serving the apt.
Please hold on while we try to fix it.


> Note: The repository currently uses `trusted=yes` which skips signature verification.

## Security

Harbor CLI provides attested binaries and artifacts to ensure integrity and authenticity.

Artifacts are signed using Cosign as part of the release process enabling verification of distributed binaries and container images.

SHA256 checksums are generated for all release artifacts allowing users to validate downloads.

Additionally, SBOMs (Software Bill of Materials) are generated for each release using Syft in CycloneDX format providing transparency into dependencies and build contents.

These features help ensure the integrity and trustworthiness of Harbor CLI artifacts.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,8 @@ docker run -ti --rm -v $HOME/.config/harbor-cli:/root/.config/harbor-cli \
registry.goharbor.io/harbor-cli/harbor-cli \
--help
```
Use the `HARBOR_ENCRYPTION_KEY` container environment variable as a base64-encoded 32-byte key for AES-256 encryption. This securely stores your harbor login password.

If you intend to run the CLI as a container, it is advised
to set the following environment variables and to create an alias
and append the alias to your .zshrc or .bashrc file

```shell
echo "export HARBOR_CLI_CONFIG=\$HOME/.config/harbor-cli" >> ~/.zshrc
echo "export HARBOR_ENCRYPTION_KEY=\$(cat <path_to_32bit_private_key_file> | base64)" >> ~/.zshrc
echo "alias harbor='docker run -ti --rm -v \$HARBOR_CLI_CONFIG:/root/.config/harbor-cli -e HARBOR_ENCRYPTION_KEY=\$HARBOR_ENCRYPTION_KEY registry.goharbor.io/harbor-cli/harbor-cli'" >> ~/.zshrc
source ~/.zshrc # or restart your terminal
```

## Linux, macOS and Windows
## Linux/macOS

On Linux and macOS, you can use Homebrew:

Expand All @@ -92,6 +80,8 @@ brew install harbor-cli

Otherwise, you can download the binary from the [releases page](https://github.com/goharbor/harbor-cli/releases).

For detailed installation and setup instructions (binary, deb, rpm, apk, apt), see [INSTALL.md](./INSTALL.md).

## Add the Harbor CLI to your Container Image

Using Curl or Wget isn't needed if you want to
Expand Down