From 3688cf6145c7a54932a4ec96b28e52fc49e0aac6 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 22 Feb 2025 10:18:45 +0800 Subject: [PATCH 1/7] Update tamper_proof_service.py --- plugins/tamper_proof_py/tamper_proof_service.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/tamper_proof_py/tamper_proof_service.py b/plugins/tamper_proof_py/tamper_proof_service.py index 5ea9a711a..50d59be13 100644 --- a/plugins/tamper_proof_py/tamper_proof_service.py +++ b/plugins/tamper_proof_py/tamper_proof_service.py @@ -514,8 +514,7 @@ def run(): if not os.path.exists(tip): event.list_DIR(siteInfo['path'], siteInfo) try: - watchManager.add_watch( - siteInfo['path'], mode, auto_add=True, rec=True) + watchManager.add_watch(siteInfo['path'], mode, auto_add=True, rec=True) except: print(mw.getTracebackInfo()) tout = round(time.time() - s, 2) From 5be2d5eb22633e5b864d4e0c196b93a799c5849b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 22 Feb 2025 10:27:23 +0800 Subject: [PATCH 2/7] Update tamper_proof_service.py --- plugins/tamper_proof_py/tamper_proof_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tamper_proof_py/tamper_proof_service.py b/plugins/tamper_proof_py/tamper_proof_service.py index 50d59be13..e8016ef2e 100644 --- a/plugins/tamper_proof_py/tamper_proof_service.py +++ b/plugins/tamper_proof_py/tamper_proof_service.py @@ -422,7 +422,7 @@ class MyEventHandler(pyinotify.ProcessEvent): os.system('chattr -R -a {} &> /dev/null'.format(path)) self.set_user_ini(path) - def close(self, reload=False): + def close(self, close_reload=False): # 解除锁定 sites = self.get_sites() print("") @@ -433,7 +433,7 @@ class MyEventHandler(pyinotify.ProcessEvent): tip = self._PLUGIN_PATH + '/tips/' + siteInfo['siteName'] + '.pl' if not siteInfo['open'] and not os.path.exists(tip): continue - if reload and siteInfo['open']: + if close_reload and siteInfo['open']: continue if sys.version_info[0] == 2: print( From c5385541a7f042d0d5224a301c2f82586f244356 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 22 Feb 2025 10:29:16 +0800 Subject: [PATCH 3/7] Update tamper_proof_service.py --- plugins/tamper_proof_py/tamper_proof_service.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/tamper_proof_py/tamper_proof_service.py b/plugins/tamper_proof_py/tamper_proof_service.py index e8016ef2e..fb0f7d1ac 100644 --- a/plugins/tamper_proof_py/tamper_proof_service.py +++ b/plugins/tamper_proof_py/tamper_proof_service.py @@ -436,8 +436,7 @@ class MyEventHandler(pyinotify.ProcessEvent): if close_reload and siteInfo['open']: continue if sys.version_info[0] == 2: - print( - "【{}】|-Unlock website[{}]".format(mw.formatDate(), siteInfo['siteName'])), + print("【{}】|-Unlock website[{}]".format(mw.formatDate(), siteInfo['siteName'])), else: os.system("echo -e '{}|-Unlock website[{}]\c'".format(mw.formatDate(), siteInfo['siteName'])) #print("【{}】|-解锁网站[{}]".format(mw.format_date(),siteInfo['siteName']),end=" ") From 24a94b496527004e9aaf60e86a5889978318da41 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 23 Feb 2025 21:59:01 +0800 Subject: [PATCH 4/7] Update info.json --- plugins/tamper_proof_py/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tamper_proof_py/info.json b/plugins/tamper_proof_py/info.json index 4ed8adda4..29c3b599a 100644 --- a/plugins/tamper_proof_py/info.json +++ b/plugins/tamper_proof_py/info.json @@ -1,9 +1,9 @@ { - "title": "网站防篡改程序[PY]", + "title": "网站防篡改程序PY", "tip": "lib", "name": "tamper_proof_py", "type": "soft", - "ps": "事件型防篡改程序,可有效保护网站重要文件不被木马篡改", + "ps": "事件型防篡改程序,可有效保护网站重要文件不被木马篡改[Python]", "versions": "1.0", "shell": "install.sh", "checks": "server/tamper_proof_py", From 934327052d9368c17b768ba8d9c2f9224cf246ee Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 23 Feb 2025 22:33:02 +0800 Subject: [PATCH 5/7] up --- plugins/tamper_proof_py/index.py | 3 +-- plugins/tamper_proof_py/tamper_proof_service.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/tamper_proof_py/index.py b/plugins/tamper_proof_py/index.py index 4fe6746a4..901a2939a 100755 --- a/plugins/tamper_proof_py/index.py +++ b/plugins/tamper_proof_py/index.py @@ -458,8 +458,7 @@ class App: if not protectExt in siteInfo['protectExt']: continue siteInfo['protectExt'].remove(protectExt) - self.writeLog('站点[%s]从受保护列表中删除[.%s]' % - (siteInfo['siteName'], protectExt)) + self.writeLog('站点[%s]从受保护列表中删除[.%s]' % (siteInfo['siteName'], protectExt)) self.siteReload(siteInfo) self.saveSiteConfig(siteInfo) return mw.returnJson(True, '删除成功!') diff --git a/plugins/tamper_proof_py/tamper_proof_service.py b/plugins/tamper_proof_py/tamper_proof_service.py index fb0f7d1ac..7f5fa4f25 100644 --- a/plugins/tamper_proof_py/tamper_proof_service.py +++ b/plugins/tamper_proof_py/tamper_proof_service.py @@ -123,10 +123,10 @@ class MyEventHandler(pyinotify.ProcessEvent): return ret[0:20] return ret - def get_site_logs(self, Stiename): + def get_site_logs(self, site_name): try: pythonV = sys.version_info[0] - path = '/www/wwwlogs/' + Stiename + '.log' + path = '/www/wwwlogs/' + site_name + '.log' num = 500 if not os.path.exists(path): return [] From b3e2c8d9df7da46af0a4dadb3ceeca612b241293 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 25 Feb 2025 20:22:41 +0800 Subject: [PATCH 6/7] Update index.py --- plugins/tamper_proof_py/index.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/tamper_proof_py/index.py b/plugins/tamper_proof_py/index.py index 901a2939a..59d538d4b 100755 --- a/plugins/tamper_proof_py/index.py +++ b/plugins/tamper_proof_py/index.py @@ -324,8 +324,7 @@ class App: siteInfo['open'] = not siteInfo['open'] m_logs = {True: '开启', False: '关闭'} - self.writeLog('%s站点[%s]防篡改保护' % - (m_logs[siteInfo['open']], siteInfo['siteName'])) + self.writeLog('%s站点[%s]防篡改保护' % (m_logs[siteInfo['open']], siteInfo['siteName'])) self.siteReload(siteInfo) self.saveSiteConfig(siteInfo) self.restart() @@ -592,8 +591,7 @@ class App: for i in range(len(sites)): if sites[i]['siteName'] in siteNames: sites[i]['open'] = siteState - self.writeLog('%s站点[%s]防篡改保护' % - (m_logs[siteState], sites[i]['siteName'])) + self.writeLog('%s站点[%s]防篡改保护' % (m_logs[siteState], sites[i]['siteName'])) self.writeSites(sites) return mw.returnJson(True, '批量设置成功') From 172ca05efada0301141cbfed74feb336fa4e037b Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 1 Mar 2025 22:17:31 +0800 Subject: [PATCH 7/7] Update install.sh --- plugins/webhook/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/webhook/install.sh b/plugins/webhook/install.sh index 6743e6162..7386b71d4 100755 --- a/plugins/webhook/install.sh +++ b/plugins/webhook/install.sh @@ -15,6 +15,8 @@ Install_App() mkdir -p $serverPath/webhook echo "${VERSION}" > $serverPath/webhook/version.pl echo '安装完成' + + which mw && mw restart } Uninstall_App()