debian-mirror-gitlab/doc/api/settings.md

133 lines
6.6 KiB
Markdown
Raw Normal View History

2015-09-11 14:41:01 +05:30
# Application settings
2016-04-02 18:10:28 +05:30
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.
2015-09-11 14:41:01 +05:30
2016-04-02 18:10:28 +05:30
## Get current application settings
2015-09-11 14:41:01 +05:30
2016-04-02 18:10:28 +05:30
List the current application settings of the GitLab instance.
2015-09-11 14:41:01 +05:30
```
GET /application/settings
```
2016-04-02 18:10:28 +05:30
```bash
2017-08-17 22:00:37 +05:30
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/application/settings
2016-04-02 18:10:28 +05:30
```
Example response:
2015-09-11 14:41:01 +05:30
```json
{
2017-08-17 22:00:37 +05:30
"default_projects_limit" : 100000,
2016-04-02 18:10:28 +05:30
"signup_enabled" : true,
"id" : 1,
"default_branch_protection" : 2,
"restricted_visibility_levels" : [],
"signin_enabled" : true,
"after_sign_out_path" : null,
"max_attachment_size" : 10,
"user_oauth_applications" : true,
"updated_at" : "2016-01-04T15:44:55.176Z",
"session_expire_delay" : 10080,
"home_page_url" : null,
2017-08-17 22:00:37 +05:30
"default_snippet_visibility" : "private",
2016-08-24 12:49:21 +05:30
"domain_whitelist" : [],
"domain_blacklist_enabled" : false,
"domain_blacklist" : [],
2016-04-02 18:10:28 +05:30
"created_at" : "2016-01-04T15:44:55.176Z",
2017-08-17 22:00:37 +05:30
"default_project_visibility" : "private",
"default_group_visibility" : "private",
2016-04-02 18:10:28 +05:30
"gravatar_enabled" : true,
"sign_in_text" : null,
2016-08-24 12:49:21 +05:30
"container_registry_token_expire_delay": 5,
2016-11-03 12:29:30 +05:30
"repository_storage": "default",
2016-11-24 13:41:30 +05:30
"repository_storages": ["default"],
2016-11-03 12:29:30 +05:30
"koding_enabled": false,
2017-08-17 22:00:37 +05:30
"koding_url": null,
"plantuml_enabled": false,
"plantuml_url": null,
"terminal_max_session_time": 0,
"polling_interval_multiplier": 1.0
2015-09-11 14:41:01 +05:30
}
```
2016-04-02 18:10:28 +05:30
## Change application settings
2015-09-11 14:41:01 +05:30
```
PUT /application/settings
```
2016-04-02 18:10:28 +05:30
| Attribute | Type | Required | Description |
| --------- | ---- | :------: | ----------- |
2017-08-17 22:00:37 +05:30
| `default_projects_limit` | integer | no | Project limit per user. Default is `100000` |
2016-04-02 18:10:28 +05:30
| `signup_enabled` | boolean | no | Enable registration. Default is `true`. |
| `signin_enabled` | boolean | no | Enable login via a GitLab account. Default is `true`. |
| `gravatar_enabled` | boolean | no | Enable Gravatar |
| `sign_in_text` | string | no | Text on login page |
| `home_page_url` | string | no | Redirect to this URL when not logged in |
2016-08-24 12:49:21 +05:30
| `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 `2`. |
2017-08-17 22:00:37 +05:30
| `restricted_visibility_levels` | array of strings | no | Selected levels cannot be used by non-admin users for projects or snippets. Can take `private`, `internal` and `public` as a parameter. Default is null which means there is no restriction. |
2016-04-02 18:10:28 +05:30
| `max_attachment_size` | integer | no | Limit attachment size in MB |
| `session_expire_delay` | integer | no | Session duration in minutes. GitLab restart is required to apply changes |
2017-08-17 22:00:37 +05:30
| `default_project_visibility` | string | no | What visibility level new projects receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`.|
| `default_snippet_visibility` | string | no | What visibility level new snippets receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`.|
| `default_group_visibility` | string | no | What visibility level new groups receive. Can take `private`, `internal` and `public` as a parameter. Default is `private`.|
2016-08-24 12:49:21 +05:30
| `domain_whitelist` | array of strings | no | Force people to use only corporate emails for sign-up. Default is null, meaning there is no restriction. |
| `domain_blacklist_enabled` | boolean | no | Enable/disable the `domain_blacklist` |
2016-09-29 09:46:39 +05:30
| `domain_blacklist` | array of strings | yes (if `domain_blacklist_enabled` is `true`) | People trying to sign-up with emails from this domain will not be allowed to do so. |
2016-04-02 18:10:28 +05:30
| `user_oauth_applications` | boolean | no | Allow users to register any application to use GitLab as an OAuth provider |
| `after_sign_out_path` | string | no | Where to redirect users after logout |
| `container_registry_token_expire_delay` | integer | no | Container Registry token duration in minutes |
2016-11-24 13:41:30 +05:30
| `repository_storages` | array of strings | no | A list of names of enabled storage paths, taken from `gitlab.yml`. New projects will be created in one of these stores, chosen at random. |
| `repository_storage` | string | no | The first entry in `repository_storages`. Deprecated, but retained for compatibility reasons |
2016-11-03 12:29:30 +05:30
| `enabled_git_access_protocol` | string | no | Enabled protocols for Git access. Allowed values are: `ssh`, `http`, and `nil` to allow both protocols. |
| `koding_enabled` | boolean | no | Enable Koding integration. Default is `false`. |
| `koding_url` | string | yes (if `koding_enabled` is `true`) | The Koding instance URL for integration. |
2017-08-17 22:00:37 +05:30
| `disabled_oauth_sign_in_sources` | Array of strings | no | Disabled OAuth sign-in sources |
| `plantuml_enabled` | boolean | no | Enable PlantUML integration. Default is `false`. |
| `plantuml_url` | string | yes (if `plantuml_enabled` is `true`) | The PlantUML instance URL for integration. |
| `terminal_max_session_time` | integer | no | Maximum time for web terminal websocket connection (in seconds). Set to 0 for unlimited time. |
| `polling_interval_multiplier` | decimal | no | Interval multiplier used by endpoints that perform polling. Set to 0 to disable polling. |
2015-09-11 14:41:01 +05:30
2016-04-02 18:10:28 +05:30
```bash
2017-08-17 22:00:37 +05:30
curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/application/settings?signup_enabled=false&default_project_visibility=internal
2016-04-02 18:10:28 +05:30
```
2015-09-11 14:41:01 +05:30
2016-04-02 18:10:28 +05:30
Example response:
2015-09-11 14:41:01 +05:30
```json
{
"id": 1,
2017-08-17 22:00:37 +05:30
"default_projects_limit": 100000,
2015-09-11 14:41:01 +05:30
"signup_enabled": true,
"signin_enabled": true,
"gravatar_enabled": true,
"sign_in_text": "",
"created_at": "2015-06-12T15:51:55.432Z",
"updated_at": "2015-06-30T13:22:42.210Z",
"home_page_url": "",
"default_branch_protection": 2,
"restricted_visibility_levels": [],
"max_attachment_size": 10,
"session_expire_delay": 10080,
2017-08-17 22:00:37 +05:30
"default_project_visibility": "internal",
"default_snippet_visibility": "private",
"default_group_visibility": "private",
2016-08-24 12:49:21 +05:30
"domain_whitelist": [],
"domain_blacklist_enabled" : false,
"domain_blacklist" : [],
2015-09-11 14:41:01 +05:30
"user_oauth_applications": true,
"after_sign_out_path": "",
2016-08-24 12:49:21 +05:30
"container_registry_token_expire_delay": 5,
2016-11-03 12:29:30 +05:30
"repository_storage": "default",
"koding_enabled": false,
2017-08-17 22:00:37 +05:30
"koding_url": null,
"plantuml_enabled": false,
"plantuml_url": null,
"terminal_max_session_time": 0,
"polling_interval_multiplier": 1.0
2015-09-11 14:41:01 +05:30
}
```