Skip to content

Commit dea121a

Browse files
Merge pull request #572 from solid/release/v4.0.0
Release v4.0.0
2 parents 667fe00 + 48573b3 commit dea121a

File tree

264 files changed

+13857
-4253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+13857
-4253
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ node_modules/
33
*.swp
44
.tern-port
55
npm-debug.log
6-
config/account-template
7-
config/email-templates
6+
/config/account-template
7+
/config/email-templates
88
/accounts
99
/profile
1010
/inbox
1111
/.acl
1212
/config.json
13+
/config/templates
14+
/config/views
1315
/settings
16+
/.db
1417
.nyc_output
1518
coverage
19+
/data

.travis.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@ sudo: false
22
language: node_js
33
node_js:
44
- "6.0"
5+
- "8.0"
6+
- "node"
7+
env:
8+
- CXX=g++-4.8
59

6-
cache:
7-
directories:
8-
- node_modules
910
addons:
11+
apt:
12+
sources:
13+
- ubuntu-toolchain-r-test
14+
packages:
15+
- g++-4.8
1016
hosts:
1117
- nic.localhost
1218
- tim.localhost
1319
- nicola.localhost
20+
21+
cache:
22+
apt: true
23+
directories:
24+
- node_modules

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# History
22

3+
## 4.0.0
4+
- OIDC is now supported as authentication method in addition to WebID-TLS.
5+
- Both Node.js 6 and 8 are now supported.
6+
- The server now accepts N3 patches.
7+
- Responses now contain a WAC-Allow header, listing the access permissions
8+
for the current user and non-authenticated users.
9+
- The `authProxy` configuration parameter has been added,
10+
enabling back-end servers to serve authenticated content.
11+
It accepts an object of path/server pairs
12+
(such as `/my/path": "http://localhost:2345/app"`).
13+
The Solid server acts as a reverse proxy for these paths, forwarding requests
14+
to the back-end server along with the authenticated user (`User` header)
15+
and the host through which Solid is being accessed (`Forwarded` header).
16+
- The `acceptCertificateHeader` configuration parameter has been added.
17+
This allows WebID-TLS authentication behind a reverse proxy such as NGINX:
18+
the reverse proxy should be configured to pass the client certificate
19+
in a certain header, which is then read by a (non-public) Solid server.
20+
- Self-signed certificates are no longer trusted in production.
21+
To allow self-signed certificates (for testing purposes), use `bin/solid-test`,
22+
which sets `NODE_TLS_REJECT_UNAUTHORIZED=0` and `--no-reject-unauthorized`.
23+
- On POST requests, an extension will be appended to the file.
24+
- Server logging is now more concise.
25+
- Express server injection is now supported
26+
- The root route (e.g. `/`) now displays a public home page.
27+
- Several other bugfixes
28+
29+
#### 4.0.0 Upgrade Notes
30+
- The `proxy` configuration parameter has been deprecated and
31+
renamed to `corsProxy` to better distinguish it from `authProxy`.
32+
- The `idp` configuration parameter has been deprecated and
33+
renamed to `multiuser` to better identify its purpose.
34+
- Cross-domain cookie-based authentication has been removed for security reasons.
35+
We instead recommend https://github.com/solid/solid-auth-client.
36+
- Clients should not include an extension in the slug of POST requests
37+
(they never should have), as the server now adds an extension.
38+
339
## 3.5.0
440

