Skip to content

Commit 68431d9

Browse files
author
nicola
committed
fix #48, now only have --key and --cert and --no-webid
1 parent 1372ff9 commit 68431d9

4 files changed

Lines changed: 13 additions & 29 deletions

File tree

‎bin/ldnode.js‎

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,13 @@ var argv = require('nomnom')
3737
abbr: 'c',
3838
help: 'Set cache time (in seconds), 0 for no cache'
3939
})
40-
.option('noSsl', {
41-
help: 'Disable SSL, hence run on http',
42-
full: 'no-ssl',
43-
flag: true
44-
})
45-
.option('sslKey', {
40+
.option('key', {
4641
help: 'Path to the ssl key',
4742
abbr: 'K',
48-
full: 'ssl-key'
43+
full: 'key'
4944
})
50-
.option('sslCert', {
51-
full: 'ssl-cert',
45+
.option('cert', {
46+
full: 'cert',
5247
help: 'Path to the ssl cert',
5348
abbr: 'C'
5449
})
@@ -57,16 +52,6 @@ var argv = require('nomnom')
5752
full: 'no-webid',
5853
flag: true
5954
})
60-
.option('webidKey', {
61-
help: 'Path to the webid key',
62-
full: 'webid-key',
63-
abbr: 'k'
64-
})
65-
.option('webidCert', {
66-
help: 'Path to the webid cert',
67-
full: 'webid-cert',
68-
abbr: 'c',
69-
})
7055
.option('secret', {
7156
help: 'HTTP Session secret key (e.g. "your secret phrase")',
7257
abbr: 's'

‎index.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@ function createServer(argv) {
7373
var app = ldnode(argv);
7474
var opts = app.locals.ldp;
7575

76-
if (opts && (opts.webid || opts.ssl )) {
77-
var ssl = opts.webid || opts.ssl;
76+
if (opts && (opts.webid || opts.key || opts.cert) ) {
7877
var credentials = {
79-
key: fs.readFileSync(ssl.key),
80-
cert: fs.readFileSync(ssl.cert),
78+
key: fs.readFileSync(opts.key),
79+
cert: fs.readFileSync(opts.cert),
8180
requestCert: true
8281
};
8382
debug("Private Key: " + credentials.key);

‎options.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ function params(argv) {
1717
opts.path = opts.fileBase = argv.fileBase || process.cwd();
1818
opts.port = argv.port;
1919
opts.secret = argv.secret;
20-
opts.ssl = argv.ssl;
20+
opts.cert = argv.cert;
21+
opts.key = argv.key;
2122
// TODO no need of uriBase
2223
opts.uri = opts.uriBase = argv.uriBase;
2324
opts.verbose = argv.verbose;
24-
opts.webid = argv.webid;
25+
opts.webid = argv.webid === undefined ? true : argv.webid;
2526

2627
// Processed
2728
opts.leavePatchConnectionOpen = false;
@@ -56,6 +57,7 @@ function params(argv) {
5657
debug("pathStart: " + opts.pathStart);
5758
debug("URI path filter regexp: " + opts.pathFilter);
5859
debug("Verbose: " + !!opts.verbose);
60+
debug("WebID: " + !!opts.webid);
5961
debug("Live: " + !!opts.live);
6062

6163
return opts

‎test/secure-test.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ describe('ACL', function() {
1717
var ldp = ldnode.createServer({
1818
uriBase: address,
1919
fileBase: __dirname,
20-
webid: {
21-
key: __dirname + '/key.pem',
22-
cert: __dirname + '/cert.pem'
23-
}
20+
key: __dirname + '/key.pem',
21+
cert: __dirname + '/cert.pem'
2422
});
2523
ldp.listen(3456);
2624

0 commit comments

Comments
 (0)