Skip to content

Commit

Permalink
moved to HTTPS only (self-signed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Tollenaar committed Jul 31, 2014
1 parent 959f3dc commit 9afb0e1
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 36 deletions.
16 changes: 16 additions & 0 deletions lib/certificates/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE-----
MIICizCCAfQCCQCjLlATYnx8gTANBgkqhkiG9w0BAQUFADCBiTELMAkGA1UEBhMC
TkwxFjAUBgNVBAgTDU5vb3JkIEhvbGxhbmQxEjAQBgNVBAcTCUFtc3RlcmRhbTER
MA8GA1UEChMIU2lnbmFsIEsxEjAQBgNVBAMTCWxvY2FsaG9zdDEnMCUGCSqGSIb3
DQEJARYYZmFiaWFuQHN0YXJ0aW5nLXBvaW50Lm5sMB4XDTE0MDczMTE0MjEwOVoX
DTM0MDQxNzE0MjEwOVowgYkxCzAJBgNVBAYTAk5MMRYwFAYDVQQIEw1Ob29yZCBI
b2xsYW5kMRIwEAYDVQQHEwlBbXN0ZXJkYW0xETAPBgNVBAoTCFNpZ25hbCBLMRIw
EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGZhYmlhbkBzdGFydGlu
Zy1wb2ludC5ubDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA8S8LsGlP4tAW
ZVxW2AArnodRFacDHHkFTBuwPNaGTDX9u2c2PVNcO5rJjTxN5N3bR2pVB8Pr/TI0
neKLGBOLcdRMp39m6A973vs46dfB0U4+9ABGCBpPb0QY1ymNHoIBzQYze0vZbBcA
NCUINU+0uzpmKslgF+09XXjSgMvkpmcCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBb
BP9LwqIJ4uE9ydTxFxvm+N/agXFKpZyUU7PhJOQK1tTf6yM52D6i/WC2/1CbFfNG
yfgjVQivWHnW8L9F0Ooc02fht0bocS3OVNfWLP9BZHG380gQLtHnfgyR0h7MI3yC
Ax4LMXiWQxOCV25G7si6sVtMmEbh7tbfkGIF3quL2A==
-----END CERTIFICATE-----
12 changes: 12 additions & 0 deletions lib/certificates/server.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIByjCCATMCAQAwgYkxCzAJBgNVBAYTAk5MMRYwFAYDVQQIEw1Ob29yZCBIb2xs
YW5kMRIwEAYDVQQHEwlBbXN0ZXJkYW0xETAPBgNVBAoTCFNpZ25hbCBLMRIwEAYD
VQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGZhYmlhbkBzdGFydGluZy1w
b2ludC5ubDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA8S8LsGlP4tAWZVxW
2AArnodRFacDHHkFTBuwPNaGTDX9u2c2PVNcO5rJjTxN5N3bR2pVB8Pr/TI0neKL
GBOLcdRMp39m6A973vs46dfB0U4+9ABGCBpPb0QY1ymNHoIBzQYze0vZbBcANCUI
NU+0uzpmKslgF+09XXjSgMvkpmcCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBAJ98
fM1b5f68rBNNN7nNs9eiAgw5lKg+XUDABIwCzRuBTR/T9vweSe2kiRFEmBtrK3Su
aX3/RhS5V+6KuktX58HQ0PJoKtPYELBv5d+yDaF5GfwbAQFvIz3fxJN2x8M0UfgV
6BODWnKhpy3meNDks7le+1vo4JakDcbIOIl11mjg
-----END CERTIFICATE REQUEST-----
15 changes: 15 additions & 0 deletions lib/certificates/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDxLwuwaU/i0BZlXFbYACueh1EVpwMceQVMG7A81oZMNf27ZzY9
U1w7msmNPE3k3dtHalUHw+v9MjSd4osYE4tx1Eynf2boD3ve+zjp18HRTj70AEYI
Gk9vRBjXKY0eggHNBjN7S9lsFwA0JQg1T7S7OmYqyWAX7T1deNKAy+SmZwIDAQAB
AoGBAJte7k3QGgmIedUEXmG6Al+W1pJ3S9bM06/K6obWwB9abMGMZPGuwO0Y8xyM
K7Xzgi6IfoyJF36+GA1aArcY6CvFJ2iSXVHDr/VHxZ+68aA5vXbfE3uaHaM0TymJ
JYRHOFzPhTJ+uD+XlLhlImnBTkDLBqjOnJvcev776c7NLAkRAkEA+21Jzj2JCKbd
0XBHttcuzMt/Unvqts7aC5aamWkwT6KDfzq0dlZY4j7MgD0/0AUoZfML2Oy5AB39
Nf+pOWCnjwJBAPWSEAMqqwQUsm9PTaQFoQYf+WVn6poroS9A4LQRJhrdoO3RGjJ7
IsdLCX0bigK7lcHFX/hOfS7lQN7Gbnvc56kCQAToIhubSdRYZVXUCiJAWtJ2WjrC
3lbI/KpjOwspaV70ffp6q9DvaHap4RXTnC40G5C5yI5oOEgPTcTDA4tyHnMCQQCs
GiOStJKKF58+F0wIidFiI4J7qSpnxe/+1+8jA2m7Jlwkj4lWm6myFkqeHXDJnYHE
/XjW4tskxJKEDnlb4WORAkEA5AGnsOn8ARAT+2sG0mNDInJuABmfXVL15Htz4C7n
3zdwGqkehnaI9//C4RpEDUxt69QBdLFY3LvgU8CFqX4y/g==
-----END RSA PRIVATE KEY-----
4 changes: 2 additions & 2 deletions lib/config/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
var app = this.app;
var config = this.app.config;

app.configure('development', function() {
if(app.get('env') == 'development') {

config.environment = 'development';
config.debug = true;
Expand All @@ -41,6 +41,6 @@

app.all('/', require('../controllers/config'));

});
}

}).call(global);
6 changes: 2 additions & 4 deletions lib/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@
config.vesion = -1;
}

app.configure(function() {
config.port = env.PORT || 3000;
app.use(express.logger());
});
config.port = env.PORT || 3000;
app.use(express.logger());

require('./development');
require('./production');
Expand Down
4 changes: 2 additions & 2 deletions lib/config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
var app = this.app;
var config = this.app.config;

app.configure('production', function() {
if(app.get('env') == 'production') {

config.environment = 'production';
config.debug = false;
Expand All @@ -38,6 +38,6 @@

app.all('/', require('../controllers/wifi'));

});
}

}).call(global);
4 changes: 2 additions & 2 deletions lib/config/staging.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
var app = this.app;
var config = this.app.config;

app.configure('staging', function() {
if(app.get('env') === 'staging') {
config.environment = 'staging';
});
}

}).call(global);
37 changes: 11 additions & 26 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@

(function() {

var express = require('express')
, memwatch = require('memwatch')
, colors = require('colors')
, EJSON = require('ejson')
, Multiplexer = require('./lib/Multiplexer')

, app = this.app = express()
, http = require('http').Server(this.app)
, io = this.app.io = require('socket.io')(http)
var express = require('express')
, memwatch = require('memwatch')
, colors = require('colors')
, Multiplexer = require('./lib/Multiplexer')
, fs = require('fs')
, options = { key: fs.readFileSync(__dirname + '/certificates/server.key'), cert: fs.readFileSync(__dirname + '/certificates/server.crt') }

, app = this.app = express()
, https = require('https').createServer(options, app)
, io = this.app.io = require('socket.io')(https)
;

// config
Expand All @@ -40,7 +41,7 @@
module.exports = this.app;

// start server
http.listen(app.config.port, function() {
https.listen(app.config.port, function() {
// Require bonjour/zeroconf helper
require('./lib/bonjour');

Expand Down Expand Up @@ -73,20 +74,4 @@
});
});

if(app.debug === true) {
memwatch.on('leak', function(info) {
console.log("\n" + JSON.stringify(info, null, 4).red);
});

var last_trend = 0;

memwatch.on('stats', function(info) {
last_trend = info.usage_trend;

if(typeof last_trend === 'number' && last_trend > 0) {
app.log("Memory usage is increasing...".yellow, ("" + last_trend).blue);
}
});
}

}).call(global);
26 changes: 26 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 error [email protected] start: `node ./index`
9 error Exit status 8
10 error Failed at the [email protected] start script.
10 error This is most likely a problem with the saildata-server package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node ./index
10 error You can get their info via:
10 error npm owner ls saildata-server
10 error There is likely additional logging output above.
11 error System Darwin 14.0.0
12 error command "node" "/usr/local/bin/npm" "start"
13 error cwd /Users/Fabian/Dropbox/Sites/SignalK/saildata-server
14 error node -v v0.10.26
15 error npm -v 1.4.3
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]

2 comments on commit 9afb0e1

@tkurki
Copy link
Member

@tkurki tkurki commented on 9afb0e1 Jul 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Npm log in the repo?

@fabdrol
Copy link
Member

@fabdrol fabdrol commented on 9afb0e1 Jul 31, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.