Updated README.md
parent
e62f440b65
commit
32764a90ed
68
README.md
68
README.md
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
A lot of configuration of your Strapi project is stored in the database. Like core_store, user permissions, user roles & webhooks. Things you might want to have the same on all environments. But when you update them locally, you will have to manually update them on all other environments too.
|
A lot of configuration of your Strapi project is stored in the database. Like core_store, user permissions, user roles & webhooks. Things you might want to have the same on all environments. But when you update them locally, you will have to manually update them on all other environments too.
|
||||||
|
|
||||||
That's where this plugin comes in to play. It allows you to export these configs as individual JSON files for each config, and write them somewhere in your project. With the configs written in your filesystem your can keep track of them through version control (git), and easily pull and import them across environments.
|
That's where this plugin comes in to play. It allows you to export these configs as individual JSON files for each config, and write them somewhere in your project. With the configs written in your filesystem you can keep track of them through version control (git), and easily pull and import them across environments.
|
||||||
|
|
||||||
Importing, exporting and keeping track of config changes is done in the admin page of the plugin.
|
Importing, exporting and keeping track of config changes is done in the admin page of the plugin.
|
||||||
|
|
||||||
|
@ -27,44 +27,51 @@ This way your app won't reload when you export the config in development.
|
||||||
|
|
||||||
admin: {
|
admin: {
|
||||||
auth: {
|
auth: {
|
||||||
...
|
// ...
|
||||||
},
|
},
|
||||||
watchIgnoreFiles: [
|
watchIgnoreFiles: [
|
||||||
'**/config-sync/files/**',
|
'**/config-sync/files/**',
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
Some settings for the plugin are able to be modified by creating a file `extensions/config-sync/config/config.json` and overwriting the default settings.
|
The settings of the plugin can be overridden in the `config/plugins.js` file.
|
||||||
|
In the example below you can see how, and also what the default settings are.
|
||||||
|
|
||||||
#### Default settings:
|
##### `config/plugins.js`:
|
||||||
{
|
module.exports = ({ env }) => ({
|
||||||
"destination": "extensions/config-sync/files/",
|
// ...
|
||||||
"minify": false,
|
'config-sync: {
|
||||||
"importOnBootstrap": false,
|
destination: "extensions/config-sync/files/",
|
||||||
"include": [
|
minify: false,
|
||||||
"core-store",
|
importOnBootstrap: false,
|
||||||
"role-permissions",
|
include: [
|
||||||
"webhooks"
|
"core-store",
|
||||||
],
|
"role-permissions"
|
||||||
"exclude": []
|
],
|
||||||
}
|
exclude: [
|
||||||
|
"core-store.plugin_users-permissions_grant"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
| Property | Default | Description |
|
// ...
|
||||||
| -------- | ------- | ----------- |
|
});
|
||||||
| destination | extensions/config-sync/files/ | The path for reading and writing the config JSON files. |
|
|
||||||
| minify | false | Setting to minify the JSON that's being exported. It defaults to false for better readability in git commits. |
|
| Property | Type | Description |
|
||||||
| importOnBootstrap | false | Allows you to let the config be imported automaticly when strapi is bootstrapping (on `yarn start`). This setting should only be used in production, and should be handled very carefully as it can unintendedly overwrite the changes in your database. PLEASE USE WITH CARE. |
|
| -------- | ---- | ----------- |
|
||||||
| include | ["core-store", "role-permissions", "webhooks"] | Configs you want to include. Allowed values: `core-store`, `role-permissions`, `webhooks`. |
|
| destination | string | The path for reading and writing the sync files. |
|
||||||
| exclude | [] | You might not want all your database config exported and managed in git. This settings allows you to add an array of config names which should not be tracked by the config-sync plugin. *Currently not working* |
|
| minify | bool | When enabled all the exported JSON files will be minified. |
|
||||||
|
| importOnBootstrap | bool | Allows you to let the config be imported automaticly when strapi is bootstrapping (on `strapi start`). This setting should only be used in production, and should be handled very carefully as it can unintendedly overwrite the changes in your database. PLEASE USE WITH CARE. |
|
||||||
|
| include | array | Configs types you want to include in the syncing process. Allowed values: `core-store`, `role-permissions`, `webhooks`. |
|
||||||
|
| exclude | array | Specify the names of configs you want to exclude from the syncing process. By default the API tokens for users-permissions, which are stored in core_store, are excluded. This setting expects the config names to comply with the naming convention. |
|
||||||
|
|
||||||
## Naming convention
|
## Naming convention
|
||||||
All the config files written in the file destination have the same naming convention. It goes as follows:
|
All the config files written in the file destination have the same naming convention. It goes as follows:
|
||||||
|
|
||||||
[config-type].[config-name].json
|
[config-type].[config-name].json
|
||||||
|
|
||||||
- `config-type` - Corresponds to the value in from the config.include setting.
|
- `config-type` - Corresponds to the value in from the include setting.
|
||||||
- `config-name` - The unique identifier of the config.
|
- `config-name` - The unique identifier of the config.
|
||||||
- For `core-store` config this is the `key` value.
|
- For `core-store` config this is the `key` value.
|
||||||
- For `role-permissions` config this is the `type` value.
|
- For `role-permissions` config this is the `type` value.
|
||||||
|
@ -78,7 +85,14 @@ All the config files written in the file destination have the same naming conven
|
||||||
- Exporting of EE roles & permissions
|
- Exporting of EE roles & permissions
|
||||||
- Add partial import/export functionality
|
- Add partial import/export functionality
|
||||||
- Add CLI commands for importing/exporting
|
- Add CLI commands for importing/exporting
|
||||||
- Track config deletions
|
- ~~Track config deletions~~
|
||||||
|
|
||||||
|
## ⭐️ Show your support
|
||||||
|
|
||||||
|
Give a star if this project helped you.
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
Shout out to [@ScottAgirs](https://github.com/ScottAgirs) for making [strapi-plugin-migrate](https://github.com/ijsto/strapi-plugin-migrate) as it was a big help while making the config-sync plugin.
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
|
@ -88,7 +102,3 @@ All the config files written in the file destination have the same naming conven
|
||||||
|
|
||||||
- [NPM package](https://www.npmjs.com/package/strapi-plugin-config-sync)
|
- [NPM package](https://www.npmjs.com/package/strapi-plugin-config-sync)
|
||||||
- [GitHub repository](https://github.com/boazpoolman/strapi-plugin-config-sync)
|
- [GitHub repository](https://github.com/boazpoolman/strapi-plugin-config-sync)
|
||||||
|
|
||||||
## ⭐️ Show your support
|
|
||||||
|
|
||||||
Give a star if this project helped you.
|
|
||||||
|
|
Loading…
Reference in New Issue