John Hays 8 months ago
commit 683abd2d66

@ -8,28 +8,75 @@ pass data over the Internet to the web browser. WSS requires encryption which is
Installing this will require some familiarity with Linux/Unix command line and system.
You will need to have a domain name for the site and current certificates tied to that domain. The index.js file, which defines the HTTPS server, is looking for
**key.pem** and **cert.pem**
in the same directory as index.js. I suggest using (Certbot)[https://certbot.eff.org/] to obtain free signed certificates that all major browsers recognize
as legitimate. I typically run Apache2 or another webserver to allow Certbot to authenticate the site to create the certificates. The certificates will
typically reside in /etc/live/**your domain name** and I simply soft link (ln -s) them from the dsgwdashboard directory. You can disable the webserver,
such as Apache2 or NGNIX once you have the certificates.
**key.pem** and **cert.pem** in the same directory as index.js.
I suggest using [Certbot](https://certbot.eff.org/) to obtain free signed certificates that all major browsers recognize
as legitimate. Use the --standalone flag or run Apache with plugin. The certificates will
typically reside in /etc/letsencrypt/live/**your domain name**/ (replace **your domain name** with your actual domain name)
and simply soft link (ln -s) them from the dsgwdashboard directory:
```
ln -s /etc/letsencrypt/live/**your domain name**/cert.pem cert.pen
ln -s /etc/letsencrypt/live/**your domain name**/privkey.pem key.pen
```
<<<<<<< HEAD
**Edit util/dashboard.ini and copy to /usr/local/etc/dashboard.ini**
Before starting up the dsgwdashboard you will want to have DStarGateway running, to prepopulate the log files. Your first task
will be to edit dashboard.ini to put in your hostname and to ensure file paths match your install of DStarGateway. The dashboard parses those log files
in realtime to update the dashboard.
=======
Before starting up the dsgwdashboard you will want to have DStarGateway running, to **prepopulate** the log files. Alternatively, if your gateway isn't
ready:
```
sudo touch /var/log/dstargateway/Headers.log
sudo touch /var/log/dstargateway/Links.log
sudo chown dstar:dstar /var/log/dsgateway/Headers.log
sudo chown dstar:dstar /var/log/dsgateway/Links.log
```
>>>>>>> f6a46a59847e9c923b6ab03fb8af2352d5ddac7d
This dashboard runs under a current version of NodeJS. Your distribution may install an older version, so use the methods documented at (nodesource)[https://github.com/nodesource/distributions]. Make sure **node -v** returns the version you installed.
Your first task will be to edit [util/dashboard.ini](util/dashboard.ini) to put in your hostname and to ensure file paths match your install of DStarGateway. The dashboard parses those log files in realtime to update the dashboard. Then copy the file to /usr/local/etc
```
sudo cp util/dashboard.ini /usr/local/etc
```
Your next task is to install the modules used with the command **npm install -save** within the dsgwdashboard directory.
This dashboard runs under a current version of NodeJS. Your distribution may install an older version, so use the methods documented at (nodesource)[https://github.com/nodesource/distributions]. Make sure
```
node -v
```
returns the version you installed.
Your next task is to install the modules used with the command
```
npm install -save
```
within the dsgwdashboard directory.
You can start the dsgwdashboard server on the command line by entering the install directory for dsgwdashboard and typing
**sudo node index.js** It should also run under the newer/faster [Bun Runtime](https://bun.sh/)
```
sudo node index.js
```
Kill this with **^C** before running it as service.
It should also run under the newer/faster [Bun Runtime](https://bun.sh/)
If it comes up successfully, go to a browser put in a HTTPS request to your domain name. If you get a dashboard, you have done everything correctly.
I have included a systemd service file in the util subdirectory which can be copied to /lib/systemd/system and managed with the **sudo systemctl** command.
I have included a systemd service file in the util subdirectory which can be copied to /lib/systemd/system
```
sudo cp util/dsgwdashboard.service /lib/systemd/system
```
and managed with the **systemctl** commands:
```
sudo systemctl status dsgwdashboard
sudo systemctl enable dsgwdashboard
sudo systemctl start dsgwdashboard
```
This program is still under development, but you are welcome to try it out. Consider it alpha code.
This program is still under development, but you are welcome to try it out. Consider it alpha code and refresh it periodically by going into the dsgwdashboard directory and
```
git status
git pull
sudo systemctl restart dsgwdashboard
```

Loading…
Cancel
Save