debian-mirror-gitlab/doc/administration/wikis/index.md

90 lines
2.9 KiB
Markdown
Raw Normal View History

2020-10-24 23:57:45 +05:30
---
type: reference, howto
stage: Create
2021-03-11 19:13:27 +05:30
group: Editor
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-10-24 23:57:45 +05:30
---
2021-03-11 19:13:27 +05:30
# Wiki settings **(FREE SELF)**
2020-10-24 23:57:45 +05:30
Adjust the wiki settings of your GitLab instance.
## Wiki page content size limit
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/31176) in GitLab 13.2.
You can set a maximum content size limit for wiki pages. This limit can prevent
abuse of the feature. The default value is **52428800 Bytes** (50 MB).
### How does it work?
2021-03-11 19:13:27 +05:30
The content size limit is applied when a wiki page is created or updated
through the GitLab UI or API. Local changes pushed via Git are not validated.
2020-10-24 23:57:45 +05:30
2021-03-11 19:13:27 +05:30
To break any existing wiki pages, the limit doesn't take effect until a wiki page
is edited again and the content changes.
2020-10-24 23:57:45 +05:30
### Wiki page content size limit configuration
This setting is not available through the [Admin Area settings](../../user/admin_area/settings/index.md).
2021-03-11 19:13:27 +05:30
To configure this setting, use either the Rails console
2020-10-24 23:57:45 +05:30
or the [Application settings API](../../api/settings.md).
2021-02-22 17:27:13 +05:30
NOTE:
2021-03-11 19:13:27 +05:30
The value of the limit must be in bytes. The minimum value is 1024 bytes.
2020-10-24 23:57:45 +05:30
#### Through the Rails console
2021-03-11 19:13:27 +05:30
To configure this setting through the Rails console:
2020-10-24 23:57:45 +05:30
1. Start the Rails console:
```shell
# For Omnibus installations
sudo gitlab-rails console
# For installations from source
sudo -u git -H bundle exec rails console -e production
```
1. Update the wiki page maximum content size:
```ruby
ApplicationSetting.first.update!(wiki_page_max_content_bytes: 50.megabytes)
```
To retrieve the current value, start the Rails console and run:
```ruby
Gitlab::CurrentSettings.wiki_page_max_content_bytes
```
#### Through the API
2021-03-11 19:13:27 +05:30
To set the wiki page size limit through the Application Settings API, use a command,
as you would to [update any other setting](../../api/settings.md#change-application-settings):
2020-10-24 23:57:45 +05:30
```shell
2021-02-22 17:27:13 +05:30
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings?wiki_page_max_content_bytes=52428800"
2020-10-24 23:57:45 +05:30
```
2021-03-11 19:13:27 +05:30
You can also use the API to [retrieve the current value](../../api/settings.md#get-current-application-settings):
2020-10-24 23:57:45 +05:30
```shell
2021-02-22 17:27:13 +05:30
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings"
2020-10-24 23:57:45 +05:30
```
2021-04-29 21:17:54 +05:30
2021-10-27 15:23:28 +05:30
### Reduce wiki repository size
The wiki counts as part of the [namespace storage size](../../user/admin_area/settings/account_and_limit_settings.md),
so you should keep your wiki repositories as compact as possible.
For more information about tools to compact repositories,
read the documentation on [reducing repository size](../../user/project/repository/reducing_the_repo_size_using_git.md).
2021-04-29 21:17:54 +05:30
## Related topics
- [User documentation for wikis](../../user/project/wiki/index.md)
- [Project wikis API](../../api/wikis.md)
- [Group wikis API](../../api/group_wikis.md)