Fix for outdate rehash code. Config change: flip secure semantics.
authorJack Allnutt <m2ys4u@Gmail.com>
Fri, 25 Nov 2011 03:11:55 +0000 (03:11 +0000)
committerJack Allnutt <m2ys4u@Gmail.com>
Fri, 25 Nov 2011 03:11:55 +0000 (03:11 +0000)
Rehash code now looks for changes to the 'server' param rather than ports/ssl certs etc to reflect OLD changes in the configuration file format.

The configuration file now uses the term "insecure" rather than "secure" to encourage people running KiwiIRC to run secure a secure service.

server/app.js
server/config.json

index 485879c488fee35aecba41754fc8172bcb595de2..36d221325d80d6bc866525caceadd8957d5bdea9 100644 (file)
@@ -753,7 +753,7 @@ this.websocketListen = function (servers, handler) {
 
     _.each(servers, function (server) {
         var hs, opts;
-        if (server.secure === true) {
+        if (server.insecure !== true) {
             // Start some SSL server up
             opts = {
                 key: fs.readFileSync(__dirname + '/' + server.ssl_key),
@@ -1137,10 +1137,7 @@ this.rehash = function () {
         kiwi.log('%s config changes: \n', Object.keys(changes).length, changes);
         for (i in changes) {
             switch (i) {
-            case 'ports':
-            case 'bind_address':
-            case 'ssl_key':
-            case 'ssl_cert':
+            case 'servers':
                 kiwi.websocketListen(kiwi.config.servers, kiwi.httpHandler);
                 delete changes.ports;
                 delete changes.bind_address;
index 75a38becb2f273dd1af6a28fe8c82be69bd9be55..c069c7f13ec1d8c6a0e974490e567bc51ac06b7b 100644 (file)
@@ -1,7 +1,7 @@
 {
     "servers":            [
                             {
-                                "secure":   true,
+                                "insecure":   false,
                                 "port":   7777,
                                 "address": "0.0.0.0",
 
@@ -9,7 +9,7 @@
                                 "ssl_cert": "cert.pem"
                             },
                             {
-                                "secure":   false,
+                                "insecure":   true,
                                 "port":   7778,
                                 "address": "0.0.0.0"
                             }