summary refs log tree commit diff
diff options
context:
space:
mode:
authorreivilibre <oliverw@element.io>2025-06-10 11:43:58 +0000
committerErik Johnston <erik@matrix.org>2025-06-10 12:45:31 +0100
commitcc6b4980efb281185a0f7dd958d121cf2d268855 (patch)
tree5b01145ffac6c45a7b219d6ae00b92af6010361a
parent1.132.0rc1 (diff)
downloadsynapse-cc6b4980efb281185a0f7dd958d121cf2d268855.tar.xz
Add config doc generation command to lint.sh and add missing config schema. (#18522)
Follows: #17892, #18456

<ol>
<li>

Add config doc generation command to lint.sh 

</li>
<li>

Add missing `user_types` config schema 

</li>
</ol>

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
-rw-r--r--changelog.d/18522.doc1
-rw-r--r--docs/usage/configuration/config_documentation.md19
-rw-r--r--schema/synapse-config.schema.yaml18
-rwxr-xr-xscripts-dev/lint.sh3
4 files changed, 32 insertions, 9 deletions
diff --git a/changelog.d/18522.doc b/changelog.d/18522.doc
new file mode 100644

index 0000000000..83c03190dd --- /dev/null +++ b/changelog.d/18522.doc
@@ -0,0 +1 @@ +Generate config documentation from JSON Schema file. diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md
index c014de794d..1e8953ae37 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md
@@ -764,22 +764,23 @@ max_event_delay_duration: 24h --- ### `user_types` -Configuration settings related to the user types feature. +*(object)* Configuration settings related to the user types feature. This setting has the following sub-options: -* `default_user_type`: The default user type to use for registering new users when no value has been specified. - Defaults to none. -* `extra_user_types`: Array of additional user types to allow. These are treated as real users. Defaults to []. + +* `default_user_type` (string|null): The default user type to use for registering new users when no value has been specified. Defaults to none. Defaults to `null`. + +* `extra_user_types` (list): Array of additional user types to allow. These are treated as real users. Defaults to `[]`. Example configuration: ```yaml user_types: - default_user_type: "custom" - extra_user_types: - - "custom" - - "custom2" + default_user_type: custom + extra_user_types: + - custom + - custom2 ``` - +--- ## Homeserver blocking Useful options for Synapse admins. diff --git a/schema/synapse-config.schema.yaml b/schema/synapse-config.schema.yaml
index 88804cab8d..52a6d5cf71 100644 --- a/schema/synapse-config.schema.yaml +++ b/schema/synapse-config.schema.yaml
@@ -912,6 +912,24 @@ properties: default: null examples: - 24h + user_types: + type: object + description: >- + Configuration settings related to the user types feature. + properties: + default_user_type: + type: ["string", "null"] + description: "The default user type to use for registering new users when no value has been specified. Defaults to none." + default: null + extra_user_types: + type: array + description: "Array of additional user types to allow. These are treated as real users." + items: + type: string + default: [] + examples: + - default_user_type: "custom" + extra_user_types: ["custom", "custom2"] admin_contact: type: ["string", "null"] description: How to reach the server admin, used in `ResourceLimitError`. diff --git a/scripts-dev/lint.sh b/scripts-dev/lint.sh
index c656047729..7096100a3e 100755 --- a/scripts-dev/lint.sh +++ b/scripts-dev/lint.sh
@@ -139,3 +139,6 @@ cargo-fmt # Ensure type hints are correct. mypy + +# Generate configuration documentation from the JSON Schema +./scripts-dev/gen_config_documentation.py schema/synapse-config.schema.yaml > docs/usage/configuration/config_documentation.md