From 68f3dc824c201fc64f18db4e5fc2c6d76b5a4c99 Mon Sep 17 00:00:00 2001 From: Stuart Clements Date: Mon, 13 Jan 2020 12:29:59 +0100 Subject: [PATCH] Formatting --- .../configure_user_settings_cli.md | 101 ++++++++++-------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/docs/1.10/install_config/configure_user_settings_cli.md b/docs/1.10/install_config/configure_user_settings_cli.md index eceb93e4e..19f22f2be 100644 --- a/docs/1.10/install_config/configure_user_settings_cli.md +++ b/docs/1.10/install_config/configure_user_settings_cli.md @@ -8,66 +8,73 @@ 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 ":" -H "Content-Type: application/json" -ki /api/configurations -d'{"":""}'` -Get the current configuration, run the following command: +**Get the current configuration:** `curl -u ":" -H "Content-Type: application/json" -ki /api/configurations` -Update Harbor to use LDAP authentication: +**Update Harbor to use LDAP authentication:** - Command - ```shell - curl -X PUT -u ":" -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 - Date: Wed, 08 May 2019 08:22:02 GMT - Content-Type: text/plain; charset=utf-8 - Content-Length: 0 - Connection: keep-alive - Set-Cookie: sid=a5803a1265e2b095cf65ce1d8bbd79b1; Path=/; HttpOnly - ``` +Command -Restrict project creation to Harbor administrators: +```shell +curl -X PUT -u ":" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"auth_mode":"ldap_auth"}' +``` - Command - ```shell - curl -X PUT -u ":" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"project_creation_restriction":"adminonly"}' - ``` +Output - Output - ``` - HTTP/1.1 200 OK - Server: nginx - Date: Wed, 08 May 2019 08:24:32 GMT - Content-Type: text/plain; charset=utf-8 - Content-Length: 0 - Connection: keep-alive - Set-Cookie: sid=b7925eaf7af53bdefb13bdcae201a14a; Path=/; HttpOnly - ``` +``` +HTTP/1.1 200 OK +Server: nginx +Date: Wed, 08 May 2019 08:22:02 GMT +Content-Type: text/plain; charset=utf-8 +Content-Length: 0 +Connection: keep-alive +Set-Cookie: sid=a5803a1265e2b095cf65ce1d8bbd79b1; Path=/; HttpOnly +``` -Update the token expiration time: +**Restrict project creation to Harbor administrators:** - Command - ```shell - curl -X PUT -u ":" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"token_expiration":"300"}' - ``` +Command - Output - ``` - HTTP/1.1 200 OK - Server: nginx - Date: Wed, 08 May 2019 08:23:38 GMT - Content-Type: text/plain; charset=utf-8 - Content-Length: 0 - Connection: keep-alive - Set-Cookie: sid=cc1bc93ffa2675253fc62b4bf3d9de0e; Path=/; HttpOnly - ``` +```shell +curl -X PUT -u ":" -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 +Date: Wed, 08 May 2019 08:24:32 GMT +Content-Type: text/plain; charset=utf-8 +Content-Length: 0 +Connection: keep-alive +Set-Cookie: sid=b7925eaf7af53bdefb13bdcae201a14a; Path=/; HttpOnly +``` + +**Update the token expiration time:** + +Command + +```shell +curl -X PUT -u ":" -H "Content-Type: application/json" -ki https://harbor.sample.domain/api/configurations -d'{"token_expiration":"300"}' +``` + +Output + +``` +HTTP/1.1 200 OK +Server: nginx +Date: Wed, 08 May 2019 08:23:38 GMT +Content-Type: text/plain; charset=utf-8 +Content-Length: 0 +Connection: keep-alive +Set-Cookie: sid=cc1bc93ffa2675253fc62b4bf3d9de0e; Path=/; HttpOnly +``` ## Harbor user settings