data_path

This commit is contained in:
qiaofeng1227 2023-05-20 14:14:46 +08:00
parent e7f107dec2
commit 694965a582
4 changed files with 9 additions and 5 deletions

View file

@ -10,7 +10,7 @@ COPY static ./static
COPY requirements.txt main.py ./
RUN apt update
# Install supervisords
# Install supervisord
RUN apt install -y supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY config/cmd.sh /cmd.sh

View file

@ -12,7 +12,7 @@ class App(BaseModel):
official_app: bool
app_version: str
create_time: str
volume_data = []
volume_data = str
config_path = str
image_url: str
app_https: bool

View file

@ -319,7 +319,7 @@ def get_apps_from_compose():
official_app = False
app_version = ""
create_time = ""
volume_data = []
volume_data = ""
config_path = app_path
app_https = False
app_replace_url = False
@ -360,10 +360,10 @@ def get_apps_from_compose():
else:
default_domain = domain
except IndexError:
pass
pass
try:
app_version = env_map.get("APP_VERSION")
volume_data = ["/var/lib/docker/volumes"]
volume_data = "/data/apps/" + customer_name + "/data"
user_name = env_map.get("APP_USER","")
password = env_map.get("POWER_PASSWORD","")

View file

@ -151,6 +151,10 @@ def check_app_compose(app_name, customer_name):
# set random password
power_password = shell_execute.execute_command_output_all("cat /data/apps/" + customer_name +"/.env")["result"]
if "POWER_PASSWORD" in power_password:
try:
shell_execute.execute_command_output_all("docker rm -f pwgen")
except Exception:
pass
new_password = shell_execute.execute_command_output_all("docker run --name pwgen backplane/pwgen 15")["result"].rstrip('\n') + "!"
modify_env(install_path + '/.env', 'POWER_PASSWORD', new_password)
shell_execute.execute_command_output_all("docker rm -f pwgen")