From 3b1f91bcb058f90b32a6a851451acea024c7d73a Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Fri, 11 Mar 2022 17:05:45 +0000 Subject: [PATCH] Allow setting the host parameter In order to run in a Docker container, it is necessary to listen on all interfaces (`0.0.0.0`). So make it possible to set the host. Fixes #1 Signed-off-by: Jacob Kiers --- tzk/__main__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tzk/__main__.py b/tzk/__main__.py index bd334a9..094d31b 100644 --- a/tzk/__main__.py +++ b/tzk/__main__.py @@ -83,6 +83,12 @@ class ListenCommand(CliCommand): @classmethod def setup_arguments(cls, parser: argparse.ArgumentParser) -> None: + parser.add_argument( + "--host", + metavar="HOST", + help="Host to listen on.", + default=str(cm().listen_host or "127.0.0.1"), + ) parser.add_argument( "-p", "--port", metavar="PORT", @@ -109,6 +115,7 @@ class ListenCommand(CliCommand): tw.exec( [ ("listen", + f"host={args.host}", f"port={args.port}", f"username={args.username}", f"password={args.password}")