This commit is contained in:
qiaofeng1227 2024-10-29 15:00:52 +08:00
parent 49825d5b6f
commit 4d67aad97e
3 changed files with 20 additions and 18 deletions

View file

@ -110,7 +110,7 @@ def commit(appid, github_token):
github_env_vars = dotenv_values(github_env_path)
# 需要复制的变量
env_vars_to_copy = ['W9_URL', 'W9_ID', 'W9_POWER_PASSWORD', 'W9_VERSION']
env_vars_to_copy = ['W9_URL', 'W9_ID']
port_set_vars = {key: value for key, value in github_env_vars.items() if key.endswith('PORT_SET')}
# 将这些值去替换gitea_repo_url目录下.env中对应项的值

View file

@ -5,4 +5,4 @@ path = /websoft9/library/apps
path = /websoft9/media/json/
[max_apps]
key = 2
key =

View file

@ -430,23 +430,25 @@ class AppManger:
# Verify the app is web app
is_web_app = envHelper.get_value("W9_URL")
url_with_port = envHelper.get_value("W9_URL_WITH_PORT")
if is_web_app is not None and url_with_port is not None:
try:
ipaddress.ip_address(domain_names[0])
envHelper.set_value("W9_URL", domain_names[0] + ":" + envHelper.get_value("W9_HTTP_PORT_SET"))
except ValueError:
if is_web_app is not None:
if url_with_port is None:
envHelper.set_value("W9_URL", domain_names[0])
elif url_with_port is None:
envHelper.set_value("W9_URL", domain_names[0])
# validate is bind ip(proxy_enabled is false)
# if not proxy_enabled:
# envHelper.set_value("W9_URL", domain_names[0])
# else:
# replace_domain_name = domain_names[0]
# replace_domain_name = replace_domain_name.replace(replace_domain_name.split(".")[0], app_id, 1)
# domain_names[0] = replace_domain_name
# envHelper.set_value("W9_URL", domain_names[0])
else:
try:
ipaddress.ip_address(domain_names[0])
envHelper.set_value("W9_URL", domain_names[0] + ":" + envHelper.get_value("W9_HTTP_PORT_SET"))
except ValueError:
envHelper.set_value("W9_URL", domain_names[0])
# if is_web_app is not None and url_with_port is not None:
# try:
# ipaddress.ip_address(domain_names[0])
# envHelper.set_value("W9_URL", domain_names[0] + ":" + envHelper.get_value("W9_HTTP_PORT_SET"))
# except ValueError:
# envHelper.set_value("W9_URL", domain_names[0])
# elif url_with_port is None:
# envHelper.set_value("W9_URL", domain_names[0])
# Commit and push to remote repo
self._init_local_repo_and_push_to_remote(app_tmp_dir_path,repo_url)