Wiki settings

Adjust the wiki settings of your GitLab instance.

Wiki page content size limit

Introduced 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?

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.

To break any existing wiki pages, the limit doesn’t take effect until a wiki page is edited again and the content changes.

Wiki page content size limit configuration

This setting is not available through the Admin Area settings. To configure this setting, use either the Rails console or the Application settings API.

note
The value of the limit must be in bytes. The minimum value is 1024 bytes.

Through the Rails console

To configure this setting through the Rails console:

  1. Start the Rails console:

    # For Omnibus installations
    sudo gitlab-rails console
    
    # For installations from source
    sudo -u git -H bundle exec rails console -e production
    
  2. Update the wiki page maximum content size:

    ApplicationSetting.first.update!(wiki_page_max_content_bytes: 50.megabytes)
    

To retrieve the current value, start the Rails console and run:

  Gitlab::CurrentSettings.wiki_page_max_content_bytes

Through the API

To set the wiki page size limit through the Application Settings API, use a command, as you would to update any other setting:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings?wiki_page_max_content_bytes=52428800"

You can also use the API to retrieve the current value:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings"

Reduce wiki repository size

The wiki counts as part of the namespace storage size, 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.

Allow URI includes for AsciiDoc

Introduced in GitLab 16.1.

Include directives import content from separate pages or external URLs, and display them as part of the content of the current document. To enable AsciiDoc includes, enable the feature through the Rails console or the API.

Through the Rails console

To configure this setting through the Rails console:

  1. Start the Rails console:

    # For Omnibus installations
    sudo gitlab-rails console
    
    # For installations from source
    sudo -u git -H bundle exec rails console -e production
    
  2. Update the wiki to allow URI includes for AsciiDoc:

    ApplicationSetting.first.update!(wiki_asciidoc_allow_uri_includes: true)
    

To check if includes are enabled, start the Rails console and run:

  Gitlab::CurrentSettings.wiki_asciidoc_allow_uri_includes

Through the API

To set the wiki to allow URI includes for AsciiDoc through the Application Settings API, use a curl command:

curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" \
  "https://gitlab.example.com/api/v4/application/settings?wiki_asciidoc_allow_uri_includes=true"