From 78ecc94d58c261b0d137b942f519b610576465be Mon Sep 17 00:00:00 2001 From: noe Date: Fri, 16 May 2025 21:52:45 -0700 Subject: [PATCH] logroll updates --- log/002-soppy-wet-nix.doll | 4 +++- plugins/logroll.sh | 41 ++++++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/log/002-soppy-wet-nix.doll b/log/002-soppy-wet-nix.doll index 104edee..9af63d0 100644 --- a/log/002-soppy-wet-nix.doll +++ b/log/002-soppy-wet-nix.doll @@ -119,7 +119,9 @@ description: how it stores secrets alongside its code age answers that question by letting doll use ed25519 keys to encrypt and decrypt doll's data. - [quote(important ^noe message):ed25519 would be a good name for a doll!!] + [quote(important ^noe message):: + ed25519 would be a good name for a doll!! + ] since we're deploying to machines with presumably an SSH server running, and presumably the doll also has an SSH client, all of these ends have SSH keys we can use diff --git a/plugins/logroll.sh b/plugins/logroll.sh index e3d2c30..3caf5db 100755 --- a/plugins/logroll.sh +++ b/plugins/logroll.sh @@ -1,15 +1,48 @@ #!/bin/bash - cd log +get_frontmatter() { + key=$1 + file=$2 + + keyLine=$(grep -e "^$key: " $file || echo "") + sed "s/.*: //" <<<$keyLine | xargs +} + +get_heading() { + file=$1 + grep -i '^&' $file +} + +get_heading_date() { + echo $1 | sed -E 's/^.*\(([A-Z0-9]+)\) \^.*$/\1/g' +} + +get_heading_name() { + echo $1 | sed -E 's/^.*\] (.*) \(.*$/\1/g' +} + +get_author() { + code=$(echo $1 | sed -E 's/.*\^(.*)$/\1/g') + + echo $code +} + echo "