A set of tools for using directus in real world projects. Managing roles, permissions, flows and operations as code.
- Save roles and permissions into files in JSON format
- Load roles and permissions from JSON files into a directus instance.
- Save flows and operations into files in JSON format
- Load flows and operations from JSON files into a directus intance.
The idea is to keep the settings in the Directus admin APP into human readable JSON files, so it can be version controlled and re-deployed.
For testing purpose, we start directus locally using docker.
cd test
docker compose up
-
Open browser and visit http://localhost:8055/ , with user name
admin@example.com
and passwordd1r3ctu5
. -
Set a static token for admin user. In my case, the token is
GNuG2xodzTMY19AaYh0r7yYNWSqWF-AE
change current directory to src and run python load_roles.py
change current directory to src and run python save_roles.py
change current directory to src and run python save_flows.py
the script will try to save all the flows into a directory configured in the config.ini file. Please make sure you set the correct url and token for dirctus, in the config.ini file. You can take config.ini.sample as an example.
change current directory to src and run python load_flows.py
the script will try to load all the flows from a directory configured in the config.ini file.