Skip to content

Commit 59ec504

Browse files
authored
Merge branch 'main' into tag-v5.7.10
2 parents 0e0b3ae + 19ba5e5 commit 59ec504

Some content is hidden

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

58 files changed

+8630
-7030
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,26 @@ jobs:
2121
os: [ubuntu-latest]
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
25+
26+
# extract repository name
27+
- if: github.event_name == 'pull_request'
28+
run: echo "REPO_NAME=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV
29+
30+
- if: github.event_name != 'pull_request'
31+
run: echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
32+
2533
# extract branch name
2634
- if: github.event_name == 'pull_request'
2735
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
36+
2837
- if: github.event_name != 'pull_request'
2938
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
3039

40+
# print repository name
41+
- name: Get repository name
42+
run: echo 'The repository name is' $REPO_NAME
43+
3144
# print branch name
3245
- name: Get branch name
3346
run: echo 'The branch name is' $BRANCH_NAME
@@ -40,12 +53,12 @@ jobs:
4053
# test code
4154
- run: npm run standard
4255
- run: npm run validate
43-
- run: npm run nyc
56+
- run: npm run c8
4457
# Test global install of the package
4558
- run: npm pack .
4659
- run: npm install -g solid-server-*.tgz
4760
# Run the Solid test-suite
48-
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME
61+
- run: bash test/surface/run-solid-test-suite.sh $BRANCH_NAME $REPO_NAME
4962

5063
# TODO: The pipeline should automate publication to npm, so that the docker build gets the correct version
5164
# This job will only dockerize solid-server@latest / solid-server@<tag-name> from npmjs.com!
@@ -56,7 +69,7 @@ jobs:
5669
runs-on: ubuntu-latest
5770
steps:
5871

59-
- uses: actions/checkout@v2
72+
- uses: actions/checkout@v4
6073

6174
- uses: olegtarasov/[email protected]
6275
id: tagName

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Your users will have a dedicated folder under `./data` at `./data/<username>.<yo
138138
> 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.
139139
140140
also add to `config.json`
141-
```
141+
```
142142
"useEmail": true,
143143
"emailHost": "smtp.gmail.com",
144144
"emailPort": "465",
@@ -206,6 +206,7 @@ $ solid start --help
206206
--multiuser Enable multi-user mode
207207
--idp [value] Obsolete; use --multiuser
208208
--no-live Disable live support through WebSockets
209+
--no-prep Disable Per Resource Events
209210
--proxy [value] Obsolete; use --corsProxy
210211
--cors-proxy [value] Serve the CORS proxy on this path
211212
--suppress-data-browser Suppress provision of a data browser
@@ -271,7 +272,7 @@ docker run -p 8443:8443 --name solid node-solid-server
271272

272273

273274
This will enable you to login to solid on https://localhost:8443 and then create a new account
274-
but not yet use that account. After a new account is made you will need to create an entry for
275+
but not yet use that account. After a new account is made you will need to create an entry for
275276
it in your local (/etc/)hosts file in line with the account and subdomain, i.e. --
276277

277278
```pre
@@ -280,16 +281,16 @@ it in your local (/etc/)hosts file in line with the account and subdomain, i.e.
280281

281282
You can modify the config within the docker container as follows:
282283

283-
- Copy the `config.json` to the current directory with:
284+
- Copy the `config.json` to the current directory with:
284285
```bash
285286
docker cp solid:/usr/src/app/config.json .
286287
```
287288
- Edit the `config.json` file
288-
- Copy the file back with
289+
- Copy the file back with
289290
```bash
290291
docker cp config.json solid:/usr/src/app/
291292
```
292-
- Restart the server with
293+
- Restart the server with
293294
```bash
294295
docker restart solid
295296
```

bin/lib/options.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ module.exports = [
143143
flag: true,
144144
default: false
145145
},
146+
{
147+
name: 'no-prep',
148+
help: 'Disable Per Resource Events',
149+
flag: true,
150+
default: false
151+
},
146152
// {
147153
// full: 'default-app',
148154
// help: 'URI to use as a default app for resources (default: https://linkeddata.github.io/warp/#/list/)'

bin/solid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#!/usr/bin/env node
1+
#!/usr/bin/env -S node --experimental-require-module
22
const startCli = require('./lib/cli')
33
startCli()

