blob: cabe12a0092e62f264aaef60540e8cac414c206d (
plain)
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
|
pre_install() {
if ! getent passwd bee >/dev/null; then
useradd -r -d /var/lib/bee -s /sbin/nologin -c 'Bee user' -U bee
fi
if getent passwd bee-clef >/dev/null; then
usermod -a -G bee-clef bee >/dev/null
fi
if ! test -d /var/lib/bee; then
mkdir -p /var/lib/bee
fi
chmod 0750 /var/lib/bee
chown -R bee:bee /var/lib/bee
if ! test -f /var/lib/bee/password; then
tr </dev/urandom -dc _A-Z-a-z-0-9 2>/dev/null | head -c32 >/var/lib/bee/password
chmod 0600 /var/lib/bee/password
chown bee:bee /var/lib/bee/password
fi
}
post_install() {
# On first install
if ! test -f /var/lib/bee/keys/libp2p.key; then
/usr/bin/bee init --config /etc/bee/bee.yaml >/dev/null && chown -R bee:bee /var/lib/bee/keys
echo "
Logs: journalctl -f -u bee.service
Config: /etc/bee/bee.yaml
Bee requires an Ethereum endpoint to function. By default is using ws://localhost:8546 ethereum endpoint.
If needed obtain a free Infura account and set:
swap-endpoint: wss://goerli.infura.io/ws/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
It is recommended to use external signer with bee.
Check documentation for more info:
- External signer https://docs.ethswarm.org/docs/installation/bee-clef
After you finish configuration run 'sudo bee-get-addr'.
"
fi
# Allow group members (bee user) to use clef's socket
if test -S /var/lib/bee-clef/clef.ipc; then
chmod 660 /var/lib/bee-clef/clef.ipc
fi
}
post_remove() {
userdel bee >/dev/null 2>&1 || true
groupdel bee >/dev/null 2>&1 || true
}
|