Skip to content

Commit fb0e8d5

Browse files
committed
Change domain and update certs
1 parent ecceb88 commit fb0e8d5

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

nodeserver/certs/fetch.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
22

3-
certbot certonly --manual --register-unsafely-without-email --logs-dir . --config-dir . --work-dir . --preferred-challenges dns -d christmasquiz.pro
4-
3+
certbot certonly --manual --register-unsafely-without-email --logs-dir . --config-dir . --work-dir . --preferred-challenges dns -d christmasquiz.win

nodeserver/server.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ var clients = {};
99
var lastView = "buzzer";
1010
var lastGeoImage = "start.jpg";
1111

12-
//Certificates for SSL
13-
const certkey = 'certs/privkey1.pem';
14-
const certchain = 'certs/fullchain1.pem';
15-
1612
//DNS record
17-
const dnshostname = 'iangray.me.uk';
13+
const dnshostname = 'christmasquiz.win';
1814
const hostaddress = '192.168.1.2';
1915

16+
//Certificates for SSL
17+
const certkey = 'certs/archive/' + dnshostname + '/privkey1.pem';
18+
const certchain = 'certs/archive/' + dnshostname + '/fullchain1.pem';
19+
2020
const wclientHttpsServer = https.createServer({
2121
key: fs.readFileSync(certkey, 'utf8'),
2222
cert: fs.readFileSync(certchain, 'utf8')
@@ -190,7 +190,7 @@ wclient.on('connection', function connection(ws, req) {
190190

191191
// Server to redirect HTTP requests to HTTPS
192192
const http = express();
193-
http.get('*', function(req, res) {
193+
http.get('*', function(req, res) {
194194
res.redirect('https://' + req.headers.host + req.url);
195195
});
196196
http.listen(80, "0.0.0.0", function(){
@@ -215,9 +215,9 @@ dnsserver.on('request', function (request, response) {
215215
//console.log("DNS request for " + request.question[0].name)
216216
response.answer.push(
217217
dns.A({
218-
//name: request.question[0].name,
218+
//name: request.question[0].name,
219219
name: dnshostname,
220-
address: hostaddress,
220+
address: hostaddress,
221221
ttl: 10}));
222222
response.send();
223223
});

0 commit comments

Comments
 (0)