Skip to content

Commit 516d5ac

Browse files
committed
Add information on how to update the bootstrap daemon
1 parent 6c104b5 commit 516d5ac

File tree

1 file changed

+81
-11
lines changed

1 file changed

+81
-11
lines changed

other/bootstrap_daemon/README.md

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
#Instructions
22

33
- [For `systemd` users](#systemd)
4+
- [Setting up](#systemd-setting-up)
5+
- [Updating](#systemd-updating)
46
- [Troubleshooting](#systemd-troubleshooting)
57
<br>
68
- [For `init.d` users](#initd)
9+
- [Setting up](#initd-setting-up)
10+
- [Updating](#initd-updating)
711
- [Troubleshooting](#initd-troubleshooting)
812
<br>
913
- [For `Docker` users](#docker)
14+
- [Setting up](#docker-setting-up)
15+
- [Updating](#docker-updating)
1016
- [Troubleshooting](#docker-troubleshooting)
1117

18+
1219
These instructions are primarily tested on Debian Linux, Wheezy for init.d and Jessie for systemd, but they should work on other POSIX-compliant systems too.
1320

1421

1522
<a name="systemd" />
16-
##For `systemd` users:
23+
##For `systemd` users
24+
25+
<a name="systemd-setting-up" />
26+
###Setting up
1727

1828
For security reasons we run the daemon under its own user.
1929

@@ -58,8 +68,31 @@ Get your public key and check that the daemon initialized correctly:
5868
sudo grep "tox-bootstrapd" /var/log/syslog
5969
```
6070

71+
<a name="systemd-updating" />
72+
###Updating
73+
74+
You want to make sure that the daemon uses the newest toxcore, as there might have been some changes done to the DHT, so it's advised to update the daemon at least once every month.
75+
76+
To update the daemon first stop it:
77+
78+
```sh
79+
sudo systemctl stop tox-bootstrapd.service
80+
```
81+
82+
Then update your toxcore git repository, rebuild the toxcore and the daemon and make sure to install them.
83+
84+
Check if `tox-bootstrapd.service` in toxcore git repository was modified since the last time you copied it, as you might need to update it too.
85+
86+
After all of this is done, simply start the daemon back again:
87+
88+
```sh
89+
sudo systemctl start tox-bootstrapd.service
90+
```
91+
92+
Note that `tox-bootstrapd.service` file might
93+
6194
<a name="systemd-troubleshooting" />
62-
###Troubleshooting:
95+
###Troubleshooting
6396

6497
- Check daemon's status:
6598
```sh
@@ -85,6 +118,9 @@ sudo journalctl -f _SYSTEMD_UNIT=tox-bootstrapd.service
85118
<a name="initd" />
86119
##For `init.d` users
87120

121+
<a name="initd-setting-up" />
122+
###Setting up
123+
88124
For security reasons we run the daemon under its own user.
89125

90126
Create a new user by executing the following:
@@ -128,8 +164,29 @@ Get your public key and check that the daemon initialized correctly:
128164
sudo grep "tox-bootstrapd" /var/log/syslog
129165
```
130166

167+
<a name="initd-updating" />
168+
###Updating
169+
170+
You want to make sure that the daemon uses the newest toxcore, as there might have been some changes done to the DHT, so it's advised to update the daemon at least once every month.
171+
172+
To update the daemon first stop it:
173+
174+
```sh
175+
sudo service tox-bootstrapd stop
176+
```
177+
178+
Then update your toxcore git repository, rebuild the toxcore and the daemon and make sure to install them.
179+
180+
Check if `tox-bootstrapd.sh` in toxcore git repository was modified since the last time you copied it, as you might need to update it too.
181+
182+
After all of this is done, simply start the daemon back again:
183+
184+
```sh
185+
sudo service tox-bootstrapd start
186+
```
187+
131188
<a name="initd-troubleshooting" />
132-
###Troubleshooting:
189+
###Troubleshooting
133190

134191
- Check daemon's status:
135192
```sh
@@ -153,6 +210,9 @@ sudo grep "tox-bootstrapd" /var/log/syslog
153210
<a name="docker" />
154211
##For `Docker` users:
155212

213+
<a name="docker-setting-up" />
214+
###Setting up
215+
156216
If you are familiar with Docker and would rather run the daemon in a Docker container, run the following from this directory:
157217

158218
```sh
@@ -164,27 +224,37 @@ sudo chmod 700 /var/lib/tox-bootstrapd
164224
sudo docker run -d --name tox-bootstrapd --restart always -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd
165225
```
166226

167-
We create a new user and protect its home directory in order to mount it in the Docker image, so that the kyepair the daemon uses would be shared with the host system, which makes it less likely that you would loose the keypair while playing with the Docker container.
227+
We create a new user and protect its home directory in order to mount it in the Docker image, so that the kyepair the daemon uses would be stored on the host system, which makes it less likely that you would loose the keypair while playing with or updating the Docker container.
168228

169229
You can check logs for your public key or any errors:
170230
```sh
171231
sudo docker logs tox-bootstrapd
172232
```
173233

174-
If you are an experienced Docker user and have a version of Docker that supports `docker cp` both host->container and container->host directions, you might want to skip the directory mounting part and just do:
234+
Note that the Docker container runs a script which pulls a list of bootstrap nodes off https://nodes.tox.chat/ and adds them in the config file.
235+
236+
<a name="docker-updating" />
237+
###Updating
238+
239+
You want to make sure that the daemon uses the newest toxcore, as there might have been some changes done to the DHT, so it's advised to update the daemon at least once every month.
240+
241+
To update the daemon, all you need is to erase current container with its image:
175242

176243
```sh
177-
sudo docker build -t tox-bootstrapd docker/
178-
sudo docker run -d --name tox-bootstrapd --restart always -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd
179-
sudo docker logs tox-bootstrapd
244+
sudo docker stop tox-bootstrapd
245+
sudo docker rm tox-bootstrapd
246+
sudo docker rmi tox-bootstrapd
180247
```
181248

182-
The keypair is stored in `/var/lib/tox-bootstrapd/keys` file, so if you skipped the directory mounting part and want a new Docker container to retain the same public key that from an old one, just copy/overwrite it from the old container.
249+
Then rebuild and run the image again:
183250

184-
Note that the Docker container runs a script which pulls a list of bootstrap nodes off https://nodes.tox.chat/ and adds them in the config file.
251+
```sh
252+
sudo docker build -t tox-bootstrapd docker/
253+
sudo docker run -d --name tox-bootstrapd --restart always -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd
254+
```
185255

186256
<a name="docker-troubleshooting" />
187-
###Troubleshooting:
257+
###Troubleshooting
188258

189259
- Check if the container is running:
190260
```sh

0 commit comments

Comments
 (0)