Skip to content

Commit

Permalink
Fix configuration import & export
Browse files Browse the repository at this point in the history
  • Loading branch information
backjonas committed Sep 21, 2023
1 parent 79bb8dd commit 9885e20
Show file tree
Hide file tree
Showing 45 changed files with 5,617 additions and 261 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,14 @@ yarn develop

## Loading and exporting settings

**NOTE:** When exporting your strapi config, make sure to remove the `plugin_users-permissions_grant` block, as it contains keycloak secrets.

The current production settings can be found in [strapiconfig.json](strapiconfig.json).

The settings can be loaded by running
The current production settings can be found in [config/sync](config/sync) and can be loaded by running

```
yarn strapi configuration:restore -f strapiconfig.json
yarn cs import
```

After updating the settings, the current configuration can be dumped with
After updating the settings, the stored configuration can be updated with

```
yarn strapi configuration:dump
yarn cs export
```
11 changes: 6 additions & 5 deletions config/admin.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
export default ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),
secret: env("ADMIN_JWT_SECRET"),
},
apiToken: {
salt: env('API_TOKEN_SALT'),
salt: env("API_TOKEN_SALT"),
},
transfer: {
token: {
salt: env('TRANSFER_TOKEN_SALT'),
}
}
salt: env("TRANSFER_TOKEN_SALT"),
},
},
watchIgnoreFiles: ["**/config/sync/**"],
});
83 changes: 83 additions & 0 deletions config/sync/admin-role.strapi-author.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "Author",
"code": "strapi-author",
"description": "Authors can manage the content they have created.",
"permissions": [
{
"action": "plugin::content-manager.explorer.create",
"subject": "api::homepage.homepage",
"properties": {
"fields": [
"footer.nationlogos.url",
"footer.nationlogos.image",
"footer.nationlogos.name"
]
},
"conditions": [
"admin::is-creator"
]
},
{
"action": "plugin::content-manager.explorer.read",
"subject": "api::homepage.homepage",
"properties": {
"fields": [
"footer.nationlogos.url",
"footer.nationlogos.image",
"footer.nationlogos.name"
]
},
"conditions": [
"admin::is-creator"
]
},
{
"action": "plugin::content-manager.explorer.update",
"subject": "api::homepage.homepage",
"properties": {
"fields": [
"footer.nationlogos.url",
"footer.nationlogos.image",
"footer.nationlogos.name"
]
},
"conditions": [
"admin::is-creator"
]
},
{
"action": "plugin::upload.assets.copy-link",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.assets.create",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.assets.download",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.assets.update",
"subject": null,
"properties": {},
"conditions": [
"admin::is-creator"
]
},
{
"action": "plugin::upload.read",
"subject": null,
"properties": {},
"conditions": [
"admin::is-creator"
]
}
]
}
73 changes: 73 additions & 0 deletions config/sync/admin-role.strapi-editor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "Editor",
"code": "strapi-editor",
"description": "Editors can manage and publish contents including those of other users.",
"permissions": [
{
"action": "plugin::content-manager.explorer.create",
"subject": "api::homepage.homepage",
"properties": {
"fields": [
"footer.nationlogos.url",
"footer.nationlogos.image",
"footer.nationlogos.name"
]
},
"conditions": []
},
{
"action": "plugin::content-manager.explorer.read",
"subject": "api::homepage.homepage",
"properties": {
"fields": [
"footer.nationlogos.url",
"footer.nationlogos.image",
"footer.nationlogos.name"
]
},
"conditions": []
},
{
"action": "plugin::content-manager.explorer.update",
"subject": "api::homepage.homepage",
"properties": {
"fields": [
"footer.nationlogos.url",
"footer.nationlogos.image",
"footer.nationlogos.name"
]
},
"conditions": []
},
{
"action": "plugin::upload.assets.copy-link",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.assets.create",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.assets.download",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.assets.update",
"subject": null,
"properties": {},
"conditions": []
},
{
"action": "plugin::upload.read",
"subject": null,
"properties": {},
"conditions": []
}
]
}
Loading

0 comments on commit 9885e20

Please sign in to comment.