summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/README.md
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2016-01-02 18:46:52 -0500
committerMaxim Biro <nurupo.contributions@gmail.com>2016-01-02 18:46:52 -0500
commit516d5ac09d77248ee44232c3c7ecf414e1b9bda6 (patch)
treee2ffe2ccc47c84be101a501132481ec0b4c2575b /other/bootstrap_daemon/README.md
parent6c104b5fe3ce6e6d7d6d091b3a4af25146ecfb17 (diff)
Add information on how to update the bootstrap daemon
Diffstat (limited to 'other/bootstrap_daemon/README.md')
-rw-r--r--other/bootstrap_daemon/README.md92
1 files changed, 81 insertions, 11 deletions
diff --git a/other/bootstrap_daemon/README.md b/other/bootstrap_daemon/README.md
index 2d9e5615..b2d9118e 100644
--- a/other/bootstrap_daemon/README.md
+++ b/other/bootstrap_daemon/README.md
@@ -1,19 +1,29 @@
1#Instructions 1#Instructions
2 2
3- [For `systemd` users](#systemd) 3- [For `systemd` users](#systemd)
4 - [Setting up](#systemd-setting-up)
5 - [Updating](#systemd-updating)
4 - [Troubleshooting](#systemd-troubleshooting) 6 - [Troubleshooting](#systemd-troubleshooting)
5<br> 7<br>
6- [For `init.d` users](#initd) 8- [For `init.d` users](#initd)
9 - [Setting up](#initd-setting-up)
10 - [Updating](#initd-updating)
7 - [Troubleshooting](#initd-troubleshooting) 11 - [Troubleshooting](#initd-troubleshooting)
8<br> 12<br>
9- [For `Docker` users](#docker) 13- [For `Docker` users](#docker)
14 - [Setting up](#docker-setting-up)
15 - [Updating](#docker-updating)
10 - [Troubleshooting](#docker-troubleshooting) 16 - [Troubleshooting](#docker-troubleshooting)
11 17
18
12These 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. 19These 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.
13 20
14 21
15<a name="systemd" /> 22<a name="systemd" />
16##For `systemd` users: 23##For `systemd` users
24
25<a name="systemd-setting-up" />
26###Setting up
17 27
18For security reasons we run the daemon under its own user. 28For security reasons we run the daemon under its own user.
19 29
@@ -58,8 +68,31 @@ Get your public key and check that the daemon initialized correctly:
58sudo grep "tox-bootstrapd" /var/log/syslog 68sudo grep "tox-bootstrapd" /var/log/syslog
59``` 69```
60 70
71<a name="systemd-updating" />
72###Updating
73
74You 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
76To update the daemon first stop it:
77
78```sh
79sudo systemctl stop tox-bootstrapd.service
80```
81
82Then update your toxcore git repository, rebuild the toxcore and the daemon and make sure to install them.
83
84Check 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
86After all of this is done, simply start the daemon back again:
87
88```sh
89sudo systemctl start tox-bootstrapd.service
90```
91
92Note that `tox-bootstrapd.service` file might
93
61<a name="systemd-troubleshooting" /> 94<a name="systemd-troubleshooting" />
62###Troubleshooting: 95###Troubleshooting
63 96
64- Check daemon's status: 97- Check daemon's status:
65```sh 98```sh
@@ -85,6 +118,9 @@ sudo journalctl -f _SYSTEMD_UNIT=tox-bootstrapd.service
85<a name="initd" /> 118<a name="initd" />
86##For `init.d` users 119##For `init.d` users
87 120
121<a name="initd-setting-up" />
122###Setting up
123
88For security reasons we run the daemon under its own user. 124For security reasons we run the daemon under its own user.
89 125
90Create a new user by executing the following: 126Create a new user by executing the following:
@@ -128,8 +164,29 @@ Get your public key and check that the daemon initialized correctly:
128sudo grep "tox-bootstrapd" /var/log/syslog 164sudo grep "tox-bootstrapd" /var/log/syslog
129``` 165```
130 166
167<a name="initd-updating" />
168###Updating
169
170You 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
172To update the daemon first stop it:
173
174```sh
175sudo service tox-bootstrapd stop
176```
177
178Then update your toxcore git repository, rebuild the toxcore and the daemon and make sure to install them.
179
180Check 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
182After all of this is done, simply start the daemon back again:
183
184```sh
185sudo service tox-bootstrapd start
186```
187
131<a name="initd-troubleshooting" /> 188<a name="initd-troubleshooting" />
132###Troubleshooting: 189###Troubleshooting
133 190
134- Check daemon's status: 191- Check daemon's status:
135```sh 192```sh
@@ -153,6 +210,9 @@ sudo grep "tox-bootstrapd" /var/log/syslog
153<a name="docker" /> 210<a name="docker" />
154##For `Docker` users: 211##For `Docker` users:
155 212
213<a name="docker-setting-up" />
214###Setting up
215
156If you are familiar with Docker and would rather run the daemon in a Docker container, run the following from this directory: 216If you are familiar with Docker and would rather run the daemon in a Docker container, run the following from this directory:
157 217
158```sh 218```sh
@@ -164,27 +224,37 @@ sudo chmod 700 /var/lib/tox-bootstrapd
164sudo 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 224sudo 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
165``` 225```
166 226
167We 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. 227We 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.
168 228
169You can check logs for your public key or any errors: 229You can check logs for your public key or any errors:
170```sh 230```sh
171sudo docker logs tox-bootstrapd 231sudo docker logs tox-bootstrapd
172``` 232```
173 233
174If 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: 234Note 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
239You 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
241To update the daemon, all you need is to erase current container with its image:
175 242
176```sh 243```sh
177sudo docker build -t tox-bootstrapd docker/ 244sudo docker stop tox-bootstrapd
178sudo docker run -d --name tox-bootstrapd --restart always -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd 245sudo docker rm tox-bootstrapd
179sudo docker logs tox-bootstrapd 246sudo docker rmi tox-bootstrapd
180``` 247```
181 248
182The 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. 249Then rebuild and run the image again:
183 250
184Note 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
252sudo docker build -t tox-bootstrapd docker/
253sudo 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```
185 255
186<a name="docker-troubleshooting" /> 256<a name="docker-troubleshooting" />
187###Troubleshooting: 257###Troubleshooting
188 258
189- Check if the container is running: 259- Check if the container is running:
190```sh 260```sh