forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (45 loc) · 1.41 KB
/
Makefile
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
.PHONY: all
all: up ps logs
up:
docker-compose up -d
logs:
docker-compose logs --tail=100 -f
ps pull down:
docker-compose $@
stats:
# Conversations
@cat data/betabot/betabot.store | jq '.Convs[].ConversationPublicKey' | wc -l
restorecleandb: _backup-and-clean
# this command trashes the runtime db and restores a clean db that only has the same private key
cp -rf data/daemon/clean data/daemon/run
make print-qr
_backup-and-clean: down
rm -rf data/bkp-current
mkdir -p data/bkp-current data/bkps
mv data/daemon/run data/bkp-current/daemon || true
mv data/betabot data/bkp-current/betabot || true
mv data/bkp-current data/bkps/`date +%s` || true
initdb:
@if [ -d data/daemon/clean ]; then echo "[-] init already done"; exit 1; fi
mkdir -p data/daemon/run
docker-compose run daemon share-invite -store.dir=/store/run
make exportdb
cp -rf data/daemon/run data/daemon/clean
make print-qr
exportdb:
docker-compose run daemon export \
-store.dir=/store/run \
-export-path=/store/run/account0/export.tar \
-log.filters=info+*,-ipfs.*
ls -la data/daemon/run/account0/export.tar
importcleandb: _backup-and-clean
ls -la data/daemon
docker-compose run daemon share-invite \
-store.dir=/store/run \
-node.restore-export-path=/store/clean/account0/export.tar \
-log.filters=info+*,-ipfs.*
print-qr:
docker-compose run daemon share-invite \
-store.dir=/store/run \
-log.filters=none \
-name=BetaBot