1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
#!/usr/bin/env bash
#PASS="$(ls "/run/media/"*/*"/key.fsojp.aes256" | head -n 1)"
echo
echo == Enter password. ==
echo
PASS="pass:$(echo 53616c7465645f5f6eb8e165b79052263e125e4070138e26b3d127bb36e3e943f212d2d761a4426170cc2c17c58bc5d67c99eddb1df6ee1c02d7b33dd95ecdf0 | xxd -ps -r | openssl aes-256-cbc -salt -pbkdf2 -d)"
ROOTDIR="$(git rev-parse --show-toplevel)"
cd "$ROOTDIR"
GITDIR="$ROOTDIR/.git"
MAINTDIR="$ROOTDIR/git-maintenance"
PUBKEY=1KwpZECcrGWnM3AFVSbv3Xr5qguV4yG2sV
URLPFX="https://bico.media/$PUBKEY"
if ! curl -sfI "$URLPFX"/refs.aes>/dev/null; then echo; echo "== Remember to get on internet. =="; echo; exit 2; fi
#export GZIP=-9n
TAR="tar -J --owner=0 --group=0 --numeric-owner --mode=go=rX,u+rw,a-s"
encrypt() {
openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -e
}
decrypt() {
openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d
}
# this approach makes it easy for karl to look at history. it is not
# to be used by other channels yet, can migrate.
# let us only upload new packfiles.
# we will use a mirror folder containing encrypted files
mkdir -p "$GITDIR"/encrypted
mkdir -p "$GITDIR"/encrypted.bak
if ! [ -d "$MAINTDIR"/bsvup/node_modules ]
then
git submodule init
git submodule update
pushd "$MAINTDIR"/bsvup
npm install
popd
fi
# prevent recreation of existing data on same medium-part
git config gc.auto 0
git pack-objects --all --unpacked --incremental --non-empty --local --compression=9 --pack-loose-unreachable .git/objects/pack/pack </dev/null
git prune-packed
tmpfile="$(mktemp)"
cd "$GITDIR"
for packfile in objects/pack/*.pack
do
$TAR -cv "$packfile" > "$tmpfile"
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
if [ "$(cat "$packfile" | sha256sum)" = "$(decrypt < encrypted/"$fn" | $TAR -xvOf - "$packfile" | 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 -fv encrypted/"$fn" encrypted.bak
else
echo "$fn FAILED GET MATCH REMOTELY ($packfile)"
fi
echo "$fn" >> "$tmpfile".list
done
rm "$tmpfile"
mv "$tmpfile".list encrypted/list.txt
$TAR -cv encrypted/list.txt refs HEAD packed-refs | encrypt > encrypted/refs.aes
rm encrypted/list.txt
cp -va "$MAINTDIR"/dog.sh encrypted
if [ "$(curl -s "$URLPFX"/dog.sh | sha256sum)" = "$(cat encrypted/dog.sh | sha256sum)" ]; then rm encrypted/dog.sh; fi
# 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 !!!!!!!!
# more privacy is made if encryption key is someething only us would consider.# then can be publicized, maybe. hot-shower-in-woods? froget-it-use-random
# we are storing 'everyone' to begin a thought. we are storing it permanently
# and privately.
# we want to encrypt filename too, for what-I-call respect,
# so let's put each file in its own tarball, preferably in subdir,
# and add each filename to an index that is also uploaded, for ease finding.
# we can write down the filenames locally too. but is sufficient to write down
# the index. =)
# now upload. use PASS and upload .git/encrypted. need money.
# all aboriginal cultures. discovers is emergency measure by government AI.
# PTSD. need slow shift to turned-to-nanites, earth broken.
# anger is for imagination. helps process importance from events.
# what-is-harmed, what-was-relevent-to-harm.
# business-man, try to larn to live off nuts, alone, yourself, now.
# wouldn't it be nice if we had somebody alive to help us do this.
# industry caused destruction of billions of years of learning-how-to-be and
# how-to-learn-how-to-be, which is the most important thing known.
# they are still doing this, and planning it, but do not realize it.
# they are also important, as part of learning-how-to-be and a-way-to-be.
# some imagine anger to process disconnected parts.
cd "$MAINTDIR"
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.
#PURPOSE OF LIFE: "is this a good way to be?" taken in allrecommend checking parts and environment for clues as to what is good. senses with trust for all others.
# REMAINING:
# 0. store download-script in repo, and on blockchain
# 0b. store upload script in repo
# 1. store download-script url on USB key
# 1b. store details on backup USB key too.
# 3. try to download without usb key, as test for failure
# 4. move btc from community or from git-remote-bsv to repo bsvup
# 5. upload the encrypted repo
# 6. download the encrypted repo, as a test
# 9. consider storing bsvup transaction details in git history, to reuse transaction information.
# costs more money
# this is not severely secure. appreciate speed change though.
|