solid-server 5.6.15 → 5.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +1 -0
- package/README.md +9 -3
- package/common/css/solid.css +10 -10
- package/docker-compose.yml +10 -0
- package/lib/acl-checker.js +16 -4
- package/lib/handlers/patch/n3-patch-parser.js +13 -3
- package/lib/handlers/post.js +1 -1
- package/lib/header.js +2 -1
- package/package.json +15 -10
- package/default-views/account/register-form-ori.hbs +0 -134
package/Dockerfile
CHANGED
package/README.md
CHANGED
|
@@ -237,19 +237,25 @@ We have automatic builds set up, so commits to master will trigger a build of ht
|
|
|
237
237
|
|
|
238
238
|
### Development usage
|
|
239
239
|
|
|
240
|
-
If you want to use Docker in development,
|
|
240
|
+
If you want to use Docker in development, you can build and run the image locally with either docker-compose —
|
|
241
241
|
|
|
242
242
|
```bash
|
|
243
243
|
git clone https://github.com/solid/node-solid-server
|
|
244
244
|
cd node-solid-server
|
|
245
|
-
docker
|
|
245
|
+
docker-compose up -d
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
— or these manual commands —
|
|
249
|
+
|
|
249
250
|
```bash
|
|
251
|
+
git clone https://github.com/solid/node-solid-server
|
|
252
|
+
cd node-solid-server
|
|
253
|
+
docker build -t node-solid-server .
|
|
254
|
+
|
|
250
255
|
docker run -p 8443:8443 --name solid node-solid-server
|
|
251
256
|
```
|
|
252
257
|
|
|
258
|
+
|
|
253
259
|
This will enable you to login to solid on https://localhost:8443 and then create a new account
|
|
254
260
|
but not yet use that account. After a new account is made you will need to create an entry for
|
|
255
261
|
it in your local (/etc/)hosts file in line with the account and subdomain, i.e. --
|
package/common/css/solid.css
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
margin: 0;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.header {
|
|
15
|
+
.index-page .header {
|
|
16
16
|
box-shadow: 0px 1px 4px rgba(0,0.0,0.2) !important;
|
|
17
17
|
-webkit-box-shadow: 0px 1px 4px rgba(0,0.0,0.2) !important;
|
|
18
18
|
text-align: center !important;
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
width: 99%;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.header-left {
|
|
25
|
+
.index-page .header-left {
|
|
26
26
|
text-align: left;
|
|
27
27
|
margin-top: 0.67em;
|
|
28
28
|
width: 19%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.header-center {
|
|
31
|
+
.index-page .header-center {
|
|
32
32
|
margin: auto;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
min-width: 19%;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.logo-img {
|
|
47
|
+
.index-page .logo-img {
|
|
48
48
|
width: 50px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.title {
|
|
51
|
+
.index-page .title {
|
|
52
52
|
color: #7C4DFF;
|
|
53
53
|
font-size: 2em;
|
|
54
54
|
line-height: 1em;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
.container {
|
|
57
|
+
.index-page .container {
|
|
58
58
|
position: relative;
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
@@ -64,20 +64,20 @@
|
|
|
64
64
|
line-height: 1.6;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.content {
|
|
67
|
+
.index-page .content {
|
|
68
68
|
display: block;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.webId {
|
|
71
|
+
.index-page .webId {
|
|
72
72
|
text-align: center;
|
|
73
73
|
-webkit-box-shadow: 0px 1px 4px #7C4DFF !important;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.logo {
|
|
76
|
+
.index-page .logo {
|
|
77
77
|
color: #f8f8f8;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.register-button {
|
|
80
|
+
.index-page .register-button {
|
|
81
81
|
padding: 1em;
|
|
82
82
|
border-radius:0.5em;
|
|
83
83
|
font-size: 100%;
|
package/lib/acl-checker.js
CHANGED
|
@@ -87,15 +87,27 @@ class ACLChecker {
|
|
|
87
87
|
}
|
|
88
88
|
let accessDenied = aclCheck.accessDenied(acl.graph, resource, directory, aclFile, agent, modes, agentOrigin, trustedOrigins, originTrustedModes)
|
|
89
89
|
|
|
90
|
+
function accessDeniedForAccessTo (mode) {
|
|
91
|
+
const accessDeniedAccessTo = aclCheck.accessDenied(acl.graph, directory, null, aclFile, agent, [ACL(mode)], agentOrigin, trustedOrigins, originTrustedModes)
|
|
92
|
+
const accessResult = !accessDenied && !accessDeniedAccessTo
|
|
93
|
+
accessDenied = accessResult ? false : accessDenied || accessDeniedAccessTo
|
|
94
|
+
// debugCache('accessDenied result ' + accessDenied)
|
|
95
|
+
}
|
|
90
96
|
// For create and update HTTP methods
|
|
91
97
|
if ((method === 'PUT' || method === 'PATCH' || method === 'COPY') && directory) {
|
|
92
98
|
// if resource and acl have same parent container,
|
|
93
99
|
// and resource does not exist, then accessTo Append from parent is required
|
|
94
100
|
if (directory.value === dirname(aclFile.value) + '/' && !resourceExists) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
accessDeniedForAccessTo('Append')
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// For delete HTTP method
|
|
106
|
+
if ((method === 'DELETE') && directory) {
|
|
107
|
+
// if resource and acl have same parent container,
|
|
108
|
+
// then accessTo Write from parent is required
|
|
109
|
+
if (directory.value === dirname(aclFile.value) + '/') {
|
|
110
|
+
accessDeniedForAccessTo('Write')
|
|
99
111
|
}
|
|
100
112
|
}
|
|
101
113
|
if (accessDenied && user) {
|
|
@@ -20,16 +20,26 @@ async function parsePatchDocument (targetURI, patchURI, patchText) {
|
|
|
20
20
|
|
|
21
21
|
// Query the N3 document for insertions and deletions
|
|
22
22
|
let firstResult
|
|
23
|
-
try {
|
|
23
|
+
try { // solid/protocol v0.9.0
|
|
24
24
|
firstResult = await queryForFirstResult(patchGraph, `${PREFIXES}
|
|
25
25
|
SELECT ?insert ?delete ?where WHERE {
|
|
26
|
-
?patch solid:
|
|
26
|
+
?patch a solid:InsertDeletePatch.
|
|
27
27
|
OPTIONAL { ?patch solid:inserts ?insert. }
|
|
28
28
|
OPTIONAL { ?patch solid:deletes ?delete. }
|
|
29
29
|
OPTIONAL { ?patch solid:where ?where. }
|
|
30
30
|
}`)
|
|
31
31
|
} catch (err) {
|
|
32
|
-
|
|
32
|
+
try { // deprecated, kept for compatibility
|
|
33
|
+
firstResult = await queryForFirstResult(patchGraph, `${PREFIXES}
|
|
34
|
+
SELECT ?insert ?delete ?where WHERE {
|
|
35
|
+
?patch solid:patches <${targetURI}>.
|
|
36
|
+
OPTIONAL { ?patch solid:inserts ?insert. }
|
|
37
|
+
OPTIONAL { ?patch solid:deletes ?delete. }
|
|
38
|
+
OPTIONAL { ?patch solid:where ?where. }
|
|
39
|
+
}`)
|
|
40
|
+
} catch (err) {
|
|
41
|
+
throw error(400, 'No n3-patch found.', err)
|
|
42
|
+
}
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
// Return the insertions and deletions as an rdflib patch document
|
package/lib/handlers/post.js
CHANGED
package/lib/header.js
CHANGED
|
@@ -66,7 +66,8 @@ async function linksHandler (req, res, next) {
|
|
|
66
66
|
return next(error(404, 'Trying to access metadata file as regular file'))
|
|
67
67
|
}
|
|
68
68
|
const fileMetadata = new metadata.Metadata()
|
|
69
|
-
if (
|
|
69
|
+
if (req.path.endsWith('/')) {
|
|
70
|
+
// do not add storage header in serverUri
|
|
70
71
|
if (req.path === '/') fileMetadata.isStorage = true
|
|
71
72
|
fileMetadata.isContainer = true
|
|
72
73
|
fileMetadata.isBasicContainer = true
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-server",
|
|
3
3
|
"description": "Solid server on top of the file-system",
|
|
4
|
-
"version": "5.6.
|
|
4
|
+
"version": "5.6.19",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tim Berners-Lee",
|
|
7
7
|
"email": "timbl@w3.org"
|
|
@@ -45,6 +45,10 @@
|
|
|
45
45
|
"name": "Arne Hassel",
|
|
46
46
|
"email": "arne.hassel@inrupt.com",
|
|
47
47
|
"url": "https://icanhasweb.net/"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "Alain Bourgeois",
|
|
51
|
+
"url": "https://github.com/bourgeoa/"
|
|
48
52
|
}
|
|
49
53
|
],
|
|
50
54
|
"license": "MIT",
|
|
@@ -55,21 +59,21 @@
|
|
|
55
59
|
"homepage": "https://github.com/solid/node-solid-server",
|
|
56
60
|
"bugs": "https://github.com/solid/node-solid-server/issues",
|
|
57
61
|
"dependencies": {
|
|
62
|
+
"@fastify/busboy": "^1.0.0",
|
|
58
63
|
"@solid/acl-check": "^0.4.5",
|
|
59
64
|
"@solid/oidc-auth-manager": "^0.24.1",
|
|
60
65
|
"@solid/oidc-op": "0.11.5",
|
|
61
66
|
"async-lock": "^1.3.0",
|
|
62
|
-
"body-parser": "^1.19.
|
|
67
|
+
"body-parser": "^1.19.1",
|
|
63
68
|
"bootstrap": "^3.4.1",
|
|
64
|
-
"busboy": "^0.3.1",
|
|
65
69
|
"cached-path-relative": "^1.0.2",
|
|
66
70
|
"camelize": "^1.0.0",
|
|
67
71
|
"cheerio": "^1.0.0-rc.10",
|
|
68
72
|
"colorette": "^2.0.16",
|
|
69
73
|
"commander": "^8.3.0",
|
|
70
74
|
"cors": "^2.8.5",
|
|
71
|
-
"debug": "^4.3.
|
|
72
|
-
"express": "^4.17.
|
|
75
|
+
"debug": "^4.3.3",
|
|
76
|
+
"express": "^4.17.2",
|
|
73
77
|
"express-handlebars": "^5.3.4",
|
|
74
78
|
"express-session": "^1.17.2",
|
|
75
79
|
"extend": "^3.0.2",
|
|
@@ -85,15 +89,16 @@
|
|
|
85
89
|
"ip-range-check": "0.2.0",
|
|
86
90
|
"is-ip": "^3.1.0",
|
|
87
91
|
"li": "^1.3.0",
|
|
88
|
-
"mashlib": "^1.7.
|
|
92
|
+
"mashlib": "^1.7.17",
|
|
89
93
|
"mime-types": "^2.1.34",
|
|
90
94
|
"negotiator": "^0.6.2",
|
|
91
95
|
"node-fetch": "^2.6.6",
|
|
92
96
|
"node-forge": "^0.10.0",
|
|
93
|
-
"
|
|
97
|
+
"node-mailer": "^0.1.1",
|
|
98
|
+
"nodemailer": "^6.7.2",
|
|
94
99
|
"oidc-op-express": "^0.0.3",
|
|
95
100
|
"owasp-password-strength-test": "^1.3.0",
|
|
96
|
-
"rdflib": "^2.2.
|
|
101
|
+
"rdflib": "^2.2.17",
|
|
97
102
|
"recursive-readdir": "^2.2.2",
|
|
98
103
|
"request": "^2.88.2",
|
|
99
104
|
"rimraf": "^3.0.2",
|
|
@@ -118,14 +123,14 @@
|
|
|
118
123
|
"eslint": "^7.32.0",
|
|
119
124
|
"localstorage-memory": "1.0.3",
|
|
120
125
|
"mocha": "9.1.3",
|
|
121
|
-
"nock": "13.1
|
|
126
|
+
"nock": "^13.2.1",
|
|
122
127
|
"node-mocks-http": "1.11.0",
|
|
123
128
|
"nyc": "15.1.0",
|
|
124
129
|
"pre-commit": "1.2.2",
|
|
125
130
|
"randombytes": "2.1.0",
|
|
126
131
|
"sinon": "12.0.1",
|
|
127
132
|
"sinon-chai": "3.7.0",
|
|
128
|
-
"snyk": "1.
|
|
133
|
+
"snyk": "^1.809.0",
|
|
129
134
|
"standard": "16.0.4",
|
|
130
135
|
"supertest": "6.1.6",
|
|
131
136
|
"turtle-validator": "1.1.1",
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<div class="row">
|
|
2
|
-
<div class="col-md-6">
|
|
3
|
-
<div class="panel panel-default">
|
|
4
|
-
<div class="panel-body">
|
|
5
|
-
<form method="post" action="/api/accounts/new" id="RegisterForm">
|
|
6
|
-
{{> shared/error}}
|
|
7
|
-
|
|
8
|
-
<div class="form-group">
|
|
9
|
-
<label class="control-label" for="username">Username*</label>
|
|
10
|
-
<input type="text" class="form-control" name="username" id="username" placeholder="alice"
|
|
11
|
-
required value="{{username}}"/>
|
|
12
|
-
|
|
13
|
-
{{#if multiuser}}
|
|
14
|
-
<p>Your username should be a lower-case word with only
|
|
15
|
-
letters a-z and numbers 0-9 and without periods.</p>
|
|
16
|
-
<p>Your public Solid POD URL will be:
|
|
17
|
-
<tt>https://<span class="editable-username">alice</span>.<script type="text/javascript">
|
|
18
|
-
document.write(window.location.host)
|
|
19
|
-
</script></tt></p>
|
|
20
|
-
<p>Your public Solid WebID will be:
|
|
21
|
-
<tt>https://<span class="editable-username">alice</span>.<script type="text/javascript">
|
|
22
|
-
document.write(window.location.host)
|
|
23
|
-
</script>/profile/card#me</tt></p>
|
|
24
|
-
|
|
25
|
-
<p>Your <em>POD URL</em> is like the homepage for your Solid
|
|
26
|
-
pod. By default, it is readable by the public, but you can
|
|
27
|
-
always change that if you like by changing the access
|
|
28
|
-
control.</p>
|
|
29
|
-
|
|
30
|
-
<p>Your <em>Solid WebID</em> is your globally unique name
|
|
31
|
-
that you can use to identify and authenticate yourself with
|
|
32
|
-
other PODs across the world.</p>
|
|
33
|
-
{{/if}}
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div class="form-group has-feedback">
|
|
38
|
-
<label class="control-label" for="password">Password*</label>
|
|
39
|
-
<input type="password" class="form-control control-progress{{#if disablePasswordStrengthCheck}} disable-password-strength-check{{/if}}" name="password" id="password" required/>
|
|
40
|
-
<span class="glyphicon glyphicon-remove form-control-feedback hidden" aria-hidden="true"></span>
|
|
41
|
-
<div class="progress">
|
|
42
|
-
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="4"></div>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="help-block"></div>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<div class="form-group has-feedback">
|
|
49
|
-
<label class="control-label" for="repeat_password">Repeat password*</label>
|
|
50
|
-
<input type="password" class="form-control" name="repeat_password" id="repeat_password" required/>
|
|
51
|
-
<span class="glyphicon glyphicon-remove form-control-feedback hidden"></span>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<div class="form-group">
|
|
56
|
-
<label class="control-label" for="name">Name*</label>
|
|
57
|
-
<input type="text" class="form-control" name="name" id="name" required value="{{name}}"/>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<div class="form-group">
|
|
61
|
-
<label class="control-label" for="email">Email*</label>
|
|
62
|
-
<input type="email" class="form-control" name="email" id="email" value="{{email}}"/>
|
|
63
|
-
<span class="help-block">Your email will only be used for account recovery</span>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
{{#if enforceToc}}
|
|
67
|
-
{{#if tocUri}}
|
|
68
|
-
<div class="checkbox">
|
|
69
|
-
<label>
|
|
70
|
-
<input type="checkbox" name="acceptToc" value="true" {{#if acceptToc}}checked{{/if}}>
|
|
71
|
-
I agree to the <a href="{{tocUri}}" target="_blank">Terms & Conditions</a> of this service
|
|
72
|
-
</label>
|
|
73
|
-
</div>
|
|
74
|
-
{{/if}}
|
|
75
|
-
{{/if}}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<button type="submit" class="btn btn-primary" id="register">Register</button>
|
|
79
|
-
|
|
80
|
-
<input type="hidden" name="returnToUrl" value="{{returnToUrl}}"/>
|
|
81
|
-
{{> auth/auth-hidden-fields}}
|
|
82
|
-
|
|
83
|
-
</form>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<!-- deprecated with inrupt/solid-client-auth
|
|
89
|
-
<div class="col-md-6">
|
|
90
|
-
<div class="panel panel-default panel-already-registered">
|
|
91
|
-
<div class="panel-body">
|
|
92
|
-
<h2>Already have an account?</h2>
|
|
93
|
-
<p>
|
|
94
|
-
<a class="btn btn-lg btn-success" href="{{{loginUrl}}}">
|
|
95
|
-
Please Log In
|
|
96
|
-
</a>
|
|
97
|
-
</p>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
--->
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<script src="/common/js/owasp-password-strength-test.js" defer></script>
|
|
105
|
-
<script src="/common/js/text-encoder-lite.min.js" defer></script>
|
|
106
|
-
<script src="/common/js/solid.js" defer></script>
|
|
107
|
-
|
|
108
|
-
<script>
|
|
109
|
-
var username = document.getElementById('username');
|
|
110
|
-
username.onkeyup = function() {
|
|
111
|
-
var list = document.getElementsByClassName('editable-username');
|
|
112
|
-
for (let item of list) {
|
|
113
|
-
item.innerHTML = username.value.toLowerCase()
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
window.addEventListener('DOMContentLoaded', function () {
|
|
118
|
-
var connect = document.getElementById('ConnectExternalWebId')
|
|
119
|
-
var container = document.getElementById('ExternalWebId')
|
|
120
|
-
container.classList.toggle('hidden', !connect.checked)
|
|
121
|
-
connect.addEventListener('change', function () {
|
|
122
|
-
container.classList.toggle('hidden', !connect.checked)
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
var form = document.getElementById('RegisterForm')
|
|
126
|
-
var externalWebIdField = document.getElementById('externalWebId')
|
|
127
|
-
form.addEventListener('submit', function () {
|
|
128
|
-
if (!connect.checked) {
|
|
129
|
-
externalWebIdField.value = ''
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
</script>
|
|
134
|
-
|