Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Install SOPS without root #142

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ More info on [sops page](https://github.com/mozilla/sops#showing-diffs-in-cleart

#### Using Helm plugin manager (> 2.3.x)

If you want to install it without root access it's necessary to set the environment variable `NOROOT` to `true`.
```
export NOROOT=true; heml plugin install https://github.com/futuresimple/helm-secrets
```

As already described above,
```
helm plugin install https://github.com/futuresimple/helm-secrets
Expand Down
15 changes: 13 additions & 2 deletions install-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SOPS_DEB_URL="https://github.com/mozilla/sops/releases/download/${SOPS_VERSION}/
SOPS_DEB_SHA="9d9f319882ba05e7050be91bdfc396167ac9b00e2e6f634a647d55ac97915bb6"
SOPS_LINUX_URL="https://github.com/mozilla/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux"
SOPS_LINUX_SHA="e185d2752defdcb18c054f67682a6684c72d6a6bf2341f6bef1dd7d33a110459"
NOROOT="${NOROOT:=false}"

RED='\033[0;31m'
GREEN='\033[0;32m'
Expand Down Expand Up @@ -49,7 +50,7 @@ else
brew install sops
elif [ "$(uname)" == "Linux" ];
then
if which dpkg;
if [ "$(which dpkg)" ] && [ "${NOROOT}" == false ];
then
curl -sL "${SOPS_DEB_URL}" > /tmp/sops
if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_DEB_SHA}" ];
Expand All @@ -63,7 +64,17 @@ else
if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_LINUX_SHA}" ];
then
chmod +x /tmp/sops
mv /tmp/sops /usr/local/bin/

if [ "${NOROOT}" == true ];
then
if [ ! -d "$HOME/bin" ];
then
mkdir $HOME/bin
fi
mv /tmp/sops $HOME/bin
else
mv /tmp/sops /usr/local/bin/
fi
else
echo -e "${RED}Wrong SHA256${NOC}"
fi
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "secrets"
version: "2.0.2"
version: "2.0.3"
usage: "Secrets encryption in Helm for Git storing"
description: |-
This plugin provides secrets values encryption for Helm charts secure storing
Expand Down