Don't expose default_room_version as config opt

pull/3654/head
Richard van der Hoff 2018-08-07 12:51:57 +01:00
parent 7f3f108561
commit 3523f5432a
3 changed files with 5 additions and 15 deletions

View File

@ -97,6 +97,9 @@ class ThirdPartyEntityKind(object):
LOCATION = "location" LOCATION = "location"
# the version we will give rooms which are created on this server
DEFAULT_ROOM_VERSION = "1"
# vdh-test-version is a placeholder to get room versioning support working and tested # vdh-test-version is a placeholder to get room versioning support working and tested
# until we have a working v2. # until we have a working v2.
KNOWN_ROOM_VERSIONS = {"1", "vdh-test-version"} KNOWN_ROOM_VERSIONS = {"1", "vdh-test-version"}

View File

@ -16,7 +16,6 @@
import logging import logging
from synapse.api.constants import KNOWN_ROOM_VERSIONS
from synapse.http.endpoint import parse_and_validate_server_name from synapse.http.endpoint import parse_and_validate_server_name
from ._base import Config, ConfigError from ._base import Config, ConfigError
@ -76,16 +75,6 @@ class ServerConfig(Config):
) )
else: else:
self.max_mau_value = 0 self.max_mau_value = 0
# the version of rooms created by default on this server
self.default_room_version = str(config.get(
"default_room_version", "1",
))
if self.default_room_version not in KNOWN_ROOM_VERSIONS:
raise ConfigError("Unrecognised value '%s' for default_room_version" % (
self.default_room_version,
))
# FIXME: federation_domain_whitelist needs sytests # FIXME: federation_domain_whitelist needs sytests
self.federation_domain_whitelist = None self.federation_domain_whitelist = None
federation_domain_whitelist = config.get( federation_domain_whitelist = config.get(
@ -260,9 +249,6 @@ class ServerConfig(Config):
# (except those sent by local server admins). The default is False. # (except those sent by local server admins). The default is False.
# block_non_admin_invites: True # block_non_admin_invites: True
# The room_version of rooms which are created by default by this server.
# default_room_version: 1
# Restrict federation to the following whitelist of domains. # Restrict federation to the following whitelist of domains.
# N.B. we recommend also firewalling your federation listener to limit # N.B. we recommend also firewalling your federation listener to limit
# inbound federation traffic as early as possible, rather than relying # inbound federation traffic as early as possible, rather than relying

View File

@ -26,6 +26,7 @@ from six import string_types
from twisted.internet import defer from twisted.internet import defer
from synapse.api.constants import ( from synapse.api.constants import (
DEFAULT_ROOM_VERSION,
KNOWN_ROOM_VERSIONS, KNOWN_ROOM_VERSIONS,
EventTypes, EventTypes,
JoinRules, JoinRules,
@ -106,7 +107,7 @@ class RoomCreationHandler(BaseHandler):
if ratelimit: if ratelimit:
yield self.ratelimit(requester) yield self.ratelimit(requester)
room_version = config.get("room_version", self.hs.config.default_room_version) room_version = config.get("room_version", DEFAULT_ROOM_VERSION)
if not isinstance(room_version, string_types): if not isinstance(room_version, string_types):
raise SynapseError( raise SynapseError(
400, 400,