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)
+
|