From bf2a026b89897880d023a15f5dee3ec0d2e4d1da Mon Sep 17 00:00:00 2001 From: Ruben Barkow Date: Thu, 2 Nov 2017 21:43:33 +0100 Subject: [PATCH] [DOC] fix userrights instructions and add update to INSTALL.md (#88) --- INSTALL.md | 19 ++++++++++++++++--- config_example.toml | 4 ++-- runtime/config_test.go | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index b071db2..d877bb3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,7 +10,7 @@ rm go1.8.linux-amd64.tar.gz ``` ### Configure go -Add these lines in your root shell startup file (i.e. `/root/.bashrc`): +Add these lines in your root shell startup file (e.g. `/root/.bashrc`): ```sh export GOPATH=/opt/go export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin @@ -42,10 +42,12 @@ cp /opt/go/src/github.com/FreifunkBremen/yanic/config_example.toml /etc/yanic.co For an easy startup you only need to edit the `interfaces` in section `[respondd]` in file `/etc/yanic.conf`. -Then create the following folders: +Then create the following files and folders: ```sh mkdir -p /var/lib/yanic mkdir -p /var/www/html/meshviewer/data +touch /var/log/yanic.log +chown yanic /var/log/yanic.log /var/lib/yanic /var/www/html/meshviewer/data ``` #### Standalone @@ -62,9 +64,20 @@ the same directory as the `dataPath`. Change the path in the section `[[nodes.output.meshviewer]]` accordingly. ### Service -```bash +```sh cp /opt/go/src/github.com/FreifunkBremen/yanic/contrib/init/linux-systemd/yanic.service /lib/systemd/system/ systemctl daemon-reload systemctl start yanic systemctl enable yanic ``` + +### Update +For an update just stop yanic and then call the same `go` command again (again as root): +```sh +systemctl stop yanic +go get -v -u github.com/FreifunkBremen/yanic +``` +Then update the config file, for example look at the diff with the new example: +```sh +diff /opt/go/src/github.com/FreifunkBremen/yanic/config_example.toml /etc/yanic.conf +``` diff --git a/config_example.toml b/config_example.toml index 60027df..53aed31 100644 --- a/config_example.toml +++ b/config_example.toml @@ -5,8 +5,8 @@ enable = true synchronize = "1m" # how often request per multicast collect_interval = "1m" -# on which interface -interfaces = ["eth0"] +# interface that has an IP in your mesh network +interfaces = ["br-ffhb"] # define a port to listen # if not set or set to 0 the kernel will use a random free port at its own #port = 10001 diff --git a/runtime/config_test.go b/runtime/config_test.go index c5ae9d7..434e175 100644 --- a/runtime/config_test.go +++ b/runtime/config_test.go @@ -15,7 +15,7 @@ func TestReadConfig(t *testing.T) { assert.NotNil(config) assert.True(config.Respondd.Enable) - assert.Equal([]string{"eth0"}, config.Respondd.Interfaces) + assert.Equal([]string{"br-ffhb"}, config.Respondd.Interfaces) assert.Equal(time.Minute, config.Respondd.CollectInterval.Duration) assert.Equal(time.Hour*24*7, config.Nodes.PruneAfter.Duration)