From c95924028069dfe212fdf7ce6c0ac9195bcad80b Mon Sep 17 00:00:00 2001 From: Aidaho Date: Fri, 31 Mar 2023 20:37:26 +0300 Subject: [PATCH] v6.3.8.0 Changelog: https://roxy-wi.org/changelog#6_3_8 --- .../roles/service_common/tasks/main.yml | 14 +++++++++++++ app/scripts/install_keepalived.sh | 4 ++++ app/statsview.py | 6 ++++-- app/templates/ha.html | 4 ++-- app/templates/languages/en.html | 18 +++++++++++++++++ app/templates/languages/fr.html | 20 ++++++++++++++++++- app/templates/languages/pt-br.html | 20 ++++++++++++++++++- app/templates/languages/ru.html | 18 +++++++++++++++++ inc/ha.js | 6 ++++-- 9 files changed, 102 insertions(+), 8 deletions(-) diff --git a/app/scripts/ansible/roles/service_common/tasks/main.yml b/app/scripts/ansible/roles/service_common/tasks/main.yml index dc5b932c..52aa2c35 100644 --- a/app/scripts/ansible/roles/service_common/tasks/main.yml +++ b/app/scripts/ansible/roles/service_common/tasks/main.yml @@ -36,6 +36,20 @@ - { path: "{{ service_dir }}/conf.d"} when: service not in ansible_facts.packages +- name: Creates directorys for Apache + file: + path: "{{ item.path }}" + state: directory + mode: 0775 + owner: "{{ service_user }}" + group: "{{ service_group }}" + with_items: + - { path: "{{ service_dir }}"} + - { path: "{{ service_dir }}/{{ conf_folder }}"} + when: + - service not in ansible_facts.packages + - service = "apache" + - name: Set passlib version set_fact: diff --git a/app/scripts/install_keepalived.sh b/app/scripts/install_keepalived.sh index 0d8a10a9..fbdd6ac4 100644 --- a/app/scripts/install_keepalived.sh +++ b/app/scripts/install_keepalived.sh @@ -37,6 +37,10 @@ PWD=`pwd` PWD=$PWD/scripts/ansible/ echo "$HOST ansible_port=$SSH_PORT" > $PWD/$HOST +if [[ $MASTER == 'BACKUP' ]]; then + sleep 5 +fi + if [[ $KEY == "" ]]; then ansible-playbook $PWD/roles/keepalived.yml -e "ansible_user=$USER ansible_ssh_pass='$PASS' variable_host=$HOST SYN_FLOOD=$SYN_FLOOD PROXY=$PROXY MASTER=$MASTER ETH=$ETH ETH_SLAVE=$ETH_SLAVE keepalived_path_logs=$keepalived_path_logs IP=$IP RESTART=$RESTART RETURN_TO_MASTER=$RETURN_TO_MASTER ADD_VRRP=$ADD_VRRP router_id=$router_id HAPROXY=$HAPROXY NGINX=$NGINX SSH_PORT=$SSH_PORT" -i $PWD/$HOST else diff --git a/app/statsview.py b/app/statsview.py index 2e995e5e..674e1141 100644 --- a/app/statsview.py +++ b/app/statsview.py @@ -27,13 +27,15 @@ except Exception: if service in ('haproxy', 'nginx', 'apache'): service_desc = sql.select_service(service) if roxywi_auth.check_login(user_params['user_uuid'], user_params['token'], service=service_desc.service_id): - roxywi_common.get_dick_permit(service=service_desc.slug) + servers = roxywi_common.get_dick_permit(service=service_desc.slug) else: print('') + + rendered_template = template.render( h2=1, autorefresh=1, role=user_params['role'], user=user_params['user'], onclick="showStats()", - selects=user_params['servers'], serv=serv, service=service, user_services=user_params['user_services'], + selects=servers, serv=serv, service=service, user_services=user_params['user_services'], token=user_params['token'], select_id="serv", lang=user_params['lang'], service_desc=service_desc ) print(rendered_template) diff --git a/app/templates/ha.html b/app/templates/ha.html index 605b83fe..e46546b2 100644 --- a/app/templates/ha.html +++ b/app/templates/ha.html @@ -142,7 +142,7 @@
{{lang.words.read|title()}} {{lang.phrases.howto_ha}}
- -