Skip to content

Move specific Synapse config out of RootConfig #18410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented May 7, 2025

Move specific Synapse config out of RootConfig. Spawning from wanting to import and re-use the RootConfig/Config machinery in another project.

server_name and report_stats are Synapse specific and not useful to other applications. I also think they make more sense to be validated in the appropriate config files instead of root.

Testing strategy

Test missing server_name config:

  1. Comment out server_name in your homserver.yaml
  2. Run Synapse: poetry run synapse_homeserver --config-path homeserver.yaml
  3. Notice the error:
    $ poetry run synapse_homeserver --config-path homeserver.yaml
    The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
    
    Error in configuration at 'server_name':
      Missing mandatory `server_name` config option.

Test missing report_stats config:

  1. Comment out report_stats in your homserver.yaml
  2. Run Synapse: poetry run synapse_homeserver --config-path homeserver.yaml
  3. Notice the error:
    $ poetry run synapse_homeserver --config-path homeserver.yaml
    The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
    
    Error in configuration at 'report_stats':
      Please opt in or out of reporting homeserver usage statistics, by setting
    the `report_stats` key in your config file to either True or False.
    
    We would really appreciate it if you could help our project out by reporting
    homeserver usage statistics from your homeserver. Your homeserver's server name,
    along with very basic aggregate data (e.g. number of users) will be reported. But
    it helps us to track the growth of the Matrix community, and helps us to make Matrix
    a success, as well as to convince other networks that they should peer with us.
    
    Thank you.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct
    (run the linters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant