# Howto install Yanic ## go ### Install ```sh cd /usr/local/ wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz tar xvf go1.8.linux-amd64.tar.gz rm go1.8.linux-amd64.tar.gz ``` ### Configure go Add these lines in your root shell startup file (i.e. `/root/.bashrc`): ```sh export GOPATH=/opt/go export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin ``` and these in the shell startup file of a normal user: ```sh export GOPATH=~/go export PATH=$PATH:$GOPATH/bin ``` ## Yanic ### Compile As root: ```sh go get -v -u github.com/FreifunkBremen/yanic ``` #### Work with other databases If you like to use another database solution than influxdb, Pull Requests are welcome. Just fork this project and create another subpackage within the folder `database/`. Take this folder as example: `database/logging/`. ### Configure Yanic ```sh cp /opt/go/src/github.com/FreifunkBremen/yanic/config_example.toml /etc/yanic.conf ``` For an easy startup you only need to edit the `interfaces` in section `[respondd]` in file `/etc/yanic.conf`. Then create the following folders: ```sh mkdir -p /var/lib/yanic mkdir -p /var/www/html/meshviewer/data ``` #### Standalone If you like to run a standalone meshviewer, just set `enable` in section `[webserver]` to `true`. ##### Configure the [meshviewer](https://github.com/ffrgb/meshviewer): set `dataPath` in `config.json` to `/data/` and make the `build` directory accessible under `/var/www/html/meshviewer`. #### With webserver (Apache, nginx) The meshviewer needs the output files like `nodes_path` and `graph_path` inside the same directory as the `dataPath`. Change the path in the section `[[nodes.output.meshviewer]]` accordingly. ### Service ```bash 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 ```