Skip to content

Commit

Permalink
Merge dff0334 into cfa7001
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed Sep 27, 2021
2 parents cfa7001 + dff0334 commit 3a388a0
Show file tree
Hide file tree
Showing 72 changed files with 2,463 additions and 852 deletions.
13 changes: 12 additions & 1 deletion config/app/README.md
Expand Up @@ -8,4 +8,15 @@ This is the entry point to the main server setup.

## Init
Contains a list of initializer that need to be run when starting the server.
* *default*: The default setup that makes sure the root container has the necessary resources.
* *default*: The default setup. The ParallelHandler can be used to add custom Initializers.
* *initialize-root*: Makes sure the root container has the necessary resources to function properly.
This is only relevant if setup is disabled but root container access is still required.
* *initialize-prefilled-root*: Similar to `initialize-root` but adds some introductory resources to the root container.

## Setup
Handles the setup page the first time the server is started.
* *disabled*: Disables the setup page. Root container access will be impossible unless handled by the Init config above.
Registration and pod creation is still possible if that feature is enabled.
* *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.
8 changes: 5 additions & 3 deletions config/app/init/default.json
@@ -1,16 +1,18 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/init/base/init.json",
"files-scs:config/app/init/initializers/root.json"
"files-scs:config/app/init/base/init.json"
],
"@graph": [
{
"comment": "These handlers are called whenever the server is started, and can be used to ensure that all necessary resources for booting are available.",
"@id": "urn:solid-server:default:ParallelInitializer",
"@type": "ParallelHandler",
"handlers": [
{ "@id": "urn:solid-server:default:RootInitializer" }
{
"comment": "This handler is here because having this array empty gives Components.js errors.",
"@type": "StaticHandler"
}
]
}
]
Expand Down
17 changes: 17 additions & 0 deletions config/app/init/initialize-prefilled-root.json
@@ -0,0 +1,17 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/init/base/init.json",
"files-scs:config/app/init/initializers/prefilled-root.json"
],
"@graph": [
{
"comment": "These handlers are called whenever the server is started, and can be used to ensure that all necessary resources for booting are available.",
"@id": "urn:solid-server:default:ParallelInitializer",
"@type": "ParallelHandler",
"handlers": [
{ "@id": "urn:solid-server:default:RootInitializer" }
]
}
]
}
17 changes: 17 additions & 0 deletions config/app/init/initialize-root.json
@@ -0,0 +1,17 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/init/base/init.json",
"files-scs:config/app/init/initializers/root.json"
],
"@graph": [
{
"comment": "These handlers are called whenever the server is started, and can be used to ensure that all necessary resources for booting are available.",
"@id": "urn:solid-server:default:ParallelInitializer",
"@type": "ParallelHandler",
"handlers": [
{ "@id": "urn:solid-server:default:RootInitializer" }
]
}
]
}
18 changes: 18 additions & 0 deletions config/app/init/initializers/prefilled-root.json
@@ -0,0 +1,18 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Makes sure the root container exists and contains the necessary resources.",
"@id": "urn:solid-server:default:RootInitializer",
"@type": "RootInitializer",
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"store": { "@id": "urn:solid-server:default:ResourceStore" },
"generator": {
"@type": "TemplatedResourcesGenerator",
"templateFolder": "@css:templates/root/prefilled",
"factory": { "@type": "ExtensionBasedMapperFactory" },
"templateEngine": { "@type": "HandlebarsTemplateEngine" }
}
}
]
}
2 changes: 1 addition & 1 deletion config/app/init/initializers/root.json
Expand Up @@ -9,7 +9,7 @@
"store": { "@id": "urn:solid-server:default:ResourceStore" },
"generator": {
"@type": "TemplatedResourcesGenerator",
"templateFolder": "@css:templates/root",
"templateFolder": "@css:templates/root/empty",
"factory": { "@type": "ExtensionBasedMapperFactory" },
"templateEngine": { "@type": "HandlebarsTemplateEngine" }
}
Expand Down
13 changes: 13 additions & 0 deletions config/app/setup/disabled.json
@@ -0,0 +1,13 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/init/initializers/root.json"
],
"@graph": [
{
"comment": "Completely disables the setup page.",
"@id": "urn:solid-server:default:SetupHandler",
"@type": "UnsupportedAsyncHandler"
}
]
}
14 changes: 14 additions & 0 deletions config/app/setup/handlers/redirect.json
@@ -0,0 +1,14 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"@graph": [
{
"comment": "Redirects all request to the setup.",
"@id": "urn:solid-server:default:SetupRedirectHandler",
"@type": "RedirectAllHttpHandler",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_target": "/setup",
"args_targetExtractor": { "@id": "urn:solid-server:default:TargetExtractor" },
"args_responseWriter": { "@id": "urn:solid-server:default:ResponseWriter" }
},
]
}
34 changes: 34 additions & 0 deletions config/app/setup/handlers/setup.json
@@ -0,0 +1,34 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/init/initializers/root.json"
],
"@graph": [
{
"comment": "Handles everything related to the first-time server setup.",
"@id": "urn:solid-server:default:SetupHttpHandler",
"@type": "SetupHttpHandler",
"args_requestParser": { "@id": "urn:solid-server:default:RequestParser" },
"args_errorHandler": { "@id": "urn:solid-server:default:ErrorHandler" },
"args_responseWriter": { "@id": "urn:solid-server:default:ResponseWriter" },
"args_initializer": { "@id": "urn:solid-server:default:RootInitializer" },
"args_registrationManager": { "@id": "urn:solid-server:default:SetupRegistrationManager" },
"args_converter": { "@id": "urn:solid-server:default:RepresentationConverter" },
"args_storageKey": "setupCompleted-1.0",
"args_storage": { "@id": "urn:solid-server:default:SetupStorage" },
"args_viewTemplate": "@css:templates/setup/index.html.ejs",
"args_responseTemplate": "@css:templates/setup/response.html.ejs"
},
{
"comment": "Separate manager from the RegistrationHandler in case registration is disabled.",
"@id": "urn:solid-server:default:SetupRegistrationManager",
"@type": "RegistrationManager",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_webIdSuffix": "/profile/card#me",
"args_identifierGenerator": { "@id": "urn:solid-server:default:IdentifierGenerator" },
"args_ownershipValidator": { "@id": "urn:solid-server:auth:password:OwnershipValidator" },
"args_accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" },
"args_podManager": { "@id": "urn:solid-server:default:PodManager" }
}
]
}
24 changes: 24 additions & 0 deletions config/app/setup/optional.json
@@ -0,0 +1,24 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/setup/handlers/setup.json"
],
"@graph": [
{
"comment": "Combines both the redirect and the setup.",
"@id": "urn:solid-server:default:SetupHandler",
"@type": "ConditionalHandler",
"storageKey": "setupCompleted-1.0",
"storageValue": true,
"storage": { "@id": "urn:solid-server:default:SetupStorage" },
"source": {
"@type": "RouterHandler",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_targetExtractor": { "@id": "urn:solid-server:default:TargetExtractor" },
"args_allowedMethods": [ "*" ],
"args_allowedPathNames": [ "/setup" ],
"args_handler": { "@id": "urn:solid-server:default:SetupHttpHandler" }
}
}
]
}
31 changes: 31 additions & 0 deletions config/app/setup/required.json
@@ -0,0 +1,31 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/setup/handlers/redirect.json",
"files-scs:config/app/setup/handlers/setup.json"
],
"@graph": [
{
"comment": "Combines both the redirect and the setup.",
"@id": "urn:solid-server:default:SetupHandler",
"@type": "ConditionalHandler",
"storageKey": "setupCompleted-1.0",
"storageValue": true,
"storage": { "@id": "urn:solid-server:default:SetupStorage" },
"source": {
"@type": "WaterfallHandler",
"handlers": [
{ "@id": "urn:solid-server:default:SetupRedirectHandler" },
{
"@type": "RouterHandler",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_targetExtractor": { "@id": "urn:solid-server:default:TargetExtractor" },
"args_allowedMethods": [ "*" ],
"args_allowedPathNames": [ "/setup" ],
"args_handler": { "@id": "urn:solid-server:default:SetupHttpHandler" }
}
]
}
}
]
}
3 changes: 2 additions & 1 deletion config/default.json
Expand Up @@ -2,7 +2,8 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/init/initialize-prefilled-root.json",
"files-scs:config/app/setup/optional.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
Expand Up @@ -3,6 +3,7 @@
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.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
Expand Up @@ -3,6 +3,7 @@
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.json",
"files-scs:config/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",

