From f8ec46bf2448456836292b3adb3f47c13fb22610 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 12 Nov 2021 17:50:44 +0800 Subject: [PATCH] update --- plugins/gogs/hook/commit.tpl.ssh | 36 ++++++++++++++++++++++++++++++ plugins/php/index.py | 6 +++++ plugins/php/versions/74/install.sh | 2 +- plugins/php/versions/80/install.sh | 2 +- route/static/app/index.js | 8 +++---- route/templates/default/site.html | 2 +- 6 files changed, 49 insertions(+), 7 deletions(-) create mode 100755 plugins/gogs/hook/commit.tpl.ssh diff --git a/plugins/gogs/hook/commit.tpl.ssh b/plugins/gogs/hook/commit.tpl.ssh new file mode 100755 index 000000000..6aac78ca8 --- /dev/null +++ b/plugins/gogs/hook/commit.tpl.ssh @@ -0,0 +1,36 @@ +#!/bin/bash + +echo `date` + +GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}" +GIT_SDIR="{$CODE_DIR}" + +GIT_USER_DIR="${GIT_SDIR}/{$USERNAME}" +GIT_PROJECT_DIR="${GIT_USER_DIR}/{$PROJECT}" + +# echo $GIT_PROJECT_DIR +if [ ! -d $GIT_PROJECT_DIR ];then + mkdir -p $GIT_USER_DIR && cd $GIT_USER_DIR + git clone $GITADDR +fi + +unset GIT_DIR +cd $GIT_PROJECT_DIR && git pull + +# func 2 +# cd $GIT_PROJECT_DIR && env -i git pull origin master + + + +WEB_PATH={$WEB_ROOT}/{$USERNAME}/{$PROJECT} +mkdir -p $WEB_PATH + +rsync -vauP --delete --exclude=".*" $GIT_PROJECT_DIR/ $WEB_PATH + +sysName=`uname` +if [ $sysName == 'Darwin' ]; then + USER=$(who | sed -n "2,1p" |awk '{print $1}') + chown -R $USER:staff $WEB_PATH +else + chown -R www:www $WEB_PATH +fi \ No newline at end of file diff --git a/plugins/php/index.py b/plugins/php/index.py index c9049af52..94e6db264 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -16,6 +16,12 @@ sys.path.append(os.getcwd() + "/class/core") import mw +if mw.isAppleSystem(): + cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\'' + info = mw.execShell(cmd) + p = "/usr/local/lib/" + info[0].strip() + "/site-packages" + sys.path.append(p) + app_debug = False if mw.isAppleSystem(): app_debug = True diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index d8659cb94..070abc9a5 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -11,7 +11,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl -version=7.4.19 +version=7.4.25 PHP_VER=74 Install_php() { diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index 9cdb3a0c8..f48564ebd 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -11,7 +11,7 @@ sysName=`uname` install_tmp=${rootPath}/tmp/mw_install.pl -version=8.0.6 +version=8.0.12 PHP_VER=80 Install_php() { diff --git a/route/static/app/index.js b/route/static/app/index.js index 136db84fd..9ebe17ec1 100755 --- a/route/static/app/index.js +++ b/route/static/app/index.js @@ -166,8 +166,8 @@ function clearSystem() { } function setMemImg(info){ - setCookie("memRealUsed", parseInt((info.memRealUsed))); - $("#memory").html(parseInt((info.memRealUsed)) + '/' + info.memTotal + ' (MB)'); + setCookie("memRealUsed", parseInt(info.memRealUsed)); + $("#memory").html(parseInt(info.memRealUsed) + '/' + parseInt(info.memTotal) + ' (MB)'); setCookie("mem-before", $("#memory").text()); if (!getCookie('memSize')) setCookie('memSize', parseInt(info.memTotal)); var memPre = Math.floor(info.memRealUsed / (info.memTotal / 100)); @@ -180,8 +180,8 @@ function setMemImg(info){ function getInfo() { $.get("/system/system_total", function(info) { - setCookie("memRealUsed", parseInt((info.memRealUsed))); - $("#memory").html(parseInt((info.memRealUsed)) + '/' + info.memTotal + ' (MB)'); + setCookie("memRealUsed", parseInt(info.memRealUsed)); + $("#memory").html(parseInt(info.memRealUsed) + '/' + parseInt(info.memTotal) + ' (MB)'); setCookie("mem-before", $("#memory").text()); if (!getCookie('memSize')) setCookie('memSize', parseInt(info.memTotal)); var memPre = Math.floor(info.memRealUsed / (info.memTotal / 100)); diff --git a/route/templates/default/site.html b/route/templates/default/site.html index 4163939be..4a744d30d 100755 --- a/route/templates/default/site.html +++ b/route/templates/default/site.html @@ -17,7 +17,7 @@
-

使用mdserver-web|linux面板创建站点时会自动创建权限配置,统一使用www用户。

+

使用mw|linux面板创建站点时会自动创建权限配置,统一使用www用户。