Skip to content

Commit 58d9c95

Browse files
author
Nicola Greco
committed
Merge pull request #181 from linkeddata/dz_rename_skin
Rename 'skin' to 'defaultApp', document /etc/hosts entries
2 parents 66ff630 + c7a3cd3 commit 58d9c95

4 files changed

Lines changed: 50 additions & 35 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,26 @@ The command line tool has the following options
2929
Usage: ldnode [options]
3030
3131
Options:
32-
-v, --verbose Print the logs to console
33-
--version Print current ldnode version
34-
-m, --mount Where to mount Linked Data Platform (default: '/')
35-
-r, --root Root location on the filesystem to serve resources
36-
-p, --port Port to use
37-
-K, --key Path to the ssl key
38-
-C, --cert Path to the ssl cert
39-
--webid Enable WebID+TLS authentication
40-
-idp, --identity-provider Allow registration of WebIDs
41-
-s, --secret HTTP Session secret key (e.g. "your secret phrase")
42-
-fU, --force-user Force a WebID to always be logged in (usefull when offline)
43-
-P, --proxy Use a proxy on example.tld/proxyPath
44-
--no-live Disable live support through WebSockets
45-
-sA, --suffix-acl Suffix for acl files (default: '.acl')
46-
-sM, --suffix-meta Suffix for metadata files (default: '.meta')
47-
-sE, --suffix-sse Suffix for SSE files (default: '.events')
48-
--no-error-pages Disable custom error pages (use Node.js default pages instead)
49-
--error-pages Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)
50-
--skin URI to a skin to load (default: https://linkeddata.github.io/warp/#/list/)
51-
32+
-v, --verbose Print the logs to console
33+
--version Print current ldnode version
34+
-m, --mount Relative URL from which to serve the Linked Data Platform (default: '/')
35+
-r, --root Root location on the filesystem to serve resources
36+
-p, --port Port to use
37+
-c, --cache Set cache time (in seconds), 0 for no cache
38+
-K, --key Path to the ssl key file
39+
-C, --cert Path to the ssl cert file
40+
--webid Enable WebID+TLS authentication
41+
-idp, --identity-provider Allow registration of WebIDs
42+
-s, --secret HTTP Session cookie secret key (e.g. "your secret phrase")
43+
-fU, --force-user Force a WebID to always be logged in (useful when offline)
44+
-P, --proxy Use a proxy on example.tld/proxyPath
45+
--no-live Disable live support through WebSockets
46+
-sA, --suffix-acl Suffix for acl files (default: '.acl')
47+
-sM, --suffix-meta Suffix for metadata files (default: '.meta')
48+
-sE, --suffix-sse Suffix for SSE files (default: '.events')
49+
--no-error-pages Disable custom error pages (use Node.js default pages instead)
50+
--error-pages Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)
51+
--default-app URI to use as a default app for resources (default: https://linkeddata.github.io/warp/#/list/)
5252
```
5353

5454
### Running the server
@@ -129,14 +129,28 @@ accidentally commit your certificates to `ldnode` while you're developing.
129129
If you started your `ldnode` server locally on port 8443 as in the example
130130
above, you would then be able to visit `https://localhost:8443` in the browser
131131
(ignoring the Untrusted Connection browser warnings as usual), where your
132-
`ldnode` server would redirect you to the default viewer app (see the `--skin`
133-
server config parameter), which is usually the
132+
`ldnode` server would redirect you to the default viewer app (see the
133+
`--default-app` server config parameter), which is usually the
134134
[github.io/warp](https://linkeddata.github.io/warp/#/list/) file browser.
135135

136136
Accessing most Solid apps (such as Warp) will prompt you to select your browser
137137
side certificate which contains a WebID from a Solid storage provider (see
138138
the [pre-requisites](#pre-requisites) discussion above).
139139

140+
#### Editing your local `/etc/hosts`
141+
142+
To test certificates and account creation on subdomains, `ldnode`'s test suite
143+
uses the following localhost domains: `nic.localhost`, `tim.localhost`, and
144+
`nicola.localhost`. You will need to create host file entries for these, in
145+
order for the tests to pass.
146+
147+
Edit your `/etc/hosts` file, and append:
148+
149+
```
150+
# Used for unit testing ldnode
151+
127.0.0.1 nic.localhost, tim.localhost, nicola.localhost
152+
```
153+
140154
#### Running the Unit Tests
141155

142156
```bash

‎bin/ldnode.js‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var argv = require('nomnom')
2020
})
2121
.option('mount', {
2222
abbr: 'm',
23-
help: 'Where to mount Linked Data Platform (default: \'/\')'
23+
help: 'Relative URL from which to serve the Linked Data Platform (default: \'/\')'
2424
})
2525
.option('root', {
2626
abbr: 'r',
@@ -35,13 +35,13 @@ var argv = require('nomnom')
3535
help: 'Set cache time (in seconds), 0 for no cache'
3636
})
3737
.option('key', {
38-
help: 'Path to the ssl key',
38+
help: 'Path to the ssl key file',
3939
abbr: 'K',
4040
full: 'key'
4141
})
4242
.option('cert', {
4343
full: 'cert',
44-
help: 'Path to the ssl cert',
44+
help: 'Path to the ssl cert file',
4545
abbr: 'C'
4646
})
4747
.option('webid', {
@@ -56,11 +56,11 @@ var argv = require('nomnom')
5656
flag: true
5757
})
5858
.option('secret', {
59-
help: 'HTTP Session secret key (e.g. "your secret phrase")',
59+
help: 'HTTP Session cookie secret key (e.g. "your secret phrase")',
6060
abbr: 's'
6161
})
6262
.option('forceUser', {
63-
help: 'Force a WebID to always be logged in (usefull when offline)',
63+
help: 'Force a WebID to always be logged in (useful when offline)',
6464
abbr: 'fU',
6565
full: 'force-user'
6666
})
@@ -98,8 +98,9 @@ var argv = require('nomnom')
9898
full: 'error-pages',
9999
help: 'Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)'
100100
})
101-
.option('skin', {
102-
help: 'URI to a skin to load (default: https://linkeddata.github.io/warp/#/list/)'
101+
.option('defaultApp', {
102+
full: 'default-app',
103+
help: 'URI to use as a default app for resources (default: https://linkeddata.github.io/warp/#/list/)'
103104
})
104105
.parse();
105106

‎lib/handlers/get.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ function get (req, res, next) {
7272
return res.send(200)
7373
}
7474

75-
// Handle skin
75+
// Handle defaultApp
7676
if (container &&
7777
requestedType.indexOf('text/html') === 0 &&
78-
ldp.skin) {
78+
ldp.defaultApp) {
7979
var address = req.protocol + '/' + req.get('host') + req.originalUrl;
80-
return res.redirect(303, ldp.skin + address);
80+
return res.redirect(303, ldp.defaultApp + address);
8181
}
8282

8383
// If request accepts the content-type we found

‎lib/ldp.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ function LDP(argv) {
5353
}
5454
}
5555
ldp.errorHandler = argv.errorHandler;
56-
// argv.skin is false when --no-skin is passed
57-
if (argv.skin !== false) {
58-
ldp.skin = argv.skin || 'https://linkeddata.github.io/warp/#/list/';
56+
if (argv.defaultApp !== false) {
57+
ldp.defaultApp = argv.defaultApp || 'https://linkeddata.github.io/warp/#/list/';
5958
}
6059
debug.settings("root: " + ldp.root);
6160
debug.settings("URI path filter regexp: " + ldp.pathFilter);
6261
debug.settings("Verbose: " + !!ldp.verbose);
6362
debug.settings("WebID: " + !!ldp.webid);
6463
debug.settings("Live: " + !!ldp.live);
6564
debug.settings("Identity Provider: " + ldp.idp);
65+
debug.settings("Default App: " + ldp.defaultApp);
6666

6767
return ldp;
6868
}

0 commit comments

Comments
 (0)