diff --git a/plugins/postgresql/class/pg.py b/plugins/postgresql/class/pg.py index 4c0f7a127..0bf3b5bef 100755 --- a/plugins/postgresql/class/pg.py +++ b/plugins/postgresql/class/pg.py @@ -7,8 +7,12 @@ import sys import psycopg2 -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw class ORM: diff --git a/scripts/install.sh b/scripts/install.sh index d13c94835..9d6952229 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -45,6 +45,9 @@ elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then OSNAME='rhel' yum install -y wget curl zip unzip tar crontabs +elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then + OSNAME='rhel' + yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then OSNAME='rhel' yum install -y wget curl zip unzip tar crontabs diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index cde638325..ea1ae332d 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -50,6 +50,9 @@ elif grep -Eqi "Fedora" /etc/issue || grep -Eqi "Fedora" /etc/*-release; then elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then OSNAME='rhel' yum install -y wget zip unzip +elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then + OSNAME='rhel' + yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then OSNAME='rhel' yum install -y wget zip unzip tar diff --git a/scripts/update.sh b/scripts/update.sh index 57cf80600..0d390a316 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -51,6 +51,9 @@ elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then OSNAME='rhel' yum install -y wget zip unzip +elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then + OSNAME='rhel' + yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then OSNAME='amazon' yum install -y wget zip unzip diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 1f8caa7aa..b0b9a3529 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -50,6 +50,9 @@ elif grep -Eqi "Rocky" /etc/issue || grep -Eqi "Rocky" /etc/*-release; then elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eqi "AlmaLinux" /etc/*-release; then OSNAME='rhel' yum install -y wget zip unzip +elif grep -Eqi "Anolis" /etc/issue || grep -Eqi "Anolis" /etc/*-release; then + OSNAME='rhel' + yum install -y wget curl zip unzip tar crontabs elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eqi "Amazon Linux" /etc/*-release; then OSNAME='amazon' yum install -y wget zip unzip diff --git a/web/thisdb/logs.py b/web/thisdb/logs.py index 2b1049111..94a73eb90 100644 --- a/web/thisdb/logs.py +++ b/web/thisdb/logs.py @@ -18,13 +18,17 @@ def clearLog(): mw.M('logs').execute("update sqlite_sequence set seq=0 where name='logs'") return True -def addLog(type, log, uid = 1) -> str: +def addLog(type, log, uid = 1) -> bool: ''' 添加日志 :type -> str 类型 (必填) :log -> str 日志内容 (必填) :uid -> int 用户ID ''' + + if log.find("eval") > -1: + return False + add_time = mw.formatDate() insert_data = { 'type':type,