mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-18 00:54:23 -05:00
Add config option to specify where generated files should be dumped
This commit is contained in:
parent
bfb66773a4
commit
af7c1397d1
@ -144,6 +144,12 @@ class Config(object):
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Generate any missing key files then exit"
|
help="Generate any missing key files then exit"
|
||||||
)
|
)
|
||||||
|
config_parser.add_argument(
|
||||||
|
"--generated-directory",
|
||||||
|
metavar="DIRECTORY",
|
||||||
|
help="Used with 'generate-*' options to specify where generated"
|
||||||
|
" files (such as certs and signing keys) should be stored."
|
||||||
|
)
|
||||||
config_parser.add_argument(
|
config_parser.add_argument(
|
||||||
"-H", "--server-name",
|
"-H", "--server-name",
|
||||||
help="The server name to generate a config file for"
|
help="The server name to generate a config file for"
|
||||||
@ -178,7 +184,10 @@ class Config(object):
|
|||||||
)
|
)
|
||||||
(config_path,) = config_files
|
(config_path,) = config_files
|
||||||
if not os.path.exists(config_path):
|
if not os.path.exists(config_path):
|
||||||
config_dir_path = os.path.dirname(config_path)
|
if config_args.generated_directory:
|
||||||
|
config_dir_path = config_args.generated_directory
|
||||||
|
else:
|
||||||
|
config_dir_path = os.path.dirname(config_path)
|
||||||
config_dir_path = os.path.abspath(config_dir_path)
|
config_dir_path = os.path.abspath(config_dir_path)
|
||||||
|
|
||||||
server_name = config_args.server_name
|
server_name = config_args.server_name
|
||||||
@ -227,7 +236,10 @@ class Config(object):
|
|||||||
" -c CONFIG-FILE\""
|
" -c CONFIG-FILE\""
|
||||||
)
|
)
|
||||||
|
|
||||||
config_dir_path = os.path.dirname(config_args.config_path[-1])
|
if config_args.generated_directory:
|
||||||
|
config_dir_path = config_args.generated_directory
|
||||||
|
else:
|
||||||
|
config_dir_path = os.path.dirname(config_args.config_path[-1])
|
||||||
config_dir_path = os.path.abspath(config_dir_path)
|
config_dir_path = os.path.abspath(config_dir_path)
|
||||||
|
|
||||||
specified_config = {}
|
specified_config = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user