From 33c50c335ee1ad09d15cca63f8767dfdfa0cbd57 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Tue, 11 Jul 2023 06:04:11 +0000 Subject: [PATCH] Latest --- home/.chezmoidata.yaml | 3 +- ...n_onchange_before_91-configure-gpg.sh.tmpl | 34 +++++++++-------- home/dot_config/shell/exports.sh.tmpl | 1 + software.yml | 38 ++++++++++++++----- 4 files changed, 49 insertions(+), 27 deletions(-) diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index e5c9ee3d..3d85bc3c 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -602,12 +602,13 @@ softwareGroups: - cmctl - kdash - kn + # TODO: Check if some of these are installed by Krew and remove if they are - kubectx - kubekey - kubenav - kube-shell - kubernetes-cli - - kubernetes-helm + - helm - kubernetes-kompose - kubeval - k9s diff --git a/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl index 28b323e9..0001ca55 100644 --- a/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl @@ -9,7 +9,7 @@ {{ includeTemplate "universal/profile-before" }} {{ includeTemplate "universal/logg-before" }} -KEYID="{{ .user.gpg.id }}" +export KEYID="{{ .user.gpg.id }}" if [ -n "$KEYID" ] && command -v gpg > /dev/null; then if [ ! -d "$HOME/.gnupg" ]; then @@ -27,25 +27,27 @@ if [ -n "$KEYID" ] && command -v gpg > /dev/null; then fi KEYID_TRIMMED="$(echo "$KEYID" | sed 's/^0x//')" if ! gpg --list-secret-keys --keyid-format=long | grep "$KEYID_TRIMMED" > /dev/null; then - logg info 'Attempting to download the specified public GPG key (`{{ .user.gpg.id }}`) from public keyservers' - sudo pkill dirmngr - dirmngr --daemon --standard-resolver - gpg --keyserver https://pgp.mit.edu --recv "$KEYID" || EXIT_CODE=$? - if [ -n "$EXIT_CODE" ]; then - logg info 'Non-zero exit code received when downloading public GPG key' - gpg --keyserver hkps://pgp.mit.edu --recv "$KEYID" || EXIT_CODE=$? + LOCAL_KEYID="${KEYID^^}" + LOCAL_KEYID="$(echo "$LOCAL_KEYID" | sed 's/^0X/0x/')" + logg info 'Killing dirmngr instance and reloading daemon with standard-resolver' + sudo pkill dirmngr && dirmngr --daemon --standard-resolver || logg error 'Failed to launch dirmngr with standard-resolver' + if [ -f "$HOME/.gnupg/public/$KEYID.sig" ]; then + gpg --import "$HOME/.gnupg/public/$KEYID.sig" + else + logg info 'Attempting to download the specified public GPG key (`{{ .user.gpg.id }}`) from public keyservers' + gpg --keyserver https://pgp.mit.edu --recv "$KEYID" || EXIT_CODE=$? if [ -n "$EXIT_CODE" ]; then - logg info 'Non-zero exit code received when trying to retrieve public user GPG key on hkps://pgp.mit.edu' - gpgconf --kill dirmngr - KEYID="${KEYID^^}" - KEYID="$(echo "$KEYID" | sed 's/^0X/0x/')" - if [ -f "$HOME/.gnupg/public/$KEYID.sig" ]; then - gpg --import "$HOME/.gnupg/public/$KEYID.sig" + logg info 'Non-zero exit code received when downloading public GPG key' + gpg --keyserver hkps://pgp.mit.edu --recv "$KEYID" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg info 'Non-zero exit code received when trying to retrieve public user GPG key on hkps://pgp.mit.edu' + else + logg success 'Successfully imported configured public user GPG key' fi - else - logg success 'Successfully imported configured public user GPG key' fi fi + logg info 'Stopping dirmngr' + gpgconf --kill dirmngr && logg info 'Stopped dirmngr' || info warn 'Failed to stop dirmngr' else logg info 'Key is already in keyring' fi diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index af45c44a..82899b38 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -235,6 +235,7 @@ export KODI_DATA="$XDG_DATA_HOME/kodi" ### Krew export KREW_ROOT="$XDG_DATA_HOME/krew" +export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" ### Kube export KUBECONFIG="$XDG_CONFIG_HOME/kube/config" diff --git a/software.yml b/software.yml index f524cf91..829ea86e 100644 --- a/software.yml +++ b/software.yml @@ -4630,6 +4630,11 @@ softwarePackages: dnf: kodi flatpak: tv.kodi.Kodi pacman: kodi + krew: + _bin: kubectl-krew + _github: https://github.com/kubernetes-sigs/krew + _name: KubeCTL + brew: krew kubectx: _bin: kubectx _desc: Faster way to switch between clusters and namespaces in kubectl @@ -4642,9 +4647,6 @@ softwarePackages: choco: - kubens - kubectx - krew: - - ctx - - ns pacman: kubectx port: kubectx snap: kubectx @@ -4670,7 +4672,7 @@ softwarePackages: brew: kubectl choco: kubernetes-cli snap: kubectl - kubernetes-helm: + helm: _bin: helm _desc: The Kubernetes Package Manager. Helm is the best way to find, share, and use software built for Kubernetes. _docs: https://helm.sh/docs @@ -9972,7 +9974,7 @@ softwarePlugins: plugins: - https://github.com/BalliAsghar/mailsy-alfred/releases/download/2.0.0/Mailsy.alfredworkflow android-studio: - cmd: bash -c 'if ! sdkmanager --list_installed | grep \' {PLUGIN}\' > /dev/null; then sdkmanager --install \'{PLUGIN}\' > /dev/null; fi' + cmd: bash -c 'if ! sdkmanager --list_installed | grep " {PLUGIN}" > /dev/null; then sdkmanager --install "{PLUGIN}" > /dev/null; fi' plugins: - add-ons;addon-google_apis-google-24 - build-tools;33.0.0 @@ -10032,7 +10034,7 @@ softwarePlugins: - microsoft.cst.attacksurfaceanalyzer.cli - dotnet-format gcloud: - cmd: bash -c 'if ! gcloud components list | grep 'Installed.*{PLUGIN}' &> /dev/null; then gcloud components install "{PLUGIN}"; fi' + cmd: bash -c 'if ! gcloud components list | grep "Installed.*{PLUGIN}" &> /dev/null; then gcloud components install "{PLUGIN}"; fi' plugins: - app-engine-go - cloud-datastore-emulator @@ -10055,27 +10057,43 @@ softwarePlugins: - github/gh-net - mislav/gh-cp helm: + cmd: bash -c '{PLUGIN}' plugins: - - https://github.com/databus23/helm-diff - - https://github.com/jkroepke/helm-secrets - - repo: helm repo add cloudflare-exporter https://lablabs.github.io/cloudflare-exporter/ - install: helm install cloudflare-exporter/cloudflare-exporter + - if ! helm plugin list | grep "Preview helm upgrade changes as a diff" > /dev/null; then helm plugin install https://github.com/databus23/helm-diff; fi + - if ! helm plugin list | grep "This plugin provides secrets values encryption for Helm charts secure storing" > /dev/null; then helm plugin install https://github.com/jkroepke/helm-secrets; fi + # - helm repo add cloudflare-exporter https://lablabs.github.io/cloudflare-exporter/ && helm install cloudflare-exporter/cloudflare-exporter krew: + cmd: bash -c 'if ! kubectl krew list | grep "{PLUGIN}" > /dev/null; then kubectl krew install "{PLUGIN}"; fi' plugins: - access-matrix + - cert-manager + - cost + - ctx - datree - deprecations + - flyte - get-all + - graph + - ingress-nginx + - karmada - konfig + - kyverno + - liqo + - minio - modify-secret - neat - node-shell + - nx + - oidc-login - resource-capacity - score - sniff + - tail - tree - tunnel - view-allocations + - virt + - warp - who-can raycast: cmd: null