Federation allow list #774

Merged
Jade merged 4 commits from jade/federation-allow-list into main 2025-04-19 23:38:47 +00:00
Owner

Superseeds #673

This has slightly different behaviour, given that the relevant options support regex now. See documentation in the second commit.

Superseeds https://forgejo.ellis.link/continuwuation/continuwuity/pulls/673 This has slightly different behaviour, given that the relevant options support regex now. See documentation in the second commit.
Jade added 2 commits 2025-04-19 22:39:52 +00:00
This moves all checks related to `forbidden_remote_server_names`,
`forbidden_remote_room_directory_server_names` and
`prevent_media_downloads_from` to a new `moderation` module.
This is useful for implementing more complicated logic globally.
Mostly the changes from #673, but is also relevant for #750
feat: Add allowed_remote_server_names
Some checks failed
Release Docker Image / define-variables (push) Successful in 12s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Successful in 23m27s
Release Docker Image / define-variables (pull_request) Successful in 13s
Release Docker Image / build-image (linux/amd64, linux-amd64) (pull_request) Successful in 3m45s
Release Docker Image / build-image (linux/arm64, linux-arm64) (pull_request) Successful in 19m14s
Release Docker Image / merge (pull_request) Successful in 33s
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Successful in 17m54s
Documentation / Build and Deploy Documentation (pull_request) Failing after 1s
Release Docker Image / merge (push) Failing after 31s
9e62076baa
This allows explicitly allowing servers. Can be
combined with the opposite to create allowlist-only
federation.

See also #31

Closes #673
requested review from Owners 2025-04-19 22:42:52 +00:00
Aranjedeath reviewed 2025-04-19 22:55:35 +00:00
@ -1955,3 +1970,3 @@
self.get_bind_hosts()
.len()
.saturating_add(self.get_bind_ports().len()),
.saturating_mul(self.get_bind_ports().len()),
Owner

why change add to mul?

why change add to mul?
Author
Owner

This is a minor bug fix from the original PR. If you're listening on two ports on three hosts, you're listening on six addresses, not five. If you're listening on one port on one host, you're listening on one address, not two.

This is a minor bug fix from the original PR. If you're listening on two ports on three hosts, you're listening on six addresses, not five. If you're listening on one port on one host, you're listening on one address, not two.
Jade marked this conversation as resolved
Aranjedeath approved these changes 2025-04-19 23:00:26 +00:00
Jade added 1 commit 2025-04-19 23:16:33 +00:00
docs: Document backfill bypassing federation restrictions
Some checks failed
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Documentation / Build and Deploy Documentation (pull_request) Failing after 1s
Release Docker Image / define-variables (pull_request) Successful in 5s
Release Docker Image / build-image (linux/arm64, linux-arm64) (pull_request) Successful in 18m53s
Release Docker Image / build-image (linux/amd64, linux-amd64) (pull_request) Successful in 57m15s
Release Docker Image / merge (pull_request) Failing after 31s
84445b8458
nex requested changes 2025-04-19 23:23:51 +00:00
Dismissed
nex left a comment
Owner

looks good, just a few comments on the documentation

looks good, just a few comments on the documentation
@ -1201,4 +1208,4 @@
# sender user's server name, inbound federation X-Matrix origin, and
# outbound federation handler.
#
# Basically "global" ACLs.
Owner

This line is quite misleading to a first-time user, who may assume "you can set ACLs in rooms to prevent servers joining so global ACLs should apply to all of my rooms automatically".

Although, "default ACLs" sounds like a neat feature to tack on to /createRoom 🤔

This line is quite misleading to a first-time user, who may assume "you can set ACLs in rooms to prevent servers joining so global ACLs should apply to all of my rooms automatically". Although, "default ACLs" sounds like a neat feature to tack on to /createRoom 🤔
Author
Owner

Agreed, I'll remove that entirely.

#775

Agreed, I'll remove that entirely. https://forgejo.ellis.link/continuwuation/continuwuity/issues/775
Jade marked this conversation as resolved
@ -1208,2 +1218,4 @@
#forbidden_remote_server_names = []
# List of allowed server names via regex patterns that we will allow,
# regardless of if they match `forbidden_remote_server_names`.
Owner

nitpicking, but it might be worth mentioning that this option has no effect if forbidden_remote_server_names is unspecified or otherwise wouldn't match any of them listed

nitpicking, but it might be worth mentioning that this option has no effect if `forbidden_remote_server_names` is unspecified or otherwise wouldn't match any of them listed
Jade marked this conversation as resolved
Jade added 1 commit 2025-04-19 23:31:12 +00:00
docs: Clarify
All checks were successful
Release Docker Image / define-variables (pull_request) Successful in 1s
Release Docker Image / build-image (linux/arm64, linux-arm64) (pull_request) Successful in 17m50s
Documentation / Build and Deploy Documentation (push) Successful in 41s
Documentation / Build and Deploy Documentation (pull_request) Successful in 26s
Release Docker Image / define-variables (push) Successful in 4s
Release Docker Image / build-image (linux/amd64, linux-amd64) (pull_request) Successful in 50m28s
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Successful in 17m41s
Release Docker Image / merge (pull_request) Successful in 26s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Successful in 4m54s
Release Docker Image / merge (push) Successful in 29s
fe7963d306
nex approved these changes 2025-04-19 23:32:52 +00:00
nex left a comment
Owner

Sweet, LGTM.

Sweet, LGTM.
Jade merged commit fe7963d306 into main 2025-04-19 23:38:47 +00:00
Jade deleted branch jade/federation-allow-list 2025-04-19 23:38:47 +00:00
Jade added the
Enhancement
label 2025-04-23 21:49:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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#774
No description provided.