Skip to content

Commit

Permalink
Merge 3a351c7 into 4241c53
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Dec 16, 2021
2 parents 4241c53 + 3a351c7 commit 1a1af43
Show file tree
Hide file tree
Showing 33 changed files with 777 additions and 285 deletions.
5 changes: 4 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
## v3.0.0
### New features
- The Identity Provider now uses the `webid` scope as required for Solid-OIDC.
- It is now possible to modify how CLI variables are parsed.

### Configuration changes
You might need to make changes to your v2 configuration if you use a custom config.

The following changes pertain to the imports in the default configs:
- ...
- There is a new configuration option that needs to be imported:
- `/app/variables/default/json` contains everything related to parsing CLI arguments
and assigning values to variables.

The following changes are relevant for v2 custom configs that replaced certain features.
- Conversion has been simplified so most converters are part of the conversion chain:
Expand Down
4 changes: 4 additions & 0 deletions config/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ Handles the setup page the first time the server is started.
* *optional*: Setup is available at `/setup` but the server can already be used.
Everyone can access the setup page so make sure to complete that as soon as possible.
* *required*: All requests will be redirected to the setup page until setup is completed.

## Variables
Handles parsing CLI parameters and assigning values to Components.js variables.
* *default*: Assigns CLI parameters for all variables defined in `/config/util/variables/default.json`
22 changes: 22 additions & 0 deletions config/app/variables/cli/cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Extracts CLI arguments into a key/value object",
"@id": "urn:solid-server-app-setup:default:CliExtractor",
"@type": "YargsCliExtractor",
"parameters": {
"loggingLevel": { "alias": "l", "requiresArg": true, "type": "string" },
"baseUrl": { "alias": "b", "requiresArg": true, "type": "string" },
"port": { "alias": "p", "requiresArg": true, "type": "number" },
"rootFilePath": { "alias": "f", "requiresArg": true, "type": "string" },
"showStackTrace": { "alias": "t", "type": "boolean" },
"sparqlEndpoint": { "alias": "s", "requiresArg": true, "type": "string" },
"podConfigJson": { "requiresArg": true, "type": "string" }
},
"options": {
"usage": "node ./bin/server.js [args]"
}
}
]
}
28 changes: 28 additions & 0 deletions config/app/variables/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/variables/cli/cli.json",
"files-scs:config/app/variables/resolver/resolver.json"
],
"@graph": [
{
"comment": "Combines a CliExtractor and VariableResolver to be used by the AppRunner.",
"@id": "urn:solid-server-app-setup:default:CliResolver",
"@type": "RecordObject",
"record": [
{
"RecordObject:_record_key": "extractor",
"RecordObject:_record_value": {
"@id": "urn:solid-server-app-setup:default:CliExtractor"
}
},
{
"RecordObject:_record_key": "resolver",
"RecordObject:_record_value": {
"@id": "urn:solid-server-app-setup:default:VariableResolver"
}
}
]
}
]
}
65 changes: 65 additions & 0 deletions config/app/variables/resolver/resolver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^2.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Converts an input key/value object into an object mapping values to Components.js variables",
"@id": "urn:solid-server-app-setup:default:VariableResolver",
"@type": "ComputerResolver",
"computers": [
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:baseUrl",
"ComputerResolver:_computers_value": {
"@type": "BaseUrlComputer"
}
},
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:loggingLevel",
"ComputerResolver:_computers_value": {
"@type": "ArgExtractor",
"key": "loggingLevel",
"defaultValue": "info"
}
},
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:port",
"ComputerResolver:_computers_value": {
"@type": "ArgExtractor",
"key": "port",
"defaultValue": 3000
}
},
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:rootFilePath",
"ComputerResolver:_computers_value": {
"@type": "AssetPathResolver",
"key": "rootFilePath",
"defaultPath": "./"
}
},
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:sparqlEndpoint",
"ComputerResolver:_computers_value": {
"@type": "ArgExtractor",
"key": "sparqlEndpoint"
}
},
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:showStackTrace",
"ComputerResolver:_computers_value": {
"@type": "ArgExtractor",
"key": "showStackTrace",
"defaultValue": false
}
},
{
"ComputerResolver:_computers_key": "urn:solid-server:default:variable:AssetPathResolver",
"ComputerResolver:_computers_value": {
"@type": "AssetPathResolver",
"key": "podConfigJson",
"defaultPath": "./pod-config.json"
}
}
]
}
]
}
1 change: 1 addition & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/initialize-prefilled-root.json",
"files-scs:config/app/setup/optional.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/dynamic.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/example-https-file.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",

Expand Down
1 change: 1 addition & 0 deletions config/file-no-setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/initialize-root.json",
"files-scs:config/app/setup/disabled.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/memory-subdomains.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/initialize-root.json",
"files-scs:config/app/setup/optional.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/path-routing.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/initialize-root.json",
"files-scs:config/app/setup/disabled.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/restrict-idp.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/disabled.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/sparql-endpoint-no-setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/initialize-root.json",
"files-scs:config/app/setup/disabled.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
1 change: 1 addition & 0 deletions config/sparql-endpoint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.json",
"files-scs:config/app/variables/default.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
Expand Down
2 changes: 1 addition & 1 deletion config/util/variables/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@type": "Variable"
},
{
"comment": "Needs to be set to the base URL of the server for authnetication and authorization to function.",
"comment": "Needs to be set to the base URL of the server for authentication and authorization to function.",
"@id": "urn:solid-server:default:variable:baseUrl",
"@type": "Variable"
},
Expand Down
14 changes: 14 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ export * from './init/final/ParallelFinalizer';
// Init/Setup
export * from './init/setup/SetupHttpHandler';

// Init/Cli
export * from './init/cli/CliExtractor';
export * from './init/cli/YargsCliExtractor';

// Init/Variables/Computers
export * from './init/variables/computers/ArgExtractor';
export * from './init/variables/computers/AssetPathResolver';
export * from './init/variables/computers/BaseUrlComputer';
export * from './init/variables/computers/ValueComputer';

// Init/Variables
export * from './init/variables/ComputerResolver';
export * from './init/variables/VariableResolver';

// Init
export * from './init/App';
export * from './init/AppRunner';
Expand Down
Loading

0 comments on commit 1a1af43

Please sign in to comment.