ircDDBGateway “Node” Dashboard
These instructions are meant as a general guide for setup. Familiarity with Linux commands, administration and troubleshooting are recommended.
Tested on Compass Linux http://archive.compasslinux.org/images using a Raspberry Pi. Code changes may be necessary for other distributions,
On Raspbian and Compass the Node.js install is old, newer versions of some included libraries require a more modern Node.js after installing npm, you can install the latest stable with:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
This new version does not replace the current version, but is installed in /usr/local/bin
For non-Raspberry Pi installs, follow the directions here, then use these directions to update the webserver.js
Adding local content to the webpage is simply a matter of editing the index.html file.
Additional html pages can be added to the 'public' folder.
The dashboard will run on the computer where ircDDBGateway is installed. ircddbgateway must have been started on the computer, at least once, before the dashboard will run, as it is dependent on configuration and log files that are part of ircddbgateway in order to startup and run.
A fairly recent version of node.js should be used v0.10.0 or newer should be sufficient. Due to limited availability of v4.0.0 or newer on ARM based computers like the Raspberry Pi, it has not been extensively tested on that platform.
All testing has been on Linux based systems, mostly Raspbian and Ubuntu. It will likely run on Windows1 or MacOS if the paths to configuration and log files are available.
The main node.js installation site is https://nodejs.org/en/download/, with many Linux package manager installations documented at https://github.com/nodejs/node-v0.x-archive/wiki/Installing-Node.js-via-package-manager
Users of Raspbian Jesse or Compass Linux can simply install:
sudo apt-get update
sudo apt-get install nodejs npm
Optional: Once node.js has been successfully installed, and if you are on a system that does not use systemd, install the package forever.
sudo npm install forever
When installing the dashboard, you will probably want to run it from a system directory. I typically create a directory of /var/www-node and perform the following under that directory. I recommend the git install. If you haven't installed git:
sudo apt-get install git
Download using git
sudo mkdir /var/www-node
sudo git clone https://github.com/johnhays/ircNodeDashboard.git
Install needed libraries
sudo npm install
(This will take some time, and there will be 'errors' for optional sub-components, you can ignore these warnings.)
Make sure no other webserver is running on port 80 (e.g. Apache). If you need to run the dashboard on a different port, you can modify webserver.js to change the port number.
Start up a test run in a terminal window (see note below, this command does not execute).
sudo node webserver.js
Open a web browser and see if you see the webpage using either http://localhost or http://the ip address (if you have been successful kill (Control-C) the program)
For a systemd unit setup see https://github.com/johnhays/ircnode-support-files
Some distributions may install node as nodejs, if the node or forever commands fail, you may need to navigate to the directory where nodejs is installed and create a soft link from node. (On Raspbian Jesse and Compass, cd /usr/bin and run this command)
sudo ln -s nodejs node
To enhance security this webserver runs as user opendv. Make sure you have such an account. It is possible to modify this behavior inside the webserver.js application.
1 Windows may be problematic due to configuration being held in the registry, though one could extract the registry data into a ircDDBGateway text configuration file or an industrious developer could modify webserver.js to populate the config object directly from the registry using a library like https://www.npmjs.com/package/winreg - The author is not a fan of Windows for server applications, so he has not undertaken any work in this area.↩