|
|
@ -82,12 +82,32 @@ class ServerConfig(Config): |
|
|
|
"require_auth_for_profile_requests", False |
|
|
|
"require_auth_for_profile_requests", False |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
# If set to 'True', requires authentication to access the server's |
|
|
|
if "restrict_public_rooms_to_local_users" in config and ( |
|
|
|
# public rooms directory through the client API, and forbids any other |
|
|
|
"allow_public_rooms_without_auth" in config |
|
|
|
# homeserver to fetch it via federation. |
|
|
|
or "allow_public_rooms_over_federation" in config |
|
|
|
self.restrict_public_rooms_to_local_users = config.get( |
|
|
|
): |
|
|
|
"restrict_public_rooms_to_local_users", False |
|
|
|
raise ConfigError( |
|
|
|
) |
|
|
|
"Can't use 'restrict_public_rooms_to_local_users' if" |
|
|
|
|
|
|
|
" 'allow_public_rooms_without_auth' and/or" |
|
|
|
|
|
|
|
" 'allow_public_rooms_over_federation' is set." |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check if the legacy "restrict_public_rooms_to_local_users" flag is set. This |
|
|
|
|
|
|
|
# flag is now obsolete but we need to check it for backward-compatibility. |
|
|
|
|
|
|
|
if config.get("restrict_public_rooms_to_local_users", False): |
|
|
|
|
|
|
|
self.allow_public_rooms_without_auth = False |
|
|
|
|
|
|
|
self.allow_public_rooms_over_federation = False |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
# If set to 'False', requires authentication to access the server's public |
|
|
|
|
|
|
|
# rooms directory through the client API. Defaults to 'True'. |
|
|
|
|
|
|
|
self.allow_public_rooms_without_auth = config.get( |
|
|
|
|
|
|
|
"allow_public_rooms_without_auth", True |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
# If set to 'False', forbids any other homeserver to fetch the server's public |
|
|
|
|
|
|
|
# rooms directory via federation. Defaults to 'True'. |
|
|
|
|
|
|
|
self.allow_public_rooms_over_federation = config.get( |
|
|
|
|
|
|
|
"allow_public_rooms_over_federation", True |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
default_room_version = config.get("default_room_version", DEFAULT_ROOM_VERSION) |
|
|
|
default_room_version = config.get("default_room_version", DEFAULT_ROOM_VERSION) |
|
|
|
|
|
|
|
|
|
|
@ -366,11 +386,15 @@ class ServerConfig(Config): |
|
|
|
# |
|
|
|
# |
|
|
|
#require_auth_for_profile_requests: true |
|
|
|
#require_auth_for_profile_requests: true |
|
|
|
|
|
|
|
|
|
|
|
# If set to 'true', requires authentication to access the server's |
|
|
|
# If set to 'false', requires authentication to access the server's public rooms |
|
|
|
# public rooms directory through the client API, and forbids any other |
|
|
|
# directory through the client API. Defaults to 'true'. |
|
|
|
# homeserver to fetch it via federation. Defaults to 'false'. |
|
|
|
# |
|
|
|
|
|
|
|
#allow_public_rooms_without_auth: false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# If set to 'false', forbids any other homeserver to fetch the server's public |
|
|
|
|
|
|
|
# rooms directory via federation. Defaults to 'true'. |
|
|
|
# |
|
|
|
# |
|
|
|
#restrict_public_rooms_to_local_users: true |
|
|
|
#allow_public_rooms_over_federation: false |
|
|
|
|
|
|
|
|
|
|
|
# The default room version for newly created rooms. |
|
|
|
# The default room version for newly created rooms. |
|
|
|
# |
|
|
|
# |
|
|
|