Data initialization
When shipping Casdoor as part of a larger product, preload organizations, applications, users, and other data so users get a working setup without manual configuration. Data initialization uses a JSON file that you provide or generate.
This page describes how to import and export configuration data.
Import
By default, Casdoor looks for init_data.json in the project root at startup and loads it if present. To use a different path, set initDataFile in conf/app.conf:
initDataFile = /path/to/your/init_data.json
A template is available at init_data.json.template. Copy and rename it to init_data.json and customize as needed.
Docker
Mount the file into the container with a volume:
docker run ... -v /path/to/init_data.json:/init_data.json