"一个模块,用于基于被邀请者的域名防止向Matrix房间发送邀请。"
项目描述
Synapse Domain Rule Checker
一个模块,用于通过检查涉及的服务器(们)的域名来防止向Matrix房间发送邀请和加入。
安装
从您为Synapse使用的虚拟环境中安装此模块
pip install synapse-domain-rule-checker
(如果遇到问题,您可能需要首先升级pip,例如通过运行pip install --upgrade pip
)
然后修改您的 homeserver 配置,将以下内容添加到您的modules
配置中
modules:
- module: synapse_domain_rule_checker.DomainRuleChecker
config:
# A mapping describing which servers a server can invite into a room.
# Default is any server can invite any other server.
domain_mapping:
"inviter_domain": [ "invitee_domain_permitted", "other_domain_permitted" ]
"other_inviter_domain": [ "invitee_domain_permitted" ]
# Whether an invite should be allowed through if the inviting server doesn't appear
# in the domain_mapping.
# Required.
can_invite_if_not_in_domain_mapping: false
# Whether a user on this server needs to be invited to be allowed into a room,
# regardless of the room's settings.
# Defaults to false.
can_only_join_rooms_with_invite: false
# Whether a user on this server can only invite when creating a room.
# Default is false.
can_only_invite_during_room_creation: false
# List of servers that can't be invited to rooms that have been published to the
# public room directory. This setting only really works in a closed federation in
# which every server agrees on the list.
# Defaults to all servers being allowed.
domains_prevented_from_being_invited_to_published_rooms: []
# Whether a local user can invite another user using a third-party identifier (e.g.
# an email address).
# Defaults to true.
can_invite_by_third_party_id: true
请注意,在定义domain_mapping
和domains_prevented_from_being_invited_to_published_rooms
的值时,需要考虑两个本地用户之间的邀请。
开发
在一个具有pip ≥ 21.1的虚拟环境中运行
pip install -e .[dev]
要运行单元测试,您可以使用
tox -e py
或者
trial tests
要运行linters和mypy
类型检查器,请使用./scripts-dev/lint.sh
。
发布
发布的确切步骤可能会有所不同;但这是Synapse开发者采取的方法(假设是类Unix的shell)
-
设置一个shell变量,其值为您要发布的版本(这只是为了使后续步骤更容易)
version=X.Y.Z
-
更新
setup.cfg
,以便版本正确。 -
暂存更改的文件并提交。
git add -u git commit -m v$version -n
-
推送您的更改。
git push
-
准备就绪时,为发布创建一个已签名的标签
git tag -s v$version
根据变更日志制定标签信息。
-
推送标签。
git push origin tag v$version
-
创建源分发布并将其上传到PyPI
python -m build twine upload dist/synapse_domain_rule_checker-$version*
项目详情
关闭
synapse_domain_rule_checker-1.0.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 553b392c01ca1cc168e8ad0f79c6d58933f533f833edf4e18f2656e52c03f8ed |
|
MD5 | 37e94c9434d6921282ccccdf5e008921 |
|
BLAKE2b-256 | a06d7ac41e68d6cca97ca9f0b55ed631aef2d60cab2a22378f3dfcdab71902ca |
关闭
synapse_domain_rule_checker-1.0.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3cb8b2bf8a82c5fc193b7d0866c5889e956f2da74bdf468e233621b01463cef2 |
|
MD5 | ac8eebcdc85a63227ccbc27b65280d3e |
|
BLAKE2b-256 | eba2805dbbe10d4e29046d92f944c16240d4e0d241c3fb30d78b71d14bdb35fb |