Support for bootstrapping was added in version 1.16.6
To support deployments in CI-CD or other automated environments, Veracity Learning can read a configuration file on startup that will configure users, LRSs, api keys, and more. This allows you to use version control to manage the state of your environment, and automatically provision LRSs or accounts when your containers start. The configuration should be defined as JSON, and the path to the json file provided on the commandline or in the .env file under the parameter "bootstrap".
Unless the value 'continue' is explicitly set to true, the server will shut down after processing the bootstrap file.
Objects will be created, but never modified. If an object exists already, the bootstrap script will not modify it. Objects will be validated with the JSON schema of the API. Check the OpenAPI documentation for explicit schemas.
The top level of the json file should export a single object, with a property "models". This property should contain an object, who's property names align with the API model names of the system level API. There is one special case, the 'lrs' object. These objects may contain an additional property 'models', in addition to the properties defined in the schema. The object defined in the models property mirrors the above structure, with each key name being a model name from the LRS level API.
The attached example file creates a super-admin user (with full system permissions), two LRSs, one with a basic auth xAPI access key and a forwarding route to the other. It also creates a system management API key which can be used with the REST API to further manage the system.
Example command line:
./lrs2-win.exe --bootstrap=./bootstrapTest.json --logLevel=debug --logSources=bootstrap --continue=false
Model Names
Models in both model objects are named by their internal names, not the routes used in the API. The table below maps API object names to internal object names.
System Level
Model name in API | Model name in bootstrap |
lrs | lrs |
apikey
| apikey |
user | user |
rateLimit | rateLimit |
plugins | pluginConfig |
LRS Level
Model name in API | Model name in bootstrap |
statementViewerReport | statementViewerReport |
statements | statement |
upstreams | upstreamLRS |
xapi-access-keys | key |
api-keys | apikey |
logs | clientLog |
embeddableCharts | embedableChart |
embeddableDashboards | embedableDashboard |
plugins | pluginConfig |
dashboards | customDashboard |
scripts | script |