You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Separate commands to be entered (`bash` syntax to pop) and
returned output (`console` syntax to be muted), so that commands can be
copied via the clipboard icon directly. Closes#6
- Removed permission configuration advanced example temporarily given it wasn't
working.
- Documented more details of the workflow:
* how checking for running containers incurs a 30s delay
* how server must be stopped and started whenever invenio.cfg is changed
- Moved some small sections around for clarity and focus.
- Did a pass at all syntax highlighting in develop/ to make everything pop
as much as possible (jsx doesn't work so broken js was used for jsx 🤷)
We have reached the end of this journey, we are going to stop the instance. This will **NOT** destroy images, containers or volumes i.e. your data will be preserved.
6
+
7
+
```bash
8
+
^C
9
+
Stopping server and worker...
10
+
Server and worker stopped...
11
+
```
12
+
3
13
## Destroy the instance
4
14
5
-
Finally, we want to destroy it. This will take us to a clean state. Note that it destroys images, containers and volumes (the ones defined in the `february-release-2/docker-compose.full.yml`. ).
15
+
If you want to get to a clean state with no images, containers or volumes, then destroy the instance. This **WILL** permanently erase your volume data (database and Elasticsearch indices).
16
+
It destroys the images, containers and volumes defined in the `february-release-2/docker-compose.full.yml`.
6
17
7
-
Stop the application:
18
+
After stopping the application per above, destroy it:
When we set `RECORDS_PERMISSIONS_RECORD_POLICY = MyRecordPermissionPolicy`, we are overriding `RECORDS_PERMISSIONS_RECORD_POLICY` provided by [invenio-records-permissions](https://github.com/inveniosoftware/invenio-app-rdm). You will note that `invenio.cfg` is really just a Python module. How convenient!
30
+
And stop and start the server:
31
+
32
+
```bash
33
+
^C
34
+
Stopping server and worker...
35
+
Server and worker stopped...
36
+
```
37
+
```bash
38
+
invenio-cli run
39
+
```
40
+
41
+
!!! warning
42
+
Changes to `invenio.cfg`**MUST** be accompanied by a restart to be picked up. This only restarts the server; it does not destroy any data.
43
+
44
+
When we set `RECORDS_PERMISSIONS_RECORD_POLICY = MyRecordPermissionPolicy`, we are overriding `RECORDS_PERMISSIONS_RECORD_POLICY` provided by [invenio-records-permissions](https://github.com/inveniosoftware/invenio-records-permissions). You will note that `invenio.cfg` is really just a Python module. How convenient!
31
45
32
46
**Pro tip** : You can type `can_create = []` to achieve the same effect; any empty permission list only allows super users.
33
47
34
48
That's it configuration-wise. If we try to create a record through the API, your instance will check if you are a super user before allowing you. The same approach to configuration holds for any other setting you would like to override.
35
49
36
50
Did the changes work? We are going to try to create a new record:
As you can see, the server could not know if we are authenticated/superuser and rejected us:
111
125
112
-
```console
113
-
{"message":"The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.","status":401}
126
+
```json
127
+
{
128
+
"message": "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.",
129
+
"status": 401
130
+
}
114
131
```
115
132
116
-
**Advanced example**:
117
-
118
-
1- Create a user, for example using the web UI (*sign up* button). Alternatively, you can do so with the CLI, executing the following command (Wait until you read point number *2* before executing):
Note that the user will have ID 1 if it was the first one created.
125
-
126
-
2- Grant admin access to it. In order to do so, we only have to add the `-a` flag to the previous command:
127
-
128
-
```console
129
-
pipenv run invenio users create [email protected] -a --password=123456
130
-
```
131
-
132
-
Note that this user will have ID 2.
133
-
134
-
3- Get a token and try to create the record again. You can do so on the UI by going to `settings->applications-->new token`. Alternatively you can do it in the terminal by executing the following command:
135
-
136
-
```console
137
-
# TODO Wait until invenio-oauthclient REST only is integrated
138
-
```
139
-
140
-
Afterwards we can test if the new permissions are working correctly.
Copy file name to clipboardExpand all lines: docs/develop/customize.md
+33-11Lines changed: 33 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,26 @@ As we just saw, overriding configured values is an easy and common way of custom
4
4
5
5
## Update the logo
6
6
7
-
We are going to change the logo, take an *svg* file and update your **local** static files (You can use the [invenio color logo](https://github.com/inveniosoftware/invenio-theme/blob/master/invenio_theme/static/images/invenio-color.svg)):
7
+
We are going to change the logo. Take an *svg* file and copy it to your **local** static files. You can use the [invenio color logo](https://github.com/inveniosoftware/invenio-theme/raw/master/invenio_theme/static/images/invenio-color.svg):
Passing the `--no-install-js` option, skips re-installation of JS dependencies.
@@ -26,28 +33,26 @@ Go to the browser [*https://localhost:5000/*](https://localhost:5000) or refresh
26
33
!!! warning "That evil cache"
27
34
If you do not see it changing, check in an incognito window; the browser might have cached the logo.
28
35
29
-
Need further customizations? Have you thought of creating your own extensions? How to add them to your InvenioRDM instance is explained in the next section - [here](../extensions/custom.md).
30
-
31
36
## Change colors
32
37
33
38
You might also be wondering: *How do I change the colors so I can make my instance look like my institution's theme?*
34
39
35
40
We are going to change the top header section in the frontpage to apply our custom background color. Open the `assets/scss/<your instance shortname>/variables.scss` file and edit it as below:
36
41
37
-
```console
42
+
```scss
38
43
$navbar_background_image: unset;
39
44
$navbar_background_color: #000000; // Note this hex value is an example. Choose yours.
40
45
```
41
46
42
-
Then, run the `invenio-cli update` command as above and refresh the page! You should be able to see your top header's color changed! You can find all the available variables that you can change [here](https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/theme/assets/scss/invenio_app_rdm/variables.scss).
47
+
Then, run the `invenio-cli update` command as above and refresh the page! You should be able to see your top header's color changed! You can find all the available styling variables that you can change [here](https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/theme/assets/scss/invenio_app_rdm/variables.scss).
43
48
44
49
## Change search results
45
50
46
51
Changing how your results are presented in the search page is also something quite common.
47
52
48
53
We are going to update the search result template so we can show more text in the result's description. Create a file called `ResultsItemTemplate.jsx` inside `assets/templates/search` folder and then edit it as below:
49
54
50
-
```console
55
+
```js
51
56
importReactfrom'react';
52
57
import {Item} from'semantic-ui-react';
53
58
import_truncatefrom'lodash/truncate';
@@ -74,14 +79,14 @@ When you click on a search result, you navigate in the details page of a specifi
74
79
75
80
We are going to configure our instance to use our template for displaying the information in the record's landing page. Open the `invenio.cfg` file and add the below:
76
81
77
-
```console
82
+
```python
78
83
from invenio_rdm_records.config importRECORDS_UI_ENDPOINTS
@@ -90,3 +95,20 @@ Then, we create a file `my_record_landing_page.html` inside the `templates` fold
90
95
```
91
96
92
97
Inside the `page_body` block you can restructure the page as you want! You can check the default record landing page template [here](https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/theme/templates/invenio_rdm_records/record_landing_page.html).
98
+
99
+
Since we modified `invenio.cfg`, we need to re-start the server to see our changes take effect:
100
+
101
+
```bash
102
+
^C
103
+
Stopping server and worker...
104
+
Server and worker stopped...
105
+
```
106
+
```bash
107
+
invenio-cli run
108
+
```
109
+
110
+
## Change functionality
111
+
112
+
Need further customizations? Have you thought of creating your own extensions?
113
+
114
+
How to make an extension and add it to your InvenioRDM instance is explained in the [Extensions section](../extensions/custom.md).
0 commit comments