Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
bcb3ab60
Unverified
Commit
bcb3ab60
authored
Nov 22, 2020
by
Ivan Vandot
Committed by
GitHub
Nov 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove templates, unify deb and rpm install and add bee-get-addr wrapper (#992)
parent
fe7a64f8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
68 deletions
+55
-68
.goreleaser.yml
.goreleaser.yml
+4
-4
bee-get-addr
packaging/bee-get-addr
+29
-0
postinst
packaging/deb/postinst
+11
-35
templates
packaging/deb/templates
+0
-10
post
packaging/rpm/post
+11
-19
No files found.
.goreleaser.yml
View file @
bcb3ab60
...
...
@@ -65,11 +65,14 @@ nfpms:
formats
:
-
deb
-
rpm
files
:
"
packaging/bee.service"
:
"
/lib/systemd/system/bee.service"
"
packaging/bee-get-addr"
:
"
/usr/bin/bee-get-addr"
config_files
:
"
packaging/bee.yaml"
:
"
/etc/bee/bee.yaml"
"
packaging/default"
:
"
/etc/default/bee"
"
packaging/bee.service"
:
"
/lib/systemd/system/bee.service"
overrides
:
deb
:
...
...
@@ -90,8 +93,5 @@ nfpms:
postinstall
:
./packaging/rpm/post
preremove
:
./packaging/rpm/preun
postremove
:
./packaging/rpm/postun
deb
:
scripts
:
templates
:
./packaging/deb/templates
bindir
:
/usr/bin
packaging/bee-get-addr
0 → 100755
View file @
bcb3ab60
#!/bin/sh
if
[
!
`
id
-u
`
-eq
0
]
;
then
echo
"
use sudo!
"
exit
1
fi
RESP
=
$(
/usr/bin/bee init
--config
/etc/bee/bee.yaml 2>&1
)
case
"
$RESP
"
in
Error
*
)
echo
"
Enabled clef-signer but clef is not running.
Check https://docs.ethswarm.org/ for more info.
After you fix configuration run 'sudo bee-get-addr' again.
"
;;
*
)
ETH_ADDRESS
=
$(
echo
"
$RESP
"
|
grep
ethereum |
cut
-d
' '
-f6
|
tr
-d
'"'
)
echo
"
Please make sure there is sufficient eth and bzz available on
$ETH_ADDRESS
address.
You can get both goerli eth and goerli bzz from https://faucet.ethswarm.org
After you get the funds start service with 'systemctl start bee.service'.
"
;;
esac
packaging/deb/postinst
View file @
bcb3ab60
#!/bin/sh -e
if
[
"
$1
"
=
"configure"
]
;
then
START
=
true
if
[
-z
"
$2
"
]
;
then
.
/usr/share/debconf/confmodule
db_input high bee/ethereum-endpoint
||
true
if
db_go
;
then
db_get bee/ethereum-endpoint
grep
-v
BEE_SWAP_ENDPOINT /etc/default/bee
>
/etc/default/bee.tmp
echo
"BEE_SWAP_ENDPOINT=
$RET
"
>>
/etc/default/bee.tmp
&&
mv
/etc/default/bee.tmp /etc/default/bee
fi
# initial installation
if
[
!
-f
/var/lib/bee/keys/libp2p.key
]
;
then
/usr/bin/bee init
--config
/etc/bee/bee.yaml
>
/dev/null 2>&1
chown
-R
bee:bee /var/lib/bee/keys
fi
db_input high bee/clef-enable
||
true
if
db_go
;
then
db_get bee/clef-enable
if
[
"
$RET
"
=
true
]
;
then
grep
-v
BEE_CLEF_SIGNER_ENABLE /etc/default/bee
>
/etc/default/bee.tmp
echo
"BEE_CLEF_SIGNER_ENABLE=true"
>>
/etc/default/bee.tmp
&&
mv
/etc/default/bee.tmp /etc/default/bee
fi
fi
set
+e
RESP
=
$(
BEE_CLEF_SIGNER_ENABLE
=
$RET
/usr/bin/bee init
--config
/etc/bee/bee.yaml 2>&1
)
set
-e
case
"
$RESP
"
in
Error
*
)
START
=
false
echo
"Enabled clef-signer but clef is not running."
echo
"Check https://docs.ethswarm.org/ for more info and how to fix."
echo
"Or install latest release of bee-clef from https://github.com/ethersphere/bee-clef and reinstall bee."
echo
"Start bee with systemctl --no-reload start bee.service"
;;
*
)
ETH_ADDRESS
=
$(
echo
"
$RESP
"
|
grep
ethereum |
cut
-d
' '
-f6
|
tr
-d
'"'
)
echo
"Please make sure there is sufficient eth and bzz available on
$ETH_ADDRESS
address."
echo
"You can get both goerli eth and goerli bzz from https://faucet.ethswarm.org."
;;
esac
echo
"
Bee has SWAP enabled by default and it needs ethereum endpoint to operate.
It is recommended to use external signer with bee.
Check documentation for more info https://docs.ethswarm.org/
After you finish configuration run 'sudo bee-get-addr'.
"
fi
# allow group members (bee user) to use clef's socket
if
[
-S
/var/lib/bee-clef/clef.ipc
]
;
then
chmod
660 /var/lib/bee-clef/clef.ipc
fi
...
...
@@ -55,7 +30,8 @@ if [ "$1" = "configure" ]; then
fi
if
[
-d
/run/systemd/system
]
;
then
systemctl
--system
daemon-reload
>
/dev/null
||
true
if
[
$START
=
true
]
;
then
# upgrade
if
[
!
-z
"
$2
"
]
;
then
deb-systemd-invoke start bee.service
>
/dev/null
||
true
fi
fi
...
...
packaging/deb/templates
deleted
100644 → 0
View file @
fe7a64f8
Template: bee/ethereum-endpoint
Type: string
Description: Set ethereum endpoint for bee.
Bee has SWAP enabled by default and needs ethereum endpoint to operate.
Template: bee/clef-enable
Type: boolean
Description: Do you want to enable clef support?
It is recommended to use external signer with bee. Bee has support for clef.
Download and install latest bee-clef release from https://github.com/ethersphere/bee-clef
packaging/rpm/post
View file @
bcb3ab60
if [ $1 -eq 1 ] ; then
# Initial installation
echo "Bee has SWAP enabled by default and needs ethereum endpoint to operate."
echo "Set ethereum endpoint for bee swap-endpoint inside /etc/bee/bee.yaml"
# initial installation
if [ ! -f /var/lib/bee/keys/libp2p.key ]; then
/usr/bin/bee init --config /etc/bee/bee.yaml >/dev/null 2>&1
chown -R bee:bee /var/lib/bee/keys
fi
echo "It is recommended to use external signer with bee. Bee has support for clef."
echo "Download and install latest bee-clef release from https://github.com/ethersphere/bee-clef"
echo "Enable external signer setting clef-signer-enable to true inside /etc/bee/bee.yaml"
if [ -f /var/lib/bee/keys/swarm.key ]; then
parse_json() { echo $1|sed -e 's/[{}]/''/g'|sed -e 's/", "/'\",\"'/g'|sed -e 's/" ,"/'\",\"'/g'|sed -e 's/" , "/'\",\"'/g'|sed -e 's/","/'\"---SEPERATOR---\"'/g'|awk -F=':' -v RS='---SEPERATOR---' "\$1~/\"$2\"/ {print}"|sed -e "s/\"$2\"://"|tr -d "\n\t"|sed -e 's/\\"/"/g'|sed -e 's/\\\\/\\/g'|sed -e 's/^[ \t]*//g'|sed -e 's/^"//' -e 's/"$//' ; }
echo "If you don't want to use external signer even if we recommended it."
echo "Please make sure there is sufficient eth and bzz available on $(parse_json $(cat /var/lib/bee/keys/swarm.key) address)"
echo "You can get both goerli eth and goerli bzz from https://faucet.ethswarm.org"
fi
systemctl --no-reload preset bee.service &>/dev/null || :
systemctl --no-reload enable bee.service &>/dev/null || :
echo "If you enabled external signer. Run"
echo "sudo /usr/bin/bee init --config /etc/bee/bee.yaml 2>&1 | grep ethereum | cut -d' ' -f6 | tr -d '\"'"
echo "Prefund that address at https://faucet.ethswarm.org"
echo "Service already enabled, after initial configuration."
echo "Start service with systemctl --no-reload start bee.service"
echo "
Bee has SWAP enabled by default and it needs ethereum endpoint to operate.
It is recommended to use external signer with bee.
Check documentation for more info https://docs.ethswarm.org/
After you finish configuration run 'sudo bee-get-addr'.
"
fi
# allow group members (bee user) to use clef's socket
if [ -S /var/lib/bee-clef/clef.ipc ]; then
chmod 660 /var/lib/bee-clef/clef.ipc
fi
if [ $1 -eq 2 ] ; then
#
U
pgrade
systemctl --no-reload
re
start bee.service &>/dev/null || :
#
u
pgrade
systemctl --no-reload start bee.service &>/dev/null || :
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment