diff --git a/README.md b/README.md index 3fd83bdb..6e30136b 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,6 @@ For Runtime API, Metrics and Alerting enable state file and stat socket on HApro # Update ``` # cd /var/www/haproxy-wi -# chmod +x update.sh # ./update.sh ``` diff --git a/app/funct.py b/app/funct.py index da800f3a..b4643371 100644 --- a/app/funct.py +++ b/app/funct.py @@ -43,6 +43,7 @@ def logging(serv, action, **kwargs): import sql import http.cookies log_path = get_config_var('main', 'log_path') + login = '' if not os.path.exists(log_path): os.makedirs(log_path) diff --git a/app/login.py b/app/login.py index e92fd823..3af25add 100644 --- a/app/login.py +++ b/app/login.py @@ -73,6 +73,7 @@ if login is not None and password is not None: print(c) sql.write_user_uuid(login, user_uuid) sql.write_user_token(login, user_token) + funct.logging('locahost', sql.get_user_name_by_uuid(user_uuid)+' log in') print("Content-type: text/html\n") print('ok') sys.exit() diff --git a/app/templates/logs.html b/app/templates/logs.html index ed9940eb..80bc05b7 100644 --- a/app/templates/logs.html +++ b/app/templates/logs.html @@ -16,7 +16,7 @@ Number rows Ex for grep - + : - : diff --git a/install.sh b/install.sh index 11f67cf7..12c0d4e1 100644 --- a/install.sh +++ b/install.sh @@ -418,6 +418,7 @@ sudo mkdir /var/www/$HOME_HAPROXY_WI/configs/kp_config/ sudo mkdir /var/www/$HOME_HAPROXY_WI/log/ sudo sudo chmod +x /var/www/$HOME_HAPROXY_WI/app/*.py sudo chmod +x /var/www/$HOME_HAPROXY_WI/app/tools/*.py +chmod +x /var/www/$HOME_HAPROXY_WI/update.sh cd /var/www/$HOME_HAPROXY_WI/app ./create_db.py diff --git a/requirements.txt b/requirements.txt index 4ed94962..2b09828f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ configparser==3.5.0 -paramiko==2.4.1 +paramiko==2.4.2 pytz==2017.3 requests==2.18.4 requests_toolbelt==0.8.0 diff --git a/update.sh b/update.sh index f1ab2fb1..bf574ed3 100644 --- a/update.sh +++ b/update.sh @@ -1,6 +1,6 @@ #!/bin/bash -cp app/haproxy-webintarface.config /tmp/ +cp app/haproxy-wi.cfg /tmp/ git reset --hard git pull https://github.com/Aidaho12/haproxy-wi.git @@ -22,24 +22,14 @@ cd app/ pip3 install -r ../requirements.txt pip3.5 install -r ../requirements.txt +chmod +x ../update.sh -echo "" -echo "#################" -echo "Change in config:" -diff --expand-tabs -W 100 -y /tmp/haproxy-webintarface.config haproxy-wi.cfg -echo "" -echo "Please set your config" -echo "" -echo "################" -echo "Your config saved in /tmp/haproxy-webintarface.config. Please compare with new and set your env back" -echo "" -echo "" -echo "" +mv /tmp/haproxy-wi.cfg app/haproxy-wi.cfg echo "################" echo "" echo "" echo "" -echo "ATTENTION!!! New config file name: haproxy-wi.cfg" +echo "ATTENTION!!! New config file name is: haproxy-wi.cfg" echo "" echo "" echo ""