summary refs log tree commit diff
path: root/synapse_topology/model/config.py
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-08-23 10:47:23 +0100
committerJorik Schellekens <joriks@matrix.org>2019-08-28 15:59:54 +0100
commitb78ae32b4ece0d690ad5cd471d742735533fc9f6 (patch)
treee5708e0397ee8fdbe21752a5ee403129ff920dd0 /synapse_topology/model/config.py
parentRemove unused api endpoints. (diff)
downloadsynapse-b78ae32b4ece0d690ad5cd471d742735533fc9f6.tar.xz
Fix config generation
Diffstat (limited to 'synapse_topology/model/config.py')
-rw-r--r--synapse_topology/model/config.py42
1 files changed, 8 insertions, 34 deletions
diff --git a/synapse_topology/model/config.py b/synapse_topology/model/config.py

index 169250a9ab..99db6584a3 100644 --- a/synapse_topology/model/config.py +++ b/synapse_topology/model/config.py
@@ -3,15 +3,14 @@ from synapse.config.server import ServerConfig from synapse.config.tls import TlsConfig from synapse.config.logger import LoggingConfig from synapse.config.homeserver import HomeServerConfig -from model import get_config_dir, get_data_dir, set_config_dir -def create_config(conf): +def create_config(config_dir_path, data_dir_path, conf): server_name = conf["server_name"] del conf["server_name"] - config_dir_path = get_config_dir() - data_dir_path = get_data_dir() + server_config_in_use = conf["server_config_in_use"] + del conf["server_config_in_use"] base_configs = [ServerConfig, DatabaseConfig, TlsConfig] @@ -37,34 +36,9 @@ def create_config(conf): rest_of_config = Configs().generate_config(**config_args) - return {"homeserver.yaml": base_config, "the_rest.yaml": rest_of_config} - - -set_config_dir("/exampledir/") -confs = create_config( - { - "server_name": "banterserver", - "database": "sqlcrap", - "listeners": [ - { - "port": 8448, - "resources": [{"names": ["federation"]}], - "tls": True, - "type": "http", - }, - { - "port": 443, - "resources": [{"names": ["client"]}], - "tls": False, - "type": "http", - }, - ], - "tls_certificate_path": "asdfasfdasdfadf", - "tls_private_key_path": "asdfasfdha;kdfjhafd", - "acme_domain": "asdfaklhsadfkj", - "report_stats": True, + return { + "homeserver.yaml": base_config + + "\n\nserver_config_in_use: {}".format(server_config_in_use), + "the_rest.yaml": rest_of_config, } -) -for conf_name, conf in confs.items(): - with open(conf_name, "w") as f: - f.write(conf) +