mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 15:10:22 +00:00
update apphub
This commit is contained in:
parent
00a45147b6
commit
743eb9e5dc
7 changed files with 32 additions and 34 deletions
|
@ -16,7 +16,7 @@ user_name = admin
|
|||
user_pwd = j4FYLqfisbv4vkYY
|
||||
|
||||
[api_key]
|
||||
key = df5b3dbcb00091462769fe0bac0c7008c8788ffa72f86c32f4a2c6af90daa285
|
||||
key = 689899a928b91838e98abd6ac50fc6f6f1fab73e44932a6fd5167e4ce63e72e0
|
||||
|
||||
[domain]
|
||||
wildcard_domain = test.websoft9.cn
|
||||
|
|
|
@ -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/
|
|
@ -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)
|
||||
|
|
|
@ -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']}]")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "0.8.30",
|
||||
"version": "0.8.30-rc1",
|
||||
"plugins": {
|
||||
"portainer": "0.0.8",
|
||||
"nginx": "0.0.6",
|
||||
|
|
Loading…
Reference in a new issue