Commit 4ae7cb9a authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'doc_refactor_settings_api' into 'master'

Refactor settings API documentation



See merge request !2474
parents 6cab2e40 585e7f6e
# Application settings # Application settings
This API allows you to read and modify GitLab instance application settings. These API calls allow you to read and modify GitLab instance application
settings as appear in `/admin/application_settings`. You have to be an
administrator in order to perform this action.
## Get current application settings
## Get current application settings: List the current application settings of the GitLab instance.
``` ```
GET /application/settings GET /application/settings
``` ```
```bash
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/application/settings
```
Example response:
```json ```json
{ {
"id": 1, "default_projects_limit" : 10,
"default_projects_limit": 10, "signup_enabled" : true,
"signup_enabled": true, "id" : 1,
"signin_enabled": true, "default_branch_protection" : 2,
"gravatar_enabled": true, "restricted_visibility_levels" : [],
"sign_in_text": "", "signin_enabled" : true,
"created_at": "2015-06-12T15:51:55.432Z", "twitter_sharing_enabled" : true,
"updated_at": "2015-06-30T13:22:42.210Z", "after_sign_out_path" : null,
"home_page_url": "", "max_attachment_size" : 10,
"default_branch_protection": 2, "user_oauth_applications" : true,
"twitter_sharing_enabled": true, "updated_at" : "2016-01-04T15:44:55.176Z",
"restricted_visibility_levels": [], "session_expire_delay" : 10080,
"max_attachment_size": 10, "home_page_url" : null,
"session_expire_delay": 10080, "default_snippet_visibility" : 0,
"default_project_visibility": 0, "restricted_signup_domains" : [],
"default_snippet_visibility": 0, "created_at" : "2016-01-04T15:44:55.176Z",
"restricted_signup_domains": [], "default_project_visibility" : 0,
"user_oauth_applications": true, "gravatar_enabled" : true,
"after_sign_out_path": "" "sign_in_text" : null
} }
``` ```
## Change application settings: ## Change application settings
``` ```
PUT /application/settings PUT /application/settings
``` ```
Parameters: | Attribute | Type | Required | Description |
| --------- | ---- | :------: | ----------- |
- `default_projects_limit` - project limit per user | `default_projects_limit` | integer | no | Project limit per user. Default is `10` |
- `signup_enabled` - enable registration | `signup_enabled` | boolean | no | Enable registration. Default is `true`. |
- `signin_enabled` - enable login via GitLab account | `signin_enabled` | boolean | no | Enable login via a GitLab account. Default is `true`. |
- `gravatar_enabled` - enable gravatar | `gravatar_enabled` | boolean | no | Enable Gravatar |
- `sign_in_text` - text on login page | `sign_in_text` | string | no | Text on login page |
- `home_page_url` - redirect to this URL when not logged in | `home_page_url` | string | no | Redirect to this URL when not logged in |
- `default_branch_protection` - determine if developers can push to master | `default_branch_protection` | integer | no | Determine if developers can push to master. Can take `0` _(not protected, both developers and masters can push new commits, force push or delete the branch)_, `1` _(partially protected, developers can push new commits, but cannot force push or delete the branch, masters can do anything)_ or `2` _(fully protected, developers cannot push new commits, force push or delete the branch, masters can do anything)_ as a parameter. Default is `1`. |
- `twitter_sharing_enabled` - allow users to share project creation in twitter | `twitter_sharing_enabled` | boolean | no | Allow users to share project creation on Twitter |
- `restricted_visibility_levels` - restrict certain visibility levels | `restricted_visibility_levels` | array of integers | no | Selected levels cannot be used by non-admin users for projects or snippets. Can take `0` _(Private)_, `1` _(Internal)_ and `2` _(Public)_ as a parameter. Default is null which means there is no restriction. |
- `max_attachment_size` - limit attachment size | `max_attachment_size` | integer | no | Limit attachment size in MB |
- `session_expire_delay` - session lifetime | `session_expire_delay` | integer | no | Session duration in minutes. GitLab restart is required to apply changes |
- `default_project_visibility` - what visibility level new project receives | `default_project_visibility` | integer | no | What visibility level new projects receive. Can take `0` _(Private)_, `1` _(Internal)_ and `2` _(Public)_ as a parameter. Default is `0`.|
- `default_snippet_visibility` - what visibility level new snippet receives | `default_snippet_visibility` | integer | no | What visibility level new snippets receive. Can take `0` _(Private)_, `1` _(Internal)_ and `2` _(Public)_ as a parameter. Default is `0`.|
- `restricted_signup_domains` - force people to use only corporate emails for signup | `restricted_signup_domains` | array of strings | no | Force people to use only corporate emails for sign-up. Default is null, meaning there is no restriction. |
- `user_oauth_applications` - allow users to create oauth applications | `user_oauth_applications` | boolean | no | Allow users to register any application to use GitLab as an OAuth provider |
- `after_sign_out_path` - where redirect user after logout | `after_sign_out_path` | string | no | Where to redirect users after logout |
All parameters are optional. You can send only one that you want to change. ```bash
curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/application/settings?signup_enabled=false&default_project_visibility=1
```
Example response:
```json ```json
{ {
...@@ -79,7 +89,7 @@ All parameters are optional. You can send only one that you want to change. ...@@ -79,7 +89,7 @@ All parameters are optional. You can send only one that you want to change.
"restricted_visibility_levels": [], "restricted_visibility_levels": [],
"max_attachment_size": 10, "max_attachment_size": 10,
"session_expire_delay": 10080, "session_expire_delay": 10080,
"default_project_visibility": 0, "default_project_visibility": 1,
"default_snippet_visibility": 0, "default_snippet_visibility": 0,
"restricted_signup_domains": [], "restricted_signup_domains": [],
"user_oauth_applications": true, "user_oauth_applications": true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment