fixed both docs and added iptables commands in magneticod docs

This commit is contained in:
Bora M. Alper 2017-07-05 15:25:15 +03:00
parent bd1154be2f
commit 9d62575cf5
3 changed files with 21 additions and 13 deletions

View File

@ -31,15 +31,15 @@ Instructions
pip3 install magneticod --user pip3 install magneticod --user
2. Add installation path to the ``$PATH``; append the following line to your ``~/.profile`` :: 2. Add installation path to the ``$PATH``; append the following line to your ``~/.profile`` if you are using bash ::
export PATH=$PATH:~/.local/bin export PATH=$PATH:~/.local/bin
**or if you are on macOS**, (assuming that you are using Python 3.5): :: **or if you are on macOS** and using bash, (assuming that you are using Python 3.5): ::
export PATH="${PATH}:${HOME}/Library/Python/3.5/bin/" export PATH="${PATH}:${HOME}/Library/Python/3.5/bin/"
3. Activate the changes to ``$PATH``: :: 3. Activate the changes to ``$PATH`` (again, if you are using bash): ::
source ~/.profile source ~/.profile
@ -55,16 +55,18 @@ Instructions
Download the magneticod systemd service file (at Download the magneticod systemd service file (at
`magneticod/systemd/magneticod.service <systemd/magneticod.service>`_) and change the tilde symbol with `magneticod/systemd/magneticod.service <systemd/magneticod.service>`_) and change the tilde symbol with
the path of your home directory. For example, if my username is ``bora``, this line :: the path of your home directory, and the ``PORT_NUMBER`` with the preferred port number. For example, if my username
is ``bora`` and I prefer the port 64879, this line ::
ExecStart=~/.local/bin/magneticod ExecStart=~/.local/bin/magneticod magneticod --node-addr 0.0.0.0:PORT_NUMBER
should become this: :: should become this: ::
ExecStart=/home/bora/.local/bin/magneticod ExecStart=/home/bora/.local/bin/magneticod --node-addr 0.0.0.0:64879
Here, tilde (``~``) is replaced with ``/home/bora``. Run ``echo ~`` to see the path of your own home directory, if Here, tilde (``~``) is replaced with ``/home/bora`` and the ``PORT_NUMBER`` with 64879. Run ``echo ~`` to see the
you do not already know. path of your own home directory, if you do not already know. Port numbers above 1000 typically do not require
special permissions.
6. Copy the magneticod systemd service file to your local systemd configuration directory: :: 6. Copy the magneticod systemd service file to your local systemd configuration directory: ::
@ -72,7 +74,13 @@ Instructions
You might need to create intermediate directories (``.config``, ``systemd``, and ``user``) if not exists. You might need to create intermediate directories (``.config``, ``systemd``, and ``user``) if not exists.
7. Start **magneticod**: :: 7. (Optional, **requires root**) Disable iptables on a specified port for UDP protocol to prevent excessive number of
`EPERM` (errno 1, "Operation not permitted") errors, which also affect the performance: ::
iptables -I OUTPUT -t raw -p udp --sport PORT_NUMBER -j NOTRACK
iptables -I PREROUTING -t raw -p udp --dport PORT_NUMBER -j NOTRACK
8. Start **magneticod**: ::
systemctl --user enable magneticod --now systemctl --user enable magneticod --now

View File

@ -2,7 +2,7 @@
Description=magneticod: autonomous BitTorrent DHT crawler and metadata fetcher Description=magneticod: autonomous BitTorrent DHT crawler and metadata fetcher
[Service] [Service]
ExecStart=~/.local/bin/magneticod ExecStart=~/.local/bin/magneticod --node-addr 0.0.0.0:PORT_NUMBER
Restart=always Restart=always
RestartSec=5 RestartSec=5

View File

@ -38,8 +38,8 @@ Instructions
pip3 install magneticow --user pip3 install magneticow --user
2. Add installation path to the ``$PATH``; append the following line to your ``~/.profile`` *(you can skip to step 4 if 2. Add installation path to the ``$PATH``; append the following line to your ``~/.profile`` if you are using bash
you installed magneticod first as advised)* :: *(you can skip to step 4 if you installed magneticod first as advised)* ::
export PATH=$PATH:~/.local/bin export PATH=$PATH:~/.local/bin
@ -47,7 +47,7 @@ Instructions
export PATH="${PATH}:${HOME}/Library/Python/3.5/bin/" export PATH="${PATH}:${HOME}/Library/Python/3.5/bin/"
3. Activate the changes to ``$PATH``: :: 3. Activate the changes to ``$PATH`` (again, if you are using bash): ::
source ~/.profile source ~/.profile