mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Support seeding pods and accounts
* feat(seeding): seed accounts and pods with seeded-pod-config.json * feat(seeding): dry up SeededPodInitializer by using RegistrationManager directly and make compatible with version/3.0.0 * feat(seeding): update seed config files to version 3.0.0 context * feat(seeding): simplify seeded-root config by importing pre-existing prefilled-root config * feat(seeding): Add seeding as a default initializer, update seeded pod copy and guide, change seeded pod config to array * feat(seeding): remove template info from seeded pod guide, use mockFs, code style nit, fix redlock test * feat(seeding): remove old config file
This commit is contained in:
@@ -10,7 +10,7 @@ it is always possible to not choose any of them and create your own custom versi
|
||||
|
||||
# How to use
|
||||
The easiest way to create a new config is by creating a JSON-LD file
|
||||
that imports one option from every component subfolder
|
||||
that imports one option from every component subfolder
|
||||
(such as either `allow-all.json` or `webacl.json` from `ldp/authorization`).
|
||||
In case none of the available options suffice, there are 2 other ways to handle this:
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"files-scs:config/app/init/initializers/base-url.json",
|
||||
"files-scs:config/app/init/initializers/logger.json",
|
||||
"files-scs:config/app/init/initializers/server.json",
|
||||
"files-scs:config/app/init/initializers/seeded-pod.json",
|
||||
"files-scs:config/app/init/initializers/version.json"
|
||||
],
|
||||
"@graph": [
|
||||
@@ -15,6 +16,7 @@
|
||||
{ "@id": "urn:solid-server:default:LoggerInitializer" },
|
||||
{ "@id": "urn:solid-server:default:BaseUrlVerifier" },
|
||||
{ "@id": "urn:solid-server:default:ParallelInitializer" },
|
||||
{ "@id": "urn:solid-server:default:SeededPodInitializer" },
|
||||
{ "@id": "urn:solid-server:default:ServerInitializer" },
|
||||
{ "@id": "urn:solid-server:default:ModuleVersionVerifier" }
|
||||
]
|
||||
|
||||
23
config/app/init/initializers/seeded-pod.json
Normal file
23
config/app/init/initializers/seeded-pod.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/components/context.jsonld",
|
||||
"@graph": [
|
||||
{
|
||||
"comment": "Separate manager from the RegistrationHandler in case registration is disabled.",
|
||||
"@id": "urn:solid-server:default:SeededPodRegistrationManager",
|
||||
"@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" }
|
||||
},
|
||||
{
|
||||
"comment": "Initializer that instantiates all the seeded accounts and pods.",
|
||||
"@id": "urn:solid-server:default:SeededPodInitializer",
|
||||
"@type": "SeededPodInitializer",
|
||||
"registrationManager": { "@id": "urn:solid-server:default:SeededPodRegistrationManager" },
|
||||
"configFilePath": { "@id": "urn:solid-server:default:variable:seededPodConfigJson" },
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -57,6 +57,11 @@
|
||||
"requiresArg": true,
|
||||
"type": "string",
|
||||
"describe": "Path to the file that keeps track of dynamic Pod configurations."
|
||||
},
|
||||
"seededPodConfigJson": {
|
||||
"requiresArg": true,
|
||||
"type": "string",
|
||||
"describe": "Path to the file that will be used to seed pods."
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
|
||||
@@ -52,12 +52,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"CombinedSettingsResolver:_computers_key": "urn:solid-server:default:variable:AssetPathResolver",
|
||||
"CombinedSettingsResolver:_computers_key": "urn:solid-server:default:variable:podConfigJson",
|
||||
"CombinedSettingsResolver:_computers_value": {
|
||||
"@type": "AssetPathExtractor",
|
||||
"key": "podConfigJson",
|
||||
"defaultPath": "./pod-config.json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CombinedSettingsResolver:_computers_key": "urn:solid-server:default:variable:seededPodConfigJson",
|
||||
"CombinedSettingsResolver:_computers_value": {
|
||||
"@type": "AssetPathExtractor",
|
||||
"key": "seededPodConfigJson"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@
|
||||
"comment": "Path to the JSON file used to store configuration for dynamic pods.",
|
||||
"@id": "urn:solid-server:default:variable:podConfigJson",
|
||||
"@type": "Variable"
|
||||
},
|
||||
{
|
||||
"comment": "Path to the JSON file used to seed pods.",
|
||||
"@id": "urn:solid-server:default:variable:seededPodConfigJson",
|
||||
"@type": "Variable"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user