From 349e238f8104f72efb4d980dabacbc4869f47105 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:20:30 +0800 Subject: [PATCH 1/8] temp commit --- appmanage/api/service/manage.py | 2 +- appmanage/api/settings/settings.py | 2 +- appmanage/api/utils/docker.py | 2 +- appmanage/api/utils/files.py | 2 +- appmanage/api/utils/{common_log.py => log.py} | 0 appmanage/api/utils/nginx.py | 2 +- appmanage/api/utils/shell_execute.py | 2 +- appmanage/api/v1/routers/apps.py | 2 +- appmanage/create.sql | 0 appmanage/hostname.py | 2 +- appmanage/main.py | 2 +- 11 files changed, 9 insertions(+), 9 deletions(-) rename appmanage/api/utils/{common_log.py => log.py} (100%) create mode 100644 appmanage/create.sql diff --git a/appmanage/api/service/manage.py b/appmanage/api/service/manage.py index 2b171028..85e6014f 100644 --- a/appmanage/api/service/manage.py +++ b/appmanage/api/service/manage.py @@ -18,7 +18,7 @@ from api.service import db from api.model.response import Response from api.model.config import Config from api.model.status_reason import StatusReason -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from redis import Redis from rq import Queue, Worker, Connection from rq.registry import StartedJobRegistry, FinishedJobRegistry, DeferredJobRegistry, FailedJobRegistry, ScheduledJobRegistry, CanceledJobRegistry diff --git a/appmanage/api/settings/settings.py b/appmanage/api/settings/settings.py index a0f32c66..449f2c23 100644 --- a/appmanage/api/settings/settings.py +++ b/appmanage/api/settings/settings.py @@ -1,4 +1,4 @@ -from api.utils.common_log import myLogger +from api.utils.log import myLogger from api.utils.helper import Singleton diff --git a/appmanage/api/utils/docker.py b/appmanage/api/utils/docker.py index bae2901e..325259c8 100644 --- a/appmanage/api/utils/docker.py +++ b/appmanage/api/utils/docker.py @@ -4,7 +4,7 @@ from api.utils import shell_execute from dotenv import load_dotenv, find_dotenv import dotenv from pathlib import Path -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from api.utils import shell_execute, const from api.exception.command_exception import CommandException from api.service import manage diff --git a/appmanage/api/utils/files.py b/appmanage/api/utils/files.py index 9735006b..6639f0df 100644 --- a/appmanage/api/utils/files.py +++ b/appmanage/api/utils/files.py @@ -1,4 +1,4 @@ -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from api.utils.helper import Singleton diff --git a/appmanage/api/utils/common_log.py b/appmanage/api/utils/log.py similarity index 100% rename from appmanage/api/utils/common_log.py rename to appmanage/api/utils/log.py diff --git a/appmanage/api/utils/nginx.py b/appmanage/api/utils/nginx.py index e2ee711b..a7aa29a2 100644 --- a/appmanage/api/utils/nginx.py +++ b/appmanage/api/utils/nginx.py @@ -1 +1 @@ -# connect Nginx Proxy Manager and executive API commands \ No newline at end of file +# connect Nginx Proxy Manager and executive API endpoint \ No newline at end of file diff --git a/appmanage/api/utils/shell_execute.py b/appmanage/api/utils/shell_execute.py index 7e7057a7..0ce61a7c 100644 --- a/appmanage/api/utils/shell_execute.py +++ b/appmanage/api/utils/shell_execute.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 import os, io, sys, platform, shutil, time, subprocess, json, datetime -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from api.exception.command_exception import CommandException from api.utils import const diff --git a/appmanage/api/v1/routers/apps.py b/appmanage/api/v1/routers/apps.py index 52a81bc0..c2e540a4 100644 --- a/appmanage/api/v1/routers/apps.py +++ b/appmanage/api/v1/routers/apps.py @@ -9,7 +9,7 @@ from api.model.app import App from api.model.response import Response from api.service import manage, db from api.utils import shell_execute, const -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from api.exception.command_exception import CommandException from api.settings.settings import settings diff --git a/appmanage/create.sql b/appmanage/create.sql new file mode 100644 index 00000000..e69de29b diff --git a/appmanage/hostname.py b/appmanage/hostname.py index 7fff95e2..31d69623 100644 --- a/appmanage/hostname.py +++ b/appmanage/hostname.py @@ -1,4 +1,4 @@ -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from api.utils import shell_execute shell_execute.execute_command_output_all("sed -i '/websoft9-appmanage/d' /etc/hosts") diff --git a/appmanage/main.py b/appmanage/main.py index 838b0c36..4186d702 100644 --- a/appmanage/main.py +++ b/appmanage/main.py @@ -12,7 +12,7 @@ from fastapi.openapi.docs import ( import api.v1.api as api_router_v1 -from api.utils.common_log import myLogger +from websoft9.appmanage.api.utils.log import myLogger from api.utils import shell_execute from api.settings.settings import settings From 275b8d8436008e921a29087b53fe3b0cdaed1c69 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:22:48 +0800 Subject: [PATCH 2/8] Update manage.py --- appmanage/api/service/manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appmanage/api/service/manage.py b/appmanage/api/service/manage.py index 85e6014f..b02504c5 100644 --- a/appmanage/api/service/manage.py +++ b/appmanage/api/service/manage.py @@ -18,7 +18,7 @@ from api.service import db from api.model.response import Response from api.model.config import Config from api.model.status_reason import StatusReason -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from redis import Redis from rq import Queue, Worker, Connection from rq.registry import StartedJobRegistry, FinishedJobRegistry, DeferredJobRegistry, FailedJobRegistry, ScheduledJobRegistry, CanceledJobRegistry From 1e0ffc08a65bb3fd0831b8e464864b1f0235efd3 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:23:14 +0800 Subject: [PATCH 3/8] Update docker.py --- appmanage/api/utils/docker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appmanage/api/utils/docker.py b/appmanage/api/utils/docker.py index 325259c8..bca2b28a 100644 --- a/appmanage/api/utils/docker.py +++ b/appmanage/api/utils/docker.py @@ -4,7 +4,7 @@ from api.utils import shell_execute from dotenv import load_dotenv, find_dotenv import dotenv from pathlib import Path -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from api.utils import shell_execute, const from api.exception.command_exception import CommandException from api.service import manage From 802efb429a1ed127e40ea733d6a465231582251a Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:23:55 +0800 Subject: [PATCH 4/8] Update files.py --- appmanage/api/utils/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appmanage/api/utils/files.py b/appmanage/api/utils/files.py index 6639f0df..53eed1e7 100644 --- a/appmanage/api/utils/files.py +++ b/appmanage/api/utils/files.py @@ -1,4 +1,4 @@ -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from api.utils.helper import Singleton @@ -66,4 +66,4 @@ class SettingsFile(object): # This class is add/modify/cat/delete content from file -# src: path | URL \ No newline at end of file +# src: path | URL From bd3fed978dc021d878ce65977a7e0545019d9517 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:24:13 +0800 Subject: [PATCH 5/8] Update shell_execute.py --- appmanage/api/utils/shell_execute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appmanage/api/utils/shell_execute.py b/appmanage/api/utils/shell_execute.py index 0ce61a7c..7aa7a2ee 100644 --- a/appmanage/api/utils/shell_execute.py +++ b/appmanage/api/utils/shell_execute.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 import os, io, sys, platform, shutil, time, subprocess, json, datetime -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from api.exception.command_exception import CommandException from api.utils import const From e0be8f29ee0bd4f6412c6e409435cffae39af4ee Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:24:30 +0800 Subject: [PATCH 6/8] Update apps.py --- appmanage/api/v1/routers/apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appmanage/api/v1/routers/apps.py b/appmanage/api/v1/routers/apps.py index c2e540a4..61f377b5 100644 --- a/appmanage/api/v1/routers/apps.py +++ b/appmanage/api/v1/routers/apps.py @@ -9,7 +9,7 @@ from api.model.app import App from api.model.response import Response from api.service import manage, db from api.utils import shell_execute, const -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from api.exception.command_exception import CommandException from api.settings.settings import settings From 61e925ada5469fa36970b89c5e5d32d97994b991 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:24:53 +0800 Subject: [PATCH 7/8] Update hostname.py --- appmanage/hostname.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appmanage/hostname.py b/appmanage/hostname.py index 31d69623..8a005a0e 100644 --- a/appmanage/hostname.py +++ b/appmanage/hostname.py @@ -1,5 +1,5 @@ -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from api.utils import shell_execute shell_execute.execute_command_output_all("sed -i '/websoft9-appmanage/d' /etc/hosts") -shell_execute.execute_command_output_all("echo $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' websoft9-appmanage) websoft9-appmanage >> /etc/hosts") \ No newline at end of file +shell_execute.execute_command_output_all("echo $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' websoft9-appmanage) websoft9-appmanage >> /etc/hosts") From 69faacb250f3d8c217b2622769f4b44ee6af1886 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 26 Aug 2023 18:25:30 +0800 Subject: [PATCH 8/8] Update main.py --- appmanage/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appmanage/main.py b/appmanage/main.py index 4186d702..33000e6b 100644 --- a/appmanage/main.py +++ b/appmanage/main.py @@ -12,7 +12,7 @@ from fastapi.openapi.docs import ( import api.v1.api as api_router_v1 -from websoft9.appmanage.api.utils.log import myLogger +from api.utils.log import myLogger from api.utils import shell_execute from api.settings.settings import settings @@ -66,4 +66,4 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description='websoft9') parser.add_argument("--port", type=int, dest='port', default=5000, metavar="port") args = parser.parse_args() - uvicorn.run("main:get_app", host='0.0.0.0', port=args.port, reload=True) \ No newline at end of file + uvicorn.run("main:get_app", host='0.0.0.0', port=args.port, reload=True)