diff --git a/apphub/src/config/config.ini b/apphub/src/config/config.ini index f61ecbbd..e085f475 100755 --- a/apphub/src/config/config.ini +++ b/apphub/src/config/config.ini @@ -16,7 +16,7 @@ user_name = admin user_pwd = j4FYLqfisbv4vkYY [api_key] -key = df5b3dbcb00091462769fe0bac0c7008c8788ffa72f86c32f4a2c6af90daa285 +key = 689899a928b91838e98abd6ac50fc6f6f1fab73e44932a6fd5167e4ce63e72e0 [domain] wildcard_domain = test.websoft9.cn diff --git a/apphub/src/config/system.ini b/apphub/src/config/system.ini index c185e8a0..caf56404 100755 --- a/apphub/src/config/system.ini +++ b/apphub/src/config/system.ini @@ -1,25 +1,5 @@ -[mysql] -port = 3306 -user = root - -[postgresql] -port = 5432 -user = postgres - -[mongodb] -port = 27017 -user = root - -[oracle] -port = 1521 -user = system - -[sqlserver] -port = 1433 -user = sa - [docker_library] path = /websoft9/library/apps [app_media] -path = /websoft9/media/json/ +path = /websoft9/media/json/ \ No newline at end of file diff --git a/apphub/src/schemas/appResponse.py b/apphub/src/schemas/appResponse.py index b415a848..851bf113 100755 --- a/apphub/src/schemas/appResponse.py +++ b/apphub/src/schemas/appResponse.py @@ -7,7 +7,6 @@ class AppResponse(BaseModel): app_id: str=Field("", description="App ID",example="wordpress") endpointId: int=Field(-1, description="Endpoint ID(-1:Not install on app store)",example=1) app_name: Optional[str]=Field(None, description="App name",example="wordpress") - app_port: Optional[int] = Field(None, description="App port", example=80) app_dist: Optional[str]=Field(None, description="App dist",example="community") app_version: Optional[str]=Field(None, description="App version",example="1.0.0") app_official: bool=Field(True, description="App official",example=True) diff --git a/apphub/src/services/app_manager.py b/apphub/src/services/app_manager.py index 8827a9ae..3550162f 100755 --- a/apphub/src/services/app_manager.py +++ b/apphub/src/services/app_manager.py @@ -1,4 +1,3 @@ -import ipaddress import json import os import shutil @@ -170,7 +169,9 @@ class AppManger: apps_info.append(app_response) return apps_info - except (CustomException,Exception) as e: + except CustomException as e: + raise e + except Exception as e: logger.error(f"Get apps error:{e}") raise CustomException() @@ -246,28 +247,34 @@ class AppManger: app_env = main_container_info.get("Config", {}).get("Env", []) # Get info from app_env - app_port = None app_name = None app_dist = None app_version = None + w9_url = None + w9_url_replace = False for item in app_env: key, value = item.split("=", 1) app_env_format[key] = value - if key == "W9_HTTP_PORT_SET" or key == "W9_DB_PORT_SET": - app_port = value - elif key == "W9_APP_NAME": + if key == "W9_APP_NAME": app_name = value elif key == "W9_DIST": app_dist = value elif key == "W9_VERSION": app_version = value + elif key == "W9_URL_REPLACE": + w9_url_replace = value + elif key == "W9_URL": + w9_url = value + + for domain in domain_names: + domain["w9_url_replace"] = w9_url_replace + domain["w9_url"] = w9_url # Set the appResponse appResponse = AppResponse( app_id = app_id, endpointId = endpointId, app_name = app_name, - app_port = app_port, app_dist = app_dist, app_version = app_version, app_official = True, @@ -286,7 +293,6 @@ class AppManger: app_id = app_id, endpointId = endpointId, app_name = "", - app_port = 0, app_dist = "", app_version = "", app_official = True, @@ -983,6 +989,19 @@ class AppManger: message="Invalid Request", details=f"Proxy ID:{proxy_id} Not Found" ) + # # Get the app_id by proxy_id + # app_id = host.get("forward_host",None) + # if app_id: + # # Get the app_info by app_id + # app_info = self.get_app_by_id(app_id) + # if app_info: + # # Get the w9_url and w9_url_replace + # w9_url = app_info.get("w9_url",None) + # w9_url_replace = app_info.get("w9_url_replace",None) + + # if w9_url_replace: + # domain_names = host.get("domain_names",None) + # Remove proxy ProxyManager().remove_proxy_host_by_id(proxy_id) logger.access(f"Successfully removed domains:{host['domain_names']} for app: [{host['forward_host']}]") diff --git a/source/CHANGELOG.md b/source/CHANGELOG.md index 99d455e6..75794875 100644 --- a/source/CHANGELOG.md +++ b/source/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.8.30 release on 2023-11-16 +## 0.8.30-rc1 release on 2023-11-16 1. improve all plugins githubaction 2. install plugin by shell ## 0.8.29 release on 2023-11-04 diff --git a/source/docker/docker-compose-dev.yml b/source/docker/docker-compose-dev.yml index a23b2625..eeaef90c 100644 --- a/source/docker/docker-compose-dev.yml +++ b/source/docker/docker-compose-dev.yml @@ -16,7 +16,7 @@ services: - 9001-9999:8080 restart: always volumes: - - /data/mysource:/websoft9/apphub-dev + - /data/websoft9/apphub:/websoft9/apphub-dev - apphub_media:/websoft9/media depends_on: - deployment diff --git a/source/version.json b/source/version.json index 6950dcb7..a3ae5e81 100644 --- a/source/version.json +++ b/source/version.json @@ -1,5 +1,5 @@ { - "version": "0.8.30", + "version": "0.8.30-rc1", "plugins": { "portainer": "0.0.8", "nginx": "0.0.6",