print local and remote app urls when app host is set to "0.0.0.0"

+ update app version in settings.py
This commit is contained in:
geoffrey45
2023-01-20 22:21:40 +03:00
parent 5dad45f188
commit 3dc9bc1f15
8 changed files with 790 additions and 650 deletions
+14 -6
View File
@@ -13,7 +13,7 @@ from app.functions import run_periodic_checks
from app.lib.watchdogg import Watcher as WatchDog
from app.settings import APP_VERSION, HELP_MESSAGE, TCOLOR
from app.setup import run_setup
from app.utils import background, get_home_res_path
from app.utils import background, get_home_res_path, get_ip
werkzeug = logging.getLogger("werkzeug")
werkzeug.setLevel(logging.ERROR)
@@ -154,13 +154,21 @@ def start_watchdog():
def log_info():
lines = " -------------------------------------"
lines = " ---------------------------------------"
os.system("cls" if os.name == "nt" else "echo -e \\\\033c")
print(lines)
print(f" {TCOLOR.HEADER}{APP_VERSION} {TCOLOR.ENDC}")
print(
f" Started app on: {TCOLOR.OKGREEN}http://{Variables.FLASK_HOST}:{Variables.FLASK_PORT}{TCOLOR.ENDC}"
)
adresses = [Variables.FLASK_HOST]
if Variables.FLASK_HOST == "0.0.0.0":
adresses = ["localhost", get_ip()]
for address in adresses:
print(
f" Started app on: {TCOLOR.OKGREEN}http://{address}:{Variables.FLASK_PORT}{TCOLOR.ENDC}"
)
print(lines)
print("\n")
@@ -180,4 +188,4 @@ if __name__ == "__main__":
# TODO: Find out how to print in color: red for errors, etc.
# TODO: Find a way to verify the host string
# TODO: Organize code in this file: move args to new file, etc.
# TODO: Organize code in this file: move args to new file, etc.