feat: normalize key names to lowercase and handle single quotes in SOPS public key extraction

This commit is contained in:
Janik von Rotz committed 2026-10-14 17:58:51 +02:00
1 parent 622d12bea8
commit b4d2364fb1
4 files changed
+10 -7

No files matched your search

+3 -2
View File
@@ -5,7 +5,8 @@ init-dotenv-sops() {
project_name=$(basename -s .git "$(git remote get-url origin 2>/dev/null)" 2>/dev/null)
project_name=${project_name:-${PWD##*/}}
local key_name="${1:-$project_name}"
local key_name
key_name=$(echo "${1:-$project_name}" | tr '[:upper:]' '[:lower:]')
local age_dir="$HOME/.config/sops/age"
local age_key_file="$age_dir/keys.txt"
@@ -13,7 +14,7 @@ init-dotenv-sops() {
local public_key=""
if [[ -f ".sops.yaml" ]]; then
public_key=$(grep -E '^[[:space:]]*age:' ".sops.yaml" | head -1 | awk '{print $2}' | tr -d '"')
public_key=$(grep -E '^[[:space:]]*age:' ".sops.yaml" | head -1 | awk '{print $2}' | tr -d '"' | tr -d "'")
echo ".sops.yaml already exists with public key: $public_key"
fi
+2 -1
View File
@@ -28,7 +28,8 @@ load-agekey-from-keepass() {
project_name=$(basename -s .git "$(git remote get-url origin 2>/dev/null)" 2>/dev/null)
project_name=${project_name:-${PWD##*/}}
local key_name="${1:-$project_name}"
local key_name
key_name=$(echo "${1:-$project_name}" | tr '[:upper:]' '[:lower:]')
local age_dir="$HOME/.config/sops/age"
local age_key_file="$age_dir/keys.txt"
local keepass_entry="age/$key_name"
+3 -2
View File
@@ -31,7 +31,8 @@ store-agekey-to-keepass() {
project_name=$(basename -s .git "$(git remote get-url origin 2>/dev/null)" 2>/dev/null)
project_name=${project_name:-${PWD##*/}}
local key_name="${1:-$project_name}"
local key_name
key_name=$(echo "${1:-$project_name}" | tr '[:upper:]' '[:lower:]')
local age_key_file="$HOME/.config/sops/age/keys.txt"
local keepass_entry="age/$key_name"
local attachment_name="keys.txt"
@@ -42,7 +43,7 @@ store-agekey-to-keepass() {
fi
local public_key
public_key=$(grep -E '^[[:space:]]*age:' ".sops.yaml" 2>/dev/null | head -1 | awk '{print $2}' | tr -d '"')
public_key=$(grep -E '^[[:space:]]*age:' ".sops.yaml" 2>/dev/null | head -1 | awk '{print $2}' | tr -d '"' | tr -d "'")
if [[ -z "$public_key" ]]; then
echo "Could not determine public key from .sops.yaml"
return 1
+2 -2
View File
@@ -1,8 +1,8 @@
---
title: "Make global autocomplete work"
author: "Janik von Rotz <login@janikvonrotz.ch>"
state: review
date_completed:
state: completed
date_completed: 2026-10-14
harness: pi
model: moonshotai/Kimi-K2.6
input_tokens: