First try at starting synapse
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
database:
|
||||
args: /home/jorik/Dev/synapse/synapse_topology/config_dir/data/homeserver.db
|
||||
name: psycopg2
|
||||
listeners:
|
||||
- port: 8008
|
||||
resources:
|
||||
- names:
|
||||
- federation
|
||||
- client
|
||||
tls: true
|
||||
type: http
|
||||
log_config: /home/jorik/Dev/synapse/synapse_topology/config_dir/undefined.log.config
|
||||
media_store_path: /home/jorik/Dev/synapse/synapse_topology/config_dir/data/media_store
|
||||
pid_file: /home/jorik/Dev/synapse/synapse_topology/config_dir/data/homeserver.pid
|
||||
report_stats: true
|
||||
server_config_in_use: true
|
||||
server_name: myserver.net
|
||||
tls_certificate_path: /home/jorik/Dev/synapse/synapse_topology/config_dir/undefined.tls.cert
|
||||
tls_private_key_path: /home/jorik/Dev/synapse/synapse_topology/config_dir/undefined.tls.key
|
||||
uploads_path: /home/jorik/Dev/synapse/synapse_topology/config_dir/data/uploads
|
||||
|
||||
@@ -19,6 +19,9 @@ from .utils import validate_schema, log_body_if_fail
|
||||
|
||||
from . import app
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
@app.route("/topology_webui/", branch=True)
|
||||
def server_webui(request):
|
||||
@@ -106,3 +109,9 @@ def check_ports(request, body):
|
||||
results.append(port_checker(port))
|
||||
return json.dumps({"ports": results})
|
||||
|
||||
|
||||
@app.route("/start", methods=["POST"])
|
||||
def start_synapse():
|
||||
print("Start")
|
||||
subprocess.Popen("synctl", "start", "-c", model.get_config_dir(), "homeserver.yaml")
|
||||
sys.exit()
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
post_certs,
|
||||
test_ports,
|
||||
post_config,
|
||||
start_synapse,
|
||||
} from '../api';
|
||||
import { CONFIG_LOCK, CONFIG_DIR } from '../api/constants';
|
||||
import { base_config_to_synapse_config } from '../utils/yaml';
|
||||
@@ -249,6 +250,6 @@ export const set_database = database => ({
|
||||
export const write_config = (config, sub_config_name) => {
|
||||
return (dispatch, getState) => {
|
||||
post_config(base_config_to_synapse_config(getState().base_config), sub_config_name)
|
||||
.then(res => console.log(res), error => dispatch(fail(error)))
|
||||
.then(res => start_synapse(), error => dispatch(fail(error)))
|
||||
}
|
||||
}
|
||||
@@ -7,4 +7,5 @@ export const SETUP_CHECK = "/setup";
|
||||
export const CERT_PATHS = "/testcertpaths";
|
||||
export const TEST_PORTS = "/ports";
|
||||
export const CONFIG_LOCK = "server_config_in_use";
|
||||
export const CONFIG_DIR = "config_dir";
|
||||
export const CONFIG_DIR = "config_dir";
|
||||
export const START = "/start";
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
SETUP_CHECK,
|
||||
CERT_PATHS,
|
||||
TEST_PORTS,
|
||||
START,
|
||||
} from './constants';
|
||||
|
||||
const fetchAbs = fetchAbsolute(fetch)(API_URL)
|
||||
@@ -84,3 +85,5 @@ export const post_config = (config, sub_config_name) =>
|
||||
// Checks if the server's base config has been setup.
|
||||
export const get_server_setup = () => fetchAbs(SETUP_CHECK)
|
||||
.then(res => res.json())
|
||||
|
||||
export const start_synapse = () => fetchAbs(START)
|
||||
Reference in New Issue
Block a user