Skip to content

Conversation

V02460
Copy link
Contributor

@V02460 V02460 commented Dec 2, 2024

Another config option on my quest to a *_path variant for every secret. Adds the config options recaptcha_private_key_path and recaptcha_public_key_path. Tests and docs are included.

A public key is of course no secret, but it is closely related to the private key, so it’s still useful to have a *_path variant for it.

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)

@V02460 V02460 requested a review from a team as a code owner December 2, 2024 15:35
@github-actions github-actions bot deployed to PR Documentation Preview December 2, 2024 15:37 Active
@V02460
Copy link
Contributor Author

V02460 commented Jan 9, 2025

@MadLittleMods: Could you clarify what you want the error message to be?

For these PRs I did not use my own wording, but took it from registration_shared_secret:

CONFLICTING_SHARED_SECRET_OPTS_ERROR = """\
You have configured both `registration_shared_secret` and
`registration_shared_secret_path`. These are mutually incompatible.
"""

@github-actions github-actions bot deployed to PR Documentation Preview January 9, 2025 14:49 Active
devonh pushed a commit that referenced this pull request Feb 25, 2025
Adds the `--no-secrets-in-config` command line option that makes Synapse
reject all configurations containing keys with in-line secret values.
Currently this rejects

- `turn_shared_secret`
- `registration_shared_secret`
- `macaroon_secret_key`
- `recaptcha_private_key`
- `recaptcha_public_key`
- `experimental_features.msc3861.client_secret`
- `experimental_features.msc3861.jwk`
- `experimental_features.msc3861.admin_token`
- `form_secret`
- `redis.password`
- `worker_replication_secret`

> [!TIP]
> Hey, you! Yes, you! 😊 If you think this list is missing an item,
please leave a comment below. Thanks :)

This PR complements my other PRs[^1] that add the corresponding `_path`
variants for this class of config options. It enables admins to enforce
a policy of no secrets in configuration files and guards against
accident and malice.

Because I consider the flag `--no-secrets-in-config` to be
security-relevant, I did not add a corresponding `--secrets-in-config`
flag; this way, if Synapse command line options are appended at various
places, there is no way to weaken the once-set setting with a succeeding
flag.

[^1]: [#17690](#17690),
[#17717](#17717),
[#17983](#17983),
[#17984](#17984),
[#18004](#18004),
[#18090](#18090)


### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
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.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
@CLAassistant
Copy link

CLAassistant commented Mar 23, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot deployed to PR Documentation Preview May 6, 2025 20:12 Active
@github-actions github-actions bot deployed to PR Documentation Preview July 9, 2025 07:37 Active
@V02460 V02460 requested a review from MadLittleMods July 14, 2025 14:41
@github-actions github-actions bot deployed to PR Documentation Preview July 14, 2025 15:19 Active
@MadLittleMods MadLittleMods merged commit 481c4e2 into element-hq:develop Jul 14, 2025
74 of 76 checks passed
@MadLittleMods
Copy link
Contributor

Thanks for continuing down this path @V02460 🙂

MadLittleMods added a commit that referenced this pull request Jul 14, 2025
MadLittleMods added a commit that referenced this pull request Jul 15, 2025
…ions were introduced (#18684)

Introduced in #17984

I already see a
[`v1.134.0rc1`](https://github.com/element-hq/synapse/releases/tag/v1.134.0rc1)
tag from 5 days ago so I assume
#17984 will actually ship in
the next release (which will be `v1.135.0`)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Aug 7, 2025
Tested on NetBSD 9 amd64 (federation, multiple clients)

# Synapse 1.135.0 (2025-08-01)

## Features

- Add `recaptcha_private_key_path` and `recaptcha_public_key_path` config option. ([\#17984](element-hq/synapse#17984), [\#18684](element-hq/synapse#18684))
- Add plain-text handling for rich-text topics as per [MSC3765](matrix-org/matrix-spec-proposals#3765). ([\#18195](element-hq/synapse#18195))
- If enabled by the user, server admins will see [soft failed](https://spec.matrix.org/v1.13/server-server-api/#soft-failure) events over the Client-Server API. ([\#18238](element-hq/synapse#18238))
- Add experimental support for [MSC4277: Harmonizing the reporting endpoints](matrix-org/matrix-spec-proposals#4277). ([\#18263](element-hq/synapse#18263))
- Add ability to limit amount of media uploaded by a user in a given time period. ([\#18527](element-hq/synapse#18527))
- Enable workers to write directly to the device lists stream and handle device list updates, reducing load on the main process. ([\#18581](element-hq/synapse#18581))
- Support arbitrary profile fields. Contributed by @clokep. ([\#18635](element-hq/synapse#18635))
- Advertise support for Matrix v1.12. ([\#18647](element-hq/synapse#18647))
- Add an option to issue redactions as an admin user via the [admin redaction endpoint](https://element-hq.github.io/synapse/latest/admin_api/user_admin_api.html#redact-all-the-events-of-a-user). ([\#18671](element-hq/synapse#18671))
- Add experimental and incomplete support for [MSC4306: Thread Subscriptions](https://github.com/matrix-org/matrix-spec-proposals/blob/rei/msc_thread_subscriptions/proposals/4306-thread-subscriptions.md). ([\#18674](element-hq/synapse#18674))
- Include `event_id` when getting state with `?format=event`. Contributed by @tulir @ Beeper. ([\#18675](element-hq/synapse#18675))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants