Setup the secret key and start synapse.
This commit is contained in:
1
synapse_topology/asdfsaf.asdf
Normal file
1
synapse_topology/asdfsaf.asdf
Normal file
@@ -0,0 +1 @@
|
||||
ed25519 a_altJ iZSrNbHiO1acwiNW3j6kYheALALGXe5uQMzs5NEKP2A
|
||||
@@ -1,20 +0,0 @@
|
||||
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
|
||||
@@ -110,8 +110,13 @@ def check_ports(request, body):
|
||||
return json.dumps({"ports": results})
|
||||
|
||||
|
||||
@app.route("/start", methods=["POST"])
|
||||
def start_synapse():
|
||||
@app.route("/iw", methods=["POST"])
|
||||
def start_synapse(request):
|
||||
print("Start")
|
||||
subprocess.Popen("synctl", "start", "-c", model.get_config_dir(), "homeserver.yaml")
|
||||
subprocess.Popen(["synctl", "start", model.get_config_dir() + "/homeserver.yaml"])
|
||||
sys.exit()
|
||||
|
||||
|
||||
@app.route("/favicon.ico")
|
||||
def noop(request):
|
||||
return
|
||||
|
||||
@@ -9,11 +9,12 @@ from .constants import (
|
||||
CONFIG_LOCK,
|
||||
CONFIG_LOCK_DATA,
|
||||
DATA_SUBDIR,
|
||||
SECRET_KEY,
|
||||
SERVER_NAME,
|
||||
)
|
||||
from .errors import BasConfigInUseError, BaseConfigNotFoundError, ConfigNotFoundError
|
||||
|
||||
import subprocess
|
||||
|
||||
|
||||
def set_config_dir(conf_dir):
|
||||
global config_dir
|
||||
@@ -68,6 +69,7 @@ def generate_base_config(server_name, report_stats):
|
||||
generate_secrets=True,
|
||||
report_stats=report_stats,
|
||||
)
|
||||
|
||||
with open(path.join(config_dir, BASE_CONFIG), "w") as f:
|
||||
f.write(conf)
|
||||
f.write(CONFIG_LOCK_DATA)
|
||||
@@ -81,7 +83,11 @@ def get_server_name():
|
||||
|
||||
def get_secret_key():
|
||||
config = get_config()
|
||||
return config.get(SECRET_KEY)
|
||||
server_name = config.get(SERVER_NAME)
|
||||
signing_key_path = path.join(config_dir, server_name + ".signing.key")
|
||||
subprocess.run(["generate_signing_key.py", "-o", signing_key_path])
|
||||
with open(signing_key_path, "r") as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
def verify_yaml():
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
import {
|
||||
get_server_setup,
|
||||
post_server_name,
|
||||
fetch_secret_key,
|
||||
get_secretkey,
|
||||
post_cert_paths,
|
||||
post_certs,
|
||||
test_ports,
|
||||
@@ -139,7 +139,7 @@ export const getting_secret_keys = () => ({
|
||||
|
||||
export const get_secret_key = () => {
|
||||
return dispatch => {
|
||||
fetch_secret_key().then(
|
||||
get_secretkey().then(
|
||||
result => dispatch(set_secret_key(result)),
|
||||
error => dispatch(fail(error)),
|
||||
)
|
||||
|
||||
@@ -63,7 +63,7 @@ export const test_ports = (ports) =>
|
||||
}
|
||||
).then(res => res.json())
|
||||
|
||||
export const fetch_secret_key = () =>
|
||||
export const get_secretkey = () =>
|
||||
fetchAbs(SECRET_KEY)
|
||||
.then(res => res.json())
|
||||
.then(json => json.secret_key)
|
||||
|
||||
@@ -20,7 +20,7 @@ store.dispatch(startup());
|
||||
|
||||
render(
|
||||
<Provider store={store}>
|
||||
<img className={style.logo} src={logo} />
|
||||
{/* <img className={style.logo} src={logo} /> */}
|
||||
<UI />
|
||||
</Provider>,
|
||||
document.getElementById("content")
|
||||
|
||||
@@ -102,7 +102,7 @@ export const base_config_to_synapse_config = config => {
|
||||
const conf = {
|
||||
server_name: config.servername,
|
||||
report_stats: config.report_stats,
|
||||
log_config: config.config_dir + "/" + config.server_name + ".log.config",
|
||||
log_config: config.config_dir + "/" + config.servername + ".log.config",
|
||||
media_store_path: config.config_dir + "/data/media_store",
|
||||
uploads_path: config.config_dir + "/data/uploads",
|
||||
pid_file: config.config_dir + "/data/homeserver.pid",
|
||||
|
||||
Reference in New Issue
Block a user