From 81b1e65c6968b622872129683d8c25ea6b77a6c9 Mon Sep 17 00:00:00 2001 From: hack3d Date: Fri, 13 Dec 2019 10:13:58 +0100 Subject: [PATCH 1/6] Add noroot option --- install-binary.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install-binary.sh b/install-binary.sh index 2d38494..379bd00 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -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="false" RED='\033[0;31m' GREEN='\033[0;32m' @@ -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}" ]; From 05b3b6e0d7f4d7c4657f4c959bbcb53aaf802ebf Mon Sep 17 00:00:00 2001 From: hack3d Date: Fri, 13 Dec 2019 11:20:00 +0100 Subject: [PATCH 2/6] Bump to version 2.0.2-1 --- plugin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.yaml b/plugin.yaml index 0f043ae..3309ee8 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "secrets" -version: "2.0.2" +version: "2.0.2-1" usage: "Secrets encryption in Helm for Git storing" description: |- This plugin provides secrets values encryption for Helm charts secure storing From 432628a90d5e43839bd5a2efef694389366aa012 Mon Sep 17 00:00:00 2001 From: hack3d Date: Fri, 13 Dec 2019 11:42:22 +0100 Subject: [PATCH 3/6] Better operator --- install-binary.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-binary.sh b/install-binary.sh index 379bd00..a5a1105 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -50,7 +50,7 @@ else brew install sops elif [ "$(uname)" == "Linux" ]; then - if [ which dpkg ] & [ ${NOROOT} == "false" ]; + if [ which dpkg ] && [ ${NOROOT} == "false" ]; then curl -sL "${SOPS_DEB_URL}" > /tmp/sops if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_DEB_SHA}" ]; From f49d0e68f69c95f804aa36e9ff4a09b07a3f5691 Mon Sep 17 00:00:00 2001 From: hack3d Date: Fri, 13 Dec 2019 13:23:55 +0100 Subject: [PATCH 4/6] Move sops binary to local bin folder. --- install-binary.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install-binary.sh b/install-binary.sh index a5a1105..46dee87 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -50,7 +50,7 @@ else brew install sops elif [ "$(uname)" == "Linux" ]; then - if [ which dpkg ] && [ ${NOROOT} == "false" ]; + if [ "$(which dpkg)" ] && [ "${NOROOT}" == "false" ]; then curl -sL "${SOPS_DEB_URL}" > /tmp/sops if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_DEB_SHA}" ]; @@ -64,7 +64,14 @@ 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 + mkdir $HOME/bin + mv /tmp/sops $HOME/bin + else + mv /tmp/sops /usr/local/bin/ + fi else echo -e "${RED}Wrong SHA256${NOC}" fi From 9b20aee8aff15e21c95eac11e30fd6a1ce1c4863 Mon Sep 17 00:00:00 2001 From: hack3d Date: Fri, 13 Dec 2019 15:38:02 +0100 Subject: [PATCH 5/6] Create local bin directory for sops if noroot option is set --- install-binary.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install-binary.sh b/install-binary.sh index 46dee87..be67b59 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -7,7 +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="false" +NOROOT="${NOROOT:=false}" RED='\033[0;31m' GREEN='\033[0;32m' @@ -50,7 +50,7 @@ else brew install sops elif [ "$(uname)" == "Linux" ]; then - if [ "$(which dpkg)" ] && [ "${NOROOT}" == "false" ]; + if [ "$(which dpkg)" ] && [ "${NOROOT}" == false ]; then curl -sL "${SOPS_DEB_URL}" > /tmp/sops if [ "$(get_sha_256 /tmp/sops)" == "${SOPS_DEB_SHA}" ]; @@ -65,9 +65,12 @@ else then chmod +x /tmp/sops - if [ "${NOROOT}" == "true" ]; + if [ "${NOROOT}" == true ]; then - mkdir $HOME/bin + if [ ! -d "$HOME/bin" ]; + then + mkdir $HOME/bin + fi mv /tmp/sops $HOME/bin else mv /tmp/sops /usr/local/bin/ From 8cad28d4ebe1977131d2e211aec93e995e86a3d3 Mon Sep 17 00:00:00 2001 From: hack3d Date: Thu, 16 Jul 2020 10:10:00 +0200 Subject: [PATCH 6/6] Bump version to 2.0.3. Update README --- README.md | 5 +++++ plugin.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c31f79..a09589e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/plugin.yaml b/plugin.yaml index 3309ee8..ca3d7ef 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "secrets" -version: "2.0.2-1" +version: "2.0.3" usage: "Secrets encryption in Helm for Git storing" description: |- This plugin provides secrets values encryption for Helm charts secure storing