mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Support loading application service files from /data/appservices/
This commit is contained in:
parent
107a5c9441
commit
1ffd9cb936
3 changed files with 18 additions and 2 deletions
|
@ -4,6 +4,7 @@ import jinja2
|
|||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import glob
|
||||
|
||||
convert = lambda src, dst, environ: open(dst, "w").write(jinja2.Template(open(src).read()).render(**environ))
|
||||
mode = sys.argv[1] if len(sys.argv) > 1 else None
|
||||
|
@ -26,6 +27,9 @@ for secret in ("SYNAPSE_REGISTRATION_SHARED_SECRET", "SYNAPSE_MACAROON_SECRET_KE
|
|||
print("Generating a random secret for {}".format(secret))
|
||||
environ[secret] = os.urandom(32).encode("hex")
|
||||
|
||||
# Load appservices configurations
|
||||
environ["SYNAPSE_APPSERVICES"] = glob.glob("/data/appservices/*.yaml")
|
||||
|
||||
# In generate mode, generate a configuration, missing keys, then exit
|
||||
if mode == "generate":
|
||||
os.execv("/usr/local/bin/python", args + ["--generate-config"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue