Formatting

This commit is contained in:
Stuart Clements 2020-01-13 12:29:59 +01:00
parent 7b176d6ae8
commit 68f3dc824c

View File

@ -8,21 +8,24 @@ From release 1.8.0 onwards, user settings are configured separately from the sys
## Example Configuration Commands:
Add a new user in the local database:
**Add a new user in the local database:**
`curl -X PUT -u "<username>:<password>" -H "Content-Type: application/json" -ki <Harbor Server URL>/api/configurations -d'{"<item_name>":"<item_value>"}'`
Get the current configuration, run the following command:
**Get the current configuration:**
`curl -u "<username>:<password>" -H "Content-Type: application/json" -ki <Harbor Server URL>/api/configurations`
Update Harbor to use LDAP authentication:
**Update Harbor to use LDAP authentication:**
Command
```shell
curl -X PUT -u "<username>:<password>" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"auth_mode":"ldap_auth"}'
```
Output
```
HTTP/1.1 200 OK
Server: nginx
@ -33,14 +36,16 @@ Update Harbor to use LDAP authentication:
Set-Cookie: sid=a5803a1265e2b095cf65ce1d8bbd79b1; Path=/; HttpOnly
```
Restrict project creation to Harbor administrators:
**Restrict project creation to Harbor administrators:**
Command
```shell
curl -X PUT -u "<username>:<password>" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"project_creation_restriction":"adminonly"}'
```
Output
```
HTTP/1.1 200 OK
Server: nginx
@ -51,14 +56,16 @@ Restrict project creation to Harbor administrators:
Set-Cookie: sid=b7925eaf7af53bdefb13bdcae201a14a; Path=/; HttpOnly
```
Update the token expiration time:
**Update the token expiration time:**
Command
```shell
curl -X PUT -u "<username>:<password>" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"token_expiration":"300"}'
```
Output
```
HTTP/1.1 200 OK
Server: nginx