From cc6b4980efb281185a0f7dd958d121cf2d268855 Mon Sep 17 00:00:00 2001 From: reivilibre Date: Tue, 10 Jun 2025 11:43:58 +0000 Subject: Add config doc generation command to lint.sh and add missing config schema. (#18522) Follows: #17892, #18456
  1. Add config doc generation command to lint.sh
  2. Add missing `user_types` config schema
--------- Signed-off-by: Olivier 'reivilibre --- changelog.d/18522.doc | 1 + docs/usage/configuration/config_documentation.md | 19 ++++++++++--------- schema/synapse-config.schema.yaml | 18 ++++++++++++++++++ scripts-dev/lint.sh | 3 +++ 4 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 changelog.d/18522.doc 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 -- cgit 1.5.1