diff options
author | irungentoo <irungentoo@gmail.com> | 2016-01-04 22:43:36 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2016-01-04 22:43:36 -0500 |
commit | c6bed82d47aa39709bdd568fccc3847714ed1b74 (patch) | |
tree | 4e2dd8676a53e78a5b84e3abd68cdbe82a636737 /other/bootstrap_daemon/README.md | |
parent | 760f20c9455c2ef33ec9d242f209a1543f6acaf4 (diff) | |
parent | 9d1efd594914629204d4cd1a84678daf67eb8068 (diff) |
Merge branch 'tox-bootstrapd-docker-support' of https://github.com/nurupo/InsertProjectNameHere
Diffstat (limited to 'other/bootstrap_daemon/README.md')
-rw-r--r-- | other/bootstrap_daemon/README.md | 137 |
1 files changed, 128 insertions, 9 deletions
diff --git a/other/bootstrap_daemon/README.md b/other/bootstrap_daemon/README.md index e77e3ae0..93e390ef 100644 --- a/other/bootstrap_daemon/README.md +++ b/other/bootstrap_daemon/README.md | |||
@@ -1,17 +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 `SysVinit` users](#sysvinit) |
7 | - [Troubleshooting](#initd-troubleshooting) | 9 | - [Setting up](#sysvinit-setting-up) |
10 | - [Updating](#sysvinit-updating) | ||
11 | - [Troubleshooting](#sysvinit-troubleshooting) | ||
12 | <br> | ||
13 | - [For `Docker` users](#docker) | ||
14 | - [Setting up](#docker-setting-up) | ||
15 | - [Updating](#docker-updating) | ||
16 | - [Troubleshooting](#docker-troubleshooting) | ||
8 | 17 | ||
9 | 18 | ||
10 | 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. | 19 | These instructions are primarily tested on Debian Linux, Wheezy for SysVinit and Jessie for systemd, but they should work on other POSIX-compliant systems too. |
11 | 20 | ||
12 | 21 | ||
13 | <a name="systemd" /> | 22 | <a name="systemd" /> |
14 | ##For `systemd` users: | 23 | ##For `systemd` users |
24 | |||
25 | <a name="systemd-setting-up" /> | ||
26 | ###Setting up | ||
15 | 27 | ||
16 | For security reasons we run the daemon under its own user. | 28 | For security reasons we run the daemon under its own user. |
17 | 29 | ||
@@ -56,8 +68,31 @@ Get your public key and check that the daemon initialized correctly: | |||
56 | sudo grep "tox-bootstrapd" /var/log/syslog | 68 | sudo grep "tox-bootstrapd" /var/log/syslog |
57 | ``` | 69 | ``` |
58 | 70 | ||
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 | |||
59 | <a name="systemd-troubleshooting" /> | 94 | <a name="systemd-troubleshooting" /> |
60 | ###Troubleshooting: | 95 | ###Troubleshooting |
61 | 96 | ||
62 | - Check daemon's status: | 97 | - Check daemon's status: |
63 | ```sh | 98 | ```sh |
@@ -80,8 +115,11 @@ sudo journalctl -f _SYSTEMD_UNIT=tox-bootstrapd.service | |||
80 | - Make sure tox-bootstrapd location matches its path in tox-bootstrapd.service file. | 115 | - Make sure tox-bootstrapd location matches its path in tox-bootstrapd.service file. |
81 | 116 | ||
82 | 117 | ||
83 | <a name="initd" /> | 118 | <a name="sysvinit" /> |
84 | ##For `init.d` users | 119 | ##For `SysVinit` users |
120 | |||
121 | <a name="sysvinit-setting-up" /> | ||
122 | ###Setting up | ||
85 | 123 | ||
86 | For security reasons we run the daemon under its own user. | 124 | For security reasons we run the daemon under its own user. |
87 | 125 | ||
@@ -126,8 +164,29 @@ Get your public key and check that the daemon initialized correctly: | |||
126 | sudo grep "tox-bootstrapd" /var/log/syslog | 164 | sudo grep "tox-bootstrapd" /var/log/syslog |
127 | ``` | 165 | ``` |
128 | 166 | ||
129 | <a name="initd-troubleshooting" /> | 167 | <a name="sysvinit-updating" /> |
130 | ###Troubleshooting: | 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 | |||
188 | <a name="sysvinit-troubleshooting" /> | ||
189 | ###Troubleshooting | ||
131 | 190 | ||
132 | - Check daemon's status: | 191 | - Check daemon's status: |
133 | ```sh | 192 | ```sh |
@@ -146,3 +205,63 @@ sudo grep "tox-bootstrapd" /var/log/syslog | |||
146 | - Make sure tox-bootstrapd has read permission for the config file. | 205 | - Make sure tox-bootstrapd has read permission for the config file. |
147 | 206 | ||
148 | - Make sure tox-bootstrapd location matches its path in the `/etc/init.d/tox-bootstrapd` init script. | 207 | - Make sure tox-bootstrapd location matches its path in the `/etc/init.d/tox-bootstrapd` init script. |
208 | |||
209 | |||
210 | <a name="docker" /> | ||
211 | ##For `Docker` users: | ||
212 | |||
213 | <a name="docker-setting-up" /> | ||
214 | ###Setting up | ||
215 | |||
216 | If you are familiar with Docker and would rather run the daemon in a Docker container, run the following from this directory: | ||
217 | |||
218 | ```sh | ||
219 | sudo docker build -t tox-bootstrapd docker/ | ||
220 | |||
221 | sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd | ||
222 | sudo chmod 700 /var/lib/tox-bootstrapd | ||
223 | |||
224 | 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 | ||
225 | ``` | ||
226 | |||
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. | ||
228 | |||
229 | You can check logs for your public key or any errors: | ||
230 | ```sh | ||
231 | sudo docker logs tox-bootstrapd | ||
232 | ``` | ||
233 | |||
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: | ||
242 | |||
243 | ```sh | ||
244 | sudo docker stop tox-bootstrapd | ||
245 | sudo docker rm tox-bootstrapd | ||
246 | sudo docker rmi tox-bootstrapd | ||
247 | ``` | ||
248 | |||
249 | Then rebuild and run the image again: | ||
250 | |||
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 | ``` | ||
255 | |||
256 | <a name="docker-troubleshooting" /> | ||
257 | ###Troubleshooting | ||
258 | |||
259 | - Check if the container is running: | ||
260 | ```sh | ||
261 | sudo docker ps -a | ||
262 | ``` | ||
263 | |||
264 | - Check the log for errors: | ||
265 | ```sh | ||
266 | sudo docker logs tox-bootstrapd | ||
267 | ``` | ||