From ecd1089e9f529d5c168da85056da1ab576638ad5 Mon Sep 17 00:00:00 2001 From: olpc user Date: Tue, 7 Jan 2020 17:52:10 -0800 Subject: realized was not making deterministic files; using -J now, all files differ but should stay --- git-maintenance/get.sh | 4 ++-- git-maintenance/store.sh | 39 +++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/git-maintenance/get.sh b/git-maintenance/get.sh index a655762..7bff0ab 100755 --- a/git-maintenance/get.sh +++ b/git-maintenance/get.sh @@ -37,12 +37,12 @@ mv -f objects/pack/* objects/pack.bak/ # 3. download .git/encrypted with wget curl -sfI "$URLPFX"/refs.aes>/dev/null && wget "$URLPFX"/refs.aes -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ====" -openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in encrypted/refs.aes | tar -zxvf - +openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in encrypted/refs.aes | tar -Jxvf - for encpack in $( "$tmpfile" - openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -e -in "$tmpfile" -out "$tmpfile".aes - fn="$({ cat "$tmpfile"; echo -n "$PASS"; } | sha256sum | cut -f 1 -d ' ')".aes + fn="$({ cat "$packfile"; echo -n "$PASS"; } | sha256sum | cut -f 1 -d ' ')".aes if [ -e encrypted/"$fn" ] then echo "$fn ALREADY EXISTS LOCALLY ($packfile)" else echo "$fn IS NEW LOCALLY ($packfile)" fi - mv "$tmpfile".aes encrypted/"$fn" - if [ "$(curl "$URLPFX"/"$fn" | sha256sum)" = "$(cat encrypted/"$fn" | sha256sum)" ]; then - echo "$fn ALREADY EXISTS REMOTELY ($packfile)" + if [ "$(cat "$packfile" | sha256sum)" = "$(decrypt < encrypted/"$fn" | sha256sum) ] + then + echo "$fn MATCHES CONTENT LOCALLY ($packfile)" + else + echo "$fn DOESN'T MATCH LOCAL CONTENT ($packfile)" + encrypt < "$tmpfile" > "$tmpfile".aes + mv "$tmpfile".aes encrypted/"$fn" + fi + # need to decrypt to compare content. + if [ "$(curl "$URLPFX"/"$fn" | decrypt | "$TAR" -xvOf - "$packfile" | sha256sum)" = "$(cat "$packfile" | sha256sum)" ]; then + echo "$fn MATCHES DOWNLOAD CONTENT ($packfile)" mv -v encrypted/"$fn" encrypted.bak else echo "$fn FAILED GET MATCH REMOTELY ($packfile)" @@ -59,7 +75,7 @@ do done rm "$tmpfile" mv "$tmpfile".list encrypted/list.txt -$TAR -cv encrypted/list.txt refs HEAD packed-refs | openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -e -out encrypted/refs.aes +$TAR -cv encrypted/list.txt refs HEAD packed-refs | encrypt > encrypted/refs.aes rm encrypted/list.txt cp -va "$MAINTDIR"/get.sh encrypted if [ "$(curl -s "$URLPFX"/get.sh | sha256sum)" = "$(cat encrypted/get.sh | sha256sum)" ]; then rm encrypted/get.sh; fi @@ -67,7 +83,6 @@ if [ "$(curl -s "$URLPFX"/get.sh | sha256sum)" = "$(cat encrypted/get.sh | sha25 - # primordia is detectable due to a pattern that emerges from not being industrialized. appears resolvable with industrial history assumption, including academic degrees. name-AI-primordia, keep earth-is-god assumption? the-king? the-king-is-earth. AI works for earth. be any thing you want. silica-computer. # this junk in scriptfile is why private !!!!!!!! @@ -97,7 +112,7 @@ if [ "$(curl -s "$URLPFX"/get.sh | sha256sum)" = "$(cat encrypted/get.sh | sha25 # some imagine anger to process disconnected parts. cd "$MAINTDIR" -node bsvup/cli.js upload -f "$GITDIR"/encrypted -t dir -p "$(<"$PASS")" -vb +node bsvup/cli.js upload -f "$GITDIR"/encrypted -t dir -p "$(<"$PASS")" -v # -b # 'is this a good way to be' <- habit's task for self and others, by living # the best way to be it can. -- cgit v1.2.3