docs: Add Delegation page #1414

Merged
ginger merged 6 commits from stratself/continuwuity:stratself/docs-delegation into main 2026-03-04 15:10:00 +00:00
Contributor

This pull request adds a page for delegation in a newly created Advanced section. The intent is to provide a clear reference point for delegation-related inquiries, which is common in the chatrooms.

I intend to populate Advanced with further guides, and since this is reasonably specific I think it can go in there.

Relates to #1361. Perhaps that PR can simplify well-known processes by redirecting users here.

Further reverse proxy examples (e.g. Nginx) are welcome

Pull request checklist:

  • This pull request targets the main branch, and the branch is named something other than
    main.
  • I have written an appropriate pull request title and my description is clear.
  • I understand I am responsible for the contents of this pull request.
  • I have followed the contributing guidelines:
This pull request adds a page for delegation in a newly created Advanced section. The intent is to provide a clear reference point for delegation-related inquiries, which is common in the chatrooms. I intend to populate Advanced with further guides, and since this is reasonably specific I think it can go in there. Relates to #1361. Perhaps that PR can simplify well-known processes by redirecting users here. Further reverse proxy examples (e.g. Nginx) are welcome **Pull request checklist:** <!-- You need to complete these before your PR can be considered. If you aren't sure about some, feel free to ask for clarification in #dev:continuwuity.org. --> - [x] This pull request targets the `main` branch, and the branch is named something other than `main`. - [x] I have written an appropriate pull request title and my description is clear. - [x] I understand I am responsible for the contents of this pull request. - I have followed the [contributing guidelines][c1]: - [x] My contribution follows the [code style][c2], if applicable. - [ ] I ran [pre-commit checks][c1pc] before opening/drafting this pull request. - [x] I have [tested my contribution][c1t] (or proof-read it for documentation-only changes) myself, if applicable. This includes ensuring code compiles. - [x] My commit messages follow the [commit message format][c1cm] and are descriptive. - [ ] I have written a [news fragment][n1] for this PR, if applicable<!--(can be done after hitting open!)-->. <!-- Notes on these requirements: - While not required, we encourage you to sign your commits with GPG or SSH to attest the authenticity of your changes. - While we allow LLM-assisted contributions, we do not appreciate contributions that are low quality, which is typical of machine-generated contributions that have not had a lot of love and care from a human. Please do not open a PR if all you have done is asked ChatGPT to tidy up the codebase with a +-100,000 diff. - In the case of code style violations, reviewers may leave review comments/change requests indicating what the ideal change would look like. For example, a reviewer may suggest you lower a log level, or use `match` instead of `if/else` etc. - In the case of code style violations, pre-commit check failures, minor things like typos/spelling errors, and in some cases commit format violations, reviewers may modify your branch directly, typically by making changes and adding a commit. Particularly in the latter case, a reviewer may rebase your commits to squash "spammy" ones (like "fix", "fix", "actually fix"), and reword commit messages that don't satisfy the format. - Pull requests MUST pass the `Checks` CI workflows to be capable of being merged. This can only be bypassed in exceptional circumstances. If your CI flakes, let us know in matrix:r/dev:continuwuity.org. - Pull requests have to be based on the latest `main` commit before being merged. If the main branch changes while you're making your changes, you should make sure you rebase on main before opening a PR. Your branch will be rebased on main before it is merged if it has fallen behind. - We typically only do fast-forward merges, so your entire commit log will be included. Once in main, it's difficult to get out cleanly, so put on your best dress, smile for the cameras! --> [c1]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md [c2]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/docs/development/code_style.mdx [c1pc]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#pre-commit-checks [c1t]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#running-tests-locally [c1cm]: https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages [n1]: https://towncrier.readthedocs.io/en/stable/tutorial.html#creating-news-fragments
docs: add dedicated page for delegation in new Advanced section
Some checks are pending
Documentation / Build and Deploy Documentation (pull_request) Blocked by required conditions
Checks / Prek / Pre-commit & Formatting (pull_request) Blocked by required conditions
Checks / Prek / Clippy and Cargo Tests (pull_request) Blocked by required conditions
Update flake hashes / update-flake-hashes (pull_request) Blocked by required conditions
ae1f0c4a14
Jade approved these changes 2026-02-18 18:21:50 +00:00
Dismissed
Jade left a comment
Owner

Thank you! This looks good for an explainer, although if it's an advanced guide it should probably explain client delegation too, and maybe mention the support file? At the moment it seems pretty good as something to link people who have questions about it though, so if you think that's the level of detail that's most useful I won't argue

Thank you! This looks good for an explainer, although if it's an advanced guide it should probably explain client delegation too, and maybe mention the support file? At the moment it seems pretty good as something to link people who have questions about it though, so if you think that's the level of detail that's most useful I won't argue
@ -0,0 +1,111 @@
# Delegation/split-domain
Matrix allows clients and servers to discover a homeserver's "true" destination via _`.well-known` delegation_. This is especially useful if you would like to:
Owner