bin/solid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#!/usr/bin/env node
1+
#!/usr/bin/env -S node --experimental-require-module
22
const startCli = require('./lib/cli')
33
startCli()

common/js/index-buttons.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ document.addEventListener('DOMContentLoaded', async function() {
3030
// HIDE LOGIN BUTTON, ADD REGISTER BUTTON
3131
else {
3232
let loginArea = document.getElementById('loginStatusArea');
33-
let html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button">`
33+
let html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button" style="padding: 1em; border-radius:0.2em; font-size: 100%;margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;background-color: #efe;">`
3434
let span = document.createElement("span")
3535
span.innerHTML = html
3636
loginArea.appendChild(span);
@@ -41,4 +41,4 @@ document.addEventListener('DOMContentLoaded', async function() {
4141
signUpButton.style.display = "none";
4242
}
4343
}
44-
})
44+
})

default-templates/new-account/.well-known/.acl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
a acl:Authorization;
88
acl:agent <{{webId}}>;
99
acl:accessTo <./>;
10-
acl:defaultForNew <./>;
10+
acl:default <./>;
1111
acl:mode acl:Read, acl:Write, acl:Control.
1212

1313
# The public has read permissions
1414
<#public>
1515
a acl:Authorization;
1616
acl:agentClass foaf:Agent;
1717
acl:accessTo <./>;
18-
acl:defaultForNew <./>;
18+
acl:default <./>;
1919
acl:mode acl:Read.

docker-image/src/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine
1+
FROM node:20-alpine
22

33
# hadolint ignore=DL3018
44
RUN apk add --no-cache openssl

docker-image/test/test_image_foundations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def test_solid_home_dir_exists_and_owned_by_node(host):
2929
def test_node_command_is_available(host):
3030
assert host.exists("node")
3131

32-
def test_node_version_is_16(host):
33-
assert host.check_output("node --version").startswith('v16')
32+
def test_node_version_is_20(host):
33+
assert host.check_output("node --version").startswith('v20')
3434

3535
def test_openssl_command_is_available(host):
3636
assert host.exists("openssl")

lib/create-app.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ const ResourceMapper = require('./resource-mapper')
2828
const aclCheck = require('@solid/acl-check')
2929
const { version } = require('../package.json')
3030

31+
const acceptEvents = require('express-accept-events').default
32+
const events = require('express-negotiate-events').default
33+
const eventID = require('express-prep/event-id').default
34+
const prep = require('express-prep').default
35+
3136
const corsSettings = cors({
3237
methods: [
3338
'OPTIONS', 'HEAD', 'GET', 'PATCH', 'POST', 'PUT', 'DELETE'
@@ -61,6 +66,12 @@ function createApp (argv = {}) {
6166

6267
const app = express()
6368

69+
// Add PREP support
70+
if (argv.prep) {
71+
app.use(eventID)
72+
app.use(acceptEvents, events, prep)
73+
}
74+
6475
initAppLocals(app, argv, ldp)
6576
initHeaders(app)
6677
initViews(app, configPath)
@@ -115,7 +126,7 @@ function createApp (argv = {}) {
115126
}
116127

117128
// Attach the LDP middleware
118-
app.use('/', LdpMiddleware(corsSettings))
129+
app.use('/', LdpMiddleware(corsSettings, argv.prep))
119130

120131
// https://stackoverflow.com/questions/51741383/nodejs-express-return-405-for-un-supported-method
121132
app.use(function (req, res, next) {
@@ -168,6 +179,7 @@ function initAppLocals (app, argv, ldp) {
168179
app.locals.enforceToc = argv.enforceToc
169180
app.locals.tocUri = argv.tocUri
170181
app.locals.disablePasswordChecks = argv.disablePasswordChecks
182+
app.locals.prep = argv.prep
171183

172184
if (argv.email && argv.email.host) {
173185
app.locals.emailService = new EmailService(argv.templates.email, argv.email)
@@ -287,7 +299,7 @@ function initWebId (argv, app, ldp) {
287299
initAuthentication(app, argv)
288300

289301
if (argv.multiuser) {
290-
app.use(vhost('*', LdpMiddleware(corsSettings)))
302+
app.use(vhost('*', LdpMiddleware(corsSettings, argv.prep)))
291303
}
292304
}
293305

0 commit comments

Comments
 (0)