n2n/doc/ConfigurationFiles.md

74 lines
1.7 KiB
Markdown
Raw Normal View History

2021-01-12 20:00:48 +01:00
# Configuration Files
2021-01-12 20:11:50 +01:00
To help deployment and better handle locally different configurations, n2n supports the optional use of configuration files for `edge` and `supernode`.
2021-01-12 20:00:48 +01:00
They are plain text files and contain the desired command line options, **one per line**.
The exemplary command line
```bash
sudo edge -c mynetwork -k mysecretpass -a 192.168.100.1 -f -l supernode.ntop.org:7777
```
translates into the following `edge.conf` file:
```
-c mynetwork
-k mysecretpass
-a 192.168.100.1
-f
-l supernode.ntop.org:7777
2021-01-12 20:11:50 +01:00
-A5
2021-01-12 20:00:48 +01:00
```
which can be loaded by
```
sudo ./edge edge.conf
```
Comment lines starting with a hash '#' are ignored.
```
# automated edge configuration
# created by bot7
# on April 31, 2038 1800Z
-c mynetwork
-k mysecretpass
-a 192.168.100.1
-f
2021-01-12 20:11:50 +01:00
-A5
2021-01-12 20:00:48 +01:00
# --- supernode section ---
-l supernode.ntop.org:7777
```
2021-01-12 20:11:50 +01:00
Long options can be used as well. Please note the double minus/dash-character `--`, just like you would use them on the command line with long options:
2021-01-12 20:00:48 +01:00
```
--community mynetwork
-k mysecretpass
-a 192.168.100.1
-f
2021-01-12 20:11:50 +01:00
-A5
2021-01-12 20:00:48 +01:00
-l supernode.ntop.org:7777
```
If using a configuration file, its filename needs to be supplied as first parameter to `edge` or `supernode`. If required, additional command line parameters can be supplied afterwards:
```
2021-01-12 20:11:50 +01:00
sudo edge edge.conf -z1 -I myComputer
```
Finally, the `.conf` file syntax also allows `=` between parameter and its option:
```
-c=mynetwork
-k=mysecretpass
-a=192.168.100.1
-f
-A5
-l=supernode.ntop.org:7777
```
When used with `=`, there is no whitespace allowed between parameter, delimter (`=`), and option. So, do **not** put `-c = mynetwork` it is required to be `-c=mynetwork`.