Via an algorithm that includes this, as well as srv records etc - see the spec page. If it's going in the advanced section, best fully explain things :3

Via an algorithm that includes this, as well as srv records etc - see the spec page. If it's going in the advanced section, best fully explain things :3
Author
Contributor

I've linked the specs at the bottom, and add references to .well-known/matrix/support. Not sure how to elaborate in-docs so lemme know if any ideas

I've linked the specs at the bottom, and add references to `.well-known/matrix/support`. Not sure how to elaborate in-docs so lemme know if any ideas
stratself marked this conversation as resolved
docs: Add details on support .well-knowns and spec links at the bottom
Some checks are pending
Documentation / Build and Deploy Documentation (pull_request) Blocked by required conditions
Checks / Prek / Pre-commit & Formatting (pull_request) Blocked by required conditions
Checks / Prek / Clippy and Cargo Tests (pull_request) Blocked by required conditions
Update flake hashes / update-flake-hashes (pull_request) Blocked by required conditions
248ea20a0f
Jade approved these changes 2026-02-19 11:48:10 +00:00
nex requested changes 2026-02-19 17:23:14 +00:00
@ -0,0 +1,125 @@
# Delegation/split-domain
Owner

If you're not going to go over SRV delegation in this, I think this should be renamed to "well-known delegation" instead of just delegation.

If you're not going to go over SRV delegation in this, I think this should be renamed to "well-known delegation" instead of just delegation.
Author
Contributor

I've added some guidance on SRVs with a huge non-recommendation. Compared to Synapse's docs on this one I think it goes into a bit more details

I've added some guidance on SRVs with a huge non-recommendation. Compared to [Synapse's docs](https://element-hq.github.io/synapse/latest/delegate.html#srv-dns-record-delegation) on this one I think it goes into a bit more details
stratself marked this conversation as resolved
docs: Add section for SRV records delegation
Some checks are pending
Documentation / Build and Deploy Documentation (pull_request) Blocked by required conditions
Checks / Prek / Pre-commit & Formatting (pull_request) Blocked by required conditions
Checks / Prek / Clippy and Cargo Tests (pull_request) Blocked by required conditions
Update flake hashes / update-flake-hashes (pull_request) Blocked by required conditions
8cc3bc8306
The methods are strongly disrecommended and hidden in <details> elements
docs: Further specify that SRVs are not needed for .well-known enjoyers
Some checks failed
Update flake hashes / update-flake-hashes (pull_request) Successful in 47s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 15m29s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 15m56s
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
24e9271aec
ginger left a comment
Owner

I'm not sure this needs to be in an "advanced" section, since it's a pretty common ask, but the writing looks mostly good except for a few nits.

I'm not sure this needs to be in an "advanced" section, since it's a pretty common ask, but the writing looks mostly good except for a few nits.
@ -0,0 +5,4 @@
- Serve Continuwuity on a subdomain while having only the base domain for your usernames
- Use a port other than `:8448` for server-to-server connections
This guide will show you how to have `@user:example.com` usernames while serving Continuwuity on `https://matrix.example.com`. It assumes using port 443 for both client-to-server connections and server-to-server federation.
Owner

s/using/you are using/

s/using/you are using/
stratself marked this conversation as resolved
@ -0,0 +11,4 @@
First, ensure you have set up A/AAAA records for `matrix.example.com` and `example.com` pointing to your IP.
Then, ensure that the `server_name` field matches your intended username suffix. If this is not the case, you **MUST** wipe the database directory and reinstall Continuwuity with your desired `server_name`
Owner

sentence should end with a period

sentence should end with a period
stratself marked this conversation as resolved
@ -0,0 +46,4 @@
## Serving with a reverse proxy
The steps above will generate three JSON files: `.well-known/matrix/client`, `.well-known/matrix/server`, and `.well-known/matrix/support`. To enable discovery of your homeserver's destination and contact details, you will need to serve these files from your base domain.
Owner

this should be amended to make it clear that it doesn't generate JSON files on the filesystem, but rather makes Continuwuity serve them

this should be amended to make it clear that it doesn't generate JSON files _on the filesystem_, but rather makes Continuwuity serve them
Author
Contributor

I've amended it to say C10y serves the files, and they need to be reverse proxied from apex domain

I've amended it to say C10y _serves_ the files, and they need to be reverse proxied from apex domain
stratself marked this conversation as resolved
@ -0,0 +81,4 @@
</details>
Bring up Continuwuity and the reverse proxy. You should now see the following contents
Owner

suggested wording: "Once you've restarted Continuwuity and your reverse proxy, visit these routes with your web browser and check that the responses match the examples below:"

suggested wording: "Once you've restarted Continuwuity and your reverse proxy, visit these routes with your web browser and check that the responses match the examples below:"
stratself marked this conversation as resolved
@ -0,0 +116,4 @@
### Cannot log in with web clients
Make sure there is an `Access-Control-Allow-Origin: *` header in your `.well-known/matrix/client` path. While continuwuity serves this header by default, it may be dropped by reverse proxies or other middlewares.
Owner

inconsistent capitalization of Continuwuity

inconsistent capitalization of Continuwuity
stratself marked this conversation as resolved
@ -0,0 +122,4 @@
## Using SRV records (not recommended)
The following methods uses the legacy SRV records and only apply to federation traffic. They are provided only for completeness, and are **not recommended** for most users due to increased complexity with little benefits. If you have already set up `.well-known` delegation as above, you can safely skip this part.
Owner

this could go in a :::warn callout for extra emphasis

this could go in a `:::warn` callout for extra emphasis
stratself marked this conversation as resolved
docs: Apply changes from feedback and further improvements
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m10s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 2m35s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 9m20s
53741b4b9c
* apply grammatical/punctuation/clarity edits from feedback
* explain what the .well-known files do and highlight that
they need to be reverse proxied from base domain
* replace all ports from 6167 to 8008 - C10y's default
* rename page as 'Delegation / split-domain' in the navbar
* rename page title as 'Delegation / split-domain deployment'
* put SRV records disrecommendation in a warning admonition
Henry-Hiles approved these changes 2026-02-27 19:19:02 +00:00
Dismissed
@ -0,0 +48,4 @@
After doing the steps above, Continuwuity will serve these 3 JSON files:
- `.well-known/matrix/client`: for Client-Server discovery
Contributor

I would kind of like if these had a / at the start, but its not really needed.

I would kind of like if these had a / at the start, but its not really needed.
Author
Contributor

it's done

it's done
stratself marked this conversation as resolved
docs: add another SRV use case - as fallback for offline servers
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m44s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 4m30s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m8s
b61395b0e4
* also added the slashes to /.well-known where suitable
Henry-Hiles approved these changes 2026-02-27 20:42:57 +00:00
Dismissed
Author
Contributor

I added another case for SRV records to be used as a fallback discovery method. Of course hidden in a <details> section. Since the docs is in Advanced topics I thought this would be an addition that makes sense

Also rebased to main

I added another case for SRV records to be used as a fallback discovery method. Of course hidden in a \<details> section. Since the docs is in Advanced topics I thought this would be an addition that makes sense Also rebased to main
Contributor

@stratself wrote in #1414 (comment):

I added another case for SRV records to be used as a fallback discovery method. Of course hidden in a

section. Since the docs is in Advanced topics I thought this would be an addition that makes sense

Love how that actually rendered as a details in my email client image

@stratself wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1414#issuecomment-25237: > I added another case for SRV records to be used as a fallback discovery method. Of course hidden in a <details> section. Since the docs is in Advanced topics I thought this would be an addition that makes sense Love how that actually rendered as a details in my email client ![image](/attachments/3eb36757-cc80-49d1-b157-57931caa14cf)
stratself force-pushed stratself/docs-delegation from b61395b0e4
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m44s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 4m30s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 6m8s
to eee1a5b7d1
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m53s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 14m22s
2026-02-27 20:54:03 +00:00
Compare
Henry-Hiles left a comment
Contributor

There is inconsistent capitalization in the commit messages. Shouldn't they all start uppercase?

There is inconsistent capitalization in the commit messages. Shouldn't they all start uppercase?
Author
Contributor

@Henry-Hiles wrote in #1414 (comment):

There is inconsistent capitalization in the commit messages. Shouldn't they all start uppercase?

Following Conventional Commits specification, rule 15, there should not be any difference in uppercase/lowercase. However, I do agree I should have stuck to one or the other. I am currently more inclined to the lowercase case, as it is the case presented in Continuwuity's https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages and on the Conventional Commits website.

Do let me know if, and how, previous commits can be rewritten

@Henry-Hiles wrote in https://forgejo.ellis.link/continuwuation/continuwuity/pulls/1414#issuecomment-25242: > There is inconsistent capitalization in the commit messages. Shouldn't they all start uppercase? Following [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) specification, rule 15, there should not be any difference in uppercase/lowercase. However, I do agree I should have stuck to one or the other. I am currently more inclined to the lowercase case, as it is the case presented in Continuwuity's https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/CONTRIBUTING.md#commit-messages and on the Conventional Commits website. Do let me know if, and how, previous commits can be rewritten
Contributor

change history in the manner of your choosing, e.g. rebase, or undoing commits and recommiting, then git push --force. Out rn, can give better instructions when home. However, looking at latest commits to continuwuity, some are uppercase some lowercase, and maybe this will be squash merged anyways idk. Therefore, idk if changing is even needed.

change history in the manner of your choosing, e.g. rebase, or undoing commits and recommiting, then `git push --force`. Out rn, can give better instructions when home. However, looking at latest commits to continuwuity, some are uppercase some lowercase, and maybe this will be squash merged anyways idk. Therefore, idk if changing is even needed.
ginger changed title from docs: add Delegation page to docs: Add Delegation page 2026-03-04 15:09:06 +00:00
ginger merged commit dbf8fd3320 into main 2026-03-04 15:10:00 +00:00
ginger referenced this pull request from a commit 2026-03-04 15:10:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1414
No description provided.