Expand Down
38 changes: 38 additions & 0 deletions config/file-no-setup.json
@@ -0,0 +1,38 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"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/http/handler/default.json",
"files-scs:config/http/middleware/websockets.json",
"files-scs:config/http/server-factory/websockets.json",
"files-scs:config/http/static/default.json",
"files-scs:config/identity/email/default.json",
"files-scs:config/identity/handler/default.json",
"files-scs:config/identity/ownership/token.json",
"files-scs:config/identity/pod/static.json",
"files-scs:config/identity/registration/enabled.json",
"files-scs:config/ldp/authentication/dpop-bearer.json",
"files-scs:config/ldp/authorization/webacl.json",
"files-scs:config/ldp/handler/default.json",
"files-scs:config/ldp/metadata-parser/default.json",
"files-scs:config/ldp/metadata-writer/default.json",
"files-scs:config/ldp/permissions/acl.json",
"files-scs:config/storage/backend/file.json",
"files-scs:config/storage/key-value/resource-store.json",
"files-scs:config/storage/middleware/default.json",
"files-scs:config/util/auxiliary/acl.json",
"files-scs:config/util/identifiers/suffix.json",
"files-scs:config/util/index/default.json",
"files-scs:config/util/logging/winston.json",
"files-scs:config/util/representation-conversion/default.json",
"files-scs:config/util/resource-locker/memory.json",
"files-scs:config/util/variables/default.json"
],
"@graph": [
{
"comment": "A single-pod server that stores its resources on disk."
}
]
}
1 change: 1 addition & 0 deletions config/file.json
Expand Up @@ -3,6 +3,7 @@
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/setup/required.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
4 changes: 4 additions & 0 deletions config/http/handler/default.json
@@ -1,5 +1,8 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/init/initializers/root.json"
],
"@graph": [
{
"comment": "These are all the handlers a request will go through until it is handled.",
Expand All @@ -11,6 +14,7 @@
"@type": "WaterfallHandler",
"handlers": [
{ "@id": "urn:solid-server:default:StaticAssetHandler" },
{ "@id": "urn:solid-server:default:SetupHandler" },
{ "@id": "urn:solid-server:default:IdentityProviderHandler" },
{ "@id": "urn:solid-server:default:LdpHandler" }
]
Expand Down
8 changes: 5 additions & 3 deletions config/identity/handler/default.json
Expand Up @@ -11,9 +11,11 @@
"comment": "Routes all IDP related requests to the relevant handlers.",
"@id": "urn:solid-server:default:IdentityProviderHandler",
"@type": "RouterHandler",
"allowedMethods": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"allowedPathNames": [ "^/idp/.*", "^/\\.well-known/openid-configuration" ],
"handler": { "@id": "urn:solid-server:default:IdentityProviderHttpHandler" }
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_targetExtractor": { "@id": "urn:solid-server:default:TargetExtractor" },
"args_allowedMethods": [ "*" ],
"args_allowedPathNames": [ "^/idp/.*", "^/\\.well-known/openid-configuration" ],
"args_handler": { "@id": "urn:solid-server:default:IdentityProviderHttpHandler" }
},
{
"@id": "urn:solid-server:default:IdentityProviderHttpHandler",
Expand Down
15 changes: 9 additions & 6 deletions config/identity/registration/route/registration.json
Expand Up @@ -20,12 +20,15 @@
},
"handler": {
"@type": "RegistrationHandler",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_webIdSuffix": "/profile/card#me",
"args_identifierGenerator": { "@id": "urn:solid-server:default:IdentifierGenerator" },
"args_ownershipValidator": { "@id": "urn:solid-server:auth:password:OwnershipValidator" },
"args_accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" },
"args_podManager": { "@id": "urn:solid-server:default:PodManager" }
"registrationManager": {
"@type": "RegistrationManager",
"args_baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" },
"args_webIdSuffix": "/profile/card#me",
"args_identifierGenerator": { "@id": "urn:solid-server:default:IdentifierGenerator" },
"args_ownershipValidator": { "@id": "urn:solid-server:auth:password:OwnershipValidator" },
"args_accountStore": { "@id": "urn:solid-server:auth:password:AccountStore" },
"args_podManager": { "@id": "urn:solid-server:default:PodManager" }
}
}
}
]
Expand Down
1 change: 1 addition & 0 deletions config/ldp/handler/components/request-parser.json
Expand Up @@ -6,6 +6,7 @@
"@id": "urn:solid-server:default:RequestParser",
"@type": "BasicRequestParser",
"args_targetExtractor": {
"@id": "urn:solid-server:default:TargetExtractor",
"@type": "OriginalUrlExtractor",
"options_includeQueryString": false
},
Expand Down
3 changes: 2 additions & 1 deletion config/memory-subdomains.json
Expand Up @@ -2,7 +2,8 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/init/initialize-root.json",
"files-scs:config/app/setup/optional.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
3 changes: 2 additions & 1 deletion config/path-routing.json
Expand Up @@ -2,7 +2,8 @@
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^1.0.0/components/context.jsonld",
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
"files-scs:config/app/init/initialize-root.json",
"files-scs:config/app/setup/disabled.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

0 comments on commit 3a388a0

Please sign in to comment.