Compare commits

...
396 Commits
Author SHA1 Message Date
dami 837f95e571 Merge branch 'master' into dev 2026-09-09 01:45:29 +08:00
Mr Chen 909d818caa Merge pull request #936 from ramondelee/patch-2
Update freetype_new.sh
2026-09-09 01:44:12 +08:00
ramondelee 355ceebbd7 Update freetype_new.sh
修复freetype下载失败问题
2026-09-08 21:12:36 +08:00
dami 6ae1370709 Merge branch 'master' into dev 2026-09-08 12:02:31 +08:00
Mr Chen 93b5d8b8b4 Merge pull request #935 from ramondelee/patch-1
Update freetype_old.sh
2026-09-08 12:02:10 +08:00
ramondelee be461a15a9 Update freetype_old.sh
修复freetype下载失败问题
2026-09-07 22:23:11 +08:00
dami c239f35382 Update firewall.py 2026-09-02 08:25:34 +08:00
dami 49d57af719 Update linux.conf 2026-08-27 13:36:19 +08:00
Mr Chen 19fc0fdc51 Merge pull request #934 from midoks/dev
常规更新
2026-08-26 18:16:57 +08:00
dami c1fd4fa24c Update __init__.py 2026-08-26 18:15:43 +08:00
dami 7239b22759 update 2026-08-16 00:14:39 +08:00
dami f5fa94ae95 Update update.sh 2026-08-08 10:09:28 +08:00
Mr Chen b679ea035d Merge pull request #933 from midoks/dev
常规优化
2026-07-22 13:05:42 +08:00
dami 49bbca8faa Update index.py 2026-07-22 13:03:46 +08:00
dami 8b86cd5e63 up 2026-07-22 13:00:43 +08:00
dami 698e3ffd81 update 2026-07-22 12:55:33 +08:00
Mr Chen c2284dcee5 Merge pull request #932 from midoks/dev
兼容Ubuntu 26.04 LTS
2026-07-21 20:43:06 +08:00
dami b68c9edc3e Update index.py 2026-07-21 20:37:12 +08:00
dami 650365997a Update index.py 2026-07-21 20:36:34 +08:00
dami 3279404595 Update info.json 2026-07-21 20:35:41 +08:00
dami d32a94dccf Update install.sh 2026-07-21 20:34:44 +08:00
dami 80d846f247 Update install.sh 2026-07-21 20:31:08 +08:00
dami eadcbe336d Update install.sh 2026-07-21 20:26:57 +08:00
dami 474d0f075f Update install.sh 2026-07-21 20:26:33 +08:00
dami 2d6a41e19f Update install.sh 2026-07-21 12:03:36 +08:00
dami 1f24944417 Update caddy.service.tpl 2026-07-21 11:51:42 +08:00
dami 4ab3409e54 Update index.py 2026-07-21 11:43:14 +08:00
dami c3ad146303 update 2026-07-21 11:38:30 +08:00
dami 745cd304fb Update install.sh 2026-07-21 00:33:05 +08:00
dami e6efefd1fd Update install.sh 2026-07-21 00:11:57 +08:00
dami 1350404c58 Update install.sh 2026-07-21 00:10:03 +08:00
dami 9cdd2274fa Update install.sh 2026-07-21 00:08:53 +08:00
dami cc204ad721 Update install.sh 2026-07-21 00:00:26 +08:00
dami 8eb1614b31 Update install.sh 2026-07-20 23:50:41 +08:00
dami 9c2e9627ec update 2026-07-20 23:48:18 +08:00
dami 87123c526a update 2026-07-20 23:45:15 +08:00
dami 7c3ebc6e35 Update ubuntu.sh 2026-07-20 23:42:08 +08:00
dami 6c5bf63424 Update ubuntu.sh 2026-07-20 23:38:00 +08:00
dami 13fd47e7d4 Update ubuntu.sh 2026-07-20 23:36:38 +08:00
dami fc1321584a Update ubuntu.sh 2026-07-20 23:36:25 +08:00
dami bab3ae16d3 Update ubuntu.sh 2026-07-20 23:33:35 +08:00
dami ab8498e519 Update ubuntu.sh 2026-07-20 23:33:13 +08:00
dami 0e480c7ad8 update 2026-07-20 23:29:01 +08:00
dami 7ed8558ff0 Update ubuntu.sh 2026-07-20 23:22:35 +08:00
dami 4ed2f0caa9 update 2026-07-20 23:19:31 +08:00
dami f275eabe1b Update file.py 2026-07-20 23:08:01 +08:00
dami fe13ab1e5f Update file.py 2026-07-20 23:07:46 +08:00
dami 6ed045cf94 update 2026-07-20 22:41:10 +08:00
dami ef333ff142 update 2026-07-20 22:23:37 +08:00
dami dac2f5240f Update install.sh 2026-07-20 22:18:45 +08:00
dami cebfc2fc91 update 2026-07-20 22:17:22 +08:00
dami 1da865c1b2 Update install.sh 2026-07-20 16:46:29 +08:00
dami 2abdaaa7ce Update install.sh 2026-07-20 16:45:08 +08:00
dami c62142cf6b Update requirements.txt 2026-07-20 16:04:57 +08:00
dami 7c1820b6cd update 2026-07-20 15:59:27 +08:00
dami a24af95d24 Update install.sh 2026-07-20 15:39:32 +08:00
dami 1326c282c8 Update requirements.txt 2026-07-20 15:33:13 +08:00
dami b7e84749f1 Update debian.sh 2026-07-20 15:26:10 +08:00
dami 8a65158540 Update db.py 2026-07-20 15:21:46 +08:00
dami a576c521a2 Update ubuntu.sh 2026-07-20 15:17:24 +08:00
dami 736a387a71 Update ubuntu.sh 2026-07-20 15:15:23 +08:00
dami 090205c372 update 2026-07-20 13:41:03 +08:00
dami fda0bddc8f Update db.py 2026-07-20 13:26:23 +08:00
dami 292b18468d Update db.py 2026-07-20 13:24:57 +08:00
dami 47aab245fc Update panel_task.py 2026-07-20 12:42:24 +08:00
dami 39bd601825 Update mw.py 2026-07-20 12:32:39 +08:00
dami b744adeb13 Update monitor.py 2026-07-20 11:46:30 +08:00
dami 7b70f9fc99 Merge branch 'master' into dev 2026-07-19 22:06:00 +08:00
Mr Chen 0723f751b3 Merge pull request #930 from midoks/dependabot/pip/python-engineio-4.13.2
Bump python-engineio from 4.3.2 to 4.13.2
2026-07-19 22:05:47 +08:00
dami 1fd8617a12 Update push_notice_msg.py 2026-07-17 23:21:19 +08:00
dependabot[bot] 2fec8fcef4 Bump python-engineio from 4.3.2 to 4.13.2
Bumps [python-engineio](https://github.com/miguelgrinberg/python-engineio) from 4.3.2 to 4.13.2.
- [Release notes](https://github.com/miguelgrinberg/python-engineio/releases)
- [Changelog](https://github.com/miguelgrinberg/python-engineio/blob/main/CHANGES.md)
- [Commits](https://github.com/miguelgrinberg/python-engineio/compare/v4.3.2...v4.13.2)

---
updated-dependencies:
- dependency-name: python-engineio
  dependency-version: 4.13.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-14 21:18:01 +00:00
Mr Chen 51a48afa71 Merge pull request #929 from ccbkkb/patch-1
Fix return statement for unban IP function
2026-07-13 13:12:38 +08:00
ccbkkb 76919faca7 Fix return statement for unban IP function 2026-07-13 10:50:19 +08:00
Mr Chen 9bcbeaf1a5 Merge pull request #928 from midoks/dev
常规更新
2026-07-09 17:11:23 +08:00
dami d0de121721 Update update.sh 2026-07-09 15:14:16 +08:00
dami 957e2db3d0 Update update.sh 2026-07-09 15:06:33 +08:00
dami fb0be5549d Update update.sh 2026-07-09 15:04:40 +08:00
dami 8a9132d557 Update update.sh 2026-07-09 14:52:08 +08:00
dami 04d10435c2 Update update.sh 2026-07-09 14:51:29 +08:00
dami 92543e10fa Update update.sh 2026-07-09 14:46:38 +08:00
dami cd427dcbf3 Update update.sh 2026-07-09 14:46:26 +08:00
Mr Chen ddb5e0285b Merge pull request #927 from midoks/dev
常规更新
2026-07-09 14:24:08 +08:00
dami 75610a4559 Update crontab.js 2026-07-09 14:22:26 +08:00
dami b8f7a45f61 Update push_notice_msg.py 2026-07-09 12:58:16 +08:00
Mr Chen 37d5ce719e Merge pull request #926 from midoks/dev
常规更新
2026-07-08 16:47:46 +08:00
dami ef9053aa7e Update webstats_index.py 2026-07-08 16:47:05 +08:00
dami 018fcb7afb Update index.py 2026-07-08 16:46:45 +08:00
dami 5cc9a67152 Update mw.py 2026-07-07 23:54:17 +08:00
dami 54895f1d0a Update mw.py 2026-07-07 23:38:29 +08:00
dami 91dfecf882 up 2026-07-07 23:36:34 +08:00
dami 2f09e227d1 Update tool_migrate.py 2026-07-07 23:12:23 +08:00
dami 5d0463836e Update mw.py 2026-07-07 23:11:02 +08:00
Mr Chen fb6499cb35 Merge pull request #925 from midoks/dev
常规更新
2026-07-07 02:35:02 +08:00
dami 0bbfb58e67 Update index.py 2026-07-07 02:32:34 +08:00
Mr Chen fcd780a7d3 Merge pull request #924 from midoks/dev
常规更新
2026-07-07 02:19:41 +08:00
dami 4f4d1e7580 Update webstats_common.lua 2026-07-07 02:15:57 +08:00
dami 6e2a8e0a12 up 2026-07-07 02:12:09 +08:00
dami 817b4b36c7 Update webstats.conf 2026-07-07 02:06:03 +08:00
Mr Chen 0ba89cbb9e Merge pull request #923 from midoks/dev
常规更新
2026-07-06 21:13:07 +08:00
dami 4e3e7864be Update tool_migrate.py 2026-07-06 21:02:13 +08:00
dami 6f51eaa298 update 2026-07-06 20:59:32 +08:00
dami 39bd87e868 Update tool_migrate.py 2026-07-06 20:54:00 +08:00
dami 18443aab60 Update tool_migrate.py 2026-07-06 20:49:20 +08:00
dami b88ea7aa3c update 2026-07-06 20:32:36 +08:00
dami 6a6f6e6062 Update tool_migrate.py 2026-07-06 20:27:17 +08:00
dami 5839dbcd6b Update tool_migrate.py 2026-07-06 20:05:10 +08:00
dami b46f45569e Update tool_migrate.py 2026-07-06 20:01:23 +08:00
dami 5cdc5af8cd Update tool_migrate.py 2026-07-06 19:50:13 +08:00
dami 4f38a9f3ff Update tool_migrate.py 2026-07-06 19:49:58 +08:00
dami 9c83695187 Create tool_migrate.py 2026-07-06 19:44:14 +08:00
dami f9be534101 update 2026-07-06 19:24:36 +08:00
dami 58ab48ac15 Update webstats_common.lua 2026-07-06 19:11:48 +08:00
dami f34e93192d Update webstats_common.lua 2026-07-06 19:10:17 +08:00
dami 31106f2b13 Update webstats_common.lua 2026-07-06 19:03:27 +08:00
dami 468cc54cf5 Update webstats_common.lua 2026-07-06 18:55:25 +08:00
dami 728a38c55c Update webstats_log.lua 2026-07-06 18:35:05 +08:00
Mr Chen b2b23b0e3b Merge pull request #922 from midoks/dev
常规更新
2026-07-05 15:51:08 +08:00
dami 167dd11548 Update webstats_log.lua 2026-07-05 15:47:23 +08:00
dami 03fdbf2604 Merge branch 'master' into dev 2026-07-05 15:43:18 +08:00
dami edbdec8370 Update init.sql 2026-07-05 15:42:44 +08:00
dami 8f1c9f9471 up 2026-07-05 15:38:54 +08:00
dami d35d16943d up 2026-07-05 15:34:56 +08:00
dami 3ac4270dee Update stats.js 2026-07-05 15:30:16 +08:00
dami 90777e08ff update 2026-07-05 15:28:56 +08:00
dami b47d1262ac Update push_notice_msg.py 2026-07-05 15:11:57 +08:00
dami e28081a7c5 Update stats.js 2026-07-05 15:04:05 +08:00
dami 5f7d6c1488 Create webstats_common.lua.bk1.txt 2026-07-05 14:46:32 +08:00
dami 59385e11be Merge branch 'master' into dev 2026-07-05 14:21:28 +08:00
Mr Chen a668d88791 Merge pull request #921 from midoks/dev
常规更新
2026-07-05 14:13:11 +08:00
dami e62bd7c5a6 Update webstats_log.lua 2026-07-05 14:07:31 +08:00
dami 1ad3d2f187 Update webstats_log.lua 2026-07-05 13:41:19 +08:00
dami bf06af14ed Update webstats_log.lua 2026-07-05 13:24:37 +08:00
Mr Chen 805c96f260 Merge pull request #920 from midoks/dev
常规更新
2026-07-05 12:33:28 +08:00
dami 8ccba2f6d5 Update webstats_log.lua 2026-07-05 04:08:00 +08:00
dami 2e9f01d3ee Update webstats_log.lua 2026-07-05 04:05:19 +08:00
dami d1dcdd4f25 Update webstats_common.lua 2026-07-05 03:58:34 +08:00
dami 60958d1403 Update webstats_common.lua 2026-07-05 03:56:13 +08:00
dami 5530b14f36 Update webstats_common.lua 2026-07-05 03:36:39 +08:00
dami 64c9942ee1 Update webstats_common.lua 2026-07-05 03:36:26 +08:00
dami bc1437dac4 Update webstats_init_worker.lua 2026-07-05 03:27:35 +08:00
dami 1d9576e838 Update webstats_log.lua 2026-07-05 03:27:11 +08:00
dami 8b275a5df4 Update webstats_log.lua 2026-07-05 03:18:14 +08:00
dami 40d9334dcf Update index.py 2026-07-05 02:45:28 +08:00
dami 98c0242819 Update index.py 2026-07-05 02:39:23 +08:00
dami a2fb03f9b8 Update index.py 2026-07-05 02:31:20 +08:00
dami 98815ac5c3 update 2026-07-05 02:29:29 +08:00
dami 073dd20c96 update 2026-07-05 01:16:02 +08:00
dami 23af9085a9 update 2026-07-05 00:51:14 +08:00
dami bcaec6b6ee Update install.sh 2026-07-04 23:42:10 +08:00
dami 4063bea922 Update webstats_common.lua 2026-07-04 23:02:54 +08:00
dami 9f864b3407 Update webstats_common.lua 2026-07-04 22:56:49 +08:00
dami 01ac598e39 Update webstats_common.lua 2026-07-04 22:43:20 +08:00
dami 77a0d3af36 Update webstats_common.lua 2026-07-04 22:35:03 +08:00
dami 8d34bbea47 Update webstats_common.lua 2026-07-04 22:33:43 +08:00
dami be18e98001 Update webstats_common.lua 2026-07-04 22:23:56 +08:00
dami 754e0f98f9 Update webstats_common.lua 2026-07-04 22:23:43 +08:00
dami 07f893b6a1 Update webstats_common.lua 2026-07-04 22:21:17 +08:00
Mr Chen c1497ec44e Merge pull request #919 from midoks/dev
常规更新
2026-07-03 12:05:30 +08:00
dami 55d4784fe2 Update webstats_common.lua 2026-07-02 14:30:04 +08:00
dami f26e8bc520 update 2026-07-02 14:22:10 +08:00
dami 7b5f1a4253 up 2026-07-02 14:12:32 +08:00
dami 1058fb7e1f Update webstats_log.lua 2026-07-02 14:01:50 +08:00
dami 0f1b95cdfc up 2026-07-02 13:54:31 +08:00
dami 8ea16fcd85 Update webstats_common.lua 2026-07-02 13:32:22 +08:00
dami b4b9496980 Update webstats_common.lua 2026-07-02 13:15:12 +08:00
dami 8dfd26361f Update webstats_common.lua 2026-07-02 13:06:32 +08:00
dami cb5bd32b86 Update webstats_common.lua 2026-07-02 13:02:31 +08:00
dami 2584330d40 update 2026-07-02 12:52:05 +08:00
dami ebe6333ac9 up 2026-07-02 12:50:35 +08:00
dami 534892280e up 2026-07-02 12:45:28 +08:00
dami df05cf69cf Update tool_migrate.py 2026-07-02 12:27:43 +08:00
dami 2f782cf6a2 Update db.py 2026-07-02 12:26:19 +08:00
dami 6f483c17e6 Create tool_migrate_bak.py 2026-07-02 11:42:13 +08:00
dami e64610a2dc Update mw.py 2026-06-30 20:18:46 +08:00
Mr Chen 7673a16779 Merge pull request #918 from midoks/dev
常规更新
2026-06-29 00:51:56 +08:00
dami d73fe4b29c Update __init__.py 2026-06-29 00:51:14 +08:00
dami 2c61be084b Update __init__.py 2026-06-29 00:38:56 +08:00
dami fe5f8d1997 Update __init__.py 2026-06-29 00:38:08 +08:00
dami 2653291ded Update __init__.py 2026-06-29 00:37:42 +08:00
dami 417f91a2e8 Update init_cron.py 2026-06-29 00:19:10 +08:00
Mr Chen 08625e85bb Merge pull request #917 from midoks/dev
常规更新
2026-06-28 23:23:15 +08:00
dami c554c19a12 Update site.py 2026-06-28 23:10:34 +08:00
dami d7d08f2f12 Update site.py 2026-06-28 23:09:46 +08:00
Mr Chen bafe45a2f9 Merge pull request #916 from midoks/dev
常规优化
2026-06-28 22:44:26 +08:00
dami a11d24723d Update README.md 2026-06-28 22:43:37 +08:00
dami 3b858476f1 Update version.py 2026-06-28 22:41:13 +08:00
dami 5560b68ac1 Update site.js 2026-06-28 22:40:26 +08:00
dami 8bfd381363 Update site.py 2026-06-28 22:38:29 +08:00
dami c6cfe2a22c Update mw.py 2026-06-28 22:34:51 +08:00
dami 4ed274dedc Update gd_old.sh 2026-06-28 22:26:28 +08:00
Mr Chen 283c815de7 Merge pull request #915 from midoks/dev
哪吒监控更新,同步官方
2026-06-22 18:00:56 +08:00
dami c72c1bc889 Update update.sh 2026-06-22 17:59:31 +08:00
dami 6e61a535ca Update update.sh 2026-06-22 17:54:37 +08:00
dami c1f69ea1c7 Update update.sh 2026-06-22 17:51:11 +08:00
dami 984599c56f Update update.sh 2026-06-22 17:50:22 +08:00
dami 038bb31ec3 Update update.sh 2026-06-22 17:48:58 +08:00
dami 1ac541d16e Update update.sh 2026-06-22 17:48:47 +08:00
dami ecaa0e99c5 Update update.sh 2026-06-22 17:45:38 +08:00
dami 666ebeef0d Update update.sh 2026-06-22 17:43:53 +08:00
dami b39a936fa4 Update update.sh 2026-06-22 17:41:12 +08:00
dami d434dce568 Update update.sh 2026-06-22 17:40:21 +08:00
dami 6acb390133 Update update.sh 2026-06-22 17:30:59 +08:00
dami 3c6f3c50c4 Update update.sh 2026-06-22 17:28:40 +08:00
dami c52e707421 Update update.sh 2026-06-22 17:21:11 +08:00
dami 5fb998c221 update 2026-06-22 17:15:18 +08:00
dami a0989ea833 Update nezha.js 2026-06-22 17:12:09 +08:00
dami 5e565c06a0 Update nezha.js 2026-06-22 17:09:22 +08:00
dami 69b96aa5fa Create update.sh 2026-06-22 17:08:16 +08:00
dami bce9de1494 Update nezha.js 2026-06-22 17:05:57 +08:00
dami 3de7928be7 Update nezha.js 2026-06-22 17:05:30 +08:00
dami 41630ef01a Update install.sh 2026-06-22 17:03:46 +08:00
dami bf29cb1a4d Update index.py 2026-06-22 16:59:49 +08:00
dami 8f79a4ab86 update 2026-06-22 16:59:23 +08:00
dami 0ad933c5ad Update nezha.js 2026-06-22 16:55:33 +08:00
dami 5ed9470d83 update 2026-06-22 16:53:26 +08:00
dami cac468f454 Update plugin.py 2026-06-22 16:33:54 +08:00
dami f0f9dcf4de Update index.py 2026-06-22 16:32:59 +08:00
dami 3e0e84a4f6 Update index.py 2026-06-22 16:09:53 +08:00
dami ef8080b420 Update index.py 2026-06-22 16:05:57 +08:00
dami b5fab1fb10 Update plugin.py 2026-06-22 16:03:41 +08:00
dami c3f019d4ff Update plugin.py 2026-06-22 16:00:40 +08:00
dami 701f172276 Update plugin.py 2026-06-22 15:56:05 +08:00
dami 9e8c736cb4 Update install.sh 2026-06-22 15:31:31 +08:00
dami c8589d750c Update info.json 2026-06-22 15:30:42 +08:00
dami 5bb20a01de update 2026-06-22 15:16:01 +08:00
dami 6e4bf9da3e Update nezha.js 2026-06-22 15:02:39 +08:00
dami c21ddb5c63 Update install.sh 2026-06-22 14:43:12 +08:00
dami 431295cec9 update 2026-06-22 14:42:54 +08:00
dami 180cb84b2c Update index.py 2026-06-22 14:42:14 +08:00
dami 66b5f322d9 Update index.py 2026-06-22 14:41:00 +08:00
dami f00dc248bd Update install.sh 2026-06-22 14:40:16 +08:00
dami dbba5db9f7 Update info.json 2026-06-22 14:40:06 +08:00
dami 3a8b799df6 Update index.py 2026-06-22 14:39:29 +08:00
dami 0b99a4ae74 update 2026-06-22 14:35:51 +08:00
dami 99b77d347a update 2026-06-22 14:30:08 +08:00
dami 8235a88ecc Update nezha.js 2026-06-22 14:27:32 +08:00
dami 564ba30f91 Update install.sh 2026-06-22 14:23:48 +08:00
dami aa8535d513 update 2026-06-22 14:22:40 +08:00
dami a02ef2575b Update install.sh 2026-06-22 14:21:10 +08:00
dami a0be16c0fa Update install.sh 2026-06-22 14:12:24 +08:00
dami 548d87e339 Update install.sh 2026-06-22 14:12:14 +08:00
dami c704aa0817 Update install.sh 2026-06-22 14:10:03 +08:00
dami c6a060fde5 Update install.sh 2026-06-22 14:09:51 +08:00
dami 762e88cc44 Update index.py 2026-06-22 14:05:03 +08:00
dami b7f671d1d5 update 2026-06-22 14:04:45 +08:00
dami 48706d01f9 Update index.py 2026-06-22 14:04:21 +08:00
dami fb53354956 Update index.py 2026-06-22 14:03:54 +08:00
dami 5995147054 Update index.py 2026-06-22 13:59:22 +08:00
dami fed9f458d1 Update install.sh 2026-06-22 13:49:41 +08:00
dami 7987564401 Update install.sh 2026-06-22 13:45:08 +08:00
dami 90ae21fb8b Update nezha.service.tpl 2026-06-22 13:43:14 +08:00
dami 56a78d174d Update install.sh 2026-06-22 13:31:25 +08:00
dami 37da947b90 Update install.sh 2026-06-22 13:31:09 +08:00
dami f23e272027 Update install.sh 2026-06-22 13:27:25 +08:00
dami 10afc0a2d5 Update install.sh 2026-06-22 13:19:13 +08:00
dami f59c8ea533 Update install.sh 2026-06-22 13:17:26 +08:00
dami 4153ea7431 update 2026-06-22 13:16:32 +08:00
dami 2c73577798 Update nezha.js 2026-06-22 13:08:33 +08:00
dami 0b5c53ef7e Update index.html 2026-06-22 12:55:34 +08:00
dami 0fca0d54f8 Update info.json 2026-06-22 12:53:08 +08:00
dami 3da0c5b2b6 Update install.sh 2026-06-22 12:52:55 +08:00
dami d8519bc1c3 update 2026-06-22 12:49:08 +08:00
dami 33a4a799c5 Update index.py 2026-06-22 12:48:46 +08:00
dami 358a021ba6 Update install.sh 2026-06-22 12:47:54 +08:00
dami 6dba9c25b6 update 2026-06-22 12:47:23 +08:00
Mr Chen 1f724c802b Merge pull request #914 from midoks/dependabot/pip/gevent-23.9.0
Bump gevent from 22.10.2 to 23.9.0
2026-06-21 10:36:12 +08:00
dependabot[bot] 67e3dd0035 Bump gevent from 22.10.2 to 23.9.0
Bumps [gevent](https://github.com/gevent/gevent) from 22.10.2 to 23.9.0.
- [Release notes](https://github.com/gevent/gevent/releases)
- [Changelog](https://github.com/gevent/gevent/blob/master/docs/changelog_pre.rst)
- [Commits](https://github.com/gevent/gevent/compare/22.10.2...23.9.0)

---
updated-dependencies:
- dependency-name: gevent
  dependency-version: 23.9.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-21 02:35:26 +00:00
Mr Chen de657829fd Merge pull request #913 from midoks/dev
常规更新
2026-06-21 10:33:03 +08:00
dami a2c27134a8 update 2026-06-21 10:30:30 +08:00
dami 66c60ec10e Update r3.9.txt 2026-06-21 10:25:42 +08:00
dami 867b39d8e1 Update r3.9.txt 2026-06-21 10:25:12 +08:00
dami 1c8997d44a Update requirements.txt 2026-06-21 10:23:14 +08:00
dami 88b5112e30 Update requirements.txt 2026-06-21 10:20:39 +08:00
dami 3874b6a25a Update mw.py 2026-06-21 10:18:48 +08:00
Mr Chen 8ba6587c57 Merge pull request #912 from midoks/dev
常规更新
2026-06-21 10:17:02 +08:00
dami 3ebe36f785 Update mw.py 2026-06-21 10:13:07 +08:00
Mr Chen 34ed0b96d3 Merge pull request #910 from midoks/dev
常规更新
2026-06-20 19:38:45 +08:00
dami ab353d2268 Update mw.py 2026-06-20 19:36:23 +08:00
Mr Chen fd6f013480 Merge pull request #909 from midoks/dev
证书读取兼容
2026-06-20 19:31:31 +08:00
dami 4d0b7bc127 Update mw.py 2026-06-20 19:27:39 +08:00
dami ce917b227f Merge branch 'master' into dev 2026-06-20 18:58:41 +08:00
dami dec1bb04e8 Merge branch 'master' into dev 2026-06-20 18:57:49 +08:00
Mr Chen a1093c17bc Merge pull request #908 from midoks/dev
常规更新
2026-06-20 18:56:05 +08:00
dami 8110fbf701 Update openresty.js 2026-06-20 18:44:03 +08:00
dami cf502ebf05 Update openresty.js 2026-06-20 18:37:41 +08:00
dami 7c7837b967 up 2026-06-20 18:25:40 +08:00
dami 3bfc1cacb0 Update openresty.js 2026-06-20 18:20:52 +08:00
dami cd2ea26608 Update openresty.js 2026-06-20 18:15:52 +08:00
dami dcf8159d1c update 2026-06-20 18:11:57 +08:00
Mr Chen 1bdab80b5d Merge pull request #907 from midoks/dev
常规更新
2026-06-20 15:33:43 +08:00
dami 241c4dc600 Update install.sh 2026-06-20 15:24:32 +08:00
dami 18e93d2b24 Update info.json 2026-06-20 15:13:08 +08:00
dami 084cf6b761 Update info.json 2026-06-20 14:42:54 +08:00
dami 47ddf5f4e6 Update install.sh 2026-06-20 14:40:58 +08:00
dami 325321f5d4 Update install.sh 2026-06-20 14:32:38 +08:00
dami ecbeca3d35 Update install.sh 2026-06-20 14:29:40 +08:00
dami 862b434c72 Update install.sh 2026-06-20 14:29:10 +08:00
dami 6376ed3b7b update 2026-06-20 14:28:23 +08:00
dami 42e40d1718 Update push_notice_msg.py 2026-06-18 14:33:55 +08:00
dami 1c1cc12058 Update install.sh 2026-06-18 02:23:01 +08:00
dami e648b88a74 Update install.sh 2026-06-18 02:05:24 +08:00
Mr Chen 6fea46f7c8 Merge pull request #905 from midoks/dev
常规更新
2026-06-17 18:21:27 +08:00
dami a06e5a6e55 Update gd_old.sh 2026-06-17 18:21:15 +08:00
dami 85bf429a08 Update freetype_old.sh 2026-06-17 18:14:30 +08:00
dami dd6ba45cdd Update gd_old.sh 2026-06-17 17:39:36 +08:00
dami ab967efa64 Update gd_old.sh 2026-06-17 17:16:14 +08:00
dami 369505e1a0 Update r3.9.txt 2026-06-12 18:18:08 +08:00
dami 86d858a0fb Update r3.9.txt 2026-06-12 18:15:50 +08:00
dami d1f5158276 Update r3.9.txt 2026-06-12 18:13:48 +08:00
Mr Chen db83b0f78c Merge pull request #904 from midoks/dev
常规更新
2026-06-12 18:07:52 +08:00
dami 24fcc5a0c6 Update requirements.txt 2026-06-12 17:51:47 +08:00
Mr Chen 9cb3d474aa Merge pull request #900 from midoks/dev
常规更新
2026-06-12 16:29:24 +08:00
dami 0adfebfad6 Update install.sh 2026-06-12 16:25:58 +08:00
dami 66c4225aa3 update 2026-06-09 11:11:15 +08:00
dami 6ddef9ffda Update setting.py 2026-06-08 17:56:08 +08:00
dami 27a1b22e6f Update setting.py 2026-06-08 17:54:45 +08:00
dami f9c18cb225 update 2026-06-07 00:10:11 +08:00
dami b97733328a Update plugin.py 2026-06-05 11:47:25 +08:00
Mr Chen 2fe17aefd9 Merge pull request #899 from midoks/dev
常规更新
2026-06-01 19:10:03 +08:00
dami acddca54cd update 2026-06-01 19:06:13 +08:00
dami 7d80fb31ce Update install.sh 2026-06-01 18:52:36 +08:00
Mr Chen 8ac1d78053 Merge pull request #898 from midoks/dev
常规优化
2026-06-01 11:53:03 +08:00
dami 468d6d7752 Update op_waf_index.py 2026-06-01 11:50:38 +08:00
dami f49d789411 update 2026-06-01 11:49:51 +08:00
dami 1f56115fbb update 2026-05-21 17:35:19 +08:00
dami 20d277102e Update install.sh 2026-05-21 11:08:06 +08:00
dami 47b4036f09 Update install.sh 2026-05-21 10:32:07 +08:00
Mr Chen ee9e154fec Merge pull request #897 from midoks/dev
openresty 1.29.2.4
2026-05-21 10:26:24 +08:00
dami 85256b4fb6 Update install.sh 2026-05-21 10:24:37 +08:00
Mr Chen 16be671f1d Merge pull request #896 from midoks/dev
常规更新
2026-05-20 16:08:41 +08:00
dami af880115ab update 2026-05-17 18:06:54 +08:00
dami e64ac8f616 Update info.json 2026-05-17 18:01:47 +08:00
dami a7d4206b77 update 2026-05-17 17:58:29 +08:00
dami 5a80690404 update 2026-05-17 17:55:47 +08:00
dami 9b0d71d4ac Update phplib.conf 2026-05-17 17:54:01 +08:00
dami 729f77d8db Update opcache.sh 2026-05-17 17:53:53 +08:00
dami e89f96aa2d Update phplib.conf 2026-05-17 17:50:16 +08:00
Mr Chen f05f81cace Merge pull request #893 from midoks/dev
常规优化
2026-05-09 20:20:59 +08:00
dami f4883ee708 Update webstats_index.py 2026-05-09 20:18:45 +08:00
dami 043fb739d9 Update index.py 2026-05-09 20:04:41 +08:00
dami b19aa8702b Update index.py 2026-05-09 20:01:39 +08:00
dami f4e0744879 update 2026-05-09 19:59:09 +08:00
Mr Chen d7c822f86d Merge pull request #892 from midoks/dev
常规更新
2026-05-09 14:31:10 +08:00
dami c8f8e217e5 update 2026-05-09 14:26:41 +08:00
Mr Chen bfec7f1fe8 Merge pull request #891 from midoks/dev
常规更新
2026-05-07 19:07:02 +08:00
dami 21fce1f618 Update index.py 2026-05-07 19:05:07 +08:00
dami b5987b57ad Update task.py 2026-05-07 18:48:04 +08:00
dami e8c1cb08a7 update 2026-05-07 18:47:45 +08:00
dami 0de3a16898 Update index.py 2026-05-07 18:42:07 +08:00
dami 278bd7f38e Update debian.sh 2026-05-07 17:50:16 +08:00
dami 4a3b9db324 Update debian.sh 2026-05-07 17:47:48 +08:00
dami b3e8e96875 Update index.py 2026-05-07 17:06:56 +08:00
dami f5e50c6d76 Update index.py 2026-05-07 16:59:27 +08:00
dami c551c2ee1a Update index.py 2026-05-07 16:55:58 +08:00
dami 3fb8406e7b Update index.py 2026-05-07 16:53:30 +08:00
dami 50d12407c9 Update install.sh 2026-05-07 16:48:13 +08:00
dami 17931bb0ea Update install.sh 2026-05-07 16:48:03 +08:00
dami 6d30940920 Update index.py 2026-05-07 16:46:31 +08:00
dami 3a4c985baf Update index.py 2026-05-07 16:45:59 +08:00
Mr Chen 960d8b6cb8 Merge pull request #890 from midoks/dev
mongodb 兼容低版本
2026-05-07 16:34:36 +08:00
dami 9b7e9d4ffa update 2026-05-07 16:29:03 +08:00
dami c1a646c0d7 Merge branch 'master' into dev 2026-05-07 16:25:26 +08:00
dami 48ef0e7a65 Update index.py 2026-05-07 16:22:03 +08:00
dami 8dff306a91 Update index.py 2026-05-07 16:20:03 +08:00
dami a935acbc95 update 2026-05-07 16:12:16 +08:00
dami b1f9c99eb1 Update mw.tpl 2026-05-07 16:04:53 +08:00
dami 0851f749c3 Update mw.tpl 2026-05-07 15:57:20 +08:00
dami 3a7d9f84c7 Update install.sh 2026-05-07 15:22:12 +08:00
dami b43b35ccab Update install.sh 2026-05-07 15:21:29 +08:00
dami 5fc6eacc53 update 2026-05-07 15:11:09 +08:00
dami bd782362e8 update 2026-05-07 15:06:37 +08:00
dami 32151a176f update 2026-05-07 15:04:27 +08:00
dami f7c88d2086 update 2026-05-07 14:01:26 +08:00
dami 1eb76f2b90 update 2026-05-07 13:56:40 +08:00
dami 226b3e049d Merge branch 'master' into dev 2026-05-07 12:58:58 +08:00
Mr Chen 7f0e9851cd Merge pull request #889 from midoks/dev
常规优化
2026-05-07 12:58:41 +08:00
dami 15df77940e Update index.py 2026-05-07 12:09:57 +08:00
dami 9781516552 Update plugin.py 2026-05-07 12:05:18 +08:00
dami a23264a542 update 2026-05-07 12:03:23 +08:00
dami 0e7845985a Update install.sh 2026-05-07 11:51:06 +08:00
dami 93efe45347 Update install.sh 2026-05-07 11:40:52 +08:00
dami a46f824e1e Update install.sh 2026-05-07 11:40:09 +08:00
Mr Chen 0de9f036bc Merge pull request #888 from midoks/dev
常规优化
2026-05-01 19:19:07 +08:00
dami 275f2515d6 优化 2026-05-01 19:17:05 +08:00
dami b4604928ec Update panel_task.py 2026-05-01 18:53:42 +08:00
dami 5a79b4021a update 2026-04-23 23:09:01 +08:00
dami 280fd38039 Create r3.9.txt 2026-04-23 15:29:05 +08:00
Mr Chen b032364616 Merge pull request #887 from midoks/dev
常规更新
2026-04-23 00:24:22 +08:00
dami a430aaee97 Update index.py 2026-04-23 00:19:46 +08:00
dami f4ee2ca3b9 Update install.sh 2026-04-23 00:12:59 +08:00
dami 92b9212b31 update 2026-04-23 00:12:57 +08:00
dami 73656e60ff Update nginx.conf 2026-04-22 23:02:44 +08:00
dami 401329d80c update 2026-04-22 22:32:25 +08:00
Mr Chen 6131970724 Merge pull request #886 from midoks/dev
常规优化
2026-04-21 20:51:12 +08:00
dami 85dcc4b78a update 2026-04-21 20:27:46 +08:00
dami 34a1bf7e28 Update mw.tpl 2026-04-15 20:33:51 +08:00
205 changed files with 9257 additions and 3553 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
```
### 版本更新 0.18.5
### 版本更新 0.18.6
- 常规优化。
+2 -1
View File
@@ -80,6 +80,7 @@ def runPanelTask():
# 站点过期检查
siteEdateCheck()
# echo "True" > /www/server/mdserver-web/logs/panel_task.lock
lock_file = mw.getTriggerTaskLockFile()
try:
if os.path.exists(lock_file):
@@ -183,7 +184,7 @@ def check502():
verlist = [
'52', '53', '54', '55', '56', '70',
'71', '72', '73', '74', '80', '81',
'82', '83', '84'
'82', '83', '84', '85'
]
for ver in verlist:
server_dir = mw.getServerDir()
+1 -1
View File
@@ -122,7 +122,7 @@ def openPort():
return True
def status():
cmd = "ps aux|grep alist |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
cmd = "ps -ef|grep alist |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
+1 -1
View File
@@ -174,7 +174,7 @@ def initDreplace():
def status():
cmd = "ps -ef|grep 'httpd/bin/httpd' |grep -v grep | grep -v python | awk '{print $2}'"
cmd = "ps -ef|grep 'httpd' |grep -v grep | grep -v python | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
+1 -1
View File
@@ -14,7 +14,7 @@ sysName=`uname`
action=$1
type=$2
VERSION=2.4.66
VERSION=2.4.68
apacheDir=${serverPath}/source/apache
Install_App()
+1 -1
View File
@@ -109,7 +109,7 @@ def initDreplace():
caddy_file = getConf()
if not os.path.exists(caddy_file):
caddy_file_tpl = getConfTpl()
content = mw.readFile(systemServiceTpl)
content = mw.readFile(caddy_file_tpl)
content = content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(caddy_file, content)
+3 -3
View File
@@ -20,9 +20,9 @@ After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
Type=simple
User=www
Group=www
ExecStart={$SERVER_PATH}/caddy/bin/caddy run --environ --config {$SERVER_PATH}/caddy/Caddyfile
ExecReload={$SERVER_PATH}/caddy/bin/caddy reload --config {$SERVER_PATH}/caddy/Caddyfile --force
TimeoutStopSec=5s
+1 -1
View File
@@ -3,7 +3,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/hom
export PATH
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/caddy && bash install.sh install 1.21.4
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh install 1.21.4
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh install 2.11
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh install 1.29.2
# cd /www/server/mdserver-web/plugins/caddy && bash install.sh upgrade 1.29.2
+1
View File
@@ -30,6 +30,7 @@ case $(uname -m) in
x86_64) ARCH_NAME="amd64" ;;
arm) ARCH_NAME="arm64" ;;
arm64) ARCH_NAME="arm64" ;;
aarch64) ARCH_NAME="arm64" ;;
esac
VERSION=2.11.2
+1
View File
@@ -165,6 +165,7 @@ def initConf():
"/www/server/alist/data/log",
"/www/server/dztasks/logs",
"/www/server/rsyncd/lsyncd.log",
"/www/server/mdserver-web/logs",
]
for i in clogcom:
if os.path.exists(i):
+1 -1
View File
@@ -99,7 +99,7 @@ def readConfigTpl():
def status():
data = mw.execShell(
"ps aux|grep cloudreve |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
"ps -ef|grep cloudreve |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
if data[0] == '':
return 'stop'
+1 -1
View File
@@ -106,7 +106,7 @@ def getPidFile():
return tmp.groups()[0].strip()
def status():
cmd = "ps aux|grep dztasks|grep -v grep|grep -v python|grep -v mdserver-web|awk '{print $2}'"
cmd = "ps -ef|grep dztasks|grep -v grep|grep -v python|grep -v mdserver-web|awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
+1 -1
View File
@@ -328,7 +328,7 @@ def setBlackIp():
mw.execShell('fail2ban-client -vvv set {jail} unbanip {ip}'.format(jail=d, ip=ip))
mw.writeFile(getBlackFile(), json.dumps([]))
return nw.returnJson(True, "禁止IP成功")
return mw.returnJson(True, "禁止IP成功")
# 检查IP格式
for ip in add_ip_list:
+1 -1
View File
@@ -113,7 +113,7 @@ def status():
# if not os.path.exists(pid_file):
# return 'stop'
cmd = "ps aux|grep gorse |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
cmd = "ps -ef|grep gorse |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
+1 -1
View File
@@ -84,7 +84,7 @@ def getPidFile():
return tmp.groups()[0].strip()
def status():
cmd = "ps aux|grep grafana |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
cmd = "ps -ef|grep grafana |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
+1 -1
View File
@@ -118,7 +118,7 @@ def configScriptsTpl():
def status():
data = mw.execShell(
"ps aux|grep keepalived |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
"ps -ef|grep keepalived |grep -v grep | grep -v python| awk '{print $2}'")
if data[0] == '':
return 'stop'
+1 -1
View File
@@ -115,7 +115,7 @@ def status():
return 'stop'
# data = mw.execShell(
# "ps aux|grep redis |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
# "ps -ef|grep redis |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
# if data[0] == '':
# return 'stop'
+1 -1
View File
@@ -91,7 +91,7 @@ def getPidFile():
return tmp.groups()[0].strip()
def status():
cmd = "ps aux|grep loki |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
cmd = "ps -ef|grep loki |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
+1 -2
View File
@@ -585,8 +585,7 @@ def setMyDbPos():
mw.writeFile(myfile, mycnf)
start()
result = mw.execShell(
'ps aux|grep mysqld| grep -v grep|grep -v python')
result = mw.execShell('ps -ef|grep mysqld| grep -v grep|grep -v python')
if len(result[0]) > 10:
mw.writeFile('data/datadir.pl', t_datadir)
return mw.returnJson(True, '存储目录迁移成功!')
+1 -1
View File
@@ -96,7 +96,7 @@ def checkArgs(data, ck=[]):
def status():
cmd = "ps aux|grep " + getPluginName() + " |grep -v grep | grep -v mdserver-web | awk '{print $2}'"
cmd = "ps -ef|grep " + getPluginName() + " |grep -v grep | grep -v mdserver-web | awk '{print $2}'"
# print(cmd)
data = mw.execShell(cmd)
# print(data)
+1 -1
View File
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sys_os=`uname`
VERSION=1.6.39
VERSION=1.6.42
echo $sys_os
+2 -2
View File
@@ -230,7 +230,7 @@ class classApi:
def close_sync(self, args):
# 取消迁移
mw.execShell("kill -9 {}".format(self.get_pid()))
mw.execShell("kill -9 $(ps aux|grep index.py|grep -v grep|awk '{print $2}')")
mw.execShell("kill -9 $(ps -ef|grep index.py|grep -v grep|awk '{print $2}')")
# 删除迁移配置
time.sleep(1)
if os.path.exists(self._INFO_FILE):
@@ -1032,7 +1032,7 @@ def stepThree():
def getPid():
cmd = "ps aux|grep 'plugins/migration_api/index.py bg_process' |grep -v grep|awk '{print $2}'|xargs"
cmd = "ps -ef|grep 'plugins/migration_api/index.py bg_process' |grep -v grep|awk '{print $2}'|xargs"
result = mw.execShell(cmd)[0].strip()
if not result:
return None
+46 -14
View File
@@ -154,8 +154,8 @@ def checkArgs(data, ck=[]):
return (True, mw.returnJson(True, 'ok'))
def status():
data = mw.execShell(
"ps -ef|grep mongod |grep -v mongosh|grep -v grep | grep -v /Applications | grep -v python | grep -v mdserver-web | awk '{print $2}'")
cmd = "ps -ef|grep mongod |grep -v mongosh|grep -v grep | grep -v /Applications | grep -v python | grep -v mdserver-web | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
return 'start'
@@ -196,25 +196,55 @@ def mongdbClientS():
mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root')
if auth == 'disabled':
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True)
client = pymongo.MongoClient(host=ip, port=int(port))
else:
# print(auth,mg_root)
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True, username='root',password=mg_root)
# 使用 admin 数据库进行认证,兼容 MongoDB 3.0
client = pymongo.MongoClient(host=ip, port=int(port), username='root', password=mg_root, authSource='admin')
return client
def getMongoDBVersion():
'''获取MongoDB版本号'''
import pymongo
port = getConfPort()
ip = getConfLocalIp()
try:
# 先不使用认证连接
client = pymongo.MongoClient(host=ip, port=int(port), serverSelectionTimeoutMS=5000)
db = client.admin
serverStatus = db.command('serverStatus')
version = serverStatus.get('version', '4.0')
client.close()
return version
except Exception as e:
# 如果无法获取版本,默认返回 4.0(新版本兼容模式)
return '4.0'
def isMongoDB3x():
'''判断是否为MongoDB 3.x版本'''
version = getMongoDBVersion()
# 匹配 3.x 版本
if version.startswith('3.'):
return True
return False
def mongdbClient():
import pymongo
port = getConfPort()
auth = getConfAuth()
ip = getConfLocalIp()
mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root')
# print(ip,port,auth,mg_root)
if auth == 'disabled':
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True)
client = pymongo.MongoClient(host=ip, port=int(port))
else:
# uri = "mongodb://root:"+mg_root+"@127.0.0.1:"+str(port)
# client = pymongo.MongoClient(uri)
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True, username='root',password=mg_root)
# 根据MongoDB版本选择认证方式
if isMongoDB3x():
# MongoDB 3.x 使用 authSource 指定认证数据库
client = pymongo.MongoClient(host=ip, port=int(port), username='root', password=mg_root, authSource='admin')
else:
# MongoDB 4.x+ 默认在 admin 数据库认证
client = pymongo.MongoClient(host=ip, port=int(port), username='root', password=mg_root)
return client
@@ -711,7 +741,6 @@ def setRootPwd(version=''):
def setUserPwd(version=''):
client = mongdbClient()
db = client.admin
sqlite_db = pSqliteDb('databases')
args = getArgs()
@@ -724,6 +753,8 @@ def setUserPwd(version=''):
uid = args['id']
try:
name = sqlite_db.where('id=?', (uid,)).getField('name')
# 将用户创建在目标数据库中,而不是 admin 数据库
db = client[name]
user_roles = [{'role': 'dbOwner', 'db': name}, {'role': 'userAdmin', 'db': name}]
try:
@@ -824,16 +855,16 @@ def getDbInfo():
def toDbBase(find):
client = mongdbClient()
db_admin = client.admin
data_name = find['name']
db = client[data_name]
db.zchat.insert_one({})
user_roles = [{'role': 'dbOwner', 'db': data_name}, {'role': 'userAdmin', 'db': data_name}]
# 将用户创建在目标数据库中,而不是 admin 数据库
try:
db_admin.command("createUser", find['username'], pwd=find['password'], roles=user_roles)
db.command("createUser", find['username'], pwd=find['password'], roles=user_roles)
except Exception as e:
db_admin.command("updateUser", find['username'], pwd=find['password'], roles=user_roles)
db.command("updateUser", find['username'], pwd=find['password'], roles=user_roles)
return 1
def syncToDatabases():
@@ -990,7 +1021,8 @@ def setDbAccess():
user_roles.append(t)
client = mongdbClient()
db = client.admin
# 在目标数据库中操作用户,而不是 admin 数据库
db = client[name]
try:
db.command("updateUser", username, pwd=mg_pass, roles=user_roles)
+1 -1
View File
@@ -7,7 +7,7 @@
"shell": "install.sh",
"install_pre_inspection":true,
"uninstall_pre_inspection":true,
"versions":["4.4","5.0","6.0","7.0","8.0","8.2"],
"versions":["3.0","4.4","5.0","6.0","7.0","8.0","8.2"],
"tip": "soft",
"checks": "server/mongodb",
"path": "server/mongodb",
+24
View File
@@ -6,9 +6,21 @@ export PATH
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 7.0
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 7.0
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 8.0
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 3.0
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mongodb/index.py start
# db.createUser({
# user: "demo",
# pwd: "123123",
# roles: [{role: "dbOwner", db: "demo"}]
# })
# db.auth("demo", "123123");
# import
# /www/server/mongodb/bin/mongorestore -h localhost -d demo --dir /tmp/*.json
curPath=`pwd`
rootPath=$(dirname "$curPath")
@@ -64,6 +76,11 @@ Install_app()
if [ -f $shell_file ];then
bash -x $shell_file
if [ "$?" != "0" ];then
echo '不支持...'
exit 1
fi
else
echo '不支持...'
exit 1
@@ -78,6 +95,13 @@ Install_app()
cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py initd_install
fi
if [ "${VERSION}" == "3.0" ];then
# 降低版本
pip install pymongo==3.12.0
else
pip install pymongo
fi
}
Uninstall_app()
+3 -2
View File
@@ -122,11 +122,12 @@ def mongdbClient():
mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root')
# print(ip,port,auth,mg_root)
if auth == 'disabled':
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True)
client = pymongo.MongoClient(host=ip, port=int(port))
else:
# uri = "mongodb://root:"+mg_root+"@127.0.0.1:"+str(port)
# client = pymongo.MongoClient(uri)
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True, username='root',password=mg_root)
# 使用 admin 数据库进行认证,兼容 MongoDB 3.0
client = pymongo.MongoClient(host=ip, port=int(port), username='root', password=mg_root, authSource='admin')
return client
class backupTools:
+73
View File
@@ -0,0 +1,73 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
VERSION=3.0.15
SYS_ARCH=`arch`
if [ "$SYS_ARCH" != "x86_64" ];then
echo "no support"
exit 0
fi
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
SYS_NAME=${SYS_VERSION_ID/./}
SYS_NAME_LEN=`echo "$SYS_NAME" | wc -L`
if [ "$SYS_NAME_LEN" == "1" ];then
SYS_NAME=${SYS_NAME}0
fi
if [ "$SYS_ARCH" == "aarch64" ];then
if [ "$SYS_NAME" -gt "82" ];then
SYS_NAME="82"
fi
if [ "$SYS_NAME" -lt "62" ];then
SYS_NAME="62"
fi
else
if [ "$SYS_NAME" -gt "80" ];then
SYS_NAME="80"
fi
if [ "$SYS_NAME" -lt "70" ];then
SYS_NAME="70"
fi
fi
# https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-rhel82-4.4.23.tgz
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.4.23.tgz
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-4.4.23.tgz
# https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-rhel82-4.4.23.tgz
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-4.4.23.tgz
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
FILE_NAME=mongodb-linux-${SYS_ARCH}-${VERSION}
FILE_NAME_TGZ=${FILE_NAME}.tgz
if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then
wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}
echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}"
fi
if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME}
+56
View File
@@ -0,0 +1,56 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.15.tgz
VERSION=3.0.15
SYS_ARCH=`arch`
if [ "$SYS_ARCH" != "x86_64" ];then
echo "no support"
exit 0
fi
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
SYS_NAME=${SYS_VERSION_ID/./}
if [ "$SYS_NAME" -gt "10" ];then
SYS_NAME="10"
fi
if [ "$SYS_NAME" -lt "10" ];then
SYS_NAME="10"
fi
# FILE_NAME=mongodb-linux-${SYS_ARCH}-debian${SYS_NAME}-${VERSION}
FILE_NAME=mongodb-linux-${SYS_ARCH}-${VERSION}
FILE_NAME_TGZ=${FILE_NAME}.tgz
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then
wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}
echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}"
fi
if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME}
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
# https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.0.15.tgz
VERSION=3.0.15
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
if [ ! -f $MG_DIR/mongodb-macos-x86_64-${VERSION}.tgz ]; then
wget --no-check-certificate -O $MG_DIR/mongodb-macos-x86_64-${VERSION}.tgz https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${VERSION}.tgz
echo "wget --no-check-certificate -O $MG_DIR/mongodb-macos-x86_64-${VERSION}.tgz https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${VERSION}.tgz"
fi
if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
fi
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
fi
+53
View File
@@ -0,0 +1,53 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
VERSION=3.0.15
SYS_ARCH=`arch`
if [ "$SYS_ARCH" != "x86_64" ];then
echo "no support"
exit 0
fi
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}' | awk -F . '{print $1}'`
SYS_NAME="15"
if [ "$SYS_VERSION_ID" -gt "15" ];then
SYS_NAME="15"
fi
if [ "$SYS_NAME" -lt "12" ];then
SYS_NAME="12"
fi
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-suse15-4.4.23.tgz
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-suse12-4.4.23.tgz
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
FILE_NAME=mongodb-linux-${SYS_ARCH}-${VERSION}
FILE_NAME_TGZ=${FILE_NAME}.tgz
if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then
wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}
echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}"
fi
if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME}
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
VERSION=3.0.15
SYS_ARCH=`arch`
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
SYS_NAME=${SYS_VERSION_ID/./}
SYS_NAME_LEN=`echo "$SYS_NAME" | wc -L`
if [ "$SYS_NAME_LEN" == "1" ];then
SYS_NAME=${SYS_NAME}0
fi
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.4.23.tgz
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
FILE_NAME=mongodb-linux-${SYS_ARCH}-${VERSION}
FILE_NAME_TGZ=${FILE_NAME}.tgz
if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then
wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}
echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}"
fi
if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME}
+51
View File
@@ -0,0 +1,51 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
VERSION=3.0.15
SYS_ARCH=`arch`
if [ "$SYS_ARCH" != "x86_64" ];then
echo "no support"
exit 1
fi
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
SYS_NAME=${SYS_VERSION_ID/./}
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-4.4.23.tgz
if [ "$SYS_NAME" -gt "2004" ];then
SYS_NAME="2004"
fi
if [ "$SYS_NAME" -lt "1604" ];then
SYS_NAME="1604"
fi
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
FILE_NAME=mongodb-linux-${SYS_ARCH}-${VERSION}
FILE_NAME_TGZ=${FILE_NAME}.tgz
if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then
wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}
echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}"
fi
if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
cd ${MG_DIR} && rm -rf ${MG_DIR}/${FILE_NAME}
+1 -1
View File
@@ -60,7 +60,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+4 -3
View File
@@ -37,7 +37,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
@@ -65,7 +65,7 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME}
#--------------- mongodb database install ------------------ #
TOOL_VERSION=100.9.4
TOOL_VERSION=100.16.1
TOOL_FILE_NAME=mongodb-database-tools-debian${SYS_NAME}-x86_64-${TOOL_VERSION}
if [ "aarch64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongodb-database-tools-debian${SYS_NAME}-arm64-${TOOL_VERSION}
@@ -75,7 +75,8 @@ if [ "arm64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongodb-database-tools-debian${SYS_NAME}-arm64-${TOOL_VERSION}
fi
TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip
# https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian10-x86_64-100.16.1.tgz
TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.tgz
if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then
wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://fastdl.mongodb.org/tools/db/${TOOL_FILE_NAME_TGZ}
fi
+1 -1
View File
@@ -22,7 +22,7 @@ if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -36,7 +36,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -38,7 +38,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -47,7 +47,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -37,7 +37,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -22,7 +22,7 @@ if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -38,7 +38,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -37,7 +37,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -22,7 +22,7 @@ if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -38,7 +38,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -42,7 +42,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -23,7 +23,7 @@ if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+2 -1
View File
@@ -14,6 +14,7 @@ SYS_ARCH=`arch`
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
SYS_NAME=${SYS_VERSION_ID/./}
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-4.4.23.tgz
# https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2204-7.0.37.tgz
if [ "$SYS_NAME" -gt "2204" ];then
SYS_NAME="2204"
@@ -38,7 +39,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -31,7 +31,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -30,7 +30,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+6 -1
View File
@@ -15,6 +15,10 @@ SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | a
SYS_NAME=${SYS_VERSION_ID/./}
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-4.4.23.tgz
if [ "$SYS_NAME" -gt "2404" ];then
SYS_NAME="2404"
fi
if [ "$SYS_NAME" -lt "2004" ];then
SYS_NAME="2004"
fi
@@ -42,7 +46,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
@@ -72,6 +76,7 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME}
# https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.9.4.tgz
#--------------- mongodb database install ------------------ #
TOOL_VERSION=100.9.4
SYS_NAME=2204
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-x86_64-${TOOL_VERSION}
if [ "aarch64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-arm64-${TOOL_VERSION}
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -31,7 +31,7 @@ if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -53,7 +53,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -30,7 +30,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+1 -1
View File
@@ -40,7 +40,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
+6 -1
View File
@@ -15,6 +15,10 @@ SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | a
SYS_NAME=${SYS_VERSION_ID/./}
# https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-4.4.23.tgz
if [ "$SYS_NAME" -gt "2404" ];then
SYS_NAME="2404"
fi
if [ "$SYS_NAME" -lt "2004" ];then
SYS_NAME="2004"
fi
@@ -42,7 +46,7 @@ if [ ! -d $MG_DIR/${FILE_NAME} ];then
cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ}
fi
if [ ! -d $serverPath/mongodb/bin ];then
if [ ! -f $serverPath/mongodb/bin/mongod ];then
mkdir -p $serverPath/mongodb
cd $MG_DIR/${FILE_NAME} && cp -rf ./bin $serverPath/mongodb
fi
@@ -72,6 +76,7 @@ cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME}
# https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.9.4.tgz
#--------------- mongodb database install ------------------ #
TOOL_VERSION=100.9.4
SYS_NAME=2204
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-x86_64-${TOOL_VERSION}
if [ "aarch64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongodb-database-tools-ubuntu${SYS_NAME}-arm64-${TOOL_VERSION}
+1 -1
View File
@@ -78,7 +78,7 @@ def getArgs():
def status():
data = mw.execShell(
"ps aux|grep mosquitto |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
"ps -ef|grep mosquitto |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'")
if data[0] == '':
return 'stop'
+2 -2
View File
@@ -4,8 +4,8 @@
"name": "mosquitto",
"title": "mosquitto",
"shell": "install.sh",
"versions":["2.0.18"],
"updates":["2.0.18"],
"versions":["2.0.18", "2.1.2"],
"updates":["2.0.18", "2.1.2"],
"tip": "soft",
"checks": "server/mosquitto",
"path": "server/mosquitto",
+1 -1
View File
@@ -57,7 +57,7 @@ app_start(){
app_stop(){
echo -e "stopping mosquitto ... \c";
arr=`ps aux | grep 'mosquitto' | grep -v grep | awk '{print $2}'`
arr=`ps -ef | grep 'mosquitto' | grep -v grep | awk '{print $2}'`
for p in ${arr[@]}
do
kill -9 $p > /dev/null 2>&1
+3 -1
View File
@@ -48,7 +48,9 @@ Install_App()
mkdir -p $serverPath/mosquitto
if [ ! -d $serverPath/mosquitto/bin ];then
cd mosquitto-${VERSION} && ${INSTALL_CMD} CMakeLists.txt -DCMAKE_INSTALL_PREFIX=$serverPath/mosquitto && make install
cd mosquitto-${VERSION} && ${INSTALL_CMD} CMakeLists.txt \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_INSTALL_PREFIX=$serverPath/mosquitto && make install
fi
if [ -d $serverPath/mosquitto ];then
+19 -8
View File
@@ -25,14 +25,25 @@ sysName=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=amd64
get_arch() {
echo "package main
import (
\"fmt\"
\"runtime\"
)
func main() { fmt.Println(runtime.GOARCH) }" > /tmp/go_arch.go
ARCH=$(go run /tmp/go_arch.go)
# 使用 bash 来识别架构
local arch=$(uname -m)
case $arch in
x86_64|amd64)
ARCH=amd64
;;
aarch64|arm64)
ARCH=arm64
;;
armv7l|armv7)
ARCH=armv7
;;
i686|i386)
ARCH=386
;;
*)
ARCH=amd64
;;
esac
echo "ARCH:${ARCH}"
}
+1 -1
View File
@@ -662,7 +662,7 @@ def setMyDbPos(version=''):
mw.writeFile(myfile, mycnf)
restart(version)
result = mw.execShell('ps aux|grep mysqld| grep -v grep|grep -v python')
result = mw.execShell('ps -ef|grep mysqld| grep -v grep|grep -v python')
if len(result[0]) > 10:
mw.writeFile('data/datadir.pl', t_datadir)
return mw.returnJson(True, '存储目录迁移成功!')
+29 -10
View File
@@ -69,25 +69,44 @@ fi
VERSION_ID=`cat /etc/*-release | grep 'VERSION_ID' | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
# 针对ubuntu24进行优化
if [[ "$OSNAME" == "ubuntu" ]] && [[ "$VERSION_ID" =~ "24" ]]; then
# 针对ubuntu24,26进行优化
if [[ "$OSNAME" == "ubuntu" ]] && [[ "$VERSION_ID" =~ ^(24|26)$ ]]; then
cur_dir=`pwd`
cd /usr/lib/x86_64-linux-gnu
if [ ! -f libaio.so.1 ];then
ln -s libaio.so.1t64.0.2 libaio.so.1
if [ -d /usr/lib/x86_64-linux-gnu ];then
cd /usr/lib/x86_64-linux-gnu
if [ ! -f libaio.so.1 ];then
ln -s libaio.so.1t64.0.2 libaio.so.1
fi
if [ ! -f libncurses.so.6 ];then
ln -s libncursesw.so.6.4 libncurses.so.6
fi
fi
if [ ! -f libncurses.so.6 ];then
ln -s libncursesw.so.6.4 libncurses.so.6
if [ -d /usr/lib/aarch64-linux-gnu ];then
cd /usr/lib/aarch64-linux-gnu
if [ ! -f libaio.so.1 ];then
ln -s libaio.so.1t64.0.2 libaio.so.1
fi
fi
cd $cur_dir
fi
if [[ "$OSNAME" == "debian" ]] && [[ "$VERSION_ID" =~ "13" ]]; then
cur_dir=`pwd`
cd /usr/lib/x86_64-linux-gnu
if [ ! -f libaio.so.1 ];then
ln -s libaio.so.1t64.0.2 libaio.so.1
if [ -d /usr/lib/x86_64-linux-gnu ];then
cd /usr/lib/x86_64-linux-gnu
if [ ! -f libaio.so.1 ];then
ln -s libaio.so.1t64.0.2 libaio.so.1
fi
fi
if [ -d /usr/lib/aarch64-linux-gnu ];then
cd /usr/lib/aarch64-linux-gnu
if [ ! -f libaio.so.1 ];then
ln -s libaio.so.1t64.0.2 libaio.so.1
fi
fi
cd $cur_dir
fi
+116
View File
@@ -0,0 +1,116 @@
[client]
user = root
#password = your_password
port = 3306
socket = {$SERVER_APP_PATH}/mysql.sock
default-character-set = UTF8MB4
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
authentication_policy=caching_sha2_password
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 3306
socket = {$SERVER_APP_PATH}/mysql.sock
basedir = {$SERVER_APP_PATH}
datadir = {$SERVER_APP_PATH}/data
log-error = {$SERVER_APP_PATH}/data/error.log
server-id = {$SERVER_ID}
#sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default_storage_engine = InnoDB
key_buffer_size = 8M
table_open_cache = 32
sort_buffer_size = 256K
net_buffer_length = 4K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 4M
thread_cache_size = 4
lower_case_table_names=0
tmp_table_size = 8M
character-set-server = UTF8MB4
max_connections = 500
max_connect_errors = 100
open_files_limit = 2560
max_allowed_packet = 128M
skip_name_resolve=1
#skip-networking
#skip-external-locking
#loose-skip-innodb
#skip-grant-tables
#skip-log-bin
#disable-log-bin
#skip-slave-start
log-bin=mysql-bin
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=10
#log_queries_not_using_indexes=1
#log_slow_admin_statements=1
#log_slow_replica_statements=1
binlog_expire_logs_seconds=604800
relay-log=mdserver
relay-log-index=mdserver
#多主设置
#auto_increment_offset=2
#auto_increment_increment=2
#master
#sync_binlog=1
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log_replica_updates = 1
# Prevent replication from starting automatically with MySQL
#skip_replica_start = 1
#replicate-do-db
replica_skip_errors=1062,1396
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema
replicate-ignore-db = mysql
replicate-ignore-db = test
innodb_data_home_dir = {$SERVER_APP_PATH}/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
innodb_buffer_pool_size = 16M
#innodb_log_file_size = 5M
innodb_redo_log_capacity = 4G
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 1
innodb_write_io_threads = 1
innodb_file_per_table=1
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
+1 -1
View File
@@ -802,7 +802,7 @@ def setMyDbPos(version):
mw.writeFile(myfile, mycnf)
start(version)
result = mw.execShell('ps aux|grep mysqld| grep -v grep|grep -v python')
result = mw.execShell('ps -ef|grep mysqld| grep -v grep|grep -v python')
if len(result[0]) > 10:
mw.writeFile('data/datadir.pl', t_datadir)
return mw.returnJson(True, '存储目录迁移成功!')
+2 -2
View File
@@ -11,8 +11,8 @@
"checks": "server/mysql/VERSION/bin/mysql",
"path": "server/mysql/VERSION",
"todo_versions":["5.6","5.7","8.0","8.2"],
"versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4"],
"updates":["5.5.62","5.6.50", "5.7.32","8.0.34","8.2.0","8.3.0","9.0.1","9.1.0","9.2.0","9.3.0","9.4.0"],
"versions":["5.5", "5.6", "5.7","8.0","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.7"],
"updates":["5.5.62","5.6.50", "5.7.32","8.0.46","8.2.0","8.3.0","9.0.1","9.1.0","9.2.0","9.3.0","9.4.0","9.7.0"],
"shell":"install.sh",
"checks":"server/mysql",
"path":"server/mysql",
+25 -2
View File
@@ -131,6 +131,16 @@ Install_mysql()
cd ${rootPath}/plugins/mysql/lib && /bin/bash rpcgen.sh
INSTALL_CMD=cmake
# check cmake version
CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'`
if [ "$CMAKE_VERSION" -eq "2" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
INSTALL_CMD=cmake3
fi
if [ ! -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
wget --no-check-certificate -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-${VERSION}.tar.gz
fi
@@ -180,8 +190,12 @@ Install_mysql()
OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl11"
fi
# -DCMAKE_EXE_LINKER_FLAGS="-ltirpc" \
# -DCMAKE_C_FLAGS="-I/usr/include/tirpc" \
# -DCMAKE_CXX_FLAGS="-I/usr/include/tirpc" \
if [ ! -d $serverPath/mysql ];then
cd ${mysqlDir}/mysql-${VERSION} && cmake \
cd ${mysqlDir}/mysql-${VERSION} && ${INSTALL_CMD} \
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
@@ -195,10 +209,19 @@ Install_mysql()
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DDOWNLOAD_BOOST=1 \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DWITH_CRYPT=system \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_EMBEDDED_SERVER=OFF \
-DHAVE_GETHOSTBYNAME_R_6_ARG=1 \
-DHAVE_GETHOSTBYNAME_R=1 \
-DWITHOUT_TOKUDB=1 \
-DWITHOUT_ROCKSDB=1 \
$OPTIONS \
-DCMAKE_C_COMPILER=${WHERE_DIR_GCC} \
-DCMAKE_CXX_COMPILER=${WHERE_DIR_GPP} \
-DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/
-DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/boost_1_59_0
make -j${cpuCore} && make install && make clean
if [ -d $serverPath/mysql ];then
+2 -2
View File
@@ -54,7 +54,7 @@ fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
VERSION=8.0.37
VERSION=8.0.46
Install_mysql()
{
mkdir -p ${mysqlDir}
@@ -102,7 +102,7 @@ Install_mysql()
fi
#检测文件是否损坏.
md5_mysql_ok=e0cb61cbf6e1144c452368c4535ae931
md5_mysql_ok=6707beb0d46a9e08a19aa596329ca79d
if [ -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
md5_mysql=`md5sum ${mysqlDir}/mysql-boost-${VERSION}.tar.gz | awk '{print $1}'`
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
+2 -2
View File
@@ -54,7 +54,7 @@ fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
VERSION=8.4.2
VERSION=8.4.10
# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${VERSION}.tar.gz
# https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-boost-${VERSION}.tar.gz
Install_mysql()
@@ -104,7 +104,7 @@ Install_mysql()
fi
#检测文件是否损坏.
md5_mysql_ok=a632063fdb1c7de2c5db47e1f66191cd
md5_mysql_ok=db1e11216dd83423a9374999367d77e4
if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then
md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'`
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
+230
View File
@@ -0,0 +1,230 @@
# -*- coding: utf-8 -*-
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
# https://dev.mysql.com/downloads/mysql/
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
mysqlDir=${serverPath}/source/mysql
_os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse'
zypper refresh
elif grep -Eq "FreeBSD" /etc/*-release; then
OSNAME='freebsd'
pkg install -y wget unzip
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
OSNAME='arch'
echo y | pacman -Sy unzip
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
OSNAME='centos'
yum install -y wget zip unzip
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
OSNAME='fedora'
yum install -y wget zip unzip
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
OSNAME='rocky'
yum install -y wget zip unzip
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
OSNAME='alma'
yum install -y wget zip unzip
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
OSNAME='debian'
apt update -y
apt install -y devscripts
apt install -y wget zip unzip
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
OSNAME='ubuntu'
apt install -y wget zip unzip
else
OSNAME='unknow'
fi
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
VERSION=9.7.1
# https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz
# https://cdn.mysql.com/archives/mysql-9.4/mysql-9.4.0.tar.gz
Install_mysql()
{
mkdir -p ${mysqlDir}
echo '正在安装脚本文件...'
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
fi
if [ -f /proc/cpuinfo ];then
cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l`
fi
MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}')
if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then
if [ "${cpuCore}" -gt "${MEM_INFO}" ];then
cpuCore="${MEM_INFO}"
fi
else
cpuCore="1"
fi
if [ "$cpuCore" -gt "2" ];then
cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`
else
cpuCore="1"
fi
# ----- cpu end ------
cd ${rootPath}/plugins/mysql/lib && /bin/bash rpcgen.sh
INSTALL_CMD=cmake
# check cmake version
CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'`
if [ "$CMAKE_VERSION" -eq "2" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
INSTALL_CMD=cmake3
fi
if [ ! -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then
wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://dev.mysql.com/get/Downloads/MySQL-9.4/mysql-${VERSION}.tar.gz
fi
#检测文件是否损坏.
md5_mysql_ok=5d2f4c9568a0e01d20dc5442c772de9f
if [ -f ${mysqlDir}/mysql-${VERSION}.tar.gz ];then
md5_mysql=`md5sum ${mysqlDir}/mysql-${VERSION}.tar.gz | awk '{print $1}'`
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
echo "mysql9.4 file check ok"
else
# 重新下载
rm -rf ${mysqlDir}/mysql-${VERSION}
wget --no-check-certificate -O ${mysqlDir}/mysql-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/archives/mysql-9.4/mysql-${VERSION}.tar.gz
fi
fi
if [ ! -d ${mysqlDir}/mysql-${VERSION} ];then
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-${VERSION}.tar.gz
fi
OPTIONS=''
##check openssl version
OPENSSL_VERSION=`openssl version|awk '{print $2}'|awk -F '.' '{print $1}'`
if [ "${OPENSSL_VERSION}" -ge "3" ];then
#openssl version to high
cd ${rootPath}/plugins/php/lib && /bin/bash openssl.sh
export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig
OPTIONS="-DWITH_SSL=${serverPath}/lib/openssl"
fi
WHERE_DIR_GCC=/usr/bin/gcc
WHERE_DIR_GPP=/usr/bin/g++
if [ "$OSNAME" == "centos" ] && [ "$VERSION_ID" == "7" ];then
yum install -y libudev-devel
yum install -y centos-release-scl
yum install -y devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils
gcc --version
WHERE_DIR_GCC=/opt/rh/devtoolset-11/root/usr/bin/gcc
WHERE_DIR_GPP=/opt/rh/devtoolset-11/root/usr/bin/g++
echo $WHERE_DIR_GCC
echo $WHERE_DIR_GPP
fi
if [ "$OSNAME" == "ubuntu" ];then
apt install -y libudev-dev
apt install -y libtirpc-dev
apt install -y libssl-dev
apt install -y libgssglue-dev
apt install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
LIBTIRPC_VER=`pkg-config libtirpc --modversion`
if [ ! -f ${mysqlDir}/libtirpc_1.3.3.orig.tar.bz2 ];then
wget --no-check-certificate -O ${mysqlDir}/libtirpc_1.3.3.orig.tar.bz2 https://downloads.sourceforge.net/libtirpc/libtirpc-1.3.3.tar.bz2
cd ${mysqlDir} && tar -jxvf libtirpc_1.3.3.orig.tar.bz2
cd libtirpc-1.3.3 && ./configure
fi
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
apt install -y gcc-11 g++-11
WHERE_DIR_GCC=/usr/bin/gcc-11
WHERE_DIR_GPP=/usr/bin/g++-11
OPTIONS="${OPTIONS} -DFORCE_INSOURCE_BUILD=1"
OPTIONS="${OPTIONS} -D_FORTIFY_SOURCE=2"
fi
if [ "$OSNAME" == "opensuse" ];then
zypper install -y gcc11
zypper install -y gcc11-c++
WHERE_DIR_GCC=/usr/bin/gcc-11
WHERE_DIR_GPP=/usr/bin/g++-11
fi
if [ ! -d $serverPath/mysql ];then
# -DCMAKE_CXX_STANDARD=17 \
cd ${mysqlDir}/mysql-${VERSION} && ${INSTALL_CMD} \
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/var/tmp/mysql.sock \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DDOWNLOAD_BOOST=1 \
-DFORCE_INSOURCE_BUILD=1 \
$OPTIONS \
-DCMAKE_C_COMPILER=$WHERE_DIR_GCC \
-DCMAKE_CXX_COMPILER=$WHERE_DIR_GPP \
-DDOWNLOAD_BOOST=0 \
-DWITH_BOOST=${mysqlDir}/mysql-${VERSION}/boost/
make -j${cpuCore} && make install && make clean
if [ -d $serverPath/mysql ];then
rm -rf ${mysqlDir}/mysql-${VERSION}
echo '9.4' > $serverPath/mysql/version.pl
echo "${VERSION}安装完成"
else
# rm -rf ${mysqlDir}/mysql-${VERSION}
echo "${VERSION}安装失败"
exit 1
fi
fi
}
Uninstall_mysql()
{
rm -rf $serverPath/mysql
echo '卸载完成'
}
action=$1
if [ "${1}" == "install" ];then
Install_mysql
else
Uninstall_mysql
fi
+2 -5
View File
@@ -4,11 +4,8 @@
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('nezha',$('.plugin_version').attr('version'));">面板服务</p>
<p onclick="pluginInitD('nezha',$('.plugin_version').attr('version'));">面板自启动</p>
<p onclick="nezha.cfg($('.plugin_version').attr('version'));">面板配置</p>
<p onclick="pluginConfig('nezha', $('.plugin_version').attr('version'), 'conf');">面板配置文件</p>
<p onclick="pluginService('nezha', $('.plugin_version').attr('version'), 'agent');">AGENT服务</p>
<p onclick="pluginInitD('nezha', $('.plugin_version').attr('version'), 'agent');">AGENT自启动</p>
<p onclick="nezha.agent_cfg($('.plugin_version').attr('version'));">AGENT配置</p>
<p onclick="pluginConfig('nezha', $('.plugin_version').attr('version'), 'conf');">配置文件</p>
<p onclick="nezha.otherFunc();">维护功能</p>
<p onclick="nezha.readme();">说明</p>
</div>
<div class="bt-w-con pd15">
+46 -159
View File
@@ -1,4 +1,5 @@
# coding:utf-8
#!/usr/bin/env python
# coding=utf-8
import sys
import io
@@ -64,7 +65,7 @@ class App:
return "Release failed {}".format(e)
def openPort(self):
for i in ["9527", "5555"]:
for i in ["8008"]:
self.__release_port(i)
return True
@@ -81,49 +82,36 @@ class App:
path = self.getPluginDir() + "/init.d/nezha.tpl"
return path
def getInitdAgentConfTpl(self):
path = self.getPluginDir() + "/init.d/nezha-agent.tpl"
return path
def getDataDir(self):
data = self.getServerDir()+"/dashboard/data/sqlite.db"
return data
def getHomeDir(self):
if mw.isAppleSystem():
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
user = mw.execShell("who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return '/Users/' + user
else:
return '/root'
def getRunUser(self):
if mw.isAppleSystem():
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
user = mw.execShell("who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return user
else:
return 'root'
def status(self):
cmd = "ps -ef|grep " + self.getPluginName() + \
" |grep -v grep | grep -v nezha-agent | grep -v python | awk '{print $2}'"
cmd = "ps -ef|grep nezha/dashboard |grep -v grep | grep -v python | awk '{print $2}'"
data = mw.execShell(cmd)
# mw.writeFileLog("data[0]:"+data[0])
if data[0] == '':
return "stop"
return 'start'
def status_agent(self):
cmd = "ps -ef | grep nezha-agent | grep -v grep | grep -v python | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return 'stop'
return 'start'
def contentReplace(self, content):
service_path = mw.getServerDir()
content = content.replace('{$ROOT_PATH}', mw.getFatherDir())
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$RUN_USER}', self.getRunUser())
content = content.replace('{$HOME_DIR}', self.getHomeDir())
return content
def initDreplace(self):
@@ -146,8 +134,8 @@ class App:
# systemd
systemDir = mw.systemdCfgDir()
systemService = systemDir + '/nezha.service'
systemServiceTpl = self.getPluginDir() + '/init.d/nezha.service.tpl'
systemService = systemDir + '/nezha-dashboard.service'
systemServiceTpl = self.getPluginDir() + '/init.d/nezha-dashboard.service.tpl'
if os.path.exists(systemDir) and not os.path.exists(systemService):
service_path = mw.getServerDir()
se_content = mw.readFile(systemServiceTpl)
@@ -157,53 +145,11 @@ class App:
return file_bin
def contentAgentReplace(self, content):
path = self.__agent_cfg
if os.path.exists(path):
data = self.get_agent_cfg()
content = content.replace('{$APP_HOST}', data['host'])
content = content.replace('{$APP_SECRET}', data['secret'])
return content
def initDAgent(self):
file_tpl = self.getInitdAgentConfTpl()
initD_path = self.getServerDir() + '/init.d'
if not os.path.exists(initD_path):
os.mkdir(initD_path)
file_agent_bin = initD_path + '/nezha-agent'
content = mw.readFile(file_tpl)
content = self.contentReplace(content)
content = self.contentAgentReplace(content)
mw.writeFile(file_agent_bin, content)
mw.execShell('chmod +x ' + file_agent_bin)
# systemd
sysDir = mw.systemdCfgDir()
sysService = sysDir + '/nezha-agent.service'
sysServiceTpl = self.getPluginDir() + '/init.d/nezha-agent.service.tpl'
service_path = mw.getServerDir()
content = mw.readFile(sysServiceTpl)
content = self.contentReplace(content)
content = self.contentAgentReplace(content)
mw.writeFile(sysService, content)
mw.execShell('systemctl daemon-reload')
return file_agent_bin
def init_cfg(self):
self.initDreplace()
self.initDAgent()
def imOp(self, method):
file = self.initDreplace()
if not mw.isAppleSystem():
cmd = 'systemctl {} {}'.format(method, self.getPluginName())
cmd = 'systemctl {} {}'.format(method, "nezha-dashboard")
data = mw.execShell(cmd)
if data[1] == '':
return 'ok'
@@ -227,19 +173,6 @@ class App:
return self.imOp('reload')
def agOp(self, method):
file = self.initDAgent()
path = self.__agent_cfg
if not os.path.exists(path):
return '请先设置Agent配置!'
if not mw.isAppleSystem():
cmd = 'systemctl {} {}'.format(method, 'nezha-agent')
data = mw.execShell(cmd)
if data[1] == '':
return 'ok'
return 'fail'
data = mw.execShell(file + ' ' + method)
if data[1] == '':
return 'ok'
@@ -258,105 +191,59 @@ class App:
return self.agentOp('reload')
def initd_status(self):
cmd = 'systemctl status nezha | grep loaded | grep "enabled;"'
cmd = 'systemctl status nezha-dashboard | grep loaded | grep "enabled;"'
data = mw.execShell(cmd)
if data[0] == '':
return 'fail'
return 'ok'
def initd_install(self):
mw.execShell('systemctl enable nezha')
mw.execShell('systemctl enable nezha-dashboard')
return 'ok'
def initd_uninstall(self):
mw.execShell('systemctl disable nezha')
mw.execShell('systemctl disable nezha-dashboard')
return 'ok'
def initd_status_agent(self):
cmd = 'systemctl status nezha-agent | grep loaded | grep "enabled;"'
data = mw.execShell(cmd)
if data[0] == '':
return 'fail'
return 'ok'
def getVersion(self):
ver_file = self.getServerDir()+"/version.pl"
return mw.readFile(ver_file).strip()
def initd_install_agent(self):
mw.execShell('systemctl enable nezha-agent')
return 'ok'
def uninstall_pre_inspection(self):
version = self.getVersion()
data_dir = self.getDataDir()
if os.path.exists(data_dir):
self.stop()
if mw.isDebugMode():
return 'ok'
def initd_uninstall_agent(self):
mw.execShell('systemctl disable nezha-agent')
return 'ok'
from utils.plugin import plugin as MwPlugin
MwPlugin.instance().removeIndex(self.getPluginName(), version)
return "请手动删除NEZHA[{}]<br/> rm -rf {}".format(version, self.getServerDir())
def conf(self):
return self.getServerDir() + '/dashboard/data/config.yaml'
def nezha_cfg(self):
path = self.__cfg
if not os.path.exists(path):
d = {}
cmd_un = 'cd ' + self.getServerDir() + '/dashboard && ./nezha conf -u ""'
mw.execShell(cmd_un)
td = mw.execShell(cmd_un)
d['username'] = td[0].strip()
pwd = mw.getRandomString(16)
cmd_pwd = 'cd ' + self.getServerDir() + '/dashboard && ./nezha conf -u "" -p ' + pwd
td = mw.execShell(cmd_pwd)
d['password'] = pwd
mw.writeFile(path, mw.enDoubleCrypt('nezha', mw.getJson(d)))
info = mw.readFile(path)
info = mw.deDoubleCrypt('nezha', info)
info = json.loads(info)
return mw.returnJson(True, 'ok', info)
def nezha_save_cfg(self):
args = self.getArgs()
data = self.checkArgs(args, ['username', 'password'])
if not data[0]:
return data[1]
path = self.__cfg
cmd = 'cd ' + self.getServerDir() + '/dashboard && ./nezha conf -su "' + \
args['username'] + '" -p ' + args['password']
# print(cmd)
t = mw.execShell(cmd)
# print(t)
mw.writeFile(path, mw.enDoubleCrypt('nezha', mw.getJson(args)))
return mw.returnJson(True, '修改成功!')
def get_agent_cfg(self):
path = self.__agent_cfg
info = mw.readFile(path)
info = mw.deDoubleCrypt('agent', info)
info = json.loads(info)
return info
def agent_cfg(self):
path = self.__agent_cfg
if not os.path.exists(path):
d = {}
d['host'] = '127.0.0.1:5555'
d['secret'] = 'secret'
mw.writeFile(path, mw.enDoubleCrypt('agent', mw.getJson(d)))
info = self.get_agent_cfg()
return mw.returnJson(True, 'ok', info)
def agent_save_cfg(self):
args = self.getArgs()
data = self.checkArgs(args, ['host', 'secret'])
if not data[0]:
return data[1]
path = self.__agent_cfg
mw.writeFile(path, mw.enDoubleCrypt('agent', mw.getJson(args)))
return mw.returnJson(True, '修改成功!')
def run_log(self):
return self.getServerDir() + '/logs/nezha.log'
def cron_add_check(self):
try:
import tool_task
tool_task.createBgTask()
return mw.returnJson(True, '添加检查任务成功')
except Exception as e:
return mw.returnJson(False, '添加检查任务失败:'+str(e))
def cron_del_check(self):
try:
import tool_task
tool_task.removeBgTask()
return mw.returnJson(True, '删除检查任务成功')
except Exception as e:
return mw.returnJson(False, '删除检查任务失败:'+str(e))
if __name__ == "__main__":
func = sys.argv[1]
+5 -3
View File
@@ -1,17 +1,19 @@
{
"sort": 7,
"ps": "哪吒监控面板/改造版",
"ps": "哪吒监控面板",
"name": "nezha",
"title": "哪吒监控",
"shell": "install.sh",
"versions":["0.15.2"],
"versions":["2.2.5","2.2.6","latest"],
"tip": "soft",
"checks": "server/nezha",
"path": "server/nezha",
"coexist": false,
"uninstall_pre_inspection":true,
"display": 1,
"author": "midoks",
"date": "2023-06-26",
"home": "https://github.com/midoks/nezha",
"home": "https://github.com/nezhahq/nezha",
"doc1": "https://nezha.wiki/",
"type": 0,
"pid": "5"
@@ -1,30 +0,0 @@
[Unit]
Description=Nezha Agent
After=syslog.target
#After=network.target
#After=nezha-dashboard.service
[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
Type=simple
User=root
Group=root
WorkingDirectory={$SERVER_PATH}/nezha/agent/
ExecStart={$SERVER_PATH}/nezha/agent/nezha-agent -s {$APP_HOST} -p {$APP_SECRET}
Restart=always
#Environment=DEBUG=true
# Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd.
#ProtectSystem=full
#PrivateDevices=yes
#PrivateTmp=yes
#NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
-90
View File
@@ -1,90 +0,0 @@
#!/bin/bash
# chkconfig: 2345 55 25
# description: Nezha Agent Service
### BEGIN INIT INFO
# Provides: Nezha Agent
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts Nezha Agent
# Description: starts the Nezha Agent
### END INIT INFO
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
if [ -f /etc/init.d/functions ];then
. /etc/init.d/functions
fi
if [ -f /etc/rc.d/init.d/functions ];then
. /etc/rc.d/init.d/functions
fi
SERVICENAME=nezha-agent
LOG_PATH={$SERVER_PATH}/nezha/logs
APP_PATH={$SERVER_PATH}/nezha/agent
APP_HOST={$APP_HOST}
APP_SECRET={$APP_SECRET}
app_start(){
isStart=`ps -ef|grep "${SERVICENAME}" | grep -v grep | grep -v python | grep -v "/bin/bash" | awk '{print $2}'`
if [ "$isStart" == '' ];then
echo -e "Starting ${SERVICENAME}... \c"
cd $APP_PATH
exec nohup ${APP_PATH}/${SERVICENAME} -d -s ${APP_HOST} -p ${APP_SECRET} >> ${LOG_PATH}/${SERVICENAME}.log 2>&1 &
isStart=""
while [[ "$isStart" == "" ]];
do
echo -e ".\c"
sleep 0.5
isStart=$(ps -ef|grep "${SERVICENAME}" |grep -v grep | grep -v python | grep -v "/bin/bash" | awk '{print $2}')
let n+=1
if [ $n -gt 15 ];then
break;
fi
done
if [ "$isStart" == '' ];then
echo -e "\033[31mError: ${SERVICENAME} service startup failed.\033[0m"
return;
fi
echo -e "\033[32mdone\033[0m"
else
echo "Starting ${SERVICENAME}(pid $(echo $isStart)) already running"
fi
}
app_stop(){
pids=`ps -ef | grep "${SERVICENAME}" | grep -v grep | grep -v python | grep -v "/bin/bash" |awk '{print $2}'`
arr=($pids)
echo -e "Stopping ${SERVICENAME}... \c"
for p in ${arr[@]}
do
# echo "$p"
kill -9 $p
done
echo -e "\033[32mdone\033[0m"
}
app_status(){
isStart=`ps -ef | grep "${SERVICENAME}" | grep -v grep | grep -v python | grep -v "/bin/bash" | awk '{print $2}'`
if [ "$isStart" == '' ];then
echo -e "${SERVICENAME} not running"
else
echo -e "${SERVICENAME}(pid $(echo $isStart)) already running"
fi
}
case "$1" in
'start') app_start;;
'stop') app_stop;;
'status') app_status;;
'reload')
app_stop
app_start;;
'restart')
app_stop
app_start;;
esac
@@ -15,7 +15,7 @@ Type=simple
#User=root
#Group=root
WorkingDirectory={$SERVER_PATH}/nezha/dashboard/
ExecStart={$SERVER_PATH}/nezha/dashboard/nezha web
ExecStart={$SERVER_PATH}/nezha/dashboard/app
Restart=always
#Environment=DEBUG=true
+10 -8
View File
@@ -2,6 +2,16 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# systemctl start nezha-dashboard
# systemctl status nezha-dashboard
# cd /www/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.6
# sqlite3 /www/server/nezha/dashboard/data/sqlite.db "DELETE FROM users;"
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/nezha/index.py start
# cd /www/server/mdserver-web && source bin/activate && python3 plugins/nezha/index.py status
# python3 plugins/nezha/index.py cron_add_check
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
@@ -30,12 +40,4 @@ if [ "${action}" == "uninstall" ];then
rm -rf /lib/systemd/system/nezha.service
systemctl daemon-reload
fi
if [ -f /usr/lib/systemd/system/nezha-agent.service ] || [ -f /lib/systemd/system/nezha-agent.service ] ;then
systemctl stop nezha-agent
systemctl disable nezha-agent
rm -rf /usr/lib/systemd/system/nezha-agent.service
rm -rf /lib/systemd/system/nezha-agent.service
systemctl daemon-reload
fi
fi
+17 -88
View File
@@ -31,14 +31,6 @@ var nezha = {
}
var ret_data = $.parseJSON(res.data);
console.log("send:",ret_data);
// if (!ret_data.status){
// layer.msg(ret_data.msg,{icon:2,time:2000});
// return;
// }
// console.log("send2:",ret_data);
if(typeof(callback) == 'function'){
callback(ret_data);
}
@@ -82,102 +74,39 @@ var nezha = {
}
},'json');
},
repeatPwd:function (a, id) {
$("#"+id).val(randomStrPwd(a))
},
save_cfg:function(version){
var username = $("input[name='username']").val();
var password = $("input[name='password']").val();
this.send({
tips:'正在设置中...',
data:{'username':username,'password':password},
method:'nezha_save_cfg',
otherFunc:function(){
var con = '<p class="conf_p" style="text-align:center;">\
<button class="btn btn-default btn-sm" onclick="nezha.cronAddCheck()">添加更新任务</button>\
<button class="btn btn-default btn-sm" onclick="nezha.cronDelCheck()">删除更新任务</button>\
</p>';
$(".soft-man-con").html(con);
},
cronAddCheck: function(){
nezha.send({
tips:"请求中...",
method: "cron_add_check",
success:function(rdata){
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
}
});
},
cfg:function(version){
this.send({
tips:'正在获取中...',
method:'nezha_cfg',
success:function(data){
var d = data.data;
var value = '<p>\
<span>用户名</span>\
<input id="nz_username" style="width: 160px;" class="bt-input-text mr5" name="username" value="'+d['username']+'" type="text">\
,<span title="随机用户名" class="glyphicon glyphicon-repeat cursor" onclick="nezha.repeatPwd(8,\'nz_username\')"></span>\
</p>';
value += '<p>\
<span>密码</span>\
<input id="nz_password" style="width: 160px;" class="bt-input-text mr5" name="password" value="'+d['password']+'" type="text">\
,<span title="随机密码" class="glyphicon glyphicon-repeat cursor" onclick="nezha.repeatPwd(16,\'nz_password\')"></span>\
</p>';
var conf = '<style>.conf_p p{margin-bottom: 2px;} .conf_p span {width: 50px;}</style><div class="conf_p" style="margin-bottom:0">\
' + value + '\
<div style="margin-top:10px; padding-right:15px" class="text-right">\
<button class="btn btn-success btn-sm mr5" onclick="nezha.cfg(\'' + version + '\')">刷新</button>\
<button class="btn btn-success btn-sm" onclick="nezha.save_cfg(\'' + version + '\')">保存</button>\
</div>\
</div>'
$(".soft-man-con").html(conf);
}
});
},
agent_save_cfg:function(version){
var host = $("input[name='host']").val();
var secret = $("input[name='secret']").val();
this.send({
tips:'正在设置中...',
data:{'host':host,'secret':secret},
method:'agent_save_cfg',
cronDelCheck:function(){
nezha.send({
tips:"请求中...",
method: "cron_del_check",
success:function(rdata){
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
}
});
},
agent_cfg:function(version){
this.send({
tips:'正在获取中...',
method:'agent_cfg',
success:function(data){
var d = data.data;
var value = '<p>\
<span>地址</span>\
<input id="nz_username" style="width: 160px;" class="bt-input-text mr5" name="host" value="'+d['host']+'" type="text">\
,<font>如1.1.1.1:5444</font>\
</p>';
value += '<p>\
<span>密钥</span>\
<input id="nz_password" style="width: 160px;" class="bt-input-text mr5" name="secret" value="'+d['secret']+'" type="text">\
,<font>密钥</font>\
</p>';
var conf = '<style>.conf_p p{margin-bottom: 2px;} .conf_p span {width: 50px;}</style><div class="conf_p" style="margin-bottom:0">\
' + value + '\
<div style="margin-top:10px; padding-right:15px" class="text-right">\
<button class="btn btn-success btn-sm mr5" onclick="nezha.agent_cfg(\'' + version + '\')">刷新</button>\
<button class="btn btn-success btn-sm" onclick="nezha.agent_save_cfg(\'' + version + '\')">保存</button>\
</div>\
</div>'
$(".soft-man-con").html(conf);
}
});
},
readme:function (){
var readme = '<ul class="help-info-text c7">';
readme += '<li>安装时不会自动启动。</li>';
readme += '<li>哪吒面板是改造版,用户名和密码登录【面板配置】,不依赖github/gitee/gitlab。</li>';
readme += '<li>Agent需要先手动填写正确信息。</li>';
readme += '<li>默认用户和密码(admin:admin),务必在第一时间修改</li>';
readme += '<li>经测试,修改(admin)密码后,需清空cookie,才能正常登录</li>';
readme += '</ul>';
$('.soft-man-con').html(readme);
}
+124
View File
@@ -0,0 +1,124 @@
# coding:utf-8
import sys
import io
import os
import time
import json
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
from utils.crontab import crontab as MwCrontab
app_debug = False
if mw.isAppleSystem():
app_debug = True
def getPluginName():
return 'nezha'
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()
def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
def getTaskConf():
conf = getServerDir() + "/task_config.json"
return conf
def getConfigData():
conf = getTaskConf()
if os.path.exists(conf):
return json.loads(mw.readFile(getTaskConf()))
return {
"task_id": -1,
"period": "day-n",
"where1": "7",
"hour": "0",
"minute": "0",
}
def createBgTask():
removeBgTask()
createBgTaskByName(getPluginName())
def createBgTaskByName(name):
args = getConfigData()
_name = "[NEZHA]自动更新任务"
res = mw.M("crontab").field("id, name").where("name=?", (_name,)).find()
if res:
return True
if "task_id" in args and args["task_id"] > 0:
res = mw.M("crontab").field("id, name").where(
"id=?", (args["task_id"],)).find()
if res and res["id"] == args["task_id"]:
print("计划任务已经存在!")
return True
mw_dir = mw.getPanelDir()
cmd = '''
mw_dir=%s
rname=%s
plugin_path=%s
script_path=%s
''' % (mw_dir, name, getServerDir(), getPluginDir())
cmd += 'echo "bash $script_path/update.sh"' + "\n"
cmd += 'cd $mw_dir && bash $script_path/update.sh' + "\n"
params = {
'name': _name,
'type': args['period'],
'week': "",
'where1': args['where1'],
'hour': args['hour'],
'minute': args['minute'],
'save': "",
'backup_to': "",
'stype': "toShell",
'sname': '',
'sbody': cmd,
'url_address': '',
}
task_id = MwCrontab.instance().add(params)
if task_id > 0:
args["task_id"] = task_id
args["name"] = name
mw.writeFile(getTaskConf(), json.dumps(args))
def removeBgTask():
cfg = getConfigData()
if "task_id" in cfg and cfg["task_id"] > 0:
res = mw.M("crontab").field("id, name").where(
"id=?", (cfg["task_id"],)).find()
if res and res["id"] == cfg["task_id"]:
data = MwCrontab.instance().delete(cfg["task_id"])
if data["status"]:
cfg["task_id"] = -1
mw.writeFile(getTaskConf(), json.dumps(cfg))
return True
return False
if __name__ == "__main__":
if len(sys.argv) > 1:
action = sys.argv[1]
if action == "remove":
removeBgTask()
elif action == "add":
createBgTask()
+116
View File
@@ -0,0 +1,116 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# cd /www/server/mdserver-web && bash plugins/nezha/update.sh
curPath=`pwd`
serverPath=$(dirname "$curPath")
echo $curPath
nezhaDir=${serverPath}/source/nezha
REPO="nezhahq/nezha"
LATEST_VERSION=$(curl -sL "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name')
echo "最新版本是: $LATEST_VERSION"
NUMBER_LATEST_VERSION=${LATEST_VERSION:1}
echo "最新[NUMBER]是: $NUMBER_LATEST_VERSION"
# INSTALL_VERSION=`cat /www/server/nezha/version.pl`
# echo "安装的版本: $INSTALL_VERSION"
INSTALL_VERSION=`/www/server/nezha/dashboard/app -v`
echo "安装的版本: $INSTALL_VERSION"
if [ -d /www/server/nezha ];then
echo "$INSTALL_VERSION" > /www/server/nezha/version.pl
fi
if [ "$INSTALL_VERSION" == "$NUMBER_LATEST_VERSION" ];then
echo "已经是最新!!!"
exit
fi
get_arch() {
uname=$(uname -m)
case "$uname" in
amd64|x86_64)
ARCH="amd64"
;;
i386|i686)
ARCH="386"
;;
aarch64|arm64)
ARCH="arm64"
;;
*arm*)
ARCH="arm"
;;
s390x)
ARCH="s390x"
;;
riscv64)
ARCH="riscv64"
;;
*)
err "未知架构:$ARCH"
exit 1
;;
esac
}
get_arch
download_file() {
url="${1}"
destination="${2}"
printf "Fetching ${url} \n\n"
if test -x "$(command -v curl)"; then
code=$(curl --connect-timeout 15 -w '%{http_code}' -L "${url}" -o "${destination}")
elif test -x "$(command -v wget)"; then
code=$(wget -t2 -T15 -O "${destination}" --server-response "${url}" 2>&1 | awk '/^ HTTP/{print $2}' | tail -1)
else
printf "\e[1;31mNeither curl nor wget was available to perform http requests.\e[0m\n"
exit 1
fi
if [ "${code}" != 200 ]; then
printf "\e[1;31mRequest failed with code %s\e[0m\n" $code
exit 1
else
printf "\n\e[1;33mDownload succeeded\e[0m\n"
fi
}
TARGET_DIR="$serverPath/nezha/dashboard"
filename="dashboard-linux-${ARCH}.zip"
DOWNLOAD_URL="https://github.com/nezhahq/nezha/releases/download/v${NUMBER_LATEST_VERSION}/${filename}"
DOWNLOAD_FILE="$nezhaDir/$filename"
if [ ! -f $DOWNLOAD_FILE ];then
download_file $DOWNLOAD_URL $DOWNLOAD_FILE
fi
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
cd $TARGET_DIR && rm -rf app.bak
cd $TARGET_DIR && mv app app.bak
unzip $DOWNLOAD_FILE -d $TARGET_DIR
echo "TARGET_DIR:"$TARGET_DIR
if [ ! -f $TARGET_DIR/app ];then
cd $TARGET_DIR && mv dashboard-linux-${ARCH} app && chmod +x app
fi
systemctl restart nezha-dashboard
echo $DOWNLOAD_URL
if [ -d /www/server/nezha ];then
echo "$INSTALL_VERSION" > /www/server/nezha/version.pl
fi
# 删除下载
rm -rf $DOWNLOAD_FILE
echo "ok"
@@ -7,52 +7,90 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
VERSION=0.15.2
nezhaDir=${serverPath}/source/nezha
VERSION=2.2.5
# bash install.sh install 0.15.2
# cd /www/server/mdserver-web/plugins/nezha && bash install.sh install 0.15.2
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/nezha && bash install.sh install 0.15.2
# cd /www/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.5
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.5
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
OSNAME_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
ARCH="amd64"
geo_check() {
api_list="https://blog.cloudflare.com/cdn-cgi/trace https://developers.cloudflare.com/cdn-cgi/trace"
ua="Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0"
set -- "$api_list"
for url in $api_list; do
text="$(curl -A "$ua" -m 10 -s "$url")"
endpoint="$(echo "$text" | sed -n 's/.*h=\([^ ]*\).*/\1/p')"
if echo "$text" | grep -qw 'CN'; then
isCN=true
break
elif echo "$url" | grep -q "$endpoint"; then
break
fi
done
}
get_arch() {
TMP_ARCH=`arch`
if [ "$TMP_ARCH" == "x86_64" ];then
ARCH="amd64"
elif [ "$TMP_ARCH" == "aarch64" ];then
ARCH="arm64"
else
echo $ARCH
fi
uname=$(uname -m)
case "$uname" in
amd64|x86_64)
ARCH="amd64"
;;
i386|i686)
ARCH="386"
;;
aarch64|arm64)
ARCH="arm64"
;;
*arm*)
ARCH="arm"
;;
s390x)
ARCH="s390x"
;;
riscv64)
ARCH="riscv64"
;;
*)
err "未知架构:$ARCH"
exit 1
;;
esac
}
check_init() {
init=$(readlink /sbin/init)
case "$init" in
*systemd*)
INIT=systemd
;;
*openrc-init*|*busybox*)
INIT=openrc
;;
*)
err "Unknown init"
exit 1
;;
esac
}
load_vars() {
OS=$(uname | tr '[:upper:]' '[:lower:]')
TARGET_DIR="$serverPath/nezha/dashboard"
## China_IP
if [[ -z "${CN}" ]]; then
if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then
CN=true
fi
fi
# China_IP
# if [[ -z "${CN}" ]]; then
# if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then
# CN=true
# fi
# fi
if [[ -z "${CN}" ]]; then
GITHUB_RAW_URL="raw.githubusercontent.com/midoks/nezha/main"
GITHUB_URL="github.com"
else
GITHUB_RAW_URL="cdn.jsdelivr.net/gh/midoks/nezha@main"
GITHUB_URL="dn-dao-github-mirror.daocloud.io"
fi
echo $GITHUB_RAW_URL
echo $GITHUB_URL
GITHUB_RAW_URL="raw.githubusercontent.com/nezhahq/nezha/main"
GITHUB_URL="github.com"
}
# download file
@@ -82,44 +120,29 @@ download_file() {
Install_dashborad(){
echo '正在安装哪吒监控...'
mkdir -p $serverPath/source
mkdir -p $nezhaDir
filename="dashboard-${OS}-${ARCH}.zip"
if [ ! -f $TARGET_DIR/nezha ];then
DOWNLOAD_URL="https://${GITHUB_URL}/nezhahq/nezha/releases/download/v${VERSION}/${filename}"
DOWNLOAD_URL="https://${GITHUB_URL}/midoks/nezha/releases/download/v${VERSION}/nezha-${OS}-${ARCH}.zip"
DOWNLOAD_FILE="$nezhaDir/$filename"
DOWNLOAD_FILE="$(mktemp).zip"
download_file $DOWNLOAD_URL $DOWNLOAD_FILE
if [ ! -f $DOWNLOAD_FILE ];then
download_file $DOWNLOAD_URL $DOWNLOAD_FILE
fi
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
unzip $DOWNLOAD_FILE -d $TARGET_DIR
rm -rf $DOWNLOAD_FILE
fi
echo "TARGET_DIR:"$TARGET_DIR
}
Install_agent(){
echo -e "正在下载监控端"
mkdir -p $serverPath/source
version=v0.15.1
AGENT_TARGET_DIR="$serverPath/nezha/agent"
DOWNLOAD_URL="https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_${OS}_${ARCH}.zip"
DOWNLOAD_FILE="$(mktemp).zip"
if [ ! -f $AGENT_TARGET_DIR/nezha-agent ];then
download_file $DOWNLOAD_URL $DOWNLOAD_FILE
if [ ! -d $AGENT_TARGET_DIR ]; then
mkdir -p $AGENT_TARGET_DIR
if [ ! -f $TARGET_DIR/app ];then
cd $TARGET_DIR && mv dashboard-linux-${ARCH} app && chmod +x app
fi
unzip $DOWNLOAD_FILE -d $AGENT_TARGET_DIR
rm -rf $DOWNLOAD_FILE
fi
}
@@ -128,25 +151,24 @@ Install_App()
{
load_vars
get_arch
check_init
Install_dashborad
Install_agent
if [ -d $serverPath/nezha ];then
echo "$VERSION" > $serverPath/nezha/version.pl
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py init_cfg
fi
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_install
echo 'install successful'
}
Uninstall_App()
{
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall_agent
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop_agent
rm -rf $serverPath/nezha
echo "install fail"
echo "uninstall successful"
}
action=$1
+180
View File
@@ -0,0 +1,180 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
nezhaDir=${serverPath}/source/nezha
VERSION=2.2.6
# bash install.sh install 2.2.6
# cd /www/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.6
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.6
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
OSNAME_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
ARCH="amd64"
geo_check() {
api_list="https://blog.cloudflare.com/cdn-cgi/trace https://developers.cloudflare.com/cdn-cgi/trace"
ua="Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0"
set -- "$api_list"
for url in $api_list; do
text="$(curl -A "$ua" -m 10 -s "$url")"
endpoint="$(echo "$text" | sed -n 's/.*h=\([^ ]*\).*/\1/p')"
if echo "$text" | grep -qw 'CN'; then
isCN=true
break
elif echo "$url" | grep -q "$endpoint"; then
break
fi
done
}
get_arch() {
uname=$(uname -m)
case "$uname" in
amd64|x86_64)
ARCH="amd64"
;;
i386|i686)
ARCH="386"
;;
aarch64|arm64)
ARCH="arm64"
;;
*arm*)
ARCH="arm"
;;
s390x)
ARCH="s390x"
;;
riscv64)
ARCH="riscv64"
;;
*)
err "未知架构:$ARCH"
exit 1
;;
esac
}
check_init() {
init=$(readlink /sbin/init)
case "$init" in
*systemd*)
INIT=systemd
;;
*openrc-init*|*busybox*)
INIT=openrc
;;
*)
err "Unknown init"
exit 1
;;
esac
}
load_vars() {
OS=$(uname | tr '[:upper:]' '[:lower:]')
TARGET_DIR="$serverPath/nezha/dashboard"
# China_IP
# if [[ -z "${CN}" ]]; then
# if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then
# CN=true
# fi
# fi
GITHUB_RAW_URL="raw.githubusercontent.com/nezhahq/nezha/main"
GITHUB_URL="github.com"
}
# download file
download_file() {
url="${1}"
destination="${2}"
printf "Fetching ${url} \n\n"
if test -x "$(command -v curl)"; then
code=$(curl --connect-timeout 15 -w '%{http_code}' -L "${url}" -o "${destination}")
elif test -x "$(command -v wget)"; then
code=$(wget -t2 -T15 -O "${destination}" --server-response "${url}" 2>&1 | awk '/^ HTTP/{print $2}' | tail -1)
else
printf "\e[1;31mNeither curl nor wget was available to perform http requests.\e[0m\n"
exit 1
fi
if [ "${code}" != 200 ]; then
printf "\e[1;31mRequest failed with code %s\e[0m\n" $code
exit 1
else
printf "\n\e[1;33mDownload succeeded\e[0m\n"
fi
}
Install_dashborad(){
echo '正在安装哪吒监控...'
mkdir -p $nezhaDir
filename="dashboard-${OS}-${ARCH}.zip"
if [ ! -f $TARGET_DIR/nezha ];then
DOWNLOAD_URL="https://${GITHUB_URL}/nezhahq/nezha/releases/download/v${VERSION}/${filename}"
DOWNLOAD_FILE="$nezhaDir/$filename"
if [ ! -f $DOWNLOAD_FILE ];then
download_file $DOWNLOAD_URL $DOWNLOAD_FILE
fi
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
unzip $DOWNLOAD_FILE -d $TARGET_DIR
echo "TARGET_DIR:"$TARGET_DIR
if [ ! -f $TARGET_DIR/app ];then
cd $TARGET_DIR && mv dashboard-linux-${ARCH} app && chmod +x app
fi
rm -rf $DOWNLOAD_FILE
fi
}
Install_App()
{
load_vars
get_arch
check_init
Install_dashborad
if [ -d $serverPath/nezha ];then
echo "$VERSION" > $serverPath/nezha/version.pl
fi
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_install
echo 'install successful'
}
Uninstall_App()
{
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop
rm -rf $serverPath/nezha
echo "uninstall successful"
}
action=$1
if [ "${1}" == 'install' ];then
Install_App
else
Uninstall_App
fi
+180
View File
@@ -0,0 +1,180 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
nezhaDir=${serverPath}/source/nezha
VERSION=2.2.6
# bash install.sh install 2.2.6
# cd /www/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.6
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/nezha && bash install.sh install 2.2.6
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
OSNAME_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
ARCH="amd64"
geo_check() {
api_list="https://blog.cloudflare.com/cdn-cgi/trace https://developers.cloudflare.com/cdn-cgi/trace"
ua="Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0"
set -- "$api_list"
for url in $api_list; do
text="$(curl -A "$ua" -m 10 -s "$url")"
endpoint="$(echo "$text" | sed -n 's/.*h=\([^ ]*\).*/\1/p')"
if echo "$text" | grep -qw 'CN'; then
isCN=true
break
elif echo "$url" | grep -q "$endpoint"; then
break
fi
done
}
get_arch() {
uname=$(uname -m)
case "$uname" in
amd64|x86_64)
ARCH="amd64"
;;
i386|i686)
ARCH="386"
;;
aarch64|arm64)
ARCH="arm64"
;;
*arm*)
ARCH="arm"
;;
s390x)
ARCH="s390x"
;;
riscv64)
ARCH="riscv64"
;;
*)
err "未知架构:$ARCH"
exit 1
;;
esac
}
check_init() {
init=$(readlink /sbin/init)
case "$init" in
*systemd*)
INIT=systemd
;;
*openrc-init*|*busybox*)
INIT=openrc
;;
*)
err "Unknown init"
exit 1
;;
esac
}
load_vars() {
OS=$(uname | tr '[:upper:]' '[:lower:]')
TARGET_DIR="$serverPath/nezha/dashboard"
# China_IP
# if [[ -z "${CN}" ]]; then
# if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then
# CN=true
# fi
# fi
GITHUB_RAW_URL="raw.githubusercontent.com/nezhahq/nezha/main"
GITHUB_URL="github.com"
}
# download file
download_file() {
url="${1}"
destination="${2}"
printf "Fetching ${url} \n\n"
if test -x "$(command -v curl)"; then
code=$(curl --connect-timeout 15 -w '%{http_code}' -L "${url}" -o "${destination}")
elif test -x "$(command -v wget)"; then
code=$(wget -t2 -T15 -O "${destination}" --server-response "${url}" 2>&1 | awk '/^ HTTP/{print $2}' | tail -1)
else
printf "\e[1;31mNeither curl nor wget was available to perform http requests.\e[0m\n"
exit 1
fi
if [ "${code}" != 200 ]; then
printf "\e[1;31mRequest failed with code %s\e[0m\n" $code
exit 1
else
printf "\n\e[1;33mDownload succeeded\e[0m\n"
fi
}
Install_dashborad(){
echo '正在安装哪吒监控...'
mkdir -p $nezhaDir
filename="dashboard-${OS}-${ARCH}.zip"
if [ ! -f $TARGET_DIR/nezha ];then
DOWNLOAD_URL="https://${GITHUB_URL}/nezhahq/nezha/releases/download/v${VERSION}/${filename}"
DOWNLOAD_FILE="$nezhaDir/$filename"
if [ ! -f $DOWNLOAD_FILE ];then
download_file $DOWNLOAD_URL $DOWNLOAD_FILE
fi
if [ ! -d $TARGET_DIR ]; then
mkdir -p $TARGET_DIR
fi
unzip $DOWNLOAD_FILE -d $TARGET_DIR
echo "TARGET_DIR:"$TARGET_DIR
if [ ! -f $TARGET_DIR/app ];then
cd $TARGET_DIR && mv dashboard-linux-${ARCH} app && chmod +x app
fi
rm -rf $DOWNLOAD_FILE
fi
}
Install_App()
{
load_vars
get_arch
check_init
Install_dashborad
if [ -d $serverPath/nezha ];then
echo "$VERSION" > $serverPath/nezha/version.pl
fi
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_install
echo 'install successful'
}
Uninstall_App()
{
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py initd_uninstall
cd ${rootPath} && python3 ${rootPath}/plugins/nezha/index.py stop
rm -rf $serverPath/nezha
echo "uninstall successful"
}
action=$1
if [ "${1}" == 'install' ];then
Install_App
else
Uninstall_App
fi
+1
View File
@@ -3,6 +3,7 @@
<div class='plugin_version'></div>
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('ollama',$('.plugin_version').attr('version'));">服务</p>
<p onclick="ollama.ai_model_list();">模型列表</p>
<p onclick="pluginInitD('ollama',$('.plugin_version').attr('version'));">自启动</p>
<p onclick="ollama.readme();">说明</p>
</div>
+29
View File
@@ -208,6 +208,35 @@ class App:
mw.execShell('systemctl disable '+self.getPluginName())
return 'ok'
def get_ai_model_list(self):
cmd = 'ollama list'
data = mw.execShell(cmd)
result = []
if data and data[0]:
lines = data[0].strip().split('\n')
for i, line in enumerate(lines):
if i < 1:
continue
line = line.strip()
if not line:
continue
parts = line.split()
if len(parts) >= 4:
name = parts[0]
model_id = parts[1]
size = parts[2] + ' ' + parts[3]
modified = ' '.join(parts[4:])
result.append({
'name': name,
'id': model_id,
'size': size,
'modified': modified
})
import json
return json.dumps(result)
if __name__ == "__main__":
+2
View File
@@ -7,6 +7,8 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
# cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && python3 /www/server/mdserver-web/plugins/ollama/index.py get_ai_model_list 1.0
action=$1
type=$2
+30 -8
View File
@@ -31,14 +31,6 @@ var ollama = {
}
var ret_data = $.parseJSON(res.data);
console.log("send:",ret_data);
// if (!ret_data.status){
// layer.msg(ret_data.msg,{icon:2,time:2000});
// return;
// }
// console.log("send2:",ret_data);
if(typeof(callback) == 'function'){
callback(ret_data);
}
@@ -83,6 +75,36 @@ var ollama = {
},'json');
},
ai_model_list:function(){
this.send({
"tips":"加载中...",
"method": 'get_ai_model_list',
"success": function(data){
var html = '<div class="divtable mtb15">';
html += '<table class="table table-hover">';
html += '<thead><tr><th>NAME</th><th>ID</th><th>SIZE</th><th>MODIFIED</th></tr></thead>';
html += '<tbody>';
if (data && data.length > 0) {
for (var i = 0; i < data.length; i++) {
var item = data[i];
html += '<tr>';
html += '<td>' + (item.name || '') + '</td>';
html += '<td>' + (item.id || '') + '</td>';
html += '<td>' + (item.size || '') + '</td>';
html += '<td>' + (item.modified || '') + '</td>';
html += '</tr>';
}
} else {
html += '<tr><td colspan="4" class="text-center c7">暂无模型</td></tr>';
}
html += '</tbody></table></div>';
$('.soft-man-con').html(html);
},
})
},
readme:function (){
var readme = '<ul class="help-info-text c7">';
readme += '<li>常用命令说明:</li>';
+29 -1
View File
@@ -27,6 +27,34 @@ function owPostN(method, args, callback){
},'json');
}
function owPostCallback(method, version, args,callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
var req_data = {};
req_data['name'] = 'op_waf';
req_data['script']='op_waf_index';
req_data['func'] = method;
args['version'] = version;
if (typeof(args) == 'string'){
req_data['args'] = JSON.stringify(str2Obj(args));
} else {
req_data['args'] = JSON.stringify(args);
}
$.post('/plugins/callback', req_data, function(data) {
layer.close(loadT);
if (!data.status){
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
if(typeof(callback) == 'function'){
callback(data);
}
},'json');
}
function getRuleByName(rule_name, callback){
owPost('get_rule', {rule_name:rule_name}, function(data){
@@ -1593,7 +1621,7 @@ function siteWafConfig(siteName, type) {
function wafSite(){
owPost('get_site_config', {}, function(data){
owPostCallback('get_site_config', "", {}, function(data){
var tmp = $.parseJSON(data.data);
var rdata = $.parseJSON(tmp.data);
var tbody = '';
+1458
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -37,8 +37,8 @@ http
client_max_body_size 20m;
# video big file opt
aio threads;
directio 4m;
#aio threads;
#directio 4m;
output_buffers 16 512k;
sendfile on;
tcp_nopush on;
@@ -55,18 +55,18 @@ http
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
zstd off;
zstd_comp_level 6;
zstd_min_length 256;
zstd_types text/plain text/css text/xml text/javascript text/cache-manifest text/x-component text/vtt application/javascript application/json application/ld+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/manifest+json application/x-web-app-manifest+json application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/wasm font/opentype image/svg+xml image/bmp;
#zstd off;
#zstd_comp_level 6;
#zstd_min_length 256;
#zstd_types text/plain text/css text/xml text/javascript text/cache-manifest text/x-component text/vtt application/javascript application/json application/ld+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/manifest+json application/x-web-app-manifest+json application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/wasm font/opentype image/svg+xml image/bmp;
brotli off;
brotli_min_length 256;
brotli_buffers 32 8k;
brotli_comp_level 4;
brotli_window 16m;
brotli_static on;
brotli_types text/plain text/css text/xml text/javascript text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype font/tpl font/opentype font/otf font/ttf image/svg+xml image/x-icon image/vnd.microsoft.icon application/wasm application/manifest+json;
#brotli off;
#brotli_min_length 256;
#brotli_buffers 32 8k;
#brotli_comp_level 4;
#brotli_window 16m;
#brotli_static on;
#brotli_types text/plain text/css text/xml text/javascript text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype font/tpl font/opentype font/otf font/ttf image/svg+xml image/x-icon image/vnd.microsoft.icon application/wasm application/manifest+json;
gzip on;
gzip_min_length 1k;

Some files were not shown because too many files have changed in this diff Show More