541
- Major refactoring of Account Creation classes (new account resources are now

README.md

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- [x] [WebID+TLS Authentication](https://www.w3.org/2005/Incubator/webid/spec/tls/)
1616
- [x] [Real-time live updates](https://github.com/solid/solid-spec#subscribing) (using WebSockets)
1717
- [x] Identity provider for WebID
18-
- [x] Proxy for cross-site data access
18+
- [x] CORS proxy for cross-site data access
1919
- [ ] Group members in ACL
2020
- [x] Email account recovery
2121

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

62+
### Running in development environments
63+
64+
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.
65+
6266
##### How do I get an SSL key and certificate?
63-
You need an SSL certificate you get this from your domain provider or for free from [Let's Encrypt!](https://letsencrypt.org/getting-started/).
67+
You need an SSL certificate from a _certificate authority_, such as your domain provider or [Let's Encrypt!](https://letsencrypt.org/getting-started/).
6468

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

9094
```bash
91-
$ solid --idp --port 8443 --cert /path/to/cert --key /path/to/key --root ./accounts
95+
$ solid --multiuser --port 8443 --cert /path/to/cert --key /path/to/key --root ./accounts
9296
```
9397

9498
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`.
9599

100+
### Running Solid behind a reverse proxy (such as NGINX)
101+
See [Running Solid behind a reverse proxy](https://github.com/solid/node-solid-server/wiki/Running-Solid-behind-a-reverse-proxy).
102+
96103
##### How can send emails to my users with my Gmail?
97104

98105
> 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.
@@ -138,31 +145,49 @@ $ solid init --help
138145
139146
140147
$ solid start --help
148+
141149
Usage: start [options]
150+
142151
run the Solid server
143152
153+
144154
Options:
145-
-h, --help output usage information
146-
--root [value] Root folder to serve (defaut: './')
147-
--port [value] Port to use (default: '8443')
148-
--serverUri [value] Solid server uri (default: 'https://localhost:8443')
149-
--webid Enable WebID authentication and access control (uses HTTPS. default: true)
150-
--owner [value] Set the owner of the storage (overwrites the root ACL file)
151-
--ssl-key [value] Path to the SSL private key in PEM format
152-
--ssl-cert [value] Path to the SSL certificate key in PEM format
153-
--idp Enable multi-user mode (users can sign up for accounts)
154-
--proxy [value] Serve proxy on path (default: '/proxy')
155-
--file-browser [value] Url to file browser app (uses Warp by default)
156-
--data-browser Enable viewing RDF resources using a default data browser application (e.g. mashlib)
157-
--suffix-acl [value] Suffix for acl files (default: '.acl')
158-
--suffix-meta [value] Suffix for metadata files (default: '.meta')
159-
--secret [value] Secret used to sign the session ID cookie (e.g. "your secret phrase")
160-
--error-pages [value] Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)
161-
--mount [value] Serve on a specific URL path (default: '/')
162-
--force-user [value] Force a WebID to always be logged in (useful when offline)
163-
--strict-origin Enforce same origin policy in the ACL
164-
-v, --verbose Print the logs to console
165-
```
155+
156+
--root [value] Root folder to serve (default: './data')
157+
--port [value] SSL port to use
158+
--serverUri [value] Solid server uri (default: 'https://localhost:8443')
159+
--webid Enable WebID authentication and access control (uses HTTPS)
160+
--mount [value] Serve on a specific URL path (default: '/')
161+
--config-path [value]
162+
--db-path [value]
163+
--auth [value] Pick an authentication strategy for WebID: `tls` or `oidc`
164+
--certificate-header [value]
165+
--owner [value] Set the owner of the storage (overwrites the root ACL file)
166+
--ssl-key [value] Path to the SSL private key in PEM format
167+
--ssl-cert [value] Path to the SSL certificate key in PEM format
168+
--no-reject-unauthorized Accept self-signed certificates
169+
--multiuser Enable multi-user mode
170+
--idp [value] Obsolete; use --multiuser
171+
--no-live Disable live support through WebSockets
172+
--proxy [value] Obsolete; use --corsProxy
173+
--corsProxy [value] Serve the CORS proxy on this path
174+
--suppress-data-browser Suppress provision of a data browser
175+
--data-browser-path [value] An HTML file which is sent to allow users to browse the data (eg using mashlib.js)
176+
--suffix-acl [value] Suffix for acl files (default: '.acl')
177+
--suffix-meta [value] Suffix for metadata files (default: '.meta')
178+
--secret [value] Secret used to sign the session ID cookie (e.g. "your secret phrase")
179+
--error-pages [value] Folder from which to look for custom error pages files (files must be named <error-code>.html -- eg. 500.html)
180+
--force-user [value] Force a WebID to always be logged in (useful when offline)
181+
--strict-origin Enforce same origin policy in the ACL
182+
--useEmail Do you want to set up an email service?
183+
--email-host [value] Host of your email service
184+
--email-port [value] Port of your email service
185+
--email-auth-user [value] User of your email service
186+
--email-auth-pass [value] Password of your email service
187+
--useApiApps Do you want to load your default apps on /api/apps?
188+
--api-apps [value] Path to the folder to mount on /api/apps
189+
-v, --verbose Print the logs to console
190+
```
166191

167192
## Library Usage
168193

@@ -195,7 +220,7 @@ default settings.
195220
mount: '/', // Where to mount Linked Data Platform
196221
webid: false, // Enable WebID+TLS authentication
197222
suffixAcl: '.acl', // Suffix for acl files
198-
proxy: false, // Where to mount the proxy
223+
corsProxy: false, // Where to mount the CORS proxy
199224
errorHandler: false, // function(err, req, res, next) to have a custom error handler
200225
errorPages: false // specify a path where the error pages are
201226
}
@@ -286,13 +311,7 @@ accidentally commit your certificates to `solid` while you're developing.
286311
If you started your `solid` server locally on port 8443 as in the example
287312
above, you would then be able to visit `https://localhost:8443` in the browser
288313
(ignoring the Untrusted Connection browser warnings as usual), where your
289-
`solid` server would redirect you to the default viewer app (see the
290-
`--file-browser` server config parameter), which is usually the
291-
[github.io/warp](https://linkeddata.github.io/warp/#/list/) file browser.
292-
293-
Accessing most Solid apps (such as Warp) will prompt you to select your browser
294-
side certificate which contains a WebID from a Solid storage provider (see
295-
the [pre-requisites](#pre-requisites) discussion above).
314+
`solid` server would redirect you to the default data viewer app.
296315

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

@@ -335,13 +354,13 @@ npm run test-(acl|formats|params|patch)
335354
<th align="left">Tim Berners-Lee</th>
336355
<td><a href="https://github.com/timbl">GitHub/timbl</a></td>
337356
<td><a href="http://twitter.com/timberners_lee">Twitter/@timberners_lee</a></td>
338-
<td><a href="https://www.w3.org/People/Berners-Lee/card#i">webid</a></td>
357+
<td><a href="https://www.w3.org/People/Berners-Lee/card#i">WebID</a></td>
339358
</tr>
340359
<tr>
341360
<th align="left">Nicola Greco</th>
342361
<td><a href="https://github.com/nicola">GitHub/nicola</a></td>
343362
<td><a href="http://twitter.com/nicolagreco">Twitter/@nicolagreco</a></td>
344-
<td><a href="https://nicola.databox.me/profile/card#me">webid</a></td>
363+
<td><a href="https://nicola.databox.me/profile/card#me">WebID</a></td>
345364
</tr>
346365
<tr>
347366
<th align="left">Martin Martinez Rivera</th>
@@ -353,7 +372,19 @@ npm run test-(acl|formats|params|patch)
353372
<th align="left">Andrei Sambra</th>
354373
<td><a href="https://github.com/deiu">GitHub/deiu</a></td>
355374
<td><a href="http://twitter.com/deiu">Twitter/@deiu</a></td>
356-
<td><a href="https://deiu.me/profile#me">webid</a></td>
375+
<td><a href="https://deiu.me/profile#me">WebID</a></td>
376+
</tr>
377+
<tr>
378+
<th align="left">Dmitri Zagidulin</th>
379+
<td><a href="https://github.com/dmitrizagidulin/">GitHub/dmitrizagidulin</a></td>
380+
<td><a href="https://twitter.com/codenamedmitri">Twitter/@codenamedmitri</a></td>
381+
<td></td>
382+
</tr>
383+
<tr>
384+
<th align="left">Ruben Verborgh</th>
385+
<td><a href="https://github.com/RubenVerborgh/">GitHub/RubenVerborgh</a></td>
386+
<td><a href="https://twitter.com/RubenVerborgh">Twitter/@RubenVerborgh</a></td>
387+
<td><a href="https://ruben.verborgh.org/profile/#me">WebID</a></td>
357388
</tr>
358389
</tbody>
359390
</table>

bin/lib/cli.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const program = require('commander')
2+
const loadInit = require('./init')
3+
const loadStart = require('./start')
4+
const { spawnSync } = require('child_process')
5+
6+
module.exports = function startCli (server) {
7+
program.version(getVersion())
8+
9+
loadInit(program)
10+
loadStart(program, server)
11+
12+
program.parse(process.argv)
13+
if (program.args.length === 0) program.help()
14+
}
15+
16+
function getVersion () {
17+
try {
18+
// Obtain version from git
19+
const options = { cwd: __dirname, encoding: 'utf8' }
20+
const { stdout } = spawnSync('git', ['describe', '--tags'], options)
21+
return stdout.trim()
22+
} catch (e) {
23+
// Obtain version from package.json
24+
const { version } = require('../package.json')
25+
return version
26+
}
27+
}

0 commit comments

Comments
 (0)