Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Pre-requisites:
- (If you are running locally) Add the line `127.0.0.1 *.localhost` to `/etc/hosts`

```bash
$ solid init
$ solid init
..
? Allow users to register their WebID (y/N) # write `y` here
..
Expand Down Expand Up @@ -114,7 +114,7 @@ $ solid start --port 8080 --ssl-key key.pem --ssl-cert cert.pem --no-webid
The command line tool has the following options

```
$ solid
$ solid

Usage: solid [options] [command]

Expand Down Expand Up @@ -144,17 +144,17 @@ $ solid start --help
Options:
-h, --help output usage information
--root [value] Root folder to serve (defaut: './')
--port [value] Port to use
--webid Enable WebID+TLS authentication (use `--no-webid` for HTTP instead of HTTPS)
--owner [value] Set the owner of the storage
--port [value] Port to use (default: '8443')
--webid Enable WebID authentication and access control (uses HTTPS. default: true)
--owner [value] Set the owner of the storage (overwrites the root ACL file)
--ssl-key [value] Path to the SSL private key in PEM format
--ssl-cert [value] Path to the SSL certificate key in PEM format
--idp Allow users to register their WebID
--proxy [value] Serve proxy on path
--file-browser [value] App to browse files
--idp Enable multi-user mode (users can sign up for accounts)
--proxy [value] Serve proxy on path (default: '/proxy')
--file-browser [value] Url to file browser app (uses Warp by default)
--data-browser Enable viewing RDF resources using a default data browser application (e.g. mashlib)
--suffix-acl [value] Suffix for acl files
--suffix-meta [value] Suffix for metadata files
--suffix-acl [value] Suffix for acl files (default: '.acl')
--suffix-meta [value] Suffix for metadata files (default: '.meta')
--secret [value] Secret used to sign the session ID cookie (e.g. "your secret phrase")
--error-pages [value] Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)
--mount [value] Serve on a specific URL path (default: '/')
Expand Down
63 changes: 37 additions & 26 deletions bin/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ module.exports = [
},
{
name: 'webid',
help: 'Enable WebID+TLS authentication (use `--no-webid` for HTTP instead of HTTPS)',
help: 'Enable WebID authentication and access control (uses HTTPS)',
flag: true,
default: true,
question: 'Enable WebID authentication',
prompt: true
},
{
name: 'mount',
help: "Serve on a specific URL path (default: '/')",
question: 'Serve Solid on URL path',
default: '/',
prompt: true
},
{
name: 'auth',
help: 'Pick an authentication strategy for WebID: `tls` or `oidc`',
Expand Down Expand Up @@ -57,8 +65,8 @@ module.exports = [
},
{
name: 'owner',
help: 'Set the owner of the storage',
question: 'Your webid',
help: 'Set the owner of the storage (overwrites the root ACL file)',
question: 'Your webid (to overwrite the root ACL with)',
validate: function (value) {
if (value === '' || !value.startsWith('http')) {
return 'Enter a valid Webid'
Expand All @@ -83,7 +91,8 @@ module.exports = [
},
{
name: 'idp',
help: 'Allow users to sign up for an account',
help: 'Enable multi-user mode (users can sign up for accounts)',
question: 'Enable multi-user mode (users can sign up for accounts)',
full: 'allow-signup',
flag: true,
default: false,
Expand All @@ -101,9 +110,9 @@ module.exports = [
// },
{
name: 'useProxy',
help: 'Do you want to have a proxy?',
help: 'Do you want to have a CORS proxy endpoint?',
flag: true,
prompt: false,
prompt: true,
hide: true
},
{
Expand All @@ -126,14 +135,14 @@ module.exports = [
}
return value
},
prompt: true
prompt: false
},

{
name: 'suppress-data-browser',
help: 'Suppres provision of a data browser',
help: 'Suppress provision of a data browser',
flag: true,
prompt: true,
prompt: false,
default: false,
hide: false
},
Expand All @@ -144,25 +153,28 @@ module.exports = [
question: 'Path of data viewer page (defaults to using mashlib)',
validate: validPath,
default: 'default',
prompt: true
prompt: false
},
{
name: 'suffix-acl',
full: 'suffix-acl',
help: 'Suffix for acl files',
default: '.acl'
help: "Suffix for acl files (default: '.acl')",
default: '.acl',
prompt: false
},
{
name: 'suffix-meta',
full: 'suffix-meta',
help: 'Suffix for metadata files',
default: '.meta'
help: "Suffix for metadata files (default: '.meta')",
default: '.meta',
prompt: false
},
{
name: 'secret',
help: 'Secret used to sign the session ID cookie (e.g. "your secret phrase")',
question: 'Session secret for cookie',
default: 'random',
prompt: false,
filter: function (value) {
if (value === '' || value === 'random') {
return
Expand All @@ -178,13 +190,8 @@ module.exports = [
{
name: 'error-pages',
help: 'Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)',
validate: validPath
},
{
name: 'mount',
help: "Serve on a specific URL path (default: '/')",
question: 'Serve Solid on path',
default: '/'
validate: validPath,
prompt: false
},
{
name: 'force-user',
Expand All @@ -194,7 +201,8 @@ module.exports = [
name: 'strict-origin',
help: 'Enforce same origin policy in the ACL',
flag: true,
prompt: true
default: false,
prompt: false
},
{
name: 'useEmail',
Expand Down Expand Up @@ -248,7 +256,7 @@ module.exports = [
name: 'useApiApps',
help: 'Do you want to load your default apps on /api/apps?',
flag: true,
prompt: true,
prompt: false,
default: true
},
{
Expand All @@ -263,12 +271,15 @@ module.exports = [
]

function validPath (value) {
if (value === 'default') {
return Promise.resolve(true)
}
if (!value || value === '') {
return 'You must enter a valid path'
return Promise.resolve('You must enter a valid path')
}
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
fs.stat(value, function (err) {
if (err) return reject('Nothing found at this path')
if (err) return resolve('Nothing found at this path')
return resolve(true)
})
})
Expand Down
Empty file modified bin/solid.js
100644 → 100755
Empty file.