Compare commits

...

6 Commits

Author SHA1 Message Date
John Hays aae8d44b94 Made http redirect configurable in dashboard.ini
7 months ago
John Hays cccf2be043 Punctuation
7 months ago
John Hays aaa65a7a80 Fixed titles
7 months ago
John Hays 668735608f dstar UFW rules
7 months ago
John Hays e3e9beb40a Documented UFW rules
7 months ago
John Hays 511ce019cd Added http to https redirection
7 months ago

@ -52,6 +52,8 @@ It should also run under the newer/faster [Bun Runtime](https://bun.sh/)
If it comes up successfully, go to a browser and put in a HTTPS request to your domain name. If you get a dashboard, you have done everything correctly. If it comes up successfully, go to a browser and put in a HTTPS request to your domain name. If you get a dashboard, you have done everything correctly.
The install will redirect http to https, if you don't want the redirect, see the end of [index.js](index.js)
I have included a systemd service file in the util subdirectory which can be copied to /lib/systemd/system 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 sudo cp util/dsgwdashboard.service /lib/systemd/system

@ -12,6 +12,8 @@ const inifile = ini.parse(fs.readFileSync('/usr/local/etc/dashboard.ini', 'utf-8
const host = inifile.config.host; const host = inifile.config.host;
const port = inifile.config.port; const port = inifile.config.port;
const links = inifile.logs.links; const links = inifile.logs.links;
const redirecthttp = inifile.config.redirecthttp;
const httpport = inifile.config.httpport;
const linkqueue = parseInt(inifile.params.linkqueue); const linkqueue = parseInt(inifile.params.linkqueue);
const heardqueue = parseInt(inifile.params.heardqueue); const heardqueue = parseInt(inifile.params.heardqueue);
const headers = inifile.logs.headers; const headers = inifile.logs.headers;
@ -135,3 +137,14 @@ const tailheaders = new Tail(headers, {startPos : 'end'}, line => {
}); });
tailheaders.start(); tailheaders.start();
// See dashboard.ini in /usr/local/etc
if (redirecthttp){
var http = require("http");
http
.createServer(function (req, res) {
res.writeHead(301, { Location: "https:"+host });
res.end();
})
.listen(httpport);
}

6
package-lock.json generated

@ -13,6 +13,7 @@
"configparser": "^0.3.10", "configparser": "^0.3.10",
"express": "^4.18.2", "express": "^4.18.2",
"express-ws": "^5.0.2", "express-ws": "^5.0.2",
"http": "^0.0.1-security",
"ini": "^4.1.1", "ini": "^4.1.1",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"line-reader": "^0.4.0", "line-reader": "^0.4.0",
@ -479,6 +480,11 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/http": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz",
"integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g=="
},
"node_modules/http-errors": { "node_modules/http-errors": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",

@ -4,6 +4,7 @@
"configparser": "^0.3.10", "configparser": "^0.3.10",
"express": "^4.18.2", "express": "^4.18.2",
"express-ws": "^5.0.2", "express-ws": "^5.0.2",
"http": "^0.0.1-security",
"ini": "^4.1.1", "ini": "^4.1.1",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"line-reader": "^0.4.0", "line-reader": "^0.4.0",

@ -1,4 +1,4 @@
# Configuration and Management
I have localized all of the configuration files in **/usr/local/etc**: I have localized all of the configuration files in **/usr/local/etc**:
@ -38,3 +38,14 @@ To view the systemctl manual - type<br/>
**man systemctl** **man systemctl**
Also spend some time with [DStarGateway README](https://github.com/F4FXL/DStarGateway/blob/develop/README.md) (and the README.md in each subdirectory) Also spend some time with [DStarGateway README](https://github.com/F4FXL/DStarGateway/blob/develop/README.md) (and the README.md in each subdirectory)
# Firewall
If using [ufw](https://wiki.ubuntu.com/UncomplicatedFirewall), [dstar](dstar) rules are aavailable.
```
cd util
sudo cp dstar /etc/ufw/applications.d
sudo ufw reload
sudo ufw status verbose
```

@ -5,6 +5,8 @@ links=/var/log/dstargateway/Links.log
dgwconfig=/usr/local/etc/dstargateway.cfg dgwconfig=/usr/local/etc/dstargateway.cfg
host= #enter your domain name here (this should also have a cert for https) host= #enter your domain name here (this should also have a cert for https)
port=443 port=443
redirecthttp=true #switch to false if using http
httpport=80
[urls] [urls]
sponsorname= #sponsor name sponsorname= #sponsor name
cosponsorname= #cosponsor name cosponsorname= #cosponsor name

@ -0,0 +1,4 @@
[dstar]
title=D-STAR
description=Ports for D-STAR
ports=20005,40001/tcp|12345,12346,20010,20001:20009,30001,30051:30059,30061:30065,40000,53001/udp
Loading…
Cancel
Save