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:
Adler Faulkner
2022-03-10 01:16:05 -08:00
committed by GitHub
parent 44dd56d4f6
commit c8d4bfec39
19 changed files with 192 additions and 6 deletions

View File

@@ -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:

View File

@@ -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" }
]

View 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" },
}
]
}

View File

@@ -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": {

View File

@@ -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"
}
}
]
}

View File

@@ -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"
}
]
}