From dc39583cc6af1e2e741767e32ab7598a0c4f7d47 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Mon, 21 Apr 2025 17:45:53 +0300 Subject: [PATCH] [+] add auto addr search for public, http-server --- python/online/fxreader/pr34/commands.py | 15 +++++++++++++++ python/pyproject.toml | 2 +- ...ne_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl diff --git a/python/online/fxreader/pr34/commands.py b/python/online/fxreader/pr34/commands.py index 3ddc74a..e46505d 100644 --- a/python/online/fxreader/pr34/commands.py +++ b/python/online/fxreader/pr34/commands.py @@ -1215,6 +1215,21 @@ def http_server(argv): assert options.port >= 1 try: + if options.public and options.host == '0.0.0.0': + found : bool = False + for o in commands_os.interfaces_index(): + if found: + break + for o2 in o.addr_info: + if o2.family == 'inet' and o2.local != '127.0.0.1': + options.host = o2.local + logger.info(dict( + host=options.host, + msg='found', + )) + found = True + break + assert not socket.inet_aton(options.host) is None # subprocess.check_call([ # 'ping', '-w', '1', diff --git a/python/pyproject.toml b/python/pyproject.toml index 6c471a1..034c986 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = 'online.fxreader.pr34' -version = '0.1.5.9+27.2' +version = '0.1.5.9+27.3' dependencies = [ #"-r requirements.txt", diff --git a/releases/whl/online_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl new file mode 100644 index 0000000..542dfd8 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e209b950527be9887687ddb0cf7a866595c0222f6492df4b7860683dffc9e030 +size 69874