Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
bbdc11d
OIDC Integration - WIP
dmitrizagidulin May 27, 2016
7a0376f
Extract /logout handler to LogoutRequest
dmitrizagidulin Mar 8, 2017
3fb8047
Move Provider initialization logic
dmitrizagidulin Mar 8, 2017
935be63
Handle user manually going to /login without app
dmitrizagidulin Mar 9, 2017
e7b4d0f
Extract auth api logic to oidc-auth-manager
dmitrizagidulin Mar 10, 2017
2921a54
Add --db-path config option
dmitrizagidulin Mar 16, 2017
2b77734
Move oidc-manager test from unit to integration
dmitrizagidulin Mar 16, 2017
5d1b3ae
Refactor config defaults. (webid: true by default)
dmitrizagidulin Mar 16, 2017
6bb6f38
Move default-account-template/ to default-templates/new-account
dmitrizagidulin Mar 16, 2017
6614f23
Move default-email-templates/ to default-templates/emails
dmitrizagidulin Mar 16, 2017
89fe55e
Add --config-path parameter (for default templates and apps)
dmitrizagidulin Mar 17, 2017
d608422
Serve public common/ dir (for shared CSS files, etc)
dmitrizagidulin Mar 17, 2017
73d3c23
Add boostrap.min.css v3.3.7 to common/css/
dmitrizagidulin Mar 17, 2017
4bbf131
Make views/ customizable like templates
dmitrizagidulin Mar 17, 2017
fa2b96c
Rename DiscoverProviderRequest to SelectProviderRequest
dmitrizagidulin Mar 17, 2017
344511c
Move goodbye.html to views
dmitrizagidulin Mar 17, 2017
dea5733
Add a /login default view
dmitrizagidulin Mar 17, 2017
df54a75
Add db configs to speed up integration tests
dmitrizagidulin Mar 17, 2017
18d75da
Display errors on the login form
dmitrizagidulin Mar 20, 2017
9161d11
Pass returnToUrl to /register, refactor
dmitrizagidulin Mar 20, 2017
fa20647
Add /register view
dmitrizagidulin Mar 20, 2017
4220d66
Redirect to original url after account creation
dmitrizagidulin Mar 21, 2017
b27244c
Fix logout handler
dmitrizagidulin Mar 21, 2017
8eaf259
Add a default index.html for server root
dmitrizagidulin Mar 21, 2017
e4d0b8d
Initialize a default index.html for new user accounts
dmitrizagidulin Mar 21, 2017
c6a683d
Bump oidc-auth-manager dep (moved from bcrypt to bcryptjs)
dmitrizagidulin Mar 23, 2017
a5906b8
Pre-populate provider on select-provider view
dmitrizagidulin Mar 27, 2017
478a354
Extract SelectProviderRequest and auth callback code to Auth Manager
dmitrizagidulin Apr 3, 2017
d5f53f0
Add serverUri to startup debug, bump auth manager dep
dmitrizagidulin Apr 5, 2017
0012143
Add tests
dmitrizagidulin Apr 5, 2017
d47d160
Extract template init code to server-config.js
dmitrizagidulin Apr 7, 2017
b21ae11
Refactor createApp()
dmitrizagidulin Apr 7, 2017
04e6c9c
Move acl.js test and resources/ folder to acl-tls
dmitrizagidulin Apr 11, 2017
d935642
Add acl-related OIDC integration tests
dmitrizagidulin Apr 12, 2017
10dccdb
Fix file browser redirect test
dmitrizagidulin Apr 13, 2017
60792fb
Add tests for userIdFromRequest()
dmitrizagidulin Apr 13, 2017
412f488
Add tests for TokenService
dmitrizagidulin Apr 18, 2017
357da35
Refactor TokenService and account manager, add tests
dmitrizagidulin Apr 24, 2017
3b915ff
Implement password reset request and tests
dmitrizagidulin Apr 25, 2017
4ca105e
Implement reset token validation and change password page
dmitrizagidulin Apr 26, 2017
d170650
Add support for --force-user flag for oidc auth
dmitrizagidulin Apr 27, 2017
b49082a
Fix account creation welcome email logic
dmitrizagidulin Apr 27, 2017
182cde7
Remove broken /messages api code
dmitrizagidulin Apr 27, 2017
477c0e0
Remove old account-recovery handler
dmitrizagidulin Apr 27, 2017
b753954
Remove WebID-TLS authentication code
dmitrizagidulin Apr 28, 2017
6b39dcf
Clean up params integration tests
dmitrizagidulin Apr 28, 2017
917cd29
Add tests for PasswordChangeRequest handler
dmitrizagidulin Apr 28, 2017
e2d68fe
Add test for fullUrlForReq()
dmitrizagidulin May 1, 2017
fc0a7b3
Add auth-related docstrings
dmitrizagidulin May 1, 2017
97dac71
Add a fix for utils.debrack() and unit tests
dmitrizagidulin May 1, 2017
e79f025
Set User: response header if authenticated (for legacy compat)
dmitrizagidulin May 4, 2017
9e71eb9
Bump oidc-auth-manager dep to 0.7.1
dmitrizagidulin May 11, 2017
b5f3dc4
Re-add WebID-TLS auth code
dmitrizagidulin May 18, 2017
0786e08
Add a Login with Certificate button to login screen
dmitrizagidulin May 1, 2017
9b19974
Implement Login via WebID-TLS cert local auth strategy
dmitrizagidulin May 22, 2017
eca2d4b
Fix 401 error handling, add tests (#507)
dmitrizagidulin Jun 7, 2017
3659b65
Make ./data the default root folder (#510)
dmitrizagidulin Jun 22, 2017
0b03de7
Move patch handlers to separate files.
RubenVerborgh Jun 22, 2017
a79d19d
Use same patch logic regardless of content type.
RubenVerborgh Jun 22, 2017
acc7151
Use "415 Unsupported Media Type" for unsupported patches.
RubenVerborgh Jun 22, 2017
f55a2a0
Deduplicate graph reading code.
RubenVerborgh Jun 23, 2017
3d05378
Remove incomplete SPARQL PATCH handler.
RubenVerborgh Jun 23, 2017
90c218a
Move patch writing to generic PATCH handler.
RubenVerborgh Jun 23, 2017
fc42bbc
Delegate body parsing to middleware.
RubenVerborgh Jun 23, 2017
c92c6ad
Prettify patch code.
RubenVerborgh Jun 23, 2017
a3f8a77
Refactor SPARQL update patcher with promises.
RubenVerborgh Jun 23, 2017
71c3101
Add preliminary N3 patch support.
RubenVerborgh Jun 26, 2017
aed5b6a
Construct the patch URI through a hash of its contents.
RubenVerborgh Jun 27, 2017
c44c9a1
Clean up SPARQL UPDATE PATCH tests.
RubenVerborgh Jun 27, 2017
4d1e746
Set up new PATCH tests.
RubenVerborgh Jun 27, 2017
f04b5ef
Syntactically and structurally validate patches.
RubenVerborgh Jun 28, 2017
351463d
Enable and test PATCH appending.
RubenVerborgh Jun 29, 2017
338795e
Use single-user setup for PATCH tests.
RubenVerborgh Jun 30, 2017
4c6c275
Test PATCH deletion.
RubenVerborgh Jun 30, 2017
1d55d0e
Test PATCH combined deletion and insertion.
RubenVerborgh Jun 30, 2017
c463d73
Add WHERE support to N3 patches.
RubenVerborgh Jun 30, 2017
d4315b4
Refactor patch handler to perform everything but parsing.
RubenVerborgh Jul 1, 2017
2a895f6
Expose ACL and user ID on request.
RubenVerborgh Jul 1, 2017
9a3597b
Verify read and write permissions for patches.
RubenVerborgh Jul 1, 2017
d108753
Refactor PATCH tests with helper method.
RubenVerborgh Jul 2, 2017
180a114
Support client certificates via X-SSL-Cert header.
RubenVerborgh Jul 13, 2017
97322a0
Make x509 dependency optional.
RubenVerborgh Jul 13, 2017
c541a0a
Add acceptCertificateHeader option.
RubenVerborgh Jul 13, 2017
b0591af
WebID through header doesn't require TLS.
RubenVerborgh Jul 13, 2017
de6012c
Make certificate header name customizable.
RubenVerborgh Jul 13, 2017
60a14ef
Add reverse proxy documentation link.
RubenVerborgh Jul 13, 2017
95701d9
Only set User header with WebID-TLS.
RubenVerborgh Jul 25, 2017
f853711
Reject cookies from third-party applications.
RubenVerborgh Jul 25, 2017
fc3ab8f
Fix missing foaf: prefix in prefs.ttl
dmitrizagidulin Jul 27, 2017
01261ea
Merge branch 'master' into oidc-dev
dmitrizagidulin Aug 8, 2017
c81b51d
Fix merge oddness
dmitrizagidulin Aug 8, 2017
2b4bbe4
Add support for 'request' auth param
dmitrizagidulin Aug 8, 2017
775b46d
Return scope='openid webid' in oidc WWW-Authenticate header response
dmitrizagidulin Aug 8, 2017
da8df9b
Use http-proxy-middleware for CORS proxy.
RubenVerborgh Aug 8, 2017
1696e35
Correct proxy error codes.
RubenVerborgh Aug 8, 2017
1afb00a
Update IP packages.
RubenVerborgh Aug 8, 2017
e61de87
Ensure the host is not a local IP.
RubenVerborgh Aug 8, 2017
883373e
Pass the Host header.
RubenVerborgh Aug 8, 2017
d7dfb16
Expose ACL and user ID on request.
RubenVerborgh Jul 1, 2017
22b2f6c
Test on Node 8.
RubenVerborgh Jul 6, 2017
e785193
Allow additional HTTPS options.
RubenVerborgh Jul 6, 2017
aa0b6b9
Fix ACL TLS test.
RubenVerborgh Jul 6, 2017
5bb0672
Set NODE_TLS_REJECT_UNAUTHORIZED for tests (only).
RubenVerborgh Jul 6, 2017
d9b77a8
Update nock.
RubenVerborgh Aug 8, 2017
01550b0
Move OIDC-specific details out of createApp.
RubenVerborgh Aug 10, 2017
bde91b2
Move TLS-specific details out of createApp.
RubenVerborgh Aug 10, 2017
2e435ff
Make forceUser a separate module.
RubenVerborgh Aug 10, 2017
1f4fd48
Make create-app auth-agnostic.
RubenVerborgh Aug 10, 2017
47697ca
Remove redundant "identified" setting.
RubenVerborgh Aug 10, 2017
e9b5509
Expose request.userId in OIDC handler.
RubenVerborgh Aug 10, 2017
c9467b0
Remove userId from allow handler.
RubenVerborgh Aug 10, 2017
42011d6
Only set User header for TLS.
RubenVerborgh Aug 10, 2017
c2463bc
Rename proxy to corsProxy.
RubenVerborgh Aug 8, 2017
bf3b95c
Add Auth Proxy.
RubenVerborgh Aug 9, 2017
89b6133
Set User header on proxied requests.
RubenVerborgh Aug 9, 2017
2a14bc7
Set Host header on proxied requests.
RubenVerborgh Aug 9, 2017
70f8716
Set Forwarded header on proxied requests.
RubenVerborgh Aug 10, 2017
822d58c
Add authProxy option.
RubenVerborgh Aug 9, 2017
1e6ab20
Set default test timeout to 10 seconds.
RubenVerborgh Aug 9, 2017
0b5a675
Rename main executable to solid.
RubenVerborgh Aug 11, 2017
ae946b0
Add solid-test script.
RubenVerborgh Aug 11, 2017
66e8f8a
Document solid-test executable.
RubenVerborgh Aug 11, 2017
4cf7fd5
Follow Mocha naming conventions.
RubenVerborgh Aug 11, 2017
a1a36c7
Remove specific test commands.
RubenVerborgh Aug 11, 2017
ad09398
Remove clean scripts.
RubenVerborgh Aug 11, 2017
e273032
Add a 'two pods plus external web app' integration test
dmitrizagidulin May 26, 2017
f8db96b
Add support for Proof of Possession tokens, update tests
dmitrizagidulin Aug 14, 2017
0ab52a8
Add token reuse test
dmitrizagidulin Aug 14, 2017
bfcfeca
Merge branch 'master' into dz_oidc
dmitrizagidulin Aug 15, 2017
ff3d3be
Add package-lock.json
dmitrizagidulin Aug 15, 2017
9ba7cb3
Switch to the official oidc issuer link rel value
dmitrizagidulin Aug 15, 2017
dbffa3d
Verify webid provider when extracting webid from claim
dmitrizagidulin Aug 15, 2017
9af2c51
Remove deprecated solid:inbox term from account template
dmitrizagidulin Aug 15, 2017
4bcd7fc
Cache APT packages on Travis CI.
RubenVerborgh Aug 16, 2017
bf83152
Correct certificate-header flag name.
RubenVerborgh Aug 16, 2017
c734cf6
Add --no-reject-unauthorized flag.
RubenVerborgh Aug 16, 2017
b3b755b
Disable rejectUnauthorized on solid-test.
RubenVerborgh Aug 16, 2017
5fe555d
Display error messages on Select Provider page
dmitrizagidulin Aug 16, 2017
560c570
Allow login via TLS with externally hosted WebIDs
dmitrizagidulin Aug 16, 2017
1782ba3
TlsAuthenticator - minor refactor/cleanup
dmitrizagidulin Aug 16, 2017
fb7235d
Add link to issuer discovery spec on error
dmitrizagidulin Aug 17, 2017
b0d543f
Merge remote-tracking branch 'origin/master' into dz_oidc
dmitrizagidulin Aug 18, 2017
eed6c40
Convert checkAccess to promise.
RubenVerborgh Aug 18, 2017
27f6b88
Convert can to promise.
RubenVerborgh Aug 18, 2017
c7ca72b
Move getNearestACL into separate method.
RubenVerborgh Aug 18, 2017
83da96b
Move getPermissionSet into separate method.
RubenVerborgh Aug 18, 2017
554d198
Change accessType into isContainer.
RubenVerborgh Aug 18, 2017
c723009
Pass permission set to checkAccess.
RubenVerborgh Aug 18, 2017
ab00c74
Move resource parameter to constructor.
RubenVerborgh Aug 18, 2017
31d396a
Move all options to constructor.
RubenVerborgh Aug 18, 2017
180de68
Cache the permission set.
RubenVerborgh Aug 18, 2017
0a58ac5
Clean up ACLChecker.
RubenVerborgh Aug 18, 2017
d7a429f
Simplify ACL path algorithm.
RubenVerborgh Aug 18, 2017
3161b68
Indent then and catch.
RubenVerborgh Aug 18, 2017
2b8f18b
Expose the user's permissions through a header.
RubenVerborgh Aug 17, 2017
91c8106
Migrate to Solid vocabulary.
RubenVerborgh Aug 17, 2017
30a57ed
Merge branch 'rv/patch/n3' into dz_oidc
RubenVerborgh Aug 18, 2017
e126aad
Merge branch 'master' into dz_oidc
dmitrizagidulin Aug 18, 2017
6c1938b
Fix rename missed in merge
dmitrizagidulin Aug 18, 2017
82af9ec
Implement fetchDocument without async.
RubenVerborgh Aug 18, 2017
de7b93a
Implement globHandler without async.
RubenVerborgh Aug 21, 2017
67a6b48
Implement CORS proxy test without async.
RubenVerborgh Aug 21, 2017
ace60c7
Implement LDP without async.
RubenVerborgh Aug 21, 2017
d54f958
Remove async dependency.
RubenVerborgh Aug 21, 2017
5746766
Expose WAC-Allow to browser clients.
RubenVerborgh Aug 21, 2017
41da733
Verify presence of test DNS entries. (#549)
RubenVerborgh Aug 25, 2017
34ca3a6
Bump oidc-auth-manager dep to 0.12.0
dmitrizagidulin Aug 28, 2017
9a3022a
Expand error message for unverified web id
dmitrizagidulin Aug 28, 2017
a710be5
Log whole error in error handler
dmitrizagidulin Aug 29, 2017
d0b4749
Do not check for user header in oidc test
dmitrizagidulin Aug 30, 2017
1c09007
Move RS options to oidc-auth-manager initialization
dmitrizagidulin Aug 30, 2017
c8e9109
Add support for external WebIDs registering with username & password
dmitrizagidulin Aug 18, 2017
8b1dc11
Remove solid:inbox from template
dmitrizagidulin Aug 30, 2017
49fb741
Tweak account index page phrasing
dmitrizagidulin Aug 30, 2017
c868ab1
Serve static common/ dir relative to __dirname
dmitrizagidulin Aug 30, 2017
0dfc619
Disable rejectUnauthorized on the WebID-TLS endpoint. (#561)
RubenVerborgh Aug 30, 2017
bc58c7d
Add current hash to redirect. (#562)
RubenVerborgh Aug 30, 2017
cc569a8
Add bootstrap.min.css.map to common/css/
dmitrizagidulin Aug 30, 2017
0d9a472
Fix requirement for additional verification logging in with WebID-TLS
dmitrizagidulin Aug 31, 2017
e7d7ec3
Remove debug overhead on ACL (#566)
RubenVerborgh Aug 31, 2017
928ff50
Update Data Browser html file
dmitrizagidulin Aug 31, 2017
d45d65d
Add a /public folder in new accounts (#569)
RubenVerborgh Sep 1, 2017
bae020f
Rename the idp option into multiuser (#570)
RubenVerborgh Sep 3, 2017
f168cbb
Merge branch 'dz_oidc' into release/v4.0.0
RubenVerborgh Sep 3, 2017
256beeb
fixed path for default templates and views (#577)
tomasklapka Sep 5, 2017
9e6e2a4
Use data browser for containers as well. (#573)
RubenVerborgh Sep 5, 2017
a6e9fee
Fix assignment of renamed options.
RubenVerborgh Sep 5, 2017
310d95e
CLI modularized, express injection allowed (#576)
tomasklapka Sep 5, 2017
d771b94
Display git commit info when available. (#581)
RubenVerborgh Sep 5, 2017
2fff1b9
Update mashlib path.
RubenVerborgh Sep 8, 2017
9cbc04d
Include filenames with spaces in folder listings (#588)
RubenVerborgh Sep 12, 2017
8d4a7a1
Add file extension to generated paths on POST.
RubenVerborgh Sep 6, 2017
47091e4
Also add extension on POSTed Turtle files.
RubenVerborgh Sep 12, 2017
a7f08b7
Simplify ACL debugging.
RubenVerborgh Sep 12, 2017
e205b8b
Remove 'no translation' message.
RubenVerborgh Sep 12, 2017
5057086
Log filenames on GET.
RubenVerborgh Sep 12, 2017
7c43b1a
Log resource on permissions check.
RubenVerborgh Sep 12, 2017
0ae10e0
Don't override existing DEBUG env variable.
RubenVerborgh Sep 13, 2017
f654a56
Add popup for databrowser (#593)
RubenVerborgh Sep 15, 2017
ac9d4a3
Add app name to popup, use fully-qualified URL for popupUri
dan-f Sep 15, 2017
af2762a
Set up the session for `solid-auth-client` w/ tls (#596)
dan-f Sep 15, 2017
ba0aacb
Add the user's name and ID.
RubenVerborgh Sep 14, 2017
748bae7
Add links to contents.
RubenVerborgh Sep 14, 2017
bfe1c9b
Add Data/Apps sections
dan-f Sep 15, 2017
9ea4f0a
Reduce verbosity
dan-f Sep 15, 2017
f3a0ff1
Update README.md for v4.0.0
dan-f Sep 15, 2017
fa4d1d2
Require Read permissions for authProxy.
RubenVerborgh Sep 14, 2017
d9355b8
Require write permissions for unsafe proxy methods.
RubenVerborgh Sep 15, 2017
bd00ae3
Simplify status code assertions.
RubenVerborgh Sep 15, 2017
aaf2a2e
Update contributors.
RubenVerborgh Sep 15, 2017
6637b72
Update CHANGELOG for version 4.0.0 (#534)
RubenVerborgh Sep 15, 2017
b8defc3
Add login button to homepage
dan-f Sep 15, 2017
77b6d58
Specify proper source directories for `standard`
dan-f Sep 15, 2017
f676163
Merge branch 'master' into release/v4.0.0
RubenVerborgh Sep 15, 2017
48573b3
Release version 4.0.0 of the npm package.
RubenVerborgh Sep 15, 2017
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
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ node_modules/
*.swp
.tern-port
npm-debug.log
config/account-template
config/email-templates
/config/account-template
/config/email-templates
/accounts
/profile
/inbox
/.acl
/config.json
/config/templates
/config/views
/settings
/.db
.nyc_output
coverage
/data
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ sudo: false
language: node_js
node_js:
- "6.0"
- "8.0"
- "node"
env:
- CXX=g++-4.8

cache:
directories:
- node_modules
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
hosts:
- nic.localhost
- tim.localhost
- nicola.localhost

cache:
apt: true
directories:
- node_modules
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# History

## 4.0.0
- OIDC is now supported as authentication method in addition to WebID-TLS.
- Both Node.js 6 and 8 are now supported.
- The server now accepts N3 patches.
- Responses now contain a WAC-Allow header, listing the access permissions
for the current user and non-authenticated users.
- The `authProxy` configuration parameter has been added,
enabling back-end servers to serve authenticated content.
It accepts an object of path/server pairs
(such as `/my/path": "http://localhost:2345/app"`).
The Solid server acts as a reverse proxy for these paths, forwarding requests
to the back-end server along with the authenticated user (`User` header)
and the host through which Solid is being accessed (`Forwarded` header).
- The `acceptCertificateHeader` configuration parameter has been added.
This allows WebID-TLS authentication behind a reverse proxy such as NGINX:
the reverse proxy should be configured to pass the client certificate
in a certain header, which is then read by a (non-public) Solid server.
- Self-signed certificates are no longer trusted in production.
To allow self-signed certificates (for testing purposes), use `bin/solid-test`,
which sets `NODE_TLS_REJECT_UNAUTHORIZED=0` and `--no-reject-unauthorized`.
- On POST requests, an extension will be appended to the file.
- Server logging is now more concise.
- Express server injection is now supported
- The root route (e.g. `/`) now displays a public home page.
- Several other bugfixes

#### 4.0.0 Upgrade Notes
- The `proxy` configuration parameter has been deprecated and
renamed to `corsProxy` to better distinguish it from `authProxy`.
- The `idp` configuration parameter has been deprecated and
renamed to `multiuser` to better identify its purpose.
- Cross-domain cookie-based authentication has been removed for security reasons.
We instead recommend https://github.com/solid/solid-auth-client.
- Clients should not include an extension in the slug of POST requests
(they never should have), as the server now adds an extension.

## 3.5.0

- Major refactoring of Account Creation classes (new account resources are now
Expand Down
103 changes: 67 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [x] [WebID+TLS Authentication](https://www.w3.org/2005/Incubator/webid/spec/tls/)
- [x] [Real-time live updates](https://github.com/solid/solid-spec#subscribing) (using WebSockets)
- [x] Identity provider for WebID
- [x] Proxy for cross-site data access
- [x] CORS proxy for cross-site data access
- [ ] Group members in ACL
- [x] Email account recovery

Expand Down Expand Up @@ -59,10 +59,14 @@ $ solid start --root path/to/folder --port 8443 --ssl-key path/to/ssl-key.pem --
# Solid server (solid v0.2.24) running on https://localhost:8443/
```

### Running in development environments

Solid requires SSL certificates to be valid, so you cannot use self-signed certificates. To switch off this security feature in development environments, you can use the `bin/solid-test` executable, which unsets the `NODE_TLS_REJECT_UNAUTHORIZED` flag and sets the `rejectUnauthorized` option.

##### How do I get an SSL key and certificate?
You need an SSL certificate you get this from your domain provider or for free from [Let's Encrypt!](https://letsencrypt.org/getting-started/).
You need an SSL certificate from a _certificate authority_, such as your domain provider or [Let's Encrypt!](https://letsencrypt.org/getting-started/).

If you don't have one yet, or you just want to test `solid`, generate a certificate (**DO NOT USE IN PRODUCTION**):
For testing purposes, you can use `bin/solid-test` with a _self-signed_ certificate, generated as follows:
```
$ openssl genrsa 2048 > ../localhost.key
$ openssl req -new -x509 -nodes -sha256 -days 3650 -key ../localhost.key -subj '/CN=*.localhost' > ../localhost.cert
Expand All @@ -88,11 +92,14 @@ $ solid start
Otherwise, if you want to use flags, this would be the equivalent

```bash
$ solid --idp --port 8443 --cert /path/to/cert --key /path/to/key --root ./accounts
$ solid --multiuser --port 8443 --cert /path/to/cert --key /path/to/key --root ./accounts
```

Your users will have a dedicated folder under `./accounts`. Also, your root domain's website will be in `./accounts/yourdomain.tld`. New users can create accounts on `/api/accounts/new` and create new certificates on `/api/accounts/cert`. An easy-to-use sign-up tool is found on `/api/accounts`.

### Running Solid behind a reverse proxy (such as NGINX)
See [Running Solid behind a reverse proxy](https://github.com/solid/node-solid-server/wiki/Running-Solid-behind-a-reverse-proxy).

##### How can send emails to my users with my Gmail?

> To use Gmail you may need to configure ["Allow Less Secure Apps"](https://www.google.com/settings/security/lesssecureapps) in your Gmail account unless you are using 2FA in which case you would have to create an [Application Specific](https://security.google.com/settings/security/apppasswords) password. You also may need to unlock your account with ["Allow access to your Google account"](https://accounts.google.com/DisplayUnlockCaptcha) to use SMTP.
Expand Down Expand Up @@ -138,31 +145,49 @@ $ solid init --help


$ solid start --help

Usage: start [options]

run the Solid server


Options:
-h, --help output usage information
--root [value] Root folder to serve (defaut: './')
--port [value] Port to use (default: '8443')
--serverUri [value] Solid server uri (default: 'https://localhost: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 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 (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: '/')
--force-user [value] Force a WebID to always be logged in (useful when offline)
--strict-origin Enforce same origin policy in the ACL
-v, --verbose Print the logs to console
```

--root [value] Root folder to serve (default: './data')
--port [value] SSL port to use
--serverUri [value] Solid server uri (default: 'https://localhost:8443')
--webid Enable WebID authentication and access control (uses HTTPS)
--mount [value] Serve on a specific URL path (default: '/')
--config-path [value]
--db-path [value]
--auth [value] Pick an authentication strategy for WebID: `tls` or `oidc`
--certificate-header [value]
--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
--no-reject-unauthorized Accept self-signed certificates
--multiuser Enable multi-user mode
--idp [value] Obsolete; use --multiuser
--no-live Disable live support through WebSockets
--proxy [value] Obsolete; use --corsProxy
--corsProxy [value] Serve the CORS proxy on this path
--suppress-data-browser Suppress provision of a data browser
--data-browser-path [value] An HTML file which is sent to allow users to browse the data (eg using mashlib.js)
--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)
--force-user [value] Force a WebID to always be logged in (useful when offline)
--strict-origin Enforce same origin policy in the ACL
--useEmail Do you want to set up an email service?
--email-host [value] Host of your email service
--email-port [value] Port of your email service
--email-auth-user [value] User of your email service
--email-auth-pass [value] Password of your email service
--useApiApps Do you want to load your default apps on /api/apps?
--api-apps [value] Path to the folder to mount on /api/apps
-v, --verbose Print the logs to console
```

## Library Usage

Expand Down Expand Up @@ -195,7 +220,7 @@ default settings.
mount: '/', // Where to mount Linked Data Platform
webid: false, // Enable WebID+TLS authentication
suffixAcl: '.acl', // Suffix for acl files
proxy: false, // Where to mount the proxy
corsProxy: false, // Where to mount the CORS proxy
errorHandler: false, // function(err, req, res, next) to have a custom error handler
errorPages: false // specify a path where the error pages are
}
Expand Down Expand Up @@ -286,13 +311,7 @@ accidentally commit your certificates to `solid` while you're developing.
If you started your `solid` server locally on port 8443 as in the example
above, you would then be able to visit `https://localhost:8443` in the browser
(ignoring the Untrusted Connection browser warnings as usual), where your
`solid` server would redirect you to the default viewer app (see the
`--file-browser` server config parameter), which is usually the
[github.io/warp](https://linkeddata.github.io/warp/#/list/) file browser.

Accessing most Solid apps (such as Warp) will prompt you to select your browser
side certificate which contains a WebID from a Solid storage provider (see
the [pre-requisites](#pre-requisites) discussion above).
`solid` server would redirect you to the default data viewer app.

#### Editing your local `/etc/hosts`

Expand Down Expand Up @@ -335,13 +354,13 @@ npm run test-(acl|formats|params|patch)
<th align="left">Tim Berners-Lee</th>
<td><a href="https://github.com/timbl">GitHub/timbl</a></td>
<td><a href="http://twitter.com/timberners_lee">Twitter/@timberners_lee</a></td>
<td><a href="https://www.w3.org/People/Berners-Lee/card#i">webid</a></td>
<td><a href="https://www.w3.org/People/Berners-Lee/card#i">WebID</a></td>
</tr>
<tr>
<th align="left">Nicola Greco</th>
<td><a href="https://github.com/nicola">GitHub/nicola</a></td>
<td><a href="http://twitter.com/nicolagreco">Twitter/@nicolagreco</a></td>
<td><a href="https://nicola.databox.me/profile/card#me">webid</a></td>
<td><a href="https://nicola.databox.me/profile/card#me">WebID</a></td>
</tr>
<tr>
<th align="left">Martin Martinez Rivera</th>
Expand All @@ -353,7 +372,19 @@ npm run test-(acl|formats|params|patch)
<th align="left">Andrei Sambra</th>
<td><a href="https://github.com/deiu">GitHub/deiu</a></td>
<td><a href="http://twitter.com/deiu">Twitter/@deiu</a></td>
<td><a href="https://deiu.me/profile#me">webid</a></td>
<td><a href="https://deiu.me/profile#me">WebID</a></td>
</tr>
<tr>
<th align="left">Dmitri Zagidulin</th>
<td><a href="https://github.com/dmitrizagidulin/">GitHub/dmitrizagidulin</a></td>
<td><a href="https://twitter.com/codenamedmitri">Twitter/@codenamedmitri</a></td>
<td></td>
</tr>
<tr>
<th align="left">Ruben Verborgh</th>
<td><a href="https://github.com/RubenVerborgh/">GitHub/RubenVerborgh</a></td>
<td><a href="https://twitter.com/RubenVerborgh">Twitter/@RubenVerborgh</a></td>
<td><a href="https://ruben.verborgh.org/profile/#me">WebID</a></td>
</tr>
</tbody>
</table>
Expand Down
27 changes: 27 additions & 0 deletions bin/lib/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const program = require('commander')
const loadInit = require('./init')
const loadStart = require('./start')
const { spawnSync } = require('child_process')

module.exports = function startCli (server) {
program.version(getVersion())

loadInit(program)
loadStart(program, server)

program.parse(process.argv)
if (program.args.length === 0) program.help()
}

function getVersion () {
try {
// Obtain version from git
const options = { cwd: __dirname, encoding: 'utf8' }
const { stdout } = spawnSync('git', ['describe', '--tags'], options)
return stdout.trim()
} catch (e) {
// Obtain version from package.json
const { version } = require('../package.json')
return version
}
}
Loading