From 104f3aecf5aae58d2e8c147418f4a97420a86c88 Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 12:29:58 +0800 Subject: [PATCH 01/33] Create mds-cli --- mds-cli | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 mds-cli diff --git a/mds-cli b/mds-cli new file mode 100644 index 000000000..907f97f34 --- /dev/null +++ b/mds-cli @@ -0,0 +1,73 @@ +#!/www/server/mdserver-web/bin/python +# description: mdserver-web cli tools +# ln -s /www/server/mdserver-web/mds-cli /usr/bin/mds-cli +import os +import sys + +def mw_start(): + """ + Start mdserver-web + """ + os.system('bash cli.sh start') + print("服务已启动") + + +def mw_stop(): + """ + stop mdserver-web + """ + os.system('bash cli.sh stop') + print("服务已停止") + +def mw_restart(): + """ + restart mdserver-web + """ + os.system('bash cli.sh stop && bash cli.sh start') + print("服务已重启") + +def mw_reset_username(): + """ + reset mdserver-web username + """ + from tools import set_panel_username + user_name = input("请输入新的用户名: ") + set_panel_username(user_name) + +def mw_reset_pwd(): + """ + reset mdserver-web password + """ + from tools import set_panel_pwd + pwd = input("请输入新的密码: ") + set_panel_pwd(pwd, True) + + +if __name__ == '__main__': + sys.path.append(os.getcwd() + "/class/core") + + try: + str = ''' + ==== mdserver-web cli tools ==== + 1. 启动服务 2. 停止服务 + 3. 重启服务 4. 修改用户名 + 5. 修改密码 + ================================= + ''' + print(str) + sw = input("请输入您要进行的操作: ") + + if sw == '1': + mw_start() + elif sw == '2': + mw_stop() + elif sw == '3': + mw_restart() + elif sw == '4': + mw_reset_username() + elif sw == '5': + mw_reset_pwd() + else: + print("操作不存在") + except KeyboardInterrupt: + print("\n操作已终止") From d252ab9aa85e52c0fd45dc4c5a3989097cb3806f Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 12:30:54 +0800 Subject: [PATCH 02/33] add mds-cli --- scripts/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 44552dddb..9d894d9af 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -74,7 +74,8 @@ fi echo "use system version: ${OSNAME}" curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash +ln -s /www/server/mdserver-web/mds-cli /usr/bin/mds-cli endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) -echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file +echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" From 381e941cf138ba178e821726f756e631508aa138 Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 12:32:56 +0800 Subject: [PATCH 03/33] Update install.sh --- scripts/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install.sh b/scripts/install.sh index 9d894d9af..814cfbc95 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -74,6 +74,7 @@ fi echo "use system version: ${OSNAME}" curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash +chmod +x /www/server/mdserver-web/mds-cli ln -s /www/server/mdserver-web/mds-cli /usr/bin/mds-cli endTime=`date +%s` From d0a449a57237b7665d20cba85371cb25b0c87969 Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 12:37:42 +0800 Subject: [PATCH 04/33] Update mds-cli --- mds-cli | 1 + 1 file changed, 1 insertion(+) diff --git a/mds-cli b/mds-cli index 907f97f34..2ff326018 100644 --- a/mds-cli +++ b/mds-cli @@ -44,6 +44,7 @@ def mw_reset_pwd(): if __name__ == '__main__': + os.chdir("/www/server/mdserver-web") sys.path.append(os.getcwd() + "/class/core") try: From 4307700d0382b15251021110da81695e8cb21ee0 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 12:51:30 +0800 Subject: [PATCH 05/33] Update centos.sh --- scripts/install/centos.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 49ae894eb..f2b20f964 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -86,13 +86,13 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data +pip install --upgrade pip if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . fi if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt - pip install --upgrade pip pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 @@ -102,7 +102,6 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install psutil==5.9.1 pip3 install pymongo else - pip install --upgrade pip cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 From 90fc96c04eb770ae50ae07d76b9fc7156ee8e9cd Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 12:51:57 +0800 Subject: [PATCH 06/33] Update centos.sh --- scripts/install/centos.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index f2b20f964..e330b24aa 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -93,6 +93,7 @@ fi if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 @@ -103,6 +104,7 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install pymongo else cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 From b60689bc707079f0b654564ee1a5d33ef9e2f4c8 Mon Sep 17 00:00:00 2001 From: soxft Date: Tue, 21 Jun 2022 12:52:28 +0800 Subject: [PATCH 07/33] fix --- mds-cli => mw-cli | 29 ++++++++++++++++++----------- scripts/install.sh | 4 ++-- 2 files changed, 20 insertions(+), 13 deletions(-) rename mds-cli => mw-cli (79%) diff --git a/mds-cli b/mw-cli similarity index 79% rename from mds-cli rename to mw-cli index 2ff326018..8d5f63f10 100644 --- a/mds-cli +++ b/mw-cli @@ -1,31 +1,34 @@ #!/www/server/mdserver-web/bin/python # description: mdserver-web cli tools -# ln -s /www/server/mdserver-web/mds-cli /usr/bin/mds-cli +# ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli import os import sys + def mw_start(): """ Start mdserver-web """ - os.system('bash cli.sh start') + os.system('systemctl start mw') print("服务已启动") - - + + def mw_stop(): """ stop mdserver-web """ - os.system('bash cli.sh stop') + os.system('systemctl stop mw') print("服务已停止") + def mw_restart(): """ restart mdserver-web """ - os.system('bash cli.sh stop && bash cli.sh start') + os.system('systemctl restart mw') print("服务已重启") + def mw_reset_username(): """ reset mdserver-web username @@ -33,7 +36,8 @@ def mw_reset_username(): from tools import set_panel_username user_name = input("请输入新的用户名: ") set_panel_username(user_name) - + + def mw_reset_pwd(): """ reset mdserver-web password @@ -44,9 +48,9 @@ def mw_reset_pwd(): if __name__ == '__main__': - os.chdir("/www/server/mdserver-web") + os.chdir("/www/server/mdserver-web") sys.path.append(os.getcwd() + "/class/core") - + try: str = ''' ==== mdserver-web cli tools ==== @@ -55,8 +59,11 @@ if __name__ == '__main__': 5. 修改密码 ================================= ''' - print(str) - sw = input("请输入您要进行的操作: ") + if len(sys.argv) == 2: + sw = sys.argv[1] + else: + print(str) + sw = input("请输入您要进行的操作: ") if sw == '1': mw_start() diff --git a/scripts/install.sh b/scripts/install.sh index 814cfbc95..25f0f0f00 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -74,8 +74,8 @@ fi echo "use system version: ${OSNAME}" curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash -chmod +x /www/server/mdserver-web/mds-cli -ln -s /www/server/mdserver-web/mds-cli /usr/bin/mds-cli +chmod +x /www/server/mdserver-web/mw-cli +ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli endTime=`date +%s` ((outTime=(${endTime}-${startTime})/60)) From 2805b7bdc49db230a572099cb0dce7c3821fa805 Mon Sep 17 00:00:00 2001 From: soxft Date: Tue, 21 Jun 2022 12:57:29 +0800 Subject: [PATCH 08/33] remove * --- scripts/init.d/mw.tpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 4c5192f11..437b3a662 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -185,13 +185,11 @@ case "$1" in if [ -f $mw_path/data/admin_path.pl ];then auth_path=$(cat $mw_path/data/admin_path.pl) fi - if [ "$address" = "" ];then - address=$(curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress) - fi + echo -e "==================================================================" echo -e "\033[32mMW-Panel default info!\033[0m" echo -e "==================================================================" - echo "MW-Panel-URL: http://$address:$port$auth_path" + echo -e "MW-Panel-URL: http://$address:$port$auth_path" echo -e `python3 $mw_path/tools.py username` echo -e "password: $password" echo -e "\033[33mWarning:\033[0m" From 461a9582dffcf0e1f84afaac38f49d58726b4f2f Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 14:12:31 +0800 Subject: [PATCH 09/33] Update centos.sh --- scripts/install/centos.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index e330b24aa..0ebc07ca1 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -82,10 +82,16 @@ if [ ! -f /usr/local/bin/pip3 ];then fi +echo "start install lib" cd /www/server/mdserver-web/scripts && bash lib.sh +echo "end install lib" + + chmod 755 /www/server/mdserver-web/data +echo "start install python lib" + pip install --upgrade pip if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . @@ -115,6 +121,8 @@ else pip3 install pymongo fi +echo "end install python lib" + cd /www/server/mdserver-web && ./cli.sh start sleep 5 From dee6a755835dae6d34690c9e347cc1de5cd17910 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 14:13:18 +0800 Subject: [PATCH 10/33] Update centos.sh --- scripts/install/centos.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 0ebc07ca1..016f19203 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -93,6 +93,15 @@ chmod 755 /www/server/mdserver-web/data echo "start install python lib" pip install --upgrade pip +pip3 install gunicorn==20.1.0 +pip3 install gevent==21.1.2 +pip3 install gevent-websocket==0.10.1 +pip3 install requests==2.20.0 +pip3 install flask-caching==1.10.1 +pip3 install python-socketio==4.2.0 +pip3 install psutil==5.9.1 +pip3 install pymongo + if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . fi @@ -110,15 +119,7 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install pymongo else cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt - pip install --upgrade pip - pip3 install gunicorn==20.1.0 - pip3 install gevent==21.1.2 - pip3 install gevent-websocket==0.10.1 - pip3 install requests==2.20.0 - pip3 install flask-caching==1.10.1 - pip3 install python-socketio==4.2.0 - pip3 install psutil==5.9.1 - pip3 install pymongo + fi echo "end install python lib" From 43259330e169976de50b8826555ccd3cdecd2df2 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 15:01:29 +0800 Subject: [PATCH 11/33] up --- scripts/install/centos.sh | 1 - scripts/install_dev.sh | 2 +- scripts/update_dev.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 016f19203..cd8aef071 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -119,7 +119,6 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install pymongo else cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt - fi echo "end install python lib" diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 643698616..a2710a7ab 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -72,7 +72,7 @@ if [ $OSNAME != "macos" ];then fi echo "use system version: ${OSNAME}" -curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/install/${OSNAME}.sh | bash endTime=`date +%s` diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 35285da74..ea986c847 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -52,7 +52,7 @@ rm -rf /tmp/mdserver-web-dev #pip uninstall public echo "use system version: ${OSNAME}" -curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update/${OSNAME}.sh | bash +curl -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/update/${OSNAME}.sh | bash endTime=`date +%s` ((outTime=($endTime-$startTime)/60)) From bdb4d70d8d60d9f3d6c0b4995b06f88a9732a194 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 15:45:13 +0800 Subject: [PATCH 12/33] up --- scripts/install_dev.sh | 3 ++- scripts/update_dev.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index a2710a7ab..6a58f0d3d 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -72,7 +72,8 @@ if [ $OSNAME != "macos" ];then fi echo "use system version: ${OSNAME}" -curl -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/install/${OSNAME}.sh | bash + +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/${OSNAME}.sh | bash endTime=`date +%s` diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index ea986c847..e3bf41f4a 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -52,7 +52,7 @@ rm -rf /tmp/mdserver-web-dev #pip uninstall public echo "use system version: ${OSNAME}" -curl -fsSL https://gitee.com/midoks/mdserver-web/raw/dev/scripts/update/${OSNAME}.sh | bash +curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update/${OSNAME}.sh | bash endTime=`date +%s` ((outTime=($endTime-$startTime)/60)) From e7a3b175494474146ee73e4020009e38b6dd195c Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 16:24:36 +0800 Subject: [PATCH 13/33] Update centos.sh --- scripts/install/centos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index cd8aef071..1576d53ff 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -102,6 +102,8 @@ pip3 install python-socketio==4.2.0 pip3 install psutil==5.9.1 pip3 install pymongo +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt + if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . fi @@ -117,8 +119,6 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install python-socketio==4.2.0 pip3 install psutil==5.9.1 pip3 install pymongo -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt fi echo "end install python lib" From 8e4cf4971e3e4890df5f7dd8a367c8cfde2d4cad Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 17:12:25 +0800 Subject: [PATCH 14/33] Update centos.sh --- scripts/install/centos.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 1576d53ff..578a09c7a 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -105,20 +105,13 @@ pip3 install pymongo cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt if [ ! -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && python3 -m venv . + sleep 5 fi if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt pip install --upgrade pip - pip3 install gunicorn==20.1.0 - pip3 install gevent==21.1.2 - pip3 install gevent-websocket==0.10.1 - pip3 install requests==2.20.0 - pip3 install flask-caching==1.10.1 - pip3 install python-socketio==4.2.0 - pip3 install psutil==5.9.1 - pip3 install pymongo fi echo "end install python lib" From 0a06613e86b6400148d7e24ad0a8b54b91c21c5c Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 17:16:55 +0800 Subject: [PATCH 15/33] Update centos.sh --- scripts/install/centos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 578a09c7a..cac3468fb 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -68,7 +68,7 @@ systemctl stop firewalld yum groupinstall -y "Development Tools" -yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel +yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel yum install -y lsof net-tools From 9b8f06a1a669d278289642dcca03ad09a10410a6 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 17:23:38 +0800 Subject: [PATCH 16/33] Update centos.sh --- scripts/install/centos.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index cac3468fb..600e6f0be 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -66,8 +66,7 @@ fi #安装时不开启 systemctl stop firewalld -yum groupinstall -y "Development Tools" - +# yum groupinstall -y "Development Tools" yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel From 8a1153827916ab5ecf67082ec300285cd76c4878 Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 17:34:32 +0800 Subject: [PATCH 17/33] fix: remove config file when uninstall --- plugins/xhprof/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/xhprof/install.sh b/plugins/xhprof/install.sh index 14af37c44..938a854d7 100755 --- a/plugins/xhprof/install.sh +++ b/plugins/xhprof/install.sh @@ -26,6 +26,7 @@ Uninstall_xh() { rm -rf ${serverPath}/xhprof cd /tmp/xhprof && rm -rf *.xhprof + rm -f /www/server/web_conf/nginx/vhost/xhprof.conf echo '卸载完成' > $install_tmp } From 5c9914c2c495589ee2c946a648921c901cc1ffb8 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 18:02:46 +0800 Subject: [PATCH 18/33] Update centos.sh --- scripts/install/centos.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 600e6f0be..773c41bf9 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -110,7 +110,17 @@ fi if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install python-socketio==4.2.0 + pip3 install psutil==5.9.1 + pip3 install Jinja==2.11.2 + pip3 install pymongo fi echo "end install python lib" From e12d77b9d74327d096353f00b7ce1b628c7cb15c Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 18:18:42 +0800 Subject: [PATCH 19/33] Update lib.sh --- scripts/lib.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 63d453d9c..7f33fc0e7 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -244,17 +244,19 @@ echo -e "Install_Curl" >> ${libPath}/lib.pl } -_os=`uname` if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then sudo ln -sf /bin/bash /bin/sh #sudo dpkg-reconfigure dash fi +_os=`uname` if [ ${_os} == "Darwin" ]; then OSNAME='macos' elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then OSNAME='centos' +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then OSNAME='rhel' elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then @@ -292,7 +294,7 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then apt install -y libffi-dev apt install -y cmake automake make - apt install -y php-common webp scons + apt install -y webp scons apt install -y lzma lzma-dev libunwind-dev apt install -y libpcre3 libpcre3-dev @@ -328,19 +330,17 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then else yum install -y openldap openldap-devel libtirpc libtirpc-devel rpcgen - yum install -y bison re2c cmake yum install -y libmemcached libmemcached-devel yum install -y curl-devel yum install -y zlib zlib-devel + yum install -y libzip libzip-devel yum install -y pcre pcre-devel yum install -y icu libicu-devel autoconf yum install -y freetype freetype-devel yum install -y openssl openssl-devel - yum install -y libzip libzip-devel yum install -y graphviz libxml2 libxml2-devel - yum install -y sqlite-devel yum install -y oniguruma oniguruma-devel yum install -y ImageMagick ImageMagick-devel From 6a51c42b4087ff46432e5221445ed19ad6f7d04b Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 18:28:57 +0800 Subject: [PATCH 20/33] Update centos.sh --- scripts/install/centos.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 773c41bf9..b16f71fc2 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -108,6 +108,7 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then sleep 5 fi +echo "start install python env lib" if [ -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt @@ -122,7 +123,7 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install Jinja==2.11.2 pip3 install pymongo fi - +echo "end install python env lib" echo "end install python lib" From eebe809664ad42fee585657a287c2ba99e065cd7 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 18:35:23 +0800 Subject: [PATCH 21/33] Update centos.sh --- scripts/install/centos.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index b16f71fc2..130fb0e68 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -120,7 +120,6 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install flask-caching==1.10.1 pip3 install python-socketio==4.2.0 pip3 install psutil==5.9.1 - pip3 install Jinja==2.11.2 pip3 install pymongo fi echo "end install python env lib" From 2a1fef3d54aae8842f1145ccfa166b39c149632d Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 18:38:38 +0800 Subject: [PATCH 22/33] Update centos.sh --- scripts/install/centos.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 130fb0e68..7b7ca2422 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -103,16 +103,13 @@ pip3 install pymongo cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -if [ ! -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && python3 -m venv . - sleep 5 -fi echo "start install python env lib" -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt - - pip install --upgrade pip +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + source /www/server/mdserver-web/bin/activate + pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 @@ -122,6 +119,7 @@ if [ -f /www/server/mdserver-web/bin/activate ];then pip3 install psutil==5.9.1 pip3 install pymongo fi + echo "end install python env lib" echo "end install python lib" From 71c03e2440888e6181dba787cb8cc21d24836b2d Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 11:05:57 +0000 Subject: [PATCH 23/33] fix: static site --- .gitignore | 2 +- plugins/openresty/install.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1f01fc2e6..aae13447a 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,4 @@ pyvenv.cfg include data/api_login.txt data/sessions -data/ssl.pl +data/ssl.pl diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 3676c3bc5..53ae30979 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -43,8 +43,7 @@ Install_openresty() --with-http_slice_module \ --with-http_stub_status_module && make && make install && \ echo "${VERSION}" > $serverPath/openresty/version.pl - - + echo "" > $serverPath/web_conf/nginx/enable-php-00.conf echo '安装完成' > $install_tmp } From c2324f6f4dcb12f860cf82f2b8b66928c84079ab Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 19:20:28 +0800 Subject: [PATCH 24/33] Update centos.sh --- scripts/install/centos.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 7b7ca2422..4b9853bd3 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -105,16 +105,19 @@ cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirem echo "start install python env lib" + if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . source /www/server/mdserver-web/bin/activate - pip3 install -r /www/server/mdserver-web/requirements.txt pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 + pip3 install flask-session==0.3.2 + pip3 install flask-sqlalchemy==2.3.2 pip3 install python-socketio==4.2.0 pip3 install psutil==5.9.1 pip3 install pymongo From af05cf9fe9c05420953782b548810154e453322d Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 19:57:23 +0800 Subject: [PATCH 25/33] Update centos.sh --- scripts/install/centos.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 4b9853bd3..d970764f5 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -66,7 +66,7 @@ fi #安装时不开启 systemctl stop firewalld -# yum groupinstall -y "Development Tools" +yum groupinstall -y "Development Tools" yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel @@ -81,15 +81,15 @@ if [ ! -f /usr/local/bin/pip3 ];then fi -echo "start install lib" +# echo "start install lib" cd /www/server/mdserver-web/scripts && bash lib.sh -echo "end install lib" +# echo "end install lib" chmod 755 /www/server/mdserver-web/data -echo "start install python lib" +# echo "start install python lib" pip install --upgrade pip pip3 install gunicorn==20.1.0 @@ -104,7 +104,7 @@ pip3 install pymongo cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -echo "start install python env lib" +# echo "start install python env lib" if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . @@ -123,8 +123,8 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then pip3 install pymongo fi -echo "end install python env lib" -echo "end install python lib" +# echo "end install python env lib" +# echo "end install python lib" cd /www/server/mdserver-web && ./cli.sh start From a33c151ed891b4728adb754a334ee810c68e1bdc Mon Sep 17 00:00:00 2001 From: xcsoft Date: Tue, 21 Jun 2022 20:17:55 +0800 Subject: [PATCH 26/33] fix --- scripts/init.d/mw.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 437b3a662..c59f86a7f 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -185,6 +185,9 @@ case "$1" in if [ -f $mw_path/data/admin_path.pl ];then auth_path=$(cat $mw_path/data/admin_path.pl) fi + if [ "$address" = "" ];then + address=$(curl -sS --connect-timeout 10 -m 60 https://v6r.ipip.net/?format=text) + fi echo -e "==================================================================" echo -e "\033[32mMW-Panel default info!\033[0m" @@ -197,4 +200,4 @@ case "$1" in echo -e "\033[33mrelease the following port (7200|888|80|443|20|21) in the security group\033[0m" echo -e "==================================================================" ;; -esac \ No newline at end of file +esac From 9d659d4748ffc8d6d4f0acacf5c8368b3b5a28a6 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 22:53:54 +0800 Subject: [PATCH 27/33] oniguruma oniguruma-devel | centos8 fix --- scripts/install/centos.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index d970764f5..1f51b4720 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -67,13 +67,23 @@ fi systemctl stop firewalld yum groupinstall -y "Development Tools" +yum install -y epel-release + +yum install -y oniguruma oniguruma-devel +#centos8 stream | use dnf +if [ "$?" != "0" ];then + yum install -y dnf dnf-plugins-core + dnf config-manager --set-enabled powertools + yum install -y oniguruma oniguruma-devel +fi + yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel yum install -y lsof net-tools yum install -y ncurses-devel mysql-devel cmake yum install -y MySQL-python -yum install -y epel-release + if [ ! -f /usr/local/bin/pip3 ];then From 71c2c7259864cfab0bd67845e2a905b036684439 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 23:10:19 +0800 Subject: [PATCH 28/33] debian python env --- scripts/install/debian.sh | 26 ++++++++++++++------------ scripts/update/debian.sh | 38 +++++++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index c3f2a19a4..59e96ff85 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -63,22 +63,14 @@ systemctl stop firewalld cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi - -if [ -f /www/server/mdserver-web/bin/activate ];then - pip install --upgrade pip - pip install --upgrade setuptools - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -fi - if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi +pip install --upgrade pip +pip install --upgrade setuptools + +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 @@ -89,6 +81,16 @@ pip3 install flask-socketio==5.2.0 pip3 install pymongo pip3 install psutil +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi + +if [ -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip + pip install --upgrade setuptools +fi + cd /www/server/mdserver-web && ./cli.sh start sleep 5 diff --git a/scripts/update/debian.sh b/scripts/update/debian.sh index a3eb1d282..41de8827f 100644 --- a/scripts/update/debian.sh +++ b/scripts/update/debian.sh @@ -10,24 +10,18 @@ cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data #venv -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi -if [ -f /www/server/mdserver-web/bin/activate ];then - pip install --upgrade pip - pip install --upgrade setuptools - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -fi - +pip install --upgrade pip +pip install --upgrade setuptools +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 @@ -35,9 +29,27 @@ pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 pip3 install flask-socketio==5.2.0 -pip3 install psutil pip3 install pymongo +pip3 install psutil + +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi + +if [ -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade pip + pip install --upgrade setuptools + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install flask-socketio==5.2.0 + pip3 install pymongo + pip3 install psutil +fi if [ -f /etc/init.d/mw ];then sh /etc/init.d/mw stop && rm -rf /www/server/mdserver-web/scripts/init.d/mw && rm -rf /etc/init.d/mw From e4a8cf06a57d964e1ec9838f8c22c30344590f87 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 23:20:12 +0800 Subject: [PATCH 29/33] up --- scripts/install/debian.sh | 16 +++++++++++----- scripts/update/debian.sh | 5 ++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 59e96ff85..e5338111f 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -83,12 +83,18 @@ pip3 install psutil if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . -fi - -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate pip install --upgrade pip - pip install --upgrade setuptools + pip3 install -r /www/server/mdserver-web/requirements.txt + pip install --upgrade setuptools + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install flask-socketio==5.2.0 + pip3 install pymongo + pip3 install psutil fi diff --git a/scripts/update/debian.sh b/scripts/update/debian.sh index 41de8827f..5029b36ca 100644 --- a/scripts/update/debian.sh +++ b/scripts/update/debian.sh @@ -35,11 +35,10 @@ pip3 install psutil if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . -fi + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt pip install --upgrade setuptools pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 From 0fbd43d0288660b6825c4cdbe1345986472d6c0c Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 21 Jun 2022 23:57:02 +0800 Subject: [PATCH 30/33] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install/alma.sh | 47 ++++++++++++++-------------------- scripts/install/fedora.sh | 30 ++++++++-------------- scripts/install/rocky.sh | 39 ++++++++++++++-------------- scripts/install/ubuntu.sh | 52 ++++++++++++++++++-------------------- scripts/update/rocky.sh | 28 ++++++++++----------- scripts/update/ubuntu.sh | 53 +++++++++++++++++++-------------------- 6 files changed, 114 insertions(+), 135 deletions(-) diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index c396c9792..aae93ae40 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -69,50 +69,26 @@ fi systemctl stop firewalld yum groupinstall -y "Development Tools" +yum install -y epel-release yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel yum install -y wget python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel yum install -y lsof net-tools yum install -y ncurses-devel mysql-devel cmake yum install -y MySQL-python -yum install -y epel-release - -if [ ! -d /www/server/mdserver-web ];then - wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master - cd /tmp && unzip /tmp/master.zip - mv /tmp/mdserver-web-master /www/server/mdserver-web - rm -rf /tmp/master.zip - rm -rf /tmp/mdserver-web-master -fi -#if [ ! -f '/usr/bin/pip' ];then -# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -# python get-pip.py -# pip install --upgrade pip -# pip install pillow==6.2.2 -#fi - - -if [ ! -f /usr/local/bin/pip3 ];then - python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple -fi cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi - -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +if [ ! -f /usr/local/bin/pip3 ];then + python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi pip install --upgrade pip +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 @@ -123,6 +99,21 @@ pip3 install psutil==5.9.1 pip3 install pymongo +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install flask-socketio==5.2.0 + pip3 install psutil==5.9.1 + pip3 install pymongo +fi + cd /www/server/mdserver-web && ./cli.sh start sleep 5 diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index 1d75f4106..9074e7eef 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -66,6 +66,7 @@ systemctl stop firewalld yum groupinstall -y "Development Tools" +yum -y install epel-release yum install -y libevent libevent-devel libxslt* libjpeg* libpng* gd* zip libmcrypt libmcrypt-devel yum install -y gcc libffi-devel python-devel openssl-devel @@ -74,38 +75,29 @@ yum -y install wget python-devel python-imaging libicu-devel unzip bzip2-devel g yum -y install net-tools yum -y install ncurses-devel mysql-devel cmake yum -y install python-devel -yum -y install MySQL-python -yum -y install epel-release +yum -y install MySQL-python yum -y install python3-devel - -#if [ ! -f '/usr/bin/pip' ];then -# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -# python get-pip.py -# pip install --upgrade pip -# pip install pillow==6.2.2 -#fi - +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +cd /www/server/mdserver-web/scripts && bash lib.sh +chmod 755 /www/server/mdserver-web/data if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi - -cd /www/server/mdserver-web/scripts && bash lib.sh -chmod 755 /www/server/mdserver-web/data +pip install --upgrade pip +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt fi + - -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -fi cd /www/server/mdserver-web && ./cli.sh start sleep 5 diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index f816a499b..b4621abeb 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -68,42 +68,26 @@ fi systemctl stop firewalld yum groupinstall -y "Development Tools" +yum install -y epel-release yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel yum install -y wget python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel yum install -y lsof net-tools yum install -y ncurses-devel mysql-devel cmake yum install -y MySQL-python -yum install -y epel-release - -#if [ ! -f '/usr/bin/pip' ];then -# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -# python get-pip.py -# pip install --upgrade pip -# pip install pillow==6.2.2 -#fi - - -if [ ! -f /usr/local/bin/pip3 ];then - python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple -fi cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data -if [ ! -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && python3 -m venv . +if [ ! -f /usr/local/bin/pip3 ];then + python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -fi pip install --upgrade pip +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 @@ -114,6 +98,21 @@ pip3 install psutil==5.9.1 pip3 install pymongo +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install python-socketio==4.2.0 + pip3 install psutil==5.9.1 + pip3 install pymongo +fi + cd /www/server/mdserver-web && ./cli.sh start sleep 5 diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index e31ddb5ea..9bec0dbdd 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -66,43 +66,41 @@ if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi -# cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -# pip install --upgrade pip -# pip install --upgrade setuptools -# pip3 install gunicorn==20.1.0 -# pip3 install gevent==21.1.2 -# pip3 install gevent-websocket==0.10.1 -# pip3 install requests==2.20.0 -# pip3 install flask-caching==1.10.1 -# pip3 install flask-socketio==5.2.0 -# pip3 install flask-session==0.3.2 -# pip3 install pymongo -# pip3 install psutil - - -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi - -if [ -f /www/server/mdserver-web/bin/activate ];then - python -m pip install --upgrade pip - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -fi - +pip install --upgrade pip +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +pip install --upgrade setuptools pip3 install gunicorn==20.1.0 -pip3 install gevent==20.9.0 +pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 -#ubuntu 20 need pip3 install flask-socketio==5.2.0 pip3 install flask-session==0.3.2 pip3 install pymongo pip3 install psutil +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi + +if [ -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt + pip3 install gunicorn==20.1.0 + pip3 install gevent==20.9.0 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + #ubuntu 20 need + pip3 install flask-socketio==5.2.0 + pip3 install flask-session==0.3.2 + pip3 install pymongo + pip3 install psutil +fi + + cd /www/server/mdserver-web && ./cli.sh start sleep 5 diff --git a/scripts/update/rocky.sh b/scripts/update/rocky.sh index bca02d51a..71c725bc0 100755 --- a/scripts/update/rocky.sh +++ b/scripts/update/rocky.sh @@ -27,23 +27,23 @@ if [ ! -f /www/server/mdserver-web/bin/activate ];then cd /www/server/mdserver-web && python3 -m venv . fi +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install python-socketio==4.2.0 + pip3 install psutil==5.9.1 + pip3 install pymongo fi -pip install --upgrade pip -pip3 install gunicorn==20.1.0 -pip3 install gevent==21.1.2 -pip3 install gevent-websocket==0.10.1 -pip3 install requests==2.20.0 -pip3 install flask-caching==1.10.1 -pip3 install python-socketio==4.2.0 -pip3 install psutil==5.9.1 -pip3 install pymongo - if [ -f /etc/init.d/mw ]; then sh /etc/init.d/mw stop && rm -rf /www/server/mdserver-web/scripts/init.d/mw && rm -rf /etc/init.d/mw diff --git a/scripts/update/ubuntu.sh b/scripts/update/ubuntu.sh index 1fb1bf7cc..fe9654068 100644 --- a/scripts/update/ubuntu.sh +++ b/scripts/update/ubuntu.sh @@ -13,34 +13,11 @@ if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi -# cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt - -# pip install --upgrade pip -# pip install --upgrade setuptools -# pip3 install gunicorn==20.1.0 -# pip3 install gevent==21.1.2 -# pip3 install gevent-websocket==0.10.1 -# pip3 install requests==2.20.0 -# pip3 install flask-caching==1.10.1 -# pip3 install flask-socketio==5.2.0 -# pip3 install flask-session==0.3.2 -# pip3 install pymongo -# pip3 install psutil - -#venv -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi - -if [ -f /www/server/mdserver-web/bin/activate ];then - pip install --upgrade pip - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -fi - +pip install --upgrade pip +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +pip install --upgrade setuptools pip3 install gunicorn==20.1.0 -pip3 install gevent==20.9.0 +pip3 install gevent==21.1.2 pip3 install gevent-websocket==0.10.1 pip3 install requests==2.20.0 pip3 install flask-caching==1.10.1 @@ -49,6 +26,28 @@ pip3 install flask-session==0.3.2 pip3 install pymongo pip3 install psutil + +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . +fi + +if [ -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt + pip3 install gunicorn==20.1.0 + pip3 install gevent==20.9.0 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + #ubuntu 20 need + pip3 install flask-socketio==5.2.0 + pip3 install flask-session==0.3.2 + pip3 install pymongo + pip3 install psutil +fi + + if [ -f /etc/init.d/mw ];then sh /etc/init.d/mw stop && rm -rf /www/server/mdserver-web/scripts/init.d/mw && rm -rf /etc/init.d/mw fi From 399f57f5545cbde6c42f3d21fe04a3d46a4ffb72 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 01:06:59 +0800 Subject: [PATCH 31/33] alma fix --- scripts/install/alma.sh | 1 + scripts/update/alma.sh | 37 +++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index aae93ae40..c4e669562 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -87,6 +87,7 @@ if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi +sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt pip install --upgrade pip cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt pip3 install gunicorn==20.1.0 diff --git a/scripts/update/alma.sh b/scripts/update/alma.sh index a5f2cf78f..5b8b20721 100755 --- a/scripts/update/alma.sh +++ b/scripts/update/alma.sh @@ -11,7 +11,6 @@ fi sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config -yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel cd /www/server/mdserver-web/scripts && bash lib.sh chmod 755 /www/server/mdserver-web/data @@ -21,27 +20,29 @@ if [ ! -f /usr/local/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple fi -#venv -# if [ ! -f /www/server/mdserver-web/bin/activate ];then -# cd /www/server/mdserver-web && python3 -m venv . -# fi +sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt +pip install --upgrade pip +cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +pip3 install flask-socketio==5.2.0 -if [ -f /www/server/mdserver-web/bin/activate ];then - cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt -else - cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt +#venv +if [ ! -f /www/server/mdserver-web/bin/activate ];then + cd /www/server/mdserver-web && python3 -m venv . + cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate + pip install --upgrade pip + pip3 install -r /www/server/mdserver-web/requirements.txt + + pip3 install gunicorn==20.1.0 + pip3 install gevent==21.1.2 + pip3 install gevent-websocket==0.10.1 + pip3 install requests==2.20.0 + pip3 install flask-caching==1.10.1 + pip3 install flask-socketio==5.2.0 + pip3 install psutil==5.9.1 + pip3 install pymongo fi -pip install --upgrade pip -pip3 install gunicorn==20.1.0 -pip3 install gevent==21.1.2 -pip3 install gevent-websocket==0.10.1 -pip3 install requests==2.20.0 -pip3 install flask-caching==1.10.1 -pip3 install python-socketio==4.2.0 -pip3 install psutil==5.9.1 -pip3 install pymongo if [ -f /etc/init.d/mw ]; then From 81cdcd3fd024570146f58193993f9e76e24e84ff Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 01:10:16 +0800 Subject: [PATCH 32/33] almalinux warning fix --- scripts/install.sh | 2 +- scripts/install_cn.sh | 2 +- scripts/install_dev.sh | 2 +- scripts/update.sh | 2 +- scripts/update_cn.sh | 2 +- scripts/update_dev.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 25f0f0f00..c2de403f3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,7 +1,7 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -LANG=en_US.UTF-8 +# LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` if [ -f /etc/motd ];then diff --git a/scripts/install_cn.sh b/scripts/install_cn.sh index eae9bc696..15e878001 100755 --- a/scripts/install_cn.sh +++ b/scripts/install_cn.sh @@ -1,7 +1,7 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -LANG=en_US.UTF-8 +# LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` if [ -f /etc/motd ];then diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 6a58f0d3d..4b914988f 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -1,7 +1,7 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -LANG=en_US.UTF-8 +# LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` if [ -f /etc/motd ];then diff --git a/scripts/update.sh b/scripts/update.sh index 00fa5321d..8df4e7b61 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -1,7 +1,7 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -LANG=en_US.UTF-8 +# LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` startTime=`date +%s` diff --git a/scripts/update_cn.sh b/scripts/update_cn.sh index 76cf4ac30..095210cbc 100755 --- a/scripts/update_cn.sh +++ b/scripts/update_cn.sh @@ -1,7 +1,7 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -LANG=en_US.UTF-8 +# LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` startTime=`date +%s` diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index e3bf41f4a..5852e81c6 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -1,7 +1,7 @@ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -LANG=en_US.UTF-8 +# LANG=en_US.UTF-8 is64bit=`getconf LONG_BIT` startTime=`date +%s` From 2bdb12d55cfee2086a35dc112bf408527e9940de Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 22 Jun 2022 01:12:45 +0800 Subject: [PATCH 33/33] =?UTF-8?q?=E9=87=8A=E6=94=BE=E5=86=85=E5=AD=98?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=20+=2080,81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/rememory.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/rememory.sh b/scripts/rememory.sh index eb55fcec4..1e09ee1d6 100755 --- a/scripts/rememory.sh +++ b/scripts/rememory.sh @@ -61,6 +61,14 @@ if [ -f $rootPath"/php/init.d/php74" ];then $rootPath"/php/init.d/php74" reload fi +if [ -f $rootPath"/php/init.d/php80" ];then + $rootPath"/php/init.d/php74" reload +fi + +if [ -f $rootPath"/php/init.d/php81" ];then + $rootPath"/php/init.d/php74" reload +fi + if [ -f $rootPath"/openresty/nginx/sbin/nginx" ];then $rootPath"/openresty/nginx/sbin/nginx" -s reload fi