@@ -24,11 +24,19 @@ module.exports = [
2424 } ,
2525 {
2626 name : 'webid' ,
27- help : 'Enable WebID+TLS authentication (use `--no-webid` for HTTP instead of HTTPS)' ,
27+ help : 'Enable WebID authentication and access control (uses HTTPS)' ,
2828 flag : true ,
29+ default : true ,
2930 question : 'Enable WebID authentication' ,
3031 prompt : true
3132 } ,
33+ {
34+ name : 'mount' ,
35+ help : "Serve on a specific URL path (default: '/')" ,
36+ question : 'Serve Solid on URL path' ,
37+ default : '/' ,
38+ prompt : true
39+ } ,
3240 {
3341 name : 'auth' ,
3442 help : 'Pick an authentication strategy for WebID: `tls` or `oidc`' ,
@@ -57,8 +65,8 @@ module.exports = [
5765 } ,
5866 {
5967 name : 'owner' ,
60- help : 'Set the owner of the storage' ,
61- question : 'Your webid' ,
68+ help : 'Set the owner of the storage (overwrites the root ACL file) ' ,
69+ question : 'Your webid (to overwrite the root ACL with) ' ,
6270 validate : function ( value ) {
6371 if ( value === '' || ! value . startsWith ( 'http' ) ) {
6472 return 'Enter a valid Webid'
@@ -83,7 +91,8 @@ module.exports = [
8391 } ,
8492 {
8593 name : 'idp' ,
86- help : 'Allow users to sign up for an account' ,
94+ help : 'Enable multi-user mode (users can sign up for accounts)' ,
95+ question : 'Enable multi-user mode (users can sign up for accounts)' ,
8796 full : 'allow-signup' ,
8897 flag : true ,
8998 default : false ,
@@ -101,9 +110,9 @@ module.exports = [
101110 // },
102111 {
103112 name : 'useProxy' ,
104- help : 'Do you want to have a proxy?' ,
113+ help : 'Do you want to have a CORS proxy endpoint ?' ,
105114 flag : true ,
106- prompt : false ,
115+ prompt : true ,
107116 hide : true
108117 } ,
109118 {
@@ -126,14 +135,14 @@ module.exports = [
126135 }
127136 return value
128137 } ,
129- prompt : true
138+ prompt : false
130139 } ,
131140
132141 {
133142 name : 'suppress-data-browser' ,
134- help : 'Suppres provision of a data browser' ,
143+ help : 'Suppress provision of a data browser' ,
135144 flag : true ,
136- prompt : true ,
145+ prompt : false ,
137146 default : false ,
138147 hide : false
139148 } ,
@@ -144,25 +153,28 @@ module.exports = [
144153 question : 'Path of data viewer page (defaults to using mashlib)' ,
145154 validate : validPath ,
146155 default : 'default' ,
147- prompt : true
156+ prompt : false
148157 } ,
149158 {
150159 name : 'suffix-acl' ,
151160 full : 'suffix-acl' ,
152- help : 'Suffix for acl files' ,
153- default : '.acl'
161+ help : "Suffix for acl files (default: '.acl')" ,
162+ default : '.acl' ,
163+ prompt : false
154164 } ,
155165 {
156166 name : 'suffix-meta' ,
157167 full : 'suffix-meta' ,
158- help : 'Suffix for metadata files' ,
159- default : '.meta'
168+ help : "Suffix for metadata files (default: '.meta')" ,
169+ default : '.meta' ,
170+ prompt : false
160171 } ,
161172 {
162173 name : 'secret' ,
163174 help : 'Secret used to sign the session ID cookie (e.g. "your secret phrase")' ,
164175 question : 'Session secret for cookie' ,
165176 default : 'random' ,
177+ prompt : false ,
166178 filter : function ( value ) {
167179 if ( value === '' || value === 'random' ) {
168180 return
@@ -178,13 +190,8 @@ module.exports = [
178190 {
179191 name : 'error-pages' ,
180192 help : 'Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)' ,
181- validate : validPath
182- } ,
183- {
184- name : 'mount' ,
185- help : "Serve on a specific URL path (default: '/')" ,
186- question : 'Serve Solid on path' ,
187- default : '/'
193+ validate : validPath ,
194+ prompt : false
188195 } ,
189196 {
190197 name : 'force-user' ,
@@ -194,7 +201,8 @@ module.exports = [
194201 name : 'strict-origin' ,
195202 help : 'Enforce same origin policy in the ACL' ,
196203 flag : true ,
197- prompt : true
204+ default : false ,
205+ prompt : false
198206 } ,
199207 {
200208 name : 'useEmail' ,
@@ -248,7 +256,7 @@ module.exports = [
248256 name : 'useApiApps' ,
249257 help : 'Do you want to load your default apps on /api/apps?' ,
250258 flag : true ,
251- prompt : true ,
259+ prompt : false ,
252260 default : true
253261 } ,
254262 {
@@ -263,12 +271,15 @@ module.exports = [
263271]
264272
265273function validPath ( value ) {
274+ if ( value === 'default' ) {
275+ return Promise . resolve ( true )
276+ }
266277 if ( ! value || value === '' ) {
267- return 'You must enter a valid path'
278+ return Promise . resolve ( 'You must enter a valid path' )
268279 }
269- return new Promise ( ( resolve , reject ) => {
280+ return new Promise ( ( resolve ) => {
270281 fs . stat ( value , function ( err ) {
271- if ( err ) return reject ( 'Nothing found at this path' )
282+ if ( err ) return resolve ( 'Nothing found at this path' )
272283 return resolve ( true )
273284 } )
274285 } )
0 commit comments