Compare commits

...

2383 Commits

Author SHA1 Message Date
Mr Chen
894c98702e Update CNAME 2025-08-06 23:47:40 +08:00
Mr Chen
b39d95d29e Update CNAME 2025-08-06 23:44:10 +08:00
Mr Chen
1c66f691a0 Update index.html 2023-12-01 11:37:14 +08:00
Mr Chen
aaaea5cb44 Update CNAME 2023-12-01 11:35:26 +08:00
349a7b9496 Create ads.txt 2023-07-05 15:38:16 +08:00
2c6d70f1d9 Update index.html 2023-07-05 15:36:26 +08:00
12b8afb7e9 up 2023-03-17 15:45:23 +08:00
01664afc0c Update index.html 2023-03-17 15:41:41 +08:00
5c059ffca5 up 2023-03-17 15:38:32 +08:00
Mr Chen
d122f7812a Create CNAME 2023-03-17 15:25:41 +08:00
fc5174ba64 up 2023-03-17 15:23:57 +08:00
9ad00f3ce7 Update push_tmp_msg.py 2023-03-16 22:36:25 +08:00
609a4ed351 Update tgbot.py 2023-03-16 21:34:44 +08:00
5ca74fd312 Update push_tmp_msg.py 2023-03-16 19:22:36 +08:00
3b1bb06c68 Update push_tmp_msg.py 2023-03-16 18:57:09 +08:00
b6b7de42d6 Update push_tmp_msg.py 2023-03-16 18:53:29 +08:00
3aa3b532ac Update push_tmp_msg.py 2023-03-16 18:48:19 +08:00
290c740ab1 Update push_tmp_msg.py 2023-03-16 18:43:02 +08:00
23fd4ca1de Create push_tmp_msg.py 2023-03-16 18:42:42 +08:00
c128a799b2 Update receive_faq.py 2023-03-16 15:50:52 +08:00
401c103b76 Update receive_faq.py 2023-03-16 15:47:14 +08:00
6fb88eb428 Update push_ad.py 2023-03-16 15:33:18 +08:00
956f20d295 tgbot init命令分离 2023-03-16 15:30:43 +08:00
03f8578a37 Update README.md 2023-03-16 13:04:29 +08:00
f3d83ad8a5 Update README.md 2023-03-16 12:58:06 +08:00
39b376a7cb Update webstats_common.lua 2023-03-16 12:24:02 +08:00
07858794ef Update webstats_common.lua 2023-03-16 12:02:33 +08:00
391473fc14 Update lib.sh 2023-03-15 23:26:23 +08:00
0993adcc5f Update lib.sh 2023-03-15 23:24:47 +08:00
90b1d88111 Update lib.sh 2023-03-15 23:17:49 +08:00
87098cff95 up 2023-03-15 23:00:37 +08:00
e6e64b2a4c Update mysql.js 2023-03-15 22:59:23 +08:00
81436ea81b Update index.html 2023-03-15 22:57:22 +08:00
cf7d29190d Update index.html 2023-03-15 22:53:36 +08:00
4ff62ec6ad Update tgbot.py 2023-03-15 22:09:53 +08:00
dac3ccce8d Update tgbot.py 2023-03-15 21:53:41 +08:00
10bd7aa70f Update tool_migrate.py 2023-03-15 18:28:31 +08:00
dec0afc3d3 Update tool_migrate.py 2023-03-15 18:25:43 +08:00
2331853b3b Update info.json 2023-03-15 18:13:34 +08:00
b9e063e423 Update README.md 2023-03-15 18:11:35 +08:00
52294948b2 Update config_api.py 2023-03-15 18:09:20 +08:00
87bec2b988 Update tgbot.py 2023-03-15 18:06:14 +08:00
9ab91ecc93 Update index.py 2023-03-15 17:48:05 +08:00
18312a3596 Update tgbot.py 2023-03-15 17:37:35 +08:00
8fb35440c8 Update info.json 2023-03-15 17:35:28 +08:00
a874934379 Update receive_faq.py 2023-03-15 17:34:05 +08:00
2c4e4aea3f Update info.json 2023-03-15 17:22:36 +08:00
6b115261be up 2023-03-15 17:19:15 +08:00
059ce6228b Update receive_faq.py 2023-03-15 15:09:03 +08:00
cfa396b4bb 更新 2023-03-14 20:03:53 +08:00
11e4b377ed up 2023-03-14 15:21:33 +08:00
31fe2aab92 Update receive_faq.py 2023-03-14 13:36:00 +08:00
19042a9088 Update receive_faq.py 2023-03-14 11:48:54 +08:00
2eb4543c3b Update receive_faq.py 2023-03-14 01:54:58 +08:00
e33ccbfc7d Update tgbot.py 2023-03-14 01:54:08 +08:00
ed8c9eed0a Update receive_faq.py 2023-03-14 01:50:56 +08:00
7163a7bbcf Update receive_faq.py 2023-03-14 01:46:19 +08:00
3f1c23ec8b Update receive_faq.py 2023-03-14 01:32:52 +08:00
3a6cb0ae2a Update receive_faq.py 2023-03-14 01:15:14 +08:00
936492d410 up 2023-03-14 01:10:04 +08:00
39d265aae7 Update tgbot.py 2023-03-14 00:15:27 +08:00
5a33098dd3 Update tgbot.py 2023-03-14 00:09:52 +08:00
c9927c3fb9 tgbot加入扩展机制 2023-03-14 00:09:30 +08:00
da90386816 Update tool_migrate.py 2023-03-13 11:29:00 +08:00
6be4c5977b up 2023-03-13 02:33:29 +08:00
bbf93bfd9e up 2023-03-13 02:33:22 +08:00
a2570af5f7 Update webstats_common.lua 2023-03-13 01:33:07 +08:00
77120cf31b up 2023-03-12 12:13:43 +08:00
395f449b93 Update webstats_common.lua 2023-03-12 12:09:53 +08:00
8be5f4aa7b Update info.json 2023-03-11 22:54:23 +08:00
3ccebf4f47 Update index.py 2023-03-11 22:48:42 +08:00
15d48accad Update tgbot.py 2023-03-11 22:43:15 +08:00
d0045d831c Update tgbot.py 2023-03-11 22:42:39 +08:00
a7cac3d671 up 2023-03-11 20:47:31 +08:00
7bc7fdecae Update webstats_common.lua 2023-03-11 16:40:45 +08:00
480663e2ad Update tools.py 2023-03-11 15:41:15 +08:00
2290efd060 Update config_api.py 2023-03-11 15:36:11 +08:00
dece5a0532 Update config_api.py 2023-03-11 15:30:16 +08:00
b0a44d24d4 Update config_api.py 2023-03-11 15:28:13 +08:00
d092d9f5f2 up 2023-03-11 15:24:40 +08:00
944b3e779c Update config_api.py 2023-03-11 15:21:43 +08:00
55dc2715e9 Update config_api.py 2023-03-11 15:20:13 +08:00
84bf3abd5d Update config_api.py 2023-03-11 15:15:49 +08:00
00c9157f9b up 2023-03-11 15:15:27 +08:00
faa95b0d88 Update config_api.py 2023-03-11 15:07:06 +08:00
52d0b3c940 Update config_api.py 2023-03-11 15:04:20 +08:00
0141028d41 Update config_api.py 2023-03-11 15:02:15 +08:00
9e6bf08a72 Update config_api.py 2023-03-11 15:01:46 +08:00
49ff9750cb Update config_api.py 2023-03-11 14:58:18 +08:00
75b2b4dbc2 Update config_api.py 2023-03-11 14:56:43 +08:00
667c60dda0 Update config.js 2023-03-11 14:55:48 +08:00
aa6818f953 Update config_api.py 2023-03-11 14:52:58 +08:00
6f884fe60a panel ssl https 功能添加 2023-03-11 14:48:38 +08:00
a56d53c672 Update config_api.py 2023-03-11 14:29:28 +08:00
00b1788172 up 2023-03-11 14:26:22 +08:00
cee268fcbc Update config_api.py 2023-03-11 13:56:20 +08:00
40dd929823 Update config_api.py 2023-03-11 13:47:16 +08:00
b59949e181 Update config_api.py 2023-03-11 13:41:36 +08:00
9c5975253a Update cert_api.py 2023-03-11 13:23:30 +08:00
62003b987a Update discuzx.conf 2023-03-10 14:12:27 +08:00
df0a454c3a up 2023-03-10 14:09:40 +08:00
02048c3265 Update webstats_common.lua 2023-03-10 13:19:58 +08:00
65649d171d Update tgbot.py 2023-03-09 19:11:51 +08:00
a136da6ec2 Update tgbot.py 2023-03-09 17:23:28 +08:00
3b25ca7e60 Update tgbot.py 2023-03-09 16:28:11 +08:00
c5cf8f8afb Update info.json 2023-03-09 15:40:54 +08:00
89f7d464ab Update info.json 2023-03-09 15:28:00 +08:00
4cac6d1921 Update info.json 2023-03-09 15:25:37 +08:00
dca5c82d2f Update webstats_common.lua 2023-03-09 14:56:43 +08:00
08988130b5 Update config_api.py 2023-03-09 03:00:30 +08:00
ae0a6b5079 升级图表echarts 2023-03-09 02:44:57 +08:00
a6dc15f22d 0.13.2
* supervisor添加重启功能。
* 加入滚动写入日志 mw.writeFileLog方法。
* mysql导出优化优化。
* 添加tgbot插件[仅测试]。
* TelegramBot机器人通知-加入配置。
* mariadb更新版本。
* 在线文件编辑优化。
2023-03-09 01:47:35 +08:00
360b962bd2 Update mw.py 2023-03-09 01:42:55 +08:00
37d37e0f1d Update task.py 2023-03-09 01:32:05 +08:00
ddc6da9172 Update mw.py 2023-03-09 01:30:19 +08:00
ceba7ab673 up 2023-03-09 01:26:39 +08:00
384704b8e5 Update mw.py 2023-03-09 01:10:04 +08:00
232d0c2f74 Update mw.py 2023-03-09 01:01:00 +08:00
ef8e6f07f5 Update mw.py 2023-03-09 00:43:34 +08:00
435e565559 Update mw.py 2023-03-09 00:42:15 +08:00
ec9d7e337d Update mw.py 2023-03-09 00:36:46 +08:00
b5c7a2a778 Update task.py 2023-03-09 00:32:23 +08:00
72d9c9b761 Update task.py 2023-03-09 00:28:59 +08:00
30812e1fba Update task.py 2023-03-09 00:08:49 +08:00
c95cb07e8d Update task.py 2023-03-09 00:05:45 +08:00
f3f2ea8ef0 通知限制频率 2023-03-08 19:40:23 +08:00
9e5a5192cb Update mw.py 2023-03-08 18:02:30 +08:00
271b3d448c Update mw.py 2023-03-08 18:01:06 +08:00
b7424e7195 Update config_api.py 2023-03-08 17:57:23 +08:00
b607527e1f Update config_api.py 2023-03-08 17:56:18 +08:00
3c42a4e450 对通知配置进行加密处理 2023-03-08 17:56:07 +08:00
b11fd9508a Update .gitignore 2023-03-08 17:29:42 +08:00
dc0504cf24 Delete notify.json 2023-03-08 17:25:12 +08:00
1d8b82395f Update public.js 2023-03-08 16:25:30 +08:00
39ac55760e Update config_api.py 2023-03-08 16:20:02 +08:00
ef6071956d 在线文件编辑优化 2023-03-08 16:14:28 +08:00
bbbe1c84ce Update mw.py 2023-03-07 19:24:03 +08:00
064252daad Update config.html 2023-03-07 19:20:07 +08:00
3cb63c6265 Update index.html 2023-03-07 16:28:48 +08:00
b541abad42 Update index.py 2023-03-07 13:44:28 +08:00
547027be0d Update install.sh 2023-03-06 23:40:56 +08:00
d786b2524a up 2023-03-06 23:21:55 +08:00
abac345628 Update info.json 2023-03-06 23:10:12 +08:00
d4290cbdd2 mariadb更新版本 2023-03-06 22:29:20 +08:00
cfd2d99e24 Update mw.py 2023-03-06 21:31:24 +08:00
28437ccfb0 Update mw.py 2023-03-06 21:30:18 +08:00
43bf755609 Update mw.py 2023-03-06 20:35:06 +08:00
de225fc8b9 0.13.1.2 2023-03-06 20:28:29 +08:00
44f891f7a3 Update mw.py 2023-03-06 20:12:52 +08:00
64d1387b03 Telegram Bot机器人通知 加入配置 2023-03-06 19:32:36 +08:00
51ccbefb04 up 2023-03-06 17:15:41 +08:00
29e3017e51 up 2023-03-06 16:49:42 +08:00
197e2d80c6 Update tgbot.py 2023-03-06 16:42:29 +08:00
b8f04043bc Update tgbot.service.tpl 2023-03-06 16:41:25 +08:00
2ed70b4b96 Update tgbot.py 2023-03-06 16:39:27 +08:00
d056c37be5 Update index.py 2023-03-06 16:33:18 +08:00
e75abae4b9 Update tgbot.service.tpl 2023-03-06 16:32:05 +08:00
3e695770d7 Update config_api.py 2023-03-06 16:26:49 +08:00
7301edbc5a 添加tgbot插件
现在只是为了获取chat_id
2023-03-06 16:19:13 +08:00
e129051a06 Update webstats_common.lua 2023-03-05 18:34:35 +08:00
c696742866 Update init.lua 2023-03-05 18:03:41 +08:00
046389df99 Update init.lua 2023-03-05 17:37:01 +08:00
3e244ed227 导出优化 2023-03-05 14:04:16 +08:00
5016aedb0f Update index.py 2023-03-05 02:08:04 +08:00
c1cd45a5f3 Update my8.0.cnf 2023-03-05 00:00:59 +08:00
79c9865a5d Update index.py 2023-03-04 23:53:54 +08:00
4082f29424 加入滚动写入日志 2023-03-04 23:07:23 +08:00
d777a29d8c Update update.sh 2023-03-04 21:47:12 +08:00
dffe9a77e7 Update layout.html 2023-03-02 00:57:02 +08:00
1b1462586e Update orm.py 2023-03-02 00:49:44 +08:00
f11d2db761 添加重启功能 2023-03-01 18:41:32 +08:00
842c16540a Update index.py 2023-03-01 18:03:14 +08:00
614cc1032f Update webstats_log.lua 2023-03-01 14:03:46 +08:00
ad46b2050e Update config.json 2023-03-01 01:40:57 +08:00
8109989927 Update layout.html 2023-02-28 19:41:13 +08:00
422514c40a 0.13.1
* 关闭issue,建立bbs.midoks.me。问题集中处理,发挥群众的力量。
* 添加站操作回调钩子site_cb。 网站统计和OP防火墙不再手动重载配置
* 修复ubuntu20 pureftp 安装时,端口没有加入安全里
* 增加global_static hook关键字,并优化menu的文件加载hook
* 各种细节优化。
2023-02-28 19:09:54 +08:00
632568643b Update site_api.py 2023-02-28 17:08:26 +08:00
a5f29a2a6a Update cert_api.py 2023-02-28 16:26:31 +08:00
b02705aa5a up 2023-02-28 03:00:46 +08:00
1f9ab560e3 Update files.js 2023-02-28 02:18:39 +08:00
b3970326cd Update index.py 2023-02-28 01:57:19 +08:00
f6d008e0b6 Update index.py 2023-02-28 01:50:54 +08:00
6f9a49ad7a up 2023-02-28 01:48:51 +08:00
fc3c7d334a Update public.js 2023-02-28 00:17:39 +08:00
1030d1b923 site_cb 添加站操作回调钩子。 网站统计和OP防火墙不再手动重载配置 2023-02-28 00:02:16 +08:00
94d4a90bcc Update webstats_common.lua 2023-02-27 19:35:52 +08:00
da4b872666 Update README.md 2023-02-27 17:57:17 +08:00
cf15b19f4b Update install.sh 2023-02-26 21:46:25 +08:00
aa9cdaada4 Update commit.tpl 2023-02-26 03:16:45 +08:00
659c9fe16b 修复ubuntu 20 pureftp 安装时,端口没有加入安全里 2023-02-26 02:20:06 +08:00
2b8c6d6e43 Update firewall_api.py 2023-02-26 01:39:52 +08:00
263f83088f Update firewall_api.py 2023-02-26 01:38:55 +08:00
374c938ac0 Update firewall_api.py 2023-02-26 01:38:32 +08:00
6aa73b0cae Update firewall_api.py 2023-02-26 01:36:45 +08:00
7f731ae06f Update README.md 2023-02-26 01:12:08 +08:00
f87aff704c Update rhel.sh 2023-02-25 23:36:14 +08:00
be9fa87133 Update rhel.sh 2023-02-25 23:31:36 +08:00
de6fc19dee Create discuz.conf 2023-02-25 21:33:50 +08:00
3987c6d3dc Update config_api.py 2023-02-25 08:37:26 +08:00
96875052cd Update index.py 2023-02-25 08:25:05 +08:00
583de57f96 Update plugins_api.py 2023-02-25 08:21:20 +08:00
41b7245f03 Update plugins_api.py 2023-02-25 08:15:38 +08:00
ee3684706f Update info.json 2023-02-25 07:48:32 +08:00
07936dfb81 update 2023-02-25 07:35:46 +08:00
5c46202be0 增加global_static hook关键字,并优化menu的文件加载hook
"hook":[
		{
			"tag":"global_static",
			"global_static": {
				"css_path":"menu/own_style.css",
				"js_path":"js/own_style.js"
			}
		}
	],
2023-02-25 07:26:48 +08:00
7123a15457 Update install.sh 2023-02-24 18:08:46 +08:00
4aeb45b1d5 Update install.sh 2023-02-24 17:55:13 +08:00
006a62be22 Update lib.sh 2023-02-24 17:25:04 +08:00
1e91d11125 Update mw.tpl 2023-02-24 17:22:22 +08:00
99fb4aa723 up 2023-02-24 17:14:28 +08:00
5c5bbb2da2 up 2023-02-24 17:12:31 +08:00
8b05045901 Update install.sh 2023-02-24 17:07:24 +08:00
1b73439525 Update install_dev.sh 2023-02-24 17:00:10 +08:00
ec51ad016a Update install_dev.sh 2023-02-24 16:57:24 +08:00
a42fae66ac Update install_dev.sh 2023-02-24 16:53:48 +08:00
b4c635c2e5 Update install_dev.sh 2023-02-24 16:49:03 +08:00
9802bc5915 Update pure-ftpd.conf 2023-02-24 13:29:16 +08:00
fa278abd50 Update index.py 2023-02-24 05:53:33 +08:00
f9b2dbcb5e Update index.py 2023-02-24 05:46:39 +08:00
a8808be9ae Update index.py 2023-02-24 05:41:50 +08:00
4122de13e3 Update index.py 2023-02-24 05:39:52 +08:00
4acae8e5f5 up 2023-02-24 05:38:59 +08:00
1abb611c3e 版本更新 0.13.0 2023-02-24 05:17:44 +08:00
726f9fa0d2 #374 2023-02-24 04:15:23 +08:00
cfb64caadc Update site_api.py 2023-02-24 04:09:50 +08:00
f501dd5150 Update site_api.py 2023-02-24 04:07:19 +08:00
d1fe006e39 Update site_api.py 2023-02-24 03:28:48 +08:00
d4db5dbfac up 2023-02-24 03:28:18 +08:00
efa512a3f6 #374 2023-02-24 03:16:52 +08:00
b53436343d up 2023-02-24 02:40:09 +08:00
bb1a634f3c Update site_api.py 2023-02-24 02:29:14 +08:00
acda55cc55 Update index.py 2023-02-24 01:40:02 +08:00
0ff0728517 Update index.py 2023-02-24 01:30:17 +08:00
c575f55354 Update app.js 2023-02-24 01:05:32 +08:00
d58339dbcb Update index.py 2023-02-24 00:07:19 +08:00
f6a18fa25f Update index.py 2023-02-24 00:03:48 +08:00
3016eff372 Update app.js 2023-02-23 17:29:38 +08:00
ca518591f3 up 2023-02-23 17:27:15 +08:00
d2c74f2243 up 2023-02-23 17:17:46 +08:00
71dbf8e359 Update app.js 2023-02-23 15:39:16 +08:00
cb2ad0ca82 up 2023-02-23 15:18:44 +08:00
a157db7879 Update index.py 2023-02-23 03:32:30 +08:00
fb949f4ee6 up 2023-02-23 01:25:00 +08:00
b91ae3fde2 Update index.py 2023-02-22 23:46:28 +08:00
b508e8003b Update index.py 2023-02-22 23:13:44 +08:00
0632a4b535 Update index.py 2023-02-22 23:13:17 +08:00
397e0b89a5 Update index.py 2023-02-22 22:59:45 +08:00
2427bf81cd Update index.py 2023-02-22 22:44:16 +08:00
4179bbf580 Update index.py 2023-02-22 22:40:29 +08:00
b93c3bb88e Update index.py 2023-02-22 22:37:19 +08:00
a52c854afd Update index.py 2023-02-22 22:36:10 +08:00
d7e5cf1f45 Update index.py 2023-02-22 21:55:49 +08:00
cfb444deac Update files_api.py 2023-02-22 20:54:54 +08:00
78615451ac up 2023-02-22 20:52:12 +08:00
0134643c83 Update db.py 2023-02-22 18:18:40 +08:00
70ddd1c86f Update index.py 2023-02-22 17:55:17 +08:00
808dc743ef Update files_api.py 2023-02-22 14:59:40 +08:00
e30693f9f2 Update files_api.py 2023-02-22 14:28:01 +08:00
5c97fbe011 Update __init__.py 2023-02-22 14:27:48 +08:00
6419a18525 up 2023-02-21 21:10:34 +08:00
4a804e9243 Update index.py 2023-02-19 18:12:08 +08:00
d44526004f up 2023-02-19 18:02:26 +08:00
c1f402b278 up 2023-02-19 00:10:06 +08:00
45a3eec1b5 Update install_dev.sh 2023-02-18 23:09:51 +08:00
d6f41ceb6a Update install_dev.sh 2023-02-18 23:06:53 +08:00
a1bc0f6faf Update install_dev.sh 2023-02-18 22:58:21 +08:00
8420961cf7 Update install_dev.sh 2023-02-18 22:54:58 +08:00
421594c01d Update install_dev.sh 2023-02-18 22:48:30 +08:00
ca13e8ad77 Update install_dev.sh 2023-02-18 22:46:05 +08:00
f161f24253 up 2023-02-18 22:44:42 +08:00
e5ab03951f Update README.md 2023-02-18 22:08:13 +08:00
5b45bab36d Update install_dev.sh 2023-02-18 22:06:51 +08:00
0594d3f9ce Update README.md 2023-02-18 22:04:11 +08:00
ad541216c5 up 2023-02-18 16:59:33 +08:00
1adc0c1405 Update rhel.sh 2023-02-18 15:35:16 +08:00
b22185b374 Update rhel.sh 2023-02-18 14:09:02 +08:00
02f3107e93 Update app.js 2023-02-18 02:04:52 +08:00
52fece867d up 2023-02-18 01:49:20 +08:00
2e3578dcf1 up 2023-02-18 01:39:26 +08:00
73b09a7886 up 2023-02-17 22:39:49 +08:00
f33c7e5a5e up 2023-02-17 19:57:03 +08:00
3e90db2c8d Update system_api.py 2023-02-17 19:54:44 +08:00
d599363609 Update index.py 2023-02-17 16:30:32 +08:00
ec3167f239 Update __init__.py 2023-02-17 16:30:25 +08:00
2b1099b6e9 Update __init__.py 2023-02-17 15:42:28 +08:00
e55a0760e3 Update mw.tpl 2023-02-17 15:22:15 +08:00
5c1353a38f Update mw.tpl 2023-02-17 15:20:52 +08:00
f95684b316 Update mw.tpl 2023-02-17 15:20:39 +08:00
6fc729ccf9 Update __init__.py 2023-02-17 15:17:41 +08:00
45d0c4fc4a Update __init__.py 2023-02-17 15:16:11 +08:00
6759b9055c ip 2023-02-17 15:01:26 +08:00
de694b2465 up 2023-02-17 14:56:44 +08:00
c7b3daca36 up 2023-02-16 17:02:33 +08:00
452769233f up 2023-02-16 17:00:09 +08:00
8d196a3aa1 Update index.py 2023-02-16 16:26:22 +08:00
01baf509ad up 2023-02-16 15:49:55 +08:00
d59ee2c843 Update install.sh 2023-02-16 15:39:08 +08:00
8919d5734e Update index.py 2023-02-16 14:15:15 +08:00
bb91b30d6d Update index.py 2023-02-16 14:06:41 +08:00
103ab2e099 Update index.py 2023-02-15 22:45:44 +08:00
0d33d0db79 Update install.sh 2023-02-15 22:35:29 +08:00
6d9f4cfa08 Update tools.py 2023-02-15 22:31:22 +08:00
c88c95ba21 Update macos.sh 2023-02-15 22:26:53 +08:00
a705f6a8e4 Update install.sh 2023-02-15 22:24:51 +08:00
3f40ed0a01 up 2023-02-15 22:24:46 +08:00
39653896bf Update install_dev.sh 2023-02-15 22:15:08 +08:00
31d665d962 Update install.sh 2023-02-15 22:05:16 +08:00
811fa4a40d Update install_dev.sh 2023-02-15 22:04:58 +08:00
320f58424d Update README.md 2023-02-15 21:56:19 +08:00
376f0f0a4e up 2023-02-15 21:55:21 +08:00
0efb700cee Update README.md 2023-02-15 15:54:14 +08:00
ff3fcae366 Update config_api.py 2023-02-15 15:50:55 +08:00
042fd7ac6d Update ubuntu.sh 2023-02-14 22:23:04 +08:00
1a48f52dad up 2023-02-14 22:22:06 +08:00
e758698ee2 Update debian.sh 2023-02-14 22:02:28 +08:00
088346fd5e 安装脚本优化 2023-02-14 21:58:30 +08:00
cbcb686363 Update firewall_api.py 2023-02-14 21:07:22 +08:00
Mr Chen
96d0115257 Merge branch 'master' into dev 2023-02-14 20:12:50 +08:00
801fdf51a7 0.12.3
### 版本更新 0.12.3

* 优先使用firewalld防火墙。
* PHP[APT]加入curl扩展。
* 配置添加【未认证响应状态】功能。
* 存在ipv6时,启动时强制开启。
* OP防火墙-性能优化。
* 网站统计优化。
* 优化backup_ftp插件。
* 各种细节优化。
2023-02-14 20:11:16 +08:00
24fa3a7ca9 优化backup_ftp插件 2023-02-14 18:29:08 +08:00
3dc781498c Update index.py 2023-02-14 18:24:43 +08:00
c3afaeb35a Update index.py 2023-02-14 18:23:42 +08:00
4390180a89 Update config_api.py 2023-02-14 18:20:54 +08:00
98e22f6eeb Update index.py 2023-02-14 18:19:00 +08:00
3bfd0f34f5 Update index.py 2023-02-14 18:14:27 +08:00
ec8e46494a Update crontab.js 2023-02-14 18:10:14 +08:00
7cb9b0acec Update index.py 2023-02-14 17:56:16 +08:00
f97d2a5987 Update ngx_debug.sh 2023-02-13 20:46:19 +08:00
5a50fe70a8 Update ngx_debug.sh 2023-02-13 20:45:57 +08:00
4ecb28575e Update install.sh 2023-02-13 20:34:25 +08:00
07bf8f162c Update debian.sh 2023-02-13 19:27:08 +08:00
19beb1bccc Update requirements.txt 2023-02-13 19:21:24 +08:00
33c27d7924 up 2023-02-13 18:56:49 +08:00
a9fb6c9ec9 up 2023-02-13 18:15:10 +08:00
7198a4de95 up 2023-02-13 15:56:41 +08:00
53cb56ddf2 up 2023-02-13 15:39:57 +08:00
e4582f328c Update index.py 2023-02-13 14:35:14 +08:00
bb7f1b6a7d up 2023-02-13 14:16:06 +08:00
1781d879d1 up 2023-02-13 13:36:32 +08:00
d89158124f Update ngx_debug.sh 2023-02-13 03:29:54 +08:00
bfdad5f9a3 Update ngx_debug.sh 2023-02-13 03:23:40 +08:00
165d9ba14d Update webstats_common.lua 2023-02-13 03:05:26 +08:00
ad102aa940 Update ngx_debug.sh 2023-02-13 03:01:16 +08:00
1489d15d74 Update ngx_debug.sh 2023-02-13 02:31:08 +08:00
2dbda3e6dd 优化,Linux系统不再加入到计划任务获取cpu使用率 2023-02-13 01:58:36 +08:00
4775d4f756 Update waf_common.lua 2023-02-13 01:45:49 +08:00
f57fd600e6 Update test_get_cpu.lua 2023-02-13 01:38:24 +08:00
bf281107b2 up 2023-02-13 00:26:31 +08:00
083fe59fa5 up 2023-02-12 17:29:29 +08:00
8f36e0ccb2 Update centos.sh 2023-02-12 02:15:12 +08:00
a5b3a650eb up 2023-02-12 02:14:18 +08:00
177a08af91 Update waf_common.lua 2023-02-12 02:12:34 +08:00
5ef4b3d05d firewalld优先 2023-02-12 02:12:28 +08:00
ad3d93cf8b firewalld防火墙优先 2023-02-12 02:03:57 +08:00
72643b7776 Update rhel.sh 2023-02-12 02:02:27 +08:00
45128636b0 up 2023-02-12 01:17:23 +08:00
7b962335e4 up 2023-02-12 01:08:03 +08:00
c0c67095be up 2023-02-12 01:02:19 +08:00
b3a0f11a80 up 2023-02-12 00:44:35 +08:00
088337765c Update webstats_worker.lua 2023-02-12 00:35:52 +08:00
066e7087c9 Update webstats_common.lua 2023-02-12 00:35:39 +08:00
29144595a6 网站统计 2023-02-12 00:22:39 +08:00
45c2b3cdca Update index.py 2023-02-11 23:44:19 +08:00
e3ecdfb2b3 Update index.py 2023-02-11 23:43:51 +08:00
560d482f31 up 2023-02-11 23:25:29 +08:00
62ffc94b69 up 2023-02-11 22:34:18 +08:00
0cb10cc926 Update webstats_common.lua 2023-02-11 22:23:34 +08:00
fb4eb8747c Update webstats_common.lua 2023-02-11 22:16:08 +08:00
1a26b83a46 Update webstats_log.lua 2023-02-11 22:06:04 +08:00
7c2316f005 Update webstats_common.lua 2023-02-11 21:50:32 +08:00
149baeb1fc Update webstats_log.lua 2023-02-11 21:42:57 +08:00
9714bcb419 Update init.lua 2023-02-11 17:45:17 +08:00
4e6a54dbad Update index.py 2023-02-11 17:18:24 +08:00
18498813c6 up 2023-02-11 17:06:24 +08:00
854e34a90c Update mw.py 2023-02-11 16:48:57 +08:00
a0898c849e Update lua.conf 2023-02-11 16:47:46 +08:00
3a26b71828 ip 2023-02-11 16:45:28 +08:00
f500dcac8b Update init_worker.lua 2023-02-11 16:06:25 +08:00
3a6e2e6e4b Update cpu_usage_file.sh 2023-02-11 16:06:08 +08:00
1d439e788c Update soft.html 2023-02-11 15:25:44 +08:00
75a2fcdaaf Update debian.sh 2023-02-11 15:24:17 +08:00
2ca8598671 up 2023-02-11 06:04:55 +08:00
2d42486ac5 Update index.py 2023-02-11 05:30:38 +08:00
24f22b5b8c up 2023-02-11 05:28:54 +08:00
68f8638638 up 2023-02-11 05:28:27 +08:00
fe6b16eda4 Update index.py 2023-02-11 05:27:34 +08:00
4e35c34854 up 2023-02-11 05:24:53 +08:00
cc51d9501f Update init.lua 2023-02-11 05:04:37 +08:00
c08cfd4763 Update ip_white.json 2023-02-11 05:00:58 +08:00
5fdcb8bf71 up 2023-02-11 04:43:30 +08:00
ce3b232c4b Update mw.py 2023-02-11 04:03:41 +08:00
ec7ae65f7d up 2023-02-11 02:52:02 +08:00
e4c5212ac4 Update public.js 2023-02-11 02:51:42 +08:00
23442accaf Update mw.py 2023-02-11 02:51:25 +08:00
2e6f5f9add up 2023-02-11 02:51:17 +08:00
110e356fae up 2023-02-09 17:05:06 +08:00
a243d088ee Update tool_task.py 2023-02-05 16:22:17 +08:00
365fd466c2 更快获取cpu使用率 2023-02-05 16:21:30 +08:00
d1304de69e Update cli.sh 2023-02-05 15:22:53 +08:00
e51fa2608d Update cli.sh 2023-02-05 15:21:45 +08:00
cbfcd00317 Update mw.tpl 2023-02-05 15:20:08 +08:00
7a96d3abc5 Update mw.tpl 2023-02-05 15:19:50 +08:00
33a510a5b5 Update mw.tpl 2023-02-05 12:50:26 +08:00
e8942128b8 Update tool_task.py 2023-02-05 12:49:21 +08:00
7e2bd928e2 Update tool_task.py 2023-02-05 12:42:30 +08:00
89185476aa 优化获取cpu方式。 2023-02-05 12:37:49 +08:00
f491641ab8 Create cpu_usage.sh 2023-02-05 12:25:57 +08:00
8b108d1aff Update ubuntu.sh 2023-02-05 12:16:55 +08:00
2cfa7ec2ab Update ubuntu.sh 2023-02-05 12:07:29 +08:00
d63aae100d Update ubuntu.sh 2023-02-05 11:57:44 +08:00
e8249adc53 Update tool_task.py 2023-02-05 03:48:22 +08:00
281427e479 Update tool_task.py 2023-02-05 03:48:03 +08:00
af775fc77d OP防火墙-获取cpu优化 2023-02-05 03:40:18 +08:00
f328354125 #362 2023-02-05 00:25:59 +08:00
1f70f962cf Update crontab.js 2023-02-05 00:25:25 +08:00
414787447e Update README.md 2023-02-04 19:27:55 +08:00
979f2174e5 Update README.md 2023-02-03 21:28:29 +08:00
84d1c96094 Update config_api.py 2023-02-03 21:17:25 +08:00
0d8d9022a0 Update mw.py 2023-02-03 21:17:07 +08:00
44d0e9e11c 存在ipv6,启动时强制开启 2023-02-03 13:42:35 +08:00
771d6e04ba Update mw.tpl 2023-02-03 13:39:45 +08:00
87563daa1d Update index.html 2023-02-02 20:50:42 +08:00
9fefb285e1 Update .gitignore 2023-02-02 20:47:18 +08:00
b9ca4fc11e 配置添加【未认证响应状态】功能 2023-02-02 18:04:44 +08:00
2646d0565d Update debian.sh 2023-02-02 15:23:35 +08:00
e1f900f1c5 Update tools.py 2023-02-02 14:59:15 +08:00
908b3341b2 Update rhel.sh 2023-02-01 13:25:01 +08:00
5aef2467b1 Update debian.sh 2023-02-01 13:20:53 +08:00
f59114a688 自动获取ssh端口 2023-02-01 13:09:28 +08:00
363ed8b3ff Update index.py 2023-01-31 20:07:39 +08:00
3970feacc3 Update gitea.js 2023-01-31 19:48:30 +08:00
f6c528149e Update gitea.js 2023-01-31 19:41:00 +08:00
8f6b5ddba9 Update gitea.js 2023-01-31 19:36:50 +08:00
ef350b9fd2 Update gitea.js 2023-01-31 19:33:46 +08:00
004dfb5e7d apt php curl是必须的扩展 2023-01-30 14:01:57 +08:00
3c08d7c159 Update files_api.py 2023-01-30 01:17:09 +08:00
e227204065 编码识别优化。 2023-01-30 00:50:10 +08:00
ce653b7a6a Update README.md 2023-01-29 22:31:52 +08:00
Mr Chen
a207215775 Merge pull request #355 from midoks/midoks-patch-1
Update debian.sh
2023-01-29 20:52:22 +08:00
Mr Chen
8115b0fb4d Update debian.sh 2023-01-29 20:48:51 +08:00
048bd573e8 修复API接口使用 2023-01-29 14:32:38 +08:00
918ea8d0f9 Update mw.tpl 2023-01-28 11:22:57 +08:00
97d2fd5a63 Update debian.sh 2023-01-28 10:50:31 +08:00
617a517048 Update index.html 2023-01-28 01:57:54 +08:00
2e7910a84c 一键迁移初始化 2023-01-28 01:34:48 +08:00
2ee4c4e3fd 页面更新跟随更新一遍环境 2023-01-27 21:58:10 +08:00
9ae4d32ed4 卸载时,删除首页显示 2023-01-27 21:05:16 +08:00
90a7f4ea10 Update .gitignore 2023-01-27 20:09:09 +08:00
d22cb8305d Update soft.html 2023-01-27 20:08:34 +08:00
a7a78f2103 Update .gitignore 2023-01-27 16:20:50 +08:00
Mr Chen
db7ec00c07 Merge pull request #352 from midoks/dev
优化在命令行下修改端口命令
2023-01-27 16:09:29 +08:00
dd21d25295 Update tools.py 2023-01-27 16:04:54 +08:00
f7360aa081 Update tools.py 2023-01-27 16:02:21 +08:00
1d1ba7192a Update tools.py 2023-01-27 16:00:02 +08:00
0bf540c5e7 Update mw.py 2023-01-27 15:54:55 +08:00
Mr Chen
696797f125 Merge pull request #350 from midoks/dev
0.12.2
2023-01-27 14:41:55 +08:00
fcfad78506 Update .gitignore 2023-01-27 14:40:57 +08:00
4787d6e7bb 0.12.2
* 开放菜单权限配置。
* 升级SSH终端2.0。
* 增加已安装类型。
* 加入切换linux软件源的命令。
* iptables安装优化。
* 网站统计POST获取数据优化。
* mysql[apt/yum]迁移优化。
* 优化防火墙导入。
* 图标可设置。
* 各种细节优化。
2023-01-27 14:39:46 +08:00
80ef6dbe4c 描述修改 2023-01-27 13:40:35 +08:00
78cdad5fb8 Update install.sh 2023-01-27 13:36:06 +08:00
274f0638ac Update install.sh 2023-01-27 13:35:45 +08:00
1e97b146db up 2023-01-27 13:33:11 +08:00
fbbc506de9 Update .gitignore 2023-01-27 02:16:32 +08:00
58ec4c2c30 简单加密 2023-01-27 01:19:26 +08:00
a2298ade04 Update webssh.js 2023-01-27 00:53:34 +08:00
d5fc464603 ssh update 90% 2023-01-27 00:40:06 +08:00
c952be4e45 up 2023-01-26 22:49:55 +08:00
17a92518b4 Update term-websocketio.js 2023-01-26 19:35:51 +08:00
c7154eea7b Update files.js 2023-01-26 19:35:43 +08:00
7cab1492c0 Update ssh_terminal.py 2023-01-26 04:21:49 +08:00
77b6391d9e Update ssh_terminal.py 2023-01-26 04:21:25 +08:00
08a91ed0f2 ssh终端收尾阶段 2023-01-26 04:11:51 +08:00
b4d090021c up 2023-01-26 03:14:50 +08:00
bf064d89f4 up 2023-01-26 02:06:02 +08:00
7314071634 ssh优化 2023-01-26 02:05:39 +08:00
49a606baa2 Update mw.tpl 2023-01-25 19:55:54 +08:00
aaabe5628e Update debian.sh 2023-01-25 19:54:39 +08:00
ea03373363 Update ssh_terminal.py 2023-01-25 19:42:17 +08:00
515d25648f ssh优化 2023-01-25 17:17:14 +08:00
a30792178a up 2023-01-25 16:50:10 +08:00
1c74ce3c58 ssh 60% 2023-01-25 16:20:03 +08:00
832f3b45eb up 2023-01-25 03:20:55 +08:00
2c3ad7ea99 Update webstats_common.lua 2023-01-23 20:30:01 +08:00
6b3dae6169 Update webstats_common.lua 2023-01-23 20:21:00 +08:00
d387546986 Update requirements.txt 2023-01-23 04:21:52 +08:00
6929c5a173 Update requirements.txt 2023-01-23 04:21:02 +08:00
d66e9d7fc6 up 2023-01-23 04:09:25 +08:00
17470600e9 Update app.py 2023-01-23 04:06:43 +08:00
d1017ddb5c Create term.js 2023-01-23 03:45:55 +08:00
67161e62ce Update cli.sh 2023-01-23 03:44:44 +08:00
87ad51f6ad up 2023-01-22 18:34:46 +08:00
2239d178f4 Update site.css 2023-01-22 15:33:22 +08:00
4ff95f057c 增加已安装类型 2023-01-22 15:33:14 +08:00
f32ba65596 Update webssh.js 2023-01-22 13:28:42 +08:00
d3db79a4ed webssh 55% 2023-01-22 03:17:09 +08:00
ddc8cde44c Delete cmd.json 2023-01-22 01:32:42 +08:00
719ad042c7 webssh 50% 2023-01-22 01:31:47 +08:00
9134dfb1a9 Update index.css 2023-01-20 03:02:45 +08:00
9611834a9d up 2023-01-20 02:54:55 +08:00
8d5cc2e926 Update __init__.py 2023-01-20 02:34:45 +08:00
01b9c51247 Update __init__.py 2023-01-20 02:31:59 +08:00
21ca9d8874 优化ssh并兼容mac 2023-01-20 02:31:43 +08:00
d2d5a0e12f up 2023-01-20 02:11:07 +08:00
ad2e9958f8 Update mw.tpl 2023-01-19 22:24:15 +08:00
7cf64673f9 加入切换linux软件源的命令 2023-01-19 22:18:35 +08:00
c49bc6f823 Update README.md 2023-01-19 18:04:00 +08:00
24e6c57eec Update firewall.js 2023-01-18 17:58:23 +08:00
a6842f2679 Update firewall_api.py 2023-01-18 17:42:56 +08:00
42ba0ea285 优化iptables判断 2023-01-18 17:27:33 +08:00
19e6055b7c Update install.sh 2023-01-18 01:38:18 +08:00
1388c697e0 iptables安装优化 2023-01-18 01:38:06 +08:00
2a97c0f8b3 Update plugin_menu.html 2023-01-18 01:12:24 +08:00
8aa4084373 Update plugins_api.py 2023-01-18 01:03:23 +08:00
4e16773ed8 Update layout.html 2023-01-18 00:57:38 +08:00
b4b9b6eb1f Create plugin_menu.html 2023-01-18 00:57:30 +08:00
b35ae736a3 up 2023-01-18 00:57:25 +08:00
ec78197317 Update plugins_api.py 2023-01-17 15:58:27 +08:00
1558e93f33 Update .gitignore 2023-01-17 15:37:22 +08:00
99a15ffc82 Update mw.py 2023-01-17 03:46:04 +08:00
Mr Chen
2b0b697a6a Merge pull request #343 from midoks/dev
修复iptables和firewalld同时存在,导致识别出错2。
2023-01-17 00:17:30 +08:00
a93953a61d Update firewall_api.py 2023-01-17 00:04:56 +08:00
Mr Chen
1ce68581af Merge pull request #342 from midoks/dev
修复iptables和firewalld同时存在,导致识别出错。
2023-01-16 23:53:17 +08:00
df5979a4cf Update firewall_api.py 2023-01-16 23:48:26 +08:00
9197dcbe03 Update firewall_api.py 2023-01-16 23:48:05 +08:00
4100824c43 Update firewall_api.py 2023-01-16 23:39:16 +08:00
c22b2b3774 Update firewall_api.py 2023-01-16 23:34:46 +08:00
0fbd3163e2 up 2023-01-16 23:30:12 +08:00
500171ed66 Update mw.py 2023-01-16 21:43:38 +08:00
1c6b6f1090 Update mw.py 2023-01-16 21:43:18 +08:00
fc8a54c4b3 Update app.py 2023-01-16 02:04:12 +08:00
4ade42380d Update layout.html 2023-01-14 22:43:40 +08:00
6b2c21ab47 Update install.sh 2023-01-14 20:01:54 +08:00
Mr Chen
6f5ea82a58 Merge pull request #340 from midoks/dev
修复Webhook 插件BUG
2023-01-14 16:53:51 +08:00
73c849931c #338
已经优化
2023-01-14 16:51:38 +08:00
39d76f5621 #338 2023-01-14 16:42:22 +08:00
Mr Chen
bc435ea848 Merge pull request #339 from midoks/dev
修复网站统计-设置站点配置产生的问题。
2023-01-14 15:31:45 +08:00
ed82dd3c12 Update webstats_common.lua 2023-01-14 15:14:51 +08:00
0a5a86625f 修复设置错误 2023-01-14 13:46:59 +08:00
53f56c949b Update sg11.sh 2023-01-13 00:55:49 +08:00
7e61e37d80 up 2023-01-12 19:49:31 +08:00
c05d0244db Update xhprof.js 2023-01-12 17:50:56 +08:00
226d0addc5 图标可设置 2023-01-12 14:31:12 +08:00
35cce35ff3 #334 2023-01-11 17:47:49 +08:00
9450103c4b 文字优化 2023-01-11 12:01:44 +08:00
Mr Chen
4478f005e7 Merge pull request #333 from midoks/dev
mysql[apt/yum]迁移功能优化
2023-01-10 17:49:27 +08:00
71be0e3196 Update index.py 2023-01-10 17:47:38 +08:00
e6a79216c4 mysql[apt/yum]迁移优化 2023-01-10 17:45:03 +08:00
3f12d4b8d6 Update index.py 2023-01-10 17:41:06 +08:00
683f041b1d Update update_dev.sh 2023-01-10 17:37:33 +08:00
e08cebd48e Update update_dev.sh 2023-01-10 17:32:27 +08:00
d02dea3150 Update update_dev.sh 2023-01-10 17:32:17 +08:00
18bb92c9e2 Update update_dev.sh 2023-01-10 17:29:08 +08:00
f9b45ee4d9 优化更新脚本 2023-01-10 17:25:38 +08:00
dcbc86ea5c Update index.py 2023-01-10 17:08:26 +08:00
300728cb17 Update index.py 2023-01-10 17:04:58 +08:00
51aa028f97 Update index.py 2023-01-10 17:03:36 +08:00
e30ac33cea Update index.py 2023-01-10 16:59:14 +08:00
1c2f3c4378 Update __init__.py 2023-01-10 01:06:58 +08:00
Mr Chen
17eadfccff Merge pull request #332 from midoks/dev
优化mysql初始化
2023-01-09 23:36:58 +08:00
b55a6d3bd9 Update index.py 2023-01-09 23:31:00 +08:00
Mr Chen
48936e7918 Merge pull request #331 from midoks/dev
php-apt/php-yum安装优化
2023-01-09 15:14:59 +08:00
1a99c53cb6 composer和php-apt的优化 2023-01-09 15:10:14 +08:00
a8b5df25d0 php-yum优化 2023-01-09 14:46:08 +08:00
73b4be90f5 Update install.sh 2023-01-09 14:33:15 +08:00
1ecf12ab5c php-yum update 2023-01-09 14:08:02 +08:00
758da44141 up 2023-01-09 11:39:52 +08:00
8aa44408cc Update install.sh 2023-01-09 11:27:34 +08:00
Mr Chen
ccf4ab7d81 Merge pull request #330 from midoks/dev
OP防火墙和phpmyadmin轻微优化
2023-01-08 15:21:28 +08:00
61766a8942 Update init.lua 2023-01-08 13:49:42 +08:00
ce9ac280c7 Update index.py 2023-01-08 13:04:22 +08:00
Mr Chen
94bd8cbe8e Merge pull request #329 from midoks/dev
修复绑定域名问题
2023-01-07 23:31:21 +08:00
705f2445ee Update site_api.py 2023-01-07 23:24:33 +08:00
Mr Chen
bc8d16f2c2 Merge pull request #328 from midoks/dev
OpenResty配置优化
2023-01-07 23:01:09 +08:00
fe9eb7dc38 Update cert_api.py 2023-01-07 19:39:01 +08:00
94195b5246 优化防火墙导入 2023-01-07 19:21:12 +08:00
24009267be Update index.py 2023-01-07 16:02:27 +08:00
c28412aea5 Update index.py 2023-01-07 15:55:56 +08:00
847b9d569b Update index.py 2023-01-07 15:49:37 +08:00
b3c3a4457d op防火墙优化
1.适配openresty配置修改。
2.加入一个测试功能,便于测试。
2023-01-07 15:36:44 +08:00
89a84f5ca0 Update lua.conf 2023-01-07 15:08:27 +08:00
4432fa15cc Update lua.conf 2023-01-07 14:17:33 +08:00
c6a600299d Update lua.conf 2023-01-07 12:29:50 +08:00
082b0ebcc3 openresty 默认开启 2023-01-07 12:23:50 +08:00
828436b772 Update webstats_common.lua 2023-01-07 03:00:55 +08:00
658a727fe3 Update index.py 2023-01-07 01:42:52 +08:00
bedd6e5409 Update index.py 2023-01-07 01:02:47 +08:00
ef8bc8bf57 Update index.py 2023-01-07 01:00:52 +08:00
a22f89797a Update index.py 2023-01-07 00:50:20 +08:00
eaf341cda6 Update index.py 2023-01-07 00:37:20 +08:00
58d69d734d 优化【网站统计】强制获取日志POST信息。 2023-01-07 00:15:54 +08:00
e19f7702db Update tool_task.py 2023-01-06 20:52:07 +08:00
b546a39f29 Update index.py 2023-01-06 20:32:12 +08:00
81b570214a Update index.py 2023-01-06 20:29:26 +08:00
44401f5944 Update webstats_common.lua 2023-01-06 20:12:31 +08:00
4ad190586a 调试请求日志 2023-01-06 20:08:27 +08:00
25bca124b4 Update index.py 2023-01-06 18:09:06 +08:00
98165bb449 修复网站统计-监控配置 2023-01-06 18:00:22 +08:00
6693edb924 Update install.sh 2023-01-06 16:03:02 +08:00
Mr Chen
bae1beec3e Merge pull request #327 from midoks/dev
修复网站统计【初始安装】不可用
2023-01-06 12:34:01 +08:00
0682ca4d4d #326
修复
2023-01-06 12:31:26 +08:00
5bc10bebd0 Update index.py 2023-01-06 12:17:21 +08:00
Mr Chen
25df8b430b Merge pull request #325 from midoks/dev
修复子域名绑定没有正常删除问题
2023-01-06 00:27:22 +08:00
4f8fc31ca3 修复子域名绑定没有正常删除问题 2023-01-06 00:25:21 +08:00
Mr Chen
a44f54e719 Merge pull request #324 from midoks/dev
修复绑定域名问题
2023-01-05 21:41:09 +08:00
12068046ec 修复绑定域名问题 2023-01-05 21:31:39 +08:00
d6f57e5ea7 Update install.sh 2023-01-04 21:24:40 +08:00
Mr Chen
869d7795a6 Merge pull request #321 from midoks/dev
0.12.1
2023-01-04 20:58:27 +08:00
0a3d976c6a 0.12.1
* mysql/mariadb/mysql-apt/mysql-yum增加新的同步方式[同步账户]。
* pureftp安装时自动放行端口。
* 面板ssl,添加【申请Lets证书】功能。
* 站点子域名绑定优化。
* 修复添加数据库名字判断。
* 增加PHP52的隐藏和显示指令。
* 各种细节优化。
2023-01-04 20:57:11 +08:00
c4d39ef9fb Update intl.sh 2023-01-04 20:50:18 +08:00
8e5b499601 Update install.sh 2023-01-04 20:41:26 +08:00
e6dff6094c Update tools.py 2023-01-04 20:21:52 +08:00
47dec45a27 Update tools.py 2023-01-04 20:20:47 +08:00
4706af7423 Update tools.py 2023-01-04 20:18:50 +08:00
1bc458eb8f 增加PHP52的隐藏和显示指令 2023-01-04 20:17:20 +08:00
dc3f872592 Update config_api.py 2023-01-04 19:13:08 +08:00
3d48289329 up 2023-01-04 18:52:24 +08:00
6126539929 Update config_api.py 2023-01-04 18:00:49 +08:00
cff5df6d13 Update requirements.txt 2023-01-04 17:57:55 +08:00
23a0b74f9d Update config.js 2023-01-04 17:49:58 +08:00
5927a3abab 面板ssl申请 2023-01-04 17:48:07 +08:00
4b176ad702 修复子目录绑定ssl申请问题 2023-01-03 23:45:51 +08:00
577103506d Update site_api.py 2023-01-03 23:39:40 +08:00
18f8d2b905 Update files.js 2023-01-03 18:56:56 +08:00
3a6b5339d2 Update config_api.py 2023-01-03 18:50:07 +08:00
c25d4305f7 Update files.js 2023-01-03 18:49:58 +08:00
b6ef87e97b up 2023-01-03 18:43:25 +08:00
4335668cd4 Update config_api.py 2023-01-03 18:29:20 +08:00
0fc2ab011d Update files.js 2023-01-03 18:26:20 +08:00
683035e6b7 up 2023-01-03 18:06:28 +08:00
f2dfa7ad48 Update index.py 2023-01-03 14:55:39 +08:00
2ae2c188e7 Update index.py 2023-01-03 14:54:57 +08:00
b5cd0564cb 安装,自动放行端口 2023-01-03 14:43:34 +08:00
2f274ce202 Update pure-ftpd.conf 2023-01-03 14:14:36 +08:00
0a67932473 域名添加重复bug优化 2023-01-02 22:56:19 +08:00
7b7cb215c4 Update config_api.py 2023-01-02 20:47:05 +08:00
f6e98ae286 站点配置保持优化 2023-01-02 20:46:09 +08:00
5958f6e067 Update info.json 2023-01-02 12:01:05 +08:00
6dadfb1019 Update mysql.sql 2023-01-02 11:58:41 +08:00
f5aeb5664b Update index.py 2023-01-02 11:58:08 +08:00
ca1080937d Update index.py 2023-01-02 11:52:57 +08:00
1dd934ea3f mysql-yum加入主从同步 2023-01-02 11:47:35 +08:00
a34512d057 Update ubuntu.sh 2023-01-02 01:06:54 +08:00
575c1e48ae Update info.json 2023-01-02 01:02:13 +08:00
9f3ee4997b up 2023-01-02 00:59:57 +08:00
cfaa2d9f25 up 2023-01-02 00:30:44 +08:00
aded1fc731 Update index.py 2023-01-02 00:16:12 +08:00
4a6e847743 Update index.py 2023-01-02 00:13:20 +08:00
24fac51538 Update index.py 2023-01-02 00:12:49 +08:00
148b32fed3 Update mariadb.js 2023-01-02 00:11:00 +08:00
fff19d2c4a Update my.cnf 2023-01-02 00:04:43 +08:00
a5e0332179 Update index.py 2023-01-01 23:42:14 +08:00
1349655570 up 2023-01-01 23:37:43 +08:00
b9e617bf0f Update index.py 2023-01-01 21:58:26 +08:00
f65d10e1e4 up 2023-01-01 21:56:45 +08:00
6d9ec087ce Update index.py 2023-01-01 21:18:55 +08:00
bfb9da0471 up 2023-01-01 20:55:32 +08:00
8a95a68c81 Update update_dev.sh 2023-01-01 20:55:09 +08:00
d9d81ded3d mysql-apt添加主从同步功能 2023-01-01 20:43:00 +08:00
403660c980 Update config_api.py 2023-01-01 20:26:36 +08:00
ac06cfc83c mariadb添加新的同步方式 2023-01-01 20:22:06 +08:00
c50012b9b5 Update index.py 2023-01-01 17:17:05 +08:00
baeb0ddc8f up 2023-01-01 17:00:47 +08:00
83f8c99275 Update update.sh 2022-12-31 21:06:55 +08:00
2d2b454a31 Update update_dev.sh 2022-12-31 21:05:36 +08:00
aad41ce14b Update index.py 2022-12-31 20:57:56 +08:00
ebf8c82d33 导入优化 2022-12-31 20:30:02 +08:00
d25100fec3 Update index.py 2022-12-31 20:01:20 +08:00
fe658d9009 Update config_api.py 2022-12-31 17:10:58 +08:00
f37c2c9bc6 Update index.py 2022-12-31 16:46:28 +08:00
a1550765aa up 2022-12-31 14:52:39 +08:00
b020f23161 Update info.json 2022-12-31 13:37:11 +08:00
4afe2061e2 Update mysql.js 2022-12-31 13:32:30 +08:00
ab64c01981 up 2022-12-31 13:14:30 +08:00
8a97734700 Update index.py 2022-12-31 13:08:03 +08:00
16b4c64aa5 Update index.py 2022-12-31 13:07:11 +08:00
df2a5919af Update my5.7.cnf 2022-12-30 20:41:51 +08:00
40a81b794c Update my5.7.cnf 2022-12-30 20:38:40 +08:00
8fc7ab3abf up 2022-12-30 20:14:28 +08:00
ca4205c89a up 2022-12-30 20:13:35 +08:00
c89b15a645 Update mysql.js 2022-12-30 20:08:00 +08:00
7a863c4544 修复添加数据库名字判断 2022-12-30 20:07:31 +08:00
5d81406fdf 优化mysql主从同步UI 2022-12-30 15:21:33 +08:00
cce59c0521 up 2022-12-30 14:56:31 +08:00
Mr Chen
0a5c5aae12 Merge pull request #320 from midoks/midoks-patch-1
Create requirements.txt
2022-12-30 14:25:03 +08:00
Mr Chen
7478426206 Create requirements.txt 2022-12-30 14:24:27 +08:00
c0ed736edb Update index.py 2022-12-30 12:18:35 +08:00
313eb25ccd Update mysql.js 2022-12-30 12:10:11 +08:00
f58595755b Update index.py 2022-12-30 12:01:02 +08:00
18a892a576 Update update_dev.sh 2022-12-30 00:32:51 +08:00
03d558092f Update update_dev.sh 2022-12-30 00:32:20 +08:00
3cffa9223a Update my5.7.cnf 2022-12-30 00:28:50 +08:00
c0d5aff2f5 mysql配置优化 2022-12-30 00:06:25 +08:00
3fa4c7804b Update mysql.sql 2022-12-29 23:32:20 +08:00
22acce8bc0 mysql主从加入新的同步方式 2022-12-29 23:32:14 +08:00
e53e5cd672 Update mw.py 2022-12-28 23:41:02 +08:00
a7d861de22 up 2022-12-28 23:38:37 +08:00
ddeef3c17e up 2022-12-28 23:21:07 +08:00
af733ac28a Merge branch 'master' into dev 2022-12-28 22:34:24 +08:00
Mr Chen
148e2021dc Merge pull request #318 from midoks/dependabot/pip/wheel-0.38.1
Bump wheel from 0.33.6 to 0.38.1
2022-12-28 22:33:23 +08:00
50c3fe58f4 Update rhel.sh 2022-12-28 21:54:29 +08:00
5ed3728d4f Update rhel.sh 2022-12-28 21:47:54 +08:00
9bf06c9d21 Update rhel.sh 2022-12-28 21:47:41 +08:00
08b3738cfd up 2022-12-28 21:44:18 +08:00
a04f59a3aa Update rhel.sh 2022-12-28 21:31:55 +08:00
155b8d2b4c Update rhel.sh 2022-12-28 17:26:56 +08:00
dependabot[bot]
039d2794ab Bump wheel from 0.33.6 to 0.38.1
Bumps [wheel](https://github.com/pypa/wheel) from 0.33.6 to 0.38.1.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.33.6...0.38.1)

---
updated-dependencies:
- dependency-name: wheel
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 20:58:18 +00:00
0d2721523c up 2022-12-25 22:43:34 +08:00
f042665c05 Update install.sh 2022-12-25 18:27:27 +08:00
0118548c24 up 2022-12-24 22:32:14 +08:00
1ba6625525 Update libsodium.sh 2022-12-24 22:29:33 +08:00
293f8ab0af up 2022-12-24 22:21:45 +08:00
dc68868883 Update sodium.sh 2022-12-24 21:57:40 +08:00
30f835b6b8 Update sodium.sh 2022-12-24 21:53:10 +08:00
4d90fdfe4f Update install.sh 2022-12-21 22:28:40 +08:00
bb4067aa6b Update install.sh 2022-12-21 22:25:36 +08:00
5dbf89b872 Update README.md 2022-12-21 22:11:54 +08:00
cc244a8ea5 Update README.md 2022-12-21 21:39:57 +08:00
Mr Chen
975cb988f7 Merge pull request #310 from midoks/dev
0.12.0
2022-12-21 21:38:48 +08:00
5a11d1bff9 Update README.md 2022-12-21 21:36:03 +08:00
bab3501722 0.12.0 2022-12-21 21:26:40 +08:00
872d68e0f1 Update config_api.py 2022-12-21 21:15:16 +08:00
9a5878a90c #309 先注释 2022-12-21 21:01:04 +08:00
e5e226b57a Update rhel.sh 2022-12-21 14:28:20 +08:00
5d12218a3e Update rhel.sh 2022-12-20 13:40:56 +08:00
7b3bbc8bdd Update install_dev.sh 2022-12-20 13:33:59 +08:00
67030e91f6 Update rhel.sh 2022-12-20 13:14:35 +08:00
c03eb0aa40 Update rhel.sh 2022-12-20 13:10:18 +08:00
2b5aaba0b7 Update install_dev.sh 2022-12-20 13:04:55 +08:00
c7a01b8c52 Update rhel.sh 2022-12-20 13:02:45 +08:00
9bfb72ada5 Update rhel.sh 2022-12-20 12:59:47 +08:00
5ab8936f6b Update phplib.conf 2022-12-20 12:01:43 +08:00
43c5161085 Update sodium.sh 2022-12-20 11:53:38 +08:00
7d90a6e99f Update libsodium.sh 2022-12-20 11:35:23 +08:00
9ba8028944 up 2022-12-20 11:26:49 +08:00
36fa3d7630 Update libsodium.sh 2022-12-20 11:20:31 +08:00
b6a2d7e3e8 up 2022-12-20 11:18:21 +08:00
99e73d1bda libsodium 2022-12-20 00:04:24 +08:00
1083b46078 Update rhel.sh 2022-12-19 23:59:04 +08:00
8bd081804d Update index.py 2022-12-19 23:54:28 +08:00
2536a79481 update 2022-12-19 20:28:12 +08:00
eab11680e5 up 2022-12-19 19:54:09 +08:00
651b7d6d1b Update index.py 2022-12-19 18:29:42 +08:00
75e181116e #307 2022-12-19 18:10:57 +08:00
c0a981b5a1 Update crontab.js 2022-12-19 14:38:20 +08:00
61dc601d48 Update crontab_api.py 2022-12-19 14:30:25 +08:00
415a2a1f8f #307 2022-12-19 14:27:29 +08:00
7c06a85ac7 Update crontab_api.py 2022-12-19 14:17:08 +08:00
7c8329bb78 Update crontab_api.py 2022-12-19 14:04:27 +08:00
5c8a50429f Update crontab_api.py 2022-12-19 13:50:04 +08:00
300bdc1eb1 up 2022-12-19 13:47:37 +08:00
a8a9e9033e 文件备份OK 2022-12-18 22:44:59 +08:00
77425dfc48 up 2022-12-18 21:11:15 +08:00
52eae4625f Update site_api.py 2022-12-18 15:48:31 +08:00
dafcf60633 Update site_api.py 2022-12-18 15:47:38 +08:00
79c1e81d2c up 2022-12-18 15:46:12 +08:00
b779a18de6 up 2022-12-18 03:15:39 +08:00
45f22d239a Update install.sh 2022-12-18 01:15:59 +08:00
f7b688d6bf 站点分类问题 #300 2022-12-18 00:54:26 +08:00
6f069c715a php-apt 8.2 2022-12-18 00:10:37 +08:00
98ed286b50 up 2022-12-17 23:57:05 +08:00
e931fa526f up 2022-12-17 23:50:21 +08:00
ff17610732 Update crontab_api.py 2022-12-17 23:23:00 +08:00
13bbe07ac5 Update site_api.py 2022-12-17 22:28:22 +08:00
5380cd805c up 2022-12-17 22:19:59 +08:00
c0b056c18d Update index.py 2022-12-17 22:10:01 +08:00
e287086b36 Update index.py 2022-12-17 21:58:07 +08:00
8647300e16 Update index.py 2022-12-17 21:48:36 +08:00
636f7af8ef up 2022-12-17 21:34:16 +08:00
87cf208dfc mysql 2022-12-17 21:28:31 +08:00
579a84c6f1 Update index.py 2022-12-17 21:14:34 +08:00
54b90f4484 Update index.py 2022-12-17 21:11:20 +08:00
ebdaf5d395 Update index.py 2022-12-17 21:06:12 +08:00
1e5ecabbd1 up 2022-12-17 20:52:35 +08:00
0596dc243e Update index.py 2022-12-17 20:49:18 +08:00
7fa6ec7cd3 up 2022-12-17 20:46:02 +08:00
c21d8eed8b Update index.py 2022-12-17 20:38:31 +08:00
326f9f0e6b Update index.py 2022-12-17 20:33:53 +08:00
60c94f120e Update index.py 2022-12-17 20:32:50 +08:00
55c08a8916 Update index.py 2022-12-17 20:11:21 +08:00
cf944fb976 Update index.py 2022-12-17 20:02:27 +08:00
cda1ea93a8 Update config_api.py 2022-12-17 20:01:39 +08:00
46f02cae0d Update crontab.js 2022-12-17 20:00:10 +08:00
034d00a262 Update config_api.py 2022-12-17 18:59:28 +08:00
fe1a68208b Update crontab.js 2022-12-17 18:59:17 +08:00
f364cc4e2d Update config_api.py 2022-12-17 18:56:42 +08:00
5b35b5f38c Update crontab.js 2022-12-17 18:56:21 +08:00
2151b2c597 Update index.py 2022-12-17 18:48:29 +08:00
4f8e95210f Update index.py 2022-12-17 18:02:20 +08:00
b31297b47f Update crontab_api.py 2022-12-17 17:57:10 +08:00
e492a87160 Update crontab_api.py 2022-12-17 17:42:30 +08:00
47d6eb7993 Update crontab.js 2022-12-17 17:21:04 +08:00
3ddccea897 Update config_api.py 2022-12-17 17:17:35 +08:00
069d594e49 up 2022-12-17 17:16:57 +08:00
7c49609a2b Update config_api.py 2022-12-17 17:10:01 +08:00
70d260dd5a update 2022-12-17 17:00:19 +08:00
58503722c0 Update crontab_api.py 2022-12-17 16:02:51 +08:00
0a98b4dc09 Update crontab_api.py 2022-12-17 15:45:04 +08:00
5ab0f493e4 Update crontab_api.py 2022-12-17 14:06:51 +08:00
30580874fd Update config_api.py 2022-12-17 14:04:01 +08:00
26327d958c Update crontab_api.py 2022-12-17 14:02:36 +08:00
522eddd393 Update crontab.js 2022-12-17 13:30:54 +08:00
935df8d4d1 Update config_api.py 2022-12-17 11:36:13 +08:00
15b4ba9cbb up 2022-12-17 11:34:37 +08:00
c005e1f56d Update debian.sh 2022-12-17 09:58:56 +08:00
edbca430ee Update debian.sh 2022-12-17 09:55:48 +08:00
f8fedb8285 Update crontab.js 2022-12-16 01:09:59 +08:00
d9472709fd up 2022-12-16 01:02:05 +08:00
79bf1eae07 Update config_api.py 2022-12-16 00:23:24 +08:00
fab6df7097 up 2022-12-16 00:12:53 +08:00
b9416d58f9 Update info.json 2022-12-16 00:03:29 +08:00
96d86ce49e Update info.json 2022-12-16 00:01:41 +08:00
46f2d9f029 Update plugins_api.py 2022-12-15 23:47:06 +08:00
9d5fb77123 Update plugins_api.py 2022-12-15 23:41:56 +08:00
d0c903bf11 up 2022-12-15 20:03:00 +08:00
3c1b0e6708 Update crontab_api.py 2022-12-15 20:02:49 +08:00
340b72591a Merge branch 'dev' of github.com:midoks/mdserver-web into dev 2022-12-15 18:10:49 +08:00
8f6a194a02 Update debug.sh 2022-12-15 18:06:11 +08:00
Mr Chen
7e65993978 Merge pull request #304 from hiCasper/dev
Revert changes
2022-12-15 18:03:27 +08:00
hiCasper
ca27a2d49d Revert changes 2022-12-15 17:53:17 +08:00
Mr Chen
b941c9c71b Merge pull request #302 from hiCasper/dev
Dev
2022-12-15 17:05:19 +08:00
hiCasper
e68c7b0346 Change log path 2022-12-14 14:17:44 +08:00
c7c3d8fdb9 Create jquery.qrcode.js 2022-12-13 16:15:06 +08:00
hiCasper
de383e0584 Fix 2022-12-13 15:12:44 +08:00
048463cf9d 修改名字 2022-12-13 14:45:29 +08:00
hiCasper
0c118613d5 Add more install logs 2022-12-13 14:39:04 +08:00
hiCasper
aa8e9f173b Improve OS detection 2022-12-13 14:34:10 +08:00
hiCasper
c21c54198c Better way installing deps 2022-12-13 13:42:42 +08:00
Mr Chen
e8ad9995d7 Merge pull request #299 from hiCasper/dev
Fix problems
2022-12-13 13:31:38 +08:00
hiCasper
7a0b6be401 Merge branch 'dev' of https://github.com/hiCasper/mdserver-web into dev 2022-12-13 13:09:57 +08:00
hiCasper
8b2a127ceb Add dev install hint 2022-12-13 13:09:15 +08:00
hiCasper
8a23fb18ff Rollback 2022-12-13 13:08:48 +08:00
hiCasper
234eca3729 Merge branch 'dev' of https://github.com/midoks/mdserver-web into dev 2022-12-13 13:05:22 +08:00
hiCasper
9c74eb6a77 Add dev version hint 2022-12-13 12:59:43 +08:00
hiCasper
0093af2661 Sync upstream 2022-12-13 12:45:38 +08:00
hiCasper
482d9bdd86 Fix locale error 2022-12-13 02:28:40 +08:00
hiCasper
d8f9b179ad Add hint 2022-12-13 01:49:51 +08:00
hiCasper
d179328976 Revert and fix deps issue 2022-12-13 01:36:25 +08:00
hiCasper
9aaa5e2a65 Log installation to file 2022-12-13 01:36:25 +08:00
hiCasper
821a9ce2d1 Fix acme.sh deps 2022-12-13 00:50:38 +08:00
7b39b28dcd debian系列回退 2022-12-13 00:08:15 +08:00
c881ad7d18 Update site_api.py 2022-12-12 23:30:57 +08:00
82da5c2649 Create sub.conf.tpl 2022-12-10 19:54:17 +08:00
Mr Chen
315ba990ec Merge pull request #292 from hiCasper/dev
Optimize install scripts
2022-12-10 15:23:55 +08:00
hiCasper
992fcb7e6f Optimize OS detection 2022-12-10 14:51:19 +08:00
hiCasper
d7337239f5 Optimize acme.sh install 2022-12-10 14:40:06 +08:00
hiCasper
224b91fe0b Fix install scripts 2022-12-10 14:02:05 +08:00
Mr Chen
589dfe6da2 Merge pull request #291 from hiCasper/dev
安装脚本等优化
2022-12-10 11:58:21 +08:00
hiCasper
b1b47c3c38 Combine install scripts 2022-12-10 03:01:31 +08:00
hiCasper
106f5d897d Skip missing packages 2022-12-10 02:59:16 +08:00
hiCasper
c856d09b3b Speed up install 2022-12-10 02:59:16 +08:00
hiCasper
6bf8792bb6 Fix pip location 2022-12-10 02:59:15 +08:00
hiCasper
75edb074b2 Change pip source 2022-12-10 02:37:33 +08:00
hiCasper
4a5df99f06 Fix dnf dependencies 2022-12-10 02:37:33 +08:00
hiCasper
2c7536a138 Fix typo 2022-12-10 02:09:28 +08:00
hiCasper
a758fc2264 Fix pip source 2022-12-10 02:09:28 +08:00
hiCasper
0d94fe2d26 Fix yum error 2022-12-10 02:09:28 +08:00
hiCasper
630bdd5f96 Fix error 2022-12-10 02:09:27 +08:00
hiCasper
411fc670fc Combine install scripts 2022-12-10 02:09:27 +08:00
hiCasper
cab35c7c28 Fix iptables detection 2022-12-10 02:09:27 +08:00
hiCasper
b3c8a6365f Using whitenoise to serving static files 2022-12-10 02:09:27 +08:00
Mr Chen
b64f02ff2f Merge pull request #290 from midoks/dev
0.11.4
2022-12-10 01:52:51 +08:00
7e9df9640e PHP82正式释出。 2022-12-10 01:48:52 +08:00
6c478be4df Update fileinfo.sh 2022-12-09 22:38:53 +08:00
e919fac1d5 Update fileinfo.sh 2022-12-09 22:38:21 +08:00
4854142f9a Update fileinfo.sh 2022-12-09 22:24:56 +08:00
f37de275ba Update fileinfo.sh 2022-12-09 22:19:17 +08:00
0c8f777452 Update phplib.conf 2022-12-09 20:23:52 +08:00
9235affadf Update phalcon.sh 2022-12-09 20:06:43 +08:00
2001a3b5dc Update install.sh 2022-12-09 19:49:24 +08:00
6ba1e4c19c Update yaf.sh 2022-12-09 19:44:58 +08:00
231048a4a3 Update phalcon.sh 2022-12-09 19:42:08 +08:00
6b9aab3759 Update fileinfo.sh 2022-12-09 19:22:32 +08:00
e8a152b1a3 Update install.sh 2022-12-09 19:15:58 +08:00
1cf8e4ecb7 Update fileinfo.sh 2022-12-09 19:11:55 +08:00
aa04235446 up 2022-12-09 19:03:16 +08:00
3acbc36297 Update tools.py 2022-12-09 18:34:36 +08:00
85aba4f1ce Update tools.py 2022-12-09 18:32:32 +08:00
f33f80cf34 Update mw.tpl 2022-12-09 18:04:33 +08:00
1868b3197d Update tools.py 2022-12-09 18:04:07 +08:00
b8e1fb2ca2 Update install.sh 2022-12-09 15:05:41 +08:00
9aa9c4f799 删除任务时删除日志 2022-12-09 12:16:32 +08:00
344603f1b2 Update redis.sh 2022-12-08 19:06:49 +08:00
71b43e9f2f Update redis.sh 2022-12-08 18:53:46 +08:00
adba50bfc1 Update redis.sh 2022-12-08 18:52:52 +08:00
Mr Chen
d917fa76f6 Merge pull request #286 from midoks/dev
0.11.3
2022-12-08 00:07:48 +08:00
32971ccead 0.11.3 2022-12-08 00:06:50 +08:00
c7a3481b95 #285
观察细致入微。
2022-12-07 22:56:18 +08:00
8915b672e5 Update config_api.py 2022-12-07 19:35:35 +08:00
e472d104d1 Update nginx_panel.conf 2022-12-07 16:33:44 +08:00
48ee5574c7 Update mw.py 2022-12-07 15:31:47 +08:00
706afbd681 Update mw.py 2022-12-07 15:31:32 +08:00
70ca6d0459 Update mw.py 2022-12-07 15:12:18 +08:00
f344a32fa7 Update mw.py 2022-12-07 15:09:43 +08:00
e6123000ac Update nginx_panel.conf 2022-12-07 12:56:30 +08:00
b94361c59f Update config_api.py 2022-12-07 00:37:28 +08:00
4a7efb67d4 Update config_api.py 2022-12-07 00:22:02 +08:00
536b7ac997 Update config_api.py 2022-12-07 00:20:31 +08:00
0f5b055aeb 面板ssl 2022-12-07 00:14:22 +08:00
7d81a59c8f Update config_api.py 2022-12-06 23:42:23 +08:00
2540cd1308 Update config_api.py 2022-12-06 23:40:41 +08:00
5358cd2d38 up 2022-12-06 23:38:09 +08:00
c4bb20ed54 Update files_api.py 2022-12-06 20:37:07 +08:00
7f2f307131 Update files_api.py 2022-12-06 20:30:02 +08:00
7a8ef9fe00 Update files_api.py 2022-12-06 20:19:06 +08:00
e1abc66179 Update setting.py 2022-12-06 18:00:28 +08:00
8bda20c3d0 Update config_api.py 2022-12-06 17:50:49 +08:00
3c01838df1 Update .gitignore 2022-12-06 17:38:42 +08:00
3b459e0349 panel ssl 测试中 2022-12-06 17:35:23 +08:00
d3e7684f04 ssl update 2022-12-06 16:27:24 +08:00
b2e6e7f256 Update firewall_api.py 2022-12-06 01:25:53 +08:00
ca6812561a Update mw.py 2022-12-06 01:03:25 +08:00
44e8079db6 Update README.md 2022-12-05 15:08:39 +08:00
9bd063cc1d Update phalcon.sh 2022-12-04 16:10:26 +08:00
1b0044e28a Update index.py 2022-12-04 15:58:04 +08:00
9b752cf24f up 2022-12-04 15:57:33 +08:00
cf5f98958c Update phplib.conf 2022-12-04 12:19:11 +08:00
c46872dab5 Update phplib.conf 2022-12-04 12:13:14 +08:00
b57edb7b87 加入phalcon 2022-12-04 12:12:26 +08:00
595cc30c6f Update swoole.sh 2022-12-04 11:42:41 +08:00
4b6f5a5f4e Update swoole.sh 2022-12-04 11:29:53 +08:00
741da10906 Update swoole.sh 2022-12-04 11:29:26 +08:00
9965786976 Update README.md 2022-12-04 11:24:15 +08:00
f083696131 Update install.sh 2022-12-04 11:24:09 +08:00
dd2105d9ab 文件搜索优化 2022-12-04 00:57:03 +08:00
c1574f3430 up 2022-12-03 15:56:58 +08:00
6394ead5b8 解除域名绑定成功 2022-12-03 13:27:24 +08:00
Mr Chen
2861f7f995 Merge pull request #282 from midoks/dev
0.11.2
2022-12-03 12:32:47 +08:00
10d6fa2d47 0.11.2 2022-12-03 12:31:51 +08:00
16e5b4ae73 php82 rc7 测试版 2022-12-03 12:03:34 +08:00
aca89d7d5e Update config.html 2022-12-03 12:00:35 +08:00
ffefe96f1f 域名绑定 2022-12-03 11:49:20 +08:00
e1e1e81a90 Update gettext.sh 2022-12-03 11:47:09 +08:00
502295125a Update gettext.sh 2022-12-03 11:33:02 +08:00
85258dd80b Update lib.sh 2022-12-03 02:34:36 +08:00
ff0cb6eb31 up 2022-12-03 01:28:39 +08:00
e4e1945ea5 域名配置 2022-12-03 01:23:11 +08:00
e7f74a482f Update install.sh 2022-12-02 23:25:54 +08:00
dd27af9ede up 2022-12-02 23:23:50 +08:00
4aeffd2aa6 Update openssl.sh 2022-12-02 22:59:05 +08:00
8924957e7f Update centos.sh 2022-12-02 22:55:56 +08:00
c013db9d41 Update install.sh 2022-12-02 22:54:35 +08:00
e492abf354 Update openssl.sh 2022-12-02 22:54:28 +08:00
f84cab9e98 Update openssl.sh 2022-12-02 22:51:57 +08:00
eb5be2842d Update openssl.sh 2022-12-02 22:51:29 +08:00
06e99096cf Update yar.sh 2022-12-02 22:50:32 +08:00
93f1129c0f Update gd.sh 2022-12-02 22:36:35 +08:00
46bc94946c Update site.js 2022-12-02 12:55:09 +08:00
0857c6aed7 Update config_api.py 2022-12-02 12:51:45 +08:00
fdcdd27f8e Update site.js 2022-12-02 12:45:51 +08:00
d1810606db Update config_api.py 2022-12-01 23:09:33 +08:00
68f5f4c6cb Update site.js 2022-12-01 23:07:52 +08:00
d40665c0f8 Update site.js 2022-12-01 23:05:23 +08:00
9d1ebba509 up 2022-12-01 23:02:25 +08:00
d0113840a3 up 2022-12-01 22:55:17 +08:00
43c287132b php命令功能 2022-12-01 22:50:17 +08:00
deb3a40fb7 Update README.md 2022-12-01 20:52:59 +08:00
88196175f4 Update index.py 2022-12-01 17:42:20 +08:00
217ba2d14e Update index.py 2022-12-01 17:41:34 +08:00
7af7e2321a Update webstats_log.lua 2022-12-01 17:09:39 +08:00
20b39cbb70 Update webstats_common.lua 2022-12-01 12:43:31 +08:00
66ff690bae Update webstats_log.lua 2022-12-01 12:33:09 +08:00
99e8e63917 Update webstats_common.lua 2022-12-01 03:28:39 +08:00
a4dfe26254 Update webstats_common.lua 2022-12-01 03:27:24 +08:00
15c0ef390e Update webstats_common.lua 2022-12-01 03:15:53 +08:00
a2b9658b2e Update webstats_common.lua 2022-12-01 03:03:50 +08:00
5bcb0fb739 Update webstats_log.lua 2022-12-01 03:01:32 +08:00
6278c9588b Update files.js 2022-12-01 01:06:14 +08:00
19d4456e2e Update index.py 2022-11-30 21:06:13 +08:00
807cb8fe98 Update install.sh 2022-11-30 20:19:15 +08:00
ba2df01084 登出 2022-11-30 20:03:07 +08:00
d82b0dbe9f Update commit.tpl 2022-11-30 16:13:18 +08:00
acc18cf571 up 2022-11-30 16:02:17 +08:00
f69dd139c0 Update commit.tpl.ssh 2022-11-30 15:25:39 +08:00
ab6f860bde Update index.py 2022-11-30 15:14:07 +08:00
febe56f430 Update index.py 2022-11-30 14:46:53 +08:00
0962e5aab8 up 2022-11-30 14:44:56 +08:00
5ea062862f 为了同步代码,改为www 2022-11-30 14:39:37 +08:00
cce5598f2f Update index.py 2022-11-30 13:22:23 +08:00
d88962eb56 gitea卸载检查 2022-11-30 13:21:28 +08:00
b44e24df0d Update index.py 2022-11-30 12:19:31 +08:00
f36e540a59 加强redis安全 2022-11-30 11:46:40 +08:00
992e7445f6 mysql utf8mb4排第一 2022-11-29 20:30:08 +08:00
066729e8d9 up 2022-11-29 20:18:51 +08:00
Mr Chen
be3e57a905 Merge pull request #280 from midoks/dev
版本号修正
2022-11-29 12:26:41 +08:00
bc7a569ae9 Update config_api.py 2022-11-29 12:25:45 +08:00
Mr Chen
1bc24b12fc Merge pull request #278 from midoks/dev
0.11.1
2022-11-29 10:47:24 +08:00
b2fdc8212f 0.11.1
* 提供面板API接口访问的支持。
* rockylinux系统安装优化。
* 网站统计记录POST请求原文优化。
* 针对mysql下载速度优化。
* mysql初始化默认参数优化。
* OP防火墙安全设置BUG解决。
* Gitea优化。
2022-11-29 10:42:35 +08:00
ab763f444b up 2022-11-29 10:19:56 +08:00
c0738ff1bd Update config_api.py 2022-11-29 03:06:03 +08:00
82dd2553e6 网站统计记录POST请求原文优化 2022-11-29 02:58:52 +08:00
ae371be91a Update install.sh 2022-11-29 02:47:09 +08:00
48e1ecaec6 up 2022-11-28 21:46:56 +08:00
5a21c4dac8 优化下载速度 2022-11-28 21:35:07 +08:00
7e014dfa94 提供面板API接口访问的支持
还有功能要上,肯能会影响使用,,测试使用即可。
2022-11-28 20:14:45 +08:00
93785a2472 Update ioncube.sh 2022-11-28 17:05:51 +08:00
cd0f5fd8a0 Update rocky.sh 2022-11-28 16:05:03 +08:00
d12524debd Update info.json 2022-11-28 11:52:44 +08:00
297fb60fcb Update mw.tpl 2022-11-28 11:50:55 +08:00
d3781edad0 Update close.html 2022-11-28 11:50:51 +08:00
78667460e6 up 2022-11-28 11:50:36 +08:00
decc579c2d up 2022-11-28 10:35:32 +08:00
34a64eafa2 Update install_dev.sh 2022-11-28 02:06:52 +08:00
38b263e689 Update rocky.sh 2022-11-28 02:04:37 +08:00
0ad3e8d42c Update rocky.sh 2022-11-28 02:02:39 +08:00
5243f6f4c3 Update rocky.sh 2022-11-28 01:53:52 +08:00
976c8c3271 Update lib.sh 2022-11-28 01:42:10 +08:00
b627b222bc Update lib.sh 2022-11-28 01:40:40 +08:00
8df8365eaa Update rocky.sh 2022-11-28 01:32:44 +08:00
d735d857a4 Update rocky.sh 2022-11-28 01:22:21 +08:00
211764060f up 2022-11-28 01:21:00 +08:00
b07be2d004 Update lib.sh 2022-11-28 01:17:33 +08:00
c6edd2221c Update backup.py 2022-11-28 00:08:36 +08:00
be8dd153a3 up 2022-11-27 23:31:48 +08:00
e4aef4592e Update index.py 2022-11-27 22:34:41 +08:00
4f5b25a680 Update index.py 2022-11-27 22:12:37 +08:00
abc4486311 up 2022-11-27 21:51:32 +08:00
baeb788148 up 2022-11-27 20:46:31 +08:00
e30dcf1fbe 修改优惠码 2022-11-27 14:12:52 +08:00
e7347c4a4c Update index.py 2022-11-27 11:20:41 +08:00
044cad1e64 API接口 后台ui 完成。 功能50% 2022-11-27 00:28:09 +08:00
c0d0efb756 up 2022-11-26 16:23:58 +08:00
49d1579782 Update index.py 2022-11-26 13:20:24 +08:00
b6f7ec11c2 Update install.sh 2022-11-25 23:52:09 +08:00
0860ffc713 Update install.sh 2022-11-25 23:48:12 +08:00
cd3f7603e8 Update install.sh 2022-11-25 23:47:15 +08:00
bc0e7764b2 Update install.sh 2022-11-25 23:45:19 +08:00
cfe185b105 Update gitea.service.tpl 2022-11-25 23:24:28 +08:00
3094a0af32 Update index.py 2022-11-25 16:47:44 +08:00
7f010caa6e Update index.py 2022-11-25 16:46:25 +08:00
2b6d287cf1 Update index.py 2022-11-25 16:43:13 +08:00
e525323a7d Update index.py 2022-11-25 16:38:11 +08:00
69670aa1f6 Update index.py 2022-11-25 16:26:13 +08:00
d741677b66 Update index.py 2022-11-25 16:21:22 +08:00
7fd4ea28c1 Update .gitignore 2022-11-25 13:27:21 +08:00
41294a23a2 Update .gitignore 2022-11-25 12:10:39 +08:00
86edf89474 Update .gitignore 2022-11-25 09:25:15 +08:00
e2f4043569 Create fastdfs.conf 2022-11-24 19:10:33 +08:00
6ebcb8e005 up 2022-11-24 18:21:25 +08:00
088b7425d7 Update backup.py 2022-11-23 19:56:41 +08:00
f854eed924 Update config.js 2022-11-23 19:42:56 +08:00
Mr Chen
ba706e070e Merge pull request #269 from midoks/dev
ipv6识别启动优化
2022-11-23 11:50:23 +08:00
2cdaa36744 Update mw.tpl 2022-11-23 11:46:26 +08:00
7937189935 up 2022-11-23 02:38:03 +08:00
1b7f1e2f13 Update info.json 2022-11-23 02:29:19 +08:00
a88483e2ba Update .gitignore 2022-11-22 20:15:18 +08:00
Mr Chen
b76fad0b5c Merge pull request #267 from midoks/dev
0.11.0
2022-11-22 18:11:29 +08:00
f357dfbd1a 0.11.0 发布 2022-11-22 18:09:38 +08:00
ea56cd93c2 mysql导入优化 2022-11-22 15:17:35 +08:00
cfd06d7721 Update index.py 2022-11-22 15:12:16 +08:00
e3f5ddccef Update index.py 2022-11-22 15:10:33 +08:00
cca3a5a899 up 2022-11-22 15:08:03 +08:00
908a1f660a up 2022-11-22 12:56:33 +08:00
dfc3030900 Update index.py 2022-11-22 12:04:46 +08:00
0ab8800813 Update index.py 2022-11-22 11:39:00 +08:00
1d66f9c355 Update pg.py 2022-11-22 11:33:15 +08:00
84a8e755a8 up 2022-11-22 11:31:58 +08:00
f17d4c5bef Update index.py 2022-11-22 11:28:28 +08:00
704960f7cb up 2022-11-22 11:17:58 +08:00
38e13d086c Update pg.py 2022-11-22 09:25:15 +08:00
56ff442a8d Update index.py 2022-11-22 01:17:32 +08:00
6cddfa4010 Update mw.tpl 2022-11-22 01:05:20 +08:00
2f4eb172a3 Update mw.tpl 2022-11-22 01:05:01 +08:00
6b282ce287 ip 2022-11-22 01:03:20 +08:00
a597d95940 Update index.py 2022-11-22 00:37:28 +08:00
1c471abd09 Update index.py 2022-11-22 00:35:27 +08:00
495cdfeb7c up 2022-11-22 00:27:37 +08:00
798c7888b6 Update install.sh 2022-11-22 00:09:41 +08:00
efc6a3dd83 Update index.py 2022-11-21 22:57:40 +08:00
724ccf507c Update index.py 2022-11-21 22:50:10 +08:00
cef92e76a6 Update soft.js 2022-11-21 22:29:43 +08:00
3f5c01ac85 Update install.sh 2022-11-21 22:08:12 +08:00
3dec4cd54d Update soft.js 2022-11-21 22:02:49 +08:00
2a0dc74d3a Update soft.js 2022-11-21 21:53:30 +08:00
4f514b09c5 Update files_api.py 2022-11-21 21:19:05 +08:00
5e1fe6cff8 Update files_api.py 2022-11-21 21:15:10 +08:00
4e59c6fb5c up 2022-11-21 20:06:01 +08:00
248cb43c61 up 2022-11-21 19:58:47 +08:00
23cb934e0c Update crontab.js 2022-11-21 19:37:31 +08:00
36b837bb29 Update install.sh 2022-11-21 18:13:36 +08:00
478a3eb7f2 up 2022-11-21 15:22:03 +08:00
d08c5bd511 Update index.py 2022-11-21 15:13:38 +08:00
fd2f838712 up 2022-11-21 14:55:22 +08:00
5bd57b3c8b Update openssl.sh 2022-11-21 11:52:13 +08:00
bfe6429bc2 up 2022-11-21 11:16:47 +08:00
2979def4dc up 2022-11-21 10:42:36 +08:00
1e603d27d2 Update index.py 2022-11-21 10:40:15 +08:00
f09cdcc83a Update index.py 2022-11-21 10:18:21 +08:00
b46b3346d1 Update install.sh 2022-11-21 10:01:49 +08:00
b18c78b38a ip 2022-11-21 09:57:48 +08:00
ac5a86b14e Update openssl.sh 2022-11-21 09:49:52 +08:00
af9ce2372f Update phplib.conf 2022-11-21 09:01:18 +08:00
8bec7ccf84 up 2022-11-21 01:33:50 +08:00
3256e8dc95 up 2022-11-21 00:46:32 +08:00
6e4f671628 up 2022-11-20 20:07:50 +08:00
a646cbacb5 Update firewall_api.py 2022-11-20 20:05:46 +08:00
11a4d3acf8 Update firewall_api.py 2022-11-20 20:02:39 +08:00
1e324aa695 Update firewall_api.py 2022-11-20 19:54:45 +08:00
48b57108d7 Update firewall_api.py 2022-11-20 19:52:32 +08:00
0543c0847f Update firewall_api.py 2022-11-20 19:51:15 +08:00
c47758a977 Update firewall_api.py 2022-11-20 19:48:39 +08:00
4010eaceb0 Update firewall_api.py 2022-11-20 19:48:07 +08:00
b988e09d33 Update firewall.js 2022-11-20 19:32:09 +08:00
1bfa8e0ac0 Update firewall_api.py 2022-11-20 19:27:28 +08:00
d442324466 Update firewall_api.py 2022-11-20 19:16:32 +08:00
e5ae0ecc7c Update firewall_api.py 2022-11-20 19:04:16 +08:00
642bb61a25 Update firewall_api.py 2022-11-20 19:01:07 +08:00
b8de9e3d01 up 2022-11-20 19:00:28 +08:00
4cd456a76c Update firewall_api.py 2022-11-20 17:37:46 +08:00
36952614d4 Update firewall_api.py 2022-11-20 17:26:27 +08:00
0cb03f92a5 Update tools.py 2022-11-20 17:18:07 +08:00
453c17d248 Update firewall_api.py 2022-11-20 17:17:27 +08:00
46ec61d915 Update firewall_api.py 2022-11-20 17:14:43 +08:00
7577776214 up 2022-11-20 16:54:19 +08:00
376ad46fb9 Update tools.py 2022-11-20 15:06:01 +08:00
11c40cf490 Update tools.py 2022-11-20 15:04:45 +08:00
9fd85009ae Update files.js 2022-11-20 14:05:18 +08:00
f456ae2a14 Update files.js 2022-11-20 14:04:13 +08:00
578fa62c84 up 2022-11-20 13:25:42 +08:00
6ef897addd Update install_dev.sh 2022-11-20 13:22:35 +08:00
690d30b73c Update common.py 2022-11-20 12:07:51 +08:00
bdc1fb75b4 Update common.py 2022-11-20 12:06:51 +08:00
440fa1c535 up 2022-11-20 12:06:24 +08:00
7fd59222a9 up 2022-11-20 11:41:41 +08:00
690d959898 Update files.js 2022-11-20 11:17:05 +08:00
93cbbd6e80 Update files.js 2022-11-20 11:15:42 +08:00
4f6991aefc up 2022-11-20 11:12:21 +08:00
6f2012eb7b Update config_api.py 2022-11-20 00:32:31 +08:00
bb8e43610e Update phplib.conf 2022-11-20 00:07:51 +08:00
7ad77f8338 Update sg11.sh 2022-11-20 00:04:42 +08:00
c117d8e253 Update sg11.sh 2022-11-19 23:32:42 +08:00
d754f6f0cd Update sg11.sh 2022-11-19 23:30:01 +08:00
00f421a56a Update sg11.sh 2022-11-19 23:22:22 +08:00
b74902c1b6 Update sg11.sh 2022-11-19 23:20:06 +08:00
452210fdb2 Update sg11.sh 2022-11-19 23:19:33 +08:00
b39e2e2a8c Update sg11.sh 2022-11-19 23:19:09 +08:00
b61e08b2d9 Update sg11.sh 2022-11-19 23:02:16 +08:00
2d85633d86 Update sg11.sh 2022-11-19 22:18:46 +08:00
747c2a92ef Update config_api.py 2022-11-19 22:12:09 +08:00
bf39b04622 Update config_api.py 2022-11-19 22:10:10 +08:00
d6856498f8 Update install_dev.sh 2022-11-19 22:05:45 +08:00
99f7cf9181 basic auth test 2022-11-19 22:03:55 +08:00
d5977fd9b9 up 2022-11-19 21:40:57 +08:00
d8fd671eee Update index.js 2022-11-19 18:07:11 +08:00
abd8fecbf2 up 2022-11-19 17:42:59 +08:00
60b25cd35b Update index.js 2022-11-19 17:16:59 +08:00
240d915913 up 2022-11-19 17:06:54 +08:00
f13290c7e8 Update plugins_api.py 2022-11-19 17:01:09 +08:00
f6136932f4 Update tools.py 2022-11-19 16:41:19 +08:00
6df4bbdb68 up 2022-11-19 12:33:42 +08:00
dfad621845 部分配置修改 2022-11-19 12:20:01 +08:00
b677b1a73b Update cert_api.py 2022-11-19 00:53:10 +08:00
39c350942e 初始安装提示 2022-11-19 00:46:08 +08:00
631475bd43 up 2022-11-18 23:15:28 +08:00
1f9e273ee0 Update mw.tpl 2022-11-18 21:40:06 +08:00
66eb3b8825 Update cert_api.py 2022-11-18 21:23:26 +08:00
29540da79c Update mw.tpl 2022-11-18 21:15:26 +08:00
864c77359f Update cert_api.py 2022-11-18 11:45:39 +08:00
1a0a02e1a6 Update cert_api.py 2022-11-18 11:14:42 +08:00
61b3223bb4 Update site_api.py 2022-11-18 11:10:00 +08:00
4b794bed26 Update cert_api.py 2022-11-18 11:07:42 +08:00
96e903596a Update cert_api.py 2022-11-18 10:53:56 +08:00
eb33f376c7 Update cert_api.py 2022-11-18 10:44:22 +08:00
724c3ae02a up 2022-11-18 10:34:18 +08:00
bb6f7f4e3a up 2022-11-18 10:29:25 +08:00
91e7f9917b up 2022-11-18 10:27:16 +08:00
4ea0dfe063 Update site_api.py 2022-11-17 21:22:28 +08:00
ec5266f750 续签测试 2022-11-17 21:18:34 +08:00
f152184808 Update requirements.txt 2022-11-17 19:48:49 +08:00
1ca051a496 Update requirements.txt 2022-11-17 19:47:57 +08:00
70a5ca1048 Update requirements.txt 2022-11-17 19:46:21 +08:00
c853cc66ad Update requirements.txt 2022-11-17 19:42:43 +08:00
58d2881c8e Update requirements.txt 2022-11-17 19:39:59 +08:00
a0cdb4c8c2 Update requirements.txt 2022-11-17 19:37:57 +08:00
3e3af5f11a Update requirements.txt 2022-11-17 19:34:32 +08:00
b2b36208a2 Update requirements.txt 2022-11-17 19:32:13 +08:00
0fcdd3b841 up 2022-11-17 19:18:00 +08:00
3c0844d26c Update requirements.txt 2022-11-17 18:06:46 +08:00
40d4a3e963 Update site_api.py 2022-11-17 17:53:20 +08:00
a61179164c Update cert_api.py 2022-11-17 17:37:09 +08:00
c21c8d9322 Update site_api.py 2022-11-17 17:34:13 +08:00
3adb59188a Update site_api.py 2022-11-17 17:32:02 +08:00
806e554607 Update site_api.py 2022-11-17 17:29:41 +08:00
1a0a1e5ead Update site_api.py 2022-11-17 17:27:07 +08:00
7f6ba0cbed Update site_api.py 2022-11-17 17:22:31 +08:00
f4ac70a415 Update site_api.py 2022-11-17 17:20:38 +08:00
7203c31f9b Update site_api.py 2022-11-17 17:18:05 +08:00
e6ea4ff580 Update site_api.py 2022-11-17 17:13:02 +08:00
dc4a4688c4 Update site_api.py 2022-11-17 17:11:27 +08:00
d9c547cce5 Update site_api.py 2022-11-17 17:09:13 +08:00
0517d606c8 Update site_api.py 2022-11-17 17:07:12 +08:00
7fc4a7f899 Update site_api.py 2022-11-17 17:04:53 +08:00
9a0739b9d2 Update site_api.py 2022-11-17 17:04:40 +08:00
1f16cae6c5 Update cert_api.py 2022-11-17 17:02:33 +08:00
adb8789a4f Update site_api.py 2022-11-17 17:00:27 +08:00
0cb320cb23 Update cert_api.py 2022-11-17 16:56:27 +08:00
a5861ce04e up 2022-11-17 16:48:29 +08:00
d4c9e9cae1 Update site.js 2022-11-17 14:36:01 +08:00
4713f13c10 up 2022-11-17 14:32:53 +08:00
595b6f9d28 Update site_api.py 2022-11-17 14:27:36 +08:00
dbca385d90 Update site_api.py 2022-11-17 14:27:11 +08:00
5c56dc7b24 Update requirements.txt 2022-11-17 14:14:20 +08:00
524db0d9f5 up 2022-11-17 13:54:14 +08:00
b1dbdc3000 Update site.js 2022-11-17 11:41:11 +08:00
0f0d54dd9e Update site.js 2022-11-17 11:38:49 +08:00
7c1c2fc4c2 Update site_api.py 2022-11-17 11:35:34 +08:00
fcb8db8e75 Update site_api.py 2022-11-17 11:31:43 +08:00
024d0a3a52 Update mw.py 2022-11-17 11:30:31 +08:00
c1d3e09c67 up 2022-11-17 11:23:57 +08:00
9d556f9991 Update site_api.py 2022-11-17 01:43:10 +08:00
cc744c4ccb Update site_api.py 2022-11-17 01:34:53 +08:00
6ad12f08cf Update site_api.py 2022-11-17 01:32:37 +08:00
aef9c526a6 Update config_api.py 2022-11-17 01:27:10 +08:00
669eb83893 up 2022-11-17 01:25:38 +08:00
0a8831e766 Update site_api.py 2022-11-17 01:15:17 +08:00
f094179c70 Update site.js 2022-11-17 00:35:53 +08:00
0b74018e61 Update site_api.py 2022-11-17 00:30:45 +08:00
3fa7332646 Update site_api.py 2022-11-17 00:28:10 +08:00
5d2580ae01 Update site.js 2022-11-17 00:25:15 +08:00
2b02663ea4 up 2022-11-17 00:12:08 +08:00
db29c0162f Update site.js 2022-11-16 23:51:57 +08:00
07f6636a54 up 2022-11-16 23:38:45 +08:00
b06afe619a Update my.cnf 2022-11-16 20:58:03 +08:00
7aa69aab0d Update install.sh 2022-11-16 20:47:52 +08:00
16bbe53c6e Update install.sh 2022-11-16 20:44:00 +08:00
cb3226c184 up 2022-11-16 20:37:42 +08:00
66187beabc Update install.sh 2022-11-16 20:20:41 +08:00
82fd78080c up 2022-11-16 20:13:50 +08:00
a8cf8975d4 up 2022-11-16 19:58:34 +08:00
b09c83b502 up 2022-11-16 19:36:15 +08:00
48be4ac07c Update install.sh 2022-11-16 19:31:11 +08:00
d2ebf6d038 Update site_api.py 2022-11-16 18:22:46 +08:00
6801ea2eea Update site_api.py 2022-11-16 18:21:41 +08:00
9a9d97d482 Update site_api.py 2022-11-16 18:19:46 +08:00
25083e7dd2 Update site_api.py 2022-11-16 18:00:00 +08:00
519dc4f491 up 2022-11-16 17:57:43 +08:00
bfabe34f9c Update site.js 2022-11-16 17:27:41 +08:00
23cf28133a Update site.js 2022-11-16 17:25:22 +08:00
b231c321e3 Update site.js 2022-11-16 17:17:33 +08:00
f71c43d057 Update site_api.py 2022-11-16 16:42:54 +08:00
0ca010245d Update config_api.py 2022-11-16 16:25:33 +08:00
d1cef12341 up 2022-11-16 16:02:54 +08:00
da31ad7dbe up 2022-11-16 15:59:33 +08:00
ec16720858 Update cert_api.py 2022-11-16 15:01:03 +08:00
217b42eae3 自动创建Lets续期计划任务 2022-11-16 14:50:49 +08:00
e33bf94a17 Update site.js 2022-11-16 01:58:07 +08:00
6d112e9d3d Update site_api.py 2022-11-16 01:54:17 +08:00
605a6f1245 Update site_api.py 2022-11-16 01:52:21 +08:00
eb1213d55c Update site_api.py 2022-11-16 01:48:08 +08:00
43ee847814 Update site.js 2022-11-16 01:36:24 +08:00
03bfc3a637 Update site_api.py 2022-11-16 01:31:01 +08:00
a229b322d2 Update site.js 2022-11-16 01:29:01 +08:00
15b3d44a1d Update site.js 2022-11-16 01:23:10 +08:00
520da4fabc Update site_api.py 2022-11-16 01:13:39 +08:00
1458d67d93 Update public.js 2022-11-16 01:09:33 +08:00
85077a5d2f Update site_api.py 2022-11-16 00:55:52 +08:00
1004056347 up 2022-11-16 00:51:02 +08:00
6efffdfa4f Update site_api.py 2022-11-16 00:47:04 +08:00
26f4d0b37b Update cert_api.py 2022-11-16 00:40:08 +08:00
5f8b08f100 up 2022-11-16 00:36:54 +08:00
fd3fc13710 Update cert_api.py 2022-11-15 19:33:17 +08:00
d55b370bb0 up 2022-11-15 18:34:19 +08:00
3424135409 Update site_api.py 2022-11-15 17:24:24 +08:00
0057c495da Update site_api.py 2022-11-15 17:17:13 +08:00
4073d863d0 Update site_api.py 2022-11-15 17:13:04 +08:00
07a8096a15 Update site_api.py 2022-11-15 17:09:15 +08:00
8fd7c9eda6 Update cert_api.py 2022-11-15 16:57:11 +08:00
fd1260c71f Update cert_api.py 2022-11-15 16:53:24 +08:00
e364d2e972 Update cert_api.py 2022-11-15 16:51:21 +08:00
ca10fbc3b5 Update cert_api.py 2022-11-15 16:49:49 +08:00
5a660d72b7 Update site_api.py 2022-11-15 16:42:00 +08:00
b5a710791d Update site_api.py 2022-11-15 16:41:37 +08:00
74357fa5ee Update cert_api.py 2022-11-15 16:04:13 +08:00
c5193178a3 Update setting.py 2022-11-15 15:47:19 +08:00
49cdc7e73e Update cert_api.py 2022-11-15 15:36:04 +08:00
08ac9abb65 Update cert_api.py 2022-11-15 15:35:44 +08:00
af7ffe2b26 Update cert_api.py 2022-11-15 15:33:46 +08:00
95f7dc0d3a up 2022-11-15 15:23:03 +08:00
d749c80884 up 2022-11-15 12:53:58 +08:00
8a36c2ee15 up 2022-11-14 22:41:26 +08:00
f9330720d6 Update cert_api.py 2022-11-14 22:30:48 +08:00
e1b68eed0a Update site_api.py 2022-11-14 22:10:58 +08:00
cf3e530fad Update site_api.py 2022-11-14 22:08:28 +08:00
282c1a3e70 Update site_api.py 2022-11-14 21:47:30 +08:00
0ab9b25483 up 2022-11-14 21:46:14 +08:00
6d98a704a4 Update cert_api.py 2022-11-14 21:42:12 +08:00
99afb3f5e1 up 2022-11-14 21:39:46 +08:00
081998f0de Update setting.py 2022-11-14 21:21:54 +08:00
4bee6c54be Update site.js 2022-11-14 21:12:48 +08:00
5db32760cf Update site.js 2022-11-14 21:10:45 +08:00
42e5eff80f Update site_api.py 2022-11-14 21:10:29 +08:00
94f00fe948 Update site_api.py 2022-11-14 20:48:16 +08:00
1c31f2b481 Update cert_request.py 2022-11-14 20:44:04 +08:00
ff56bedbc6 Update cert_request.py 2022-11-14 20:24:26 +08:00
68798453c4 Update cert_request.py 2022-11-14 20:23:10 +08:00
280b3de46c Update cert_request.py 2022-11-14 20:21:38 +08:00
101806826c Update cert_request.py 2022-11-14 20:19:33 +08:00
adb10c9f3f Update cert_request.py 2022-11-14 20:17:30 +08:00
5c547b60f6 Update cert_request.py 2022-11-14 20:15:56 +08:00
2431f22420 Update cert_request.py 2022-11-14 20:00:42 +08:00
47009b42af Update mw.tpl 2022-11-14 19:56:31 +08:00
b8afbc65fb Update cert_request.py 2022-11-14 19:49:09 +08:00
5f9a3dcf21 Update setting.py 2022-11-14 19:30:48 +08:00
0082b1fb76 Update mw.tpl 2022-11-14 19:20:11 +08:00
4848f9b8f6 Update cert_request.py 2022-11-14 19:14:33 +08:00
1eb7f71567 Update cert_request.py 2022-11-14 18:33:49 +08:00
041c62edac Update site.js 2022-11-14 18:29:02 +08:00
c351f5e896 Update mw.tpl 2022-11-14 18:12:09 +08:00
cf24cb38ff Update public.js 2022-11-14 18:09:39 +08:00
e85c88d9fd Update files_api.py 2022-11-14 18:07:25 +08:00
68c1acfb3e Update files_api.py 2022-11-14 18:07:09 +08:00
6bbc3ea73b Update files_api.py 2022-11-14 18:06:52 +08:00
d2ca9b57b9 Update cert_request.py 2022-11-14 18:00:35 +08:00
3a70c92c2b Update cert_request.py 2022-11-14 17:57:09 +08:00
015869494c Update public.js 2022-11-14 17:48:30 +08:00
f500d882cc Update public.js 2022-11-14 17:48:15 +08:00
3cf1204dde Update mw.tpl 2022-11-14 17:26:08 +08:00
6d8e5403c8 up 2022-11-14 17:25:21 +08:00
ece7d43950 Update cert_request.py 2022-11-14 17:20:44 +08:00
ecd72b98db Update cert_request.py 2022-11-14 17:14:38 +08:00
e13e2c172a Update requirements.txt 2022-11-14 17:01:07 +08:00
a8fa93574a Update cert_request.py 2022-11-14 16:59:57 +08:00
54cd9fa007 Update cert_request.py 2022-11-14 16:48:52 +08:00
d5615ae88f Update cert_request.py 2022-11-14 16:47:26 +08:00
7ca758b2bb Update cert_request.py 2022-11-14 16:43:36 +08:00
9be9c2a4f3 up 2022-11-14 16:36:39 +08:00
5c0717d9c3 Update cert_request.py 2022-11-14 16:28:27 +08:00
dd2bf1cb52 up 2022-11-14 16:26:37 +08:00
4dbadb2d5f Update site.js 2022-11-14 15:54:08 +08:00
9bc68eccf5 Update site.js 2022-11-14 15:52:23 +08:00
6272c1a879 Update site_api.py 2022-11-14 15:47:16 +08:00
49ebca2ef2 Update public.js 2022-11-14 15:45:50 +08:00
4bd6b0d770 Update public.js 2022-11-14 15:40:09 +08:00
fdf140ea7d Update site_api.py 2022-11-14 15:36:21 +08:00
2bac521c56 Update cert_request.py 2022-11-14 15:28:47 +08:00
2d067b2df6 up 2022-11-14 15:21:44 +08:00
80560f3763 up 2022-11-14 13:35:22 +08:00
efb148db2e Update site.js 2022-11-14 11:03:14 +08:00
7d244e0acc Update site.js 2022-11-14 01:06:02 +08:00
a9a0e61729 Update site_api.py 2022-11-14 01:04:08 +08:00
445a1f3c43 Update site_api.py 2022-11-14 01:00:58 +08:00
8f50e0365b Update site_api.py 2022-11-14 01:00:48 +08:00
af74b1e5f7 Update site.js 2022-11-14 00:57:24 +08:00
5ebb1c3f9b up 2022-11-14 00:54:15 +08:00
38f4b2c2b5 up 2022-11-14 00:13:57 +08:00
ed4c62d620 up 2022-11-13 21:54:23 +08:00
be02344c4e Update site_api.py 2022-11-13 21:29:34 +08:00
9234d452b5 Update mw.py 2022-11-13 21:28:28 +08:00
8142722652 Update site_api.py 2022-11-13 21:26:01 +08:00
0decd938e4 Update site_api.py 2022-11-13 21:12:46 +08:00
e55163f244 Update site_api.py 2022-11-13 21:11:35 +08:00
d103fb1879 Update site_api.py 2022-11-13 21:10:13 +08:00
c37f1021d9 Update site_api.py 2022-11-13 21:09:00 +08:00
080be8368f Update site_api.py 2022-11-13 21:04:45 +08:00
f7d565f33e Update site_api.py 2022-11-13 21:04:12 +08:00
2de31b28b2 Update site_api.py 2022-11-13 20:58:13 +08:00
0f72c80abf Update public.js 2022-11-13 20:55:03 +08:00
9091a26778 Update site_api.py 2022-11-13 20:42:26 +08:00
a99920a651 UP 2022-11-13 20:32:43 +08:00
6b89763075 Update site.js 2022-11-13 16:30:59 +08:00
715441b972 Update site_api.py 2022-11-13 16:18:18 +08:00
102f0cadff Update mw.tpl 2022-11-13 16:14:39 +08:00
4a2cb35865 Update site.js 2022-11-13 16:12:48 +08:00
81929adba5 up 2022-11-13 16:10:44 +08:00
ef13161bc7 Update debian.sh 2022-11-13 16:03:16 +08:00
93a323add5 Update site.js 2022-11-13 15:57:59 +08:00
3573517f7c Update mw.tpl 2022-11-13 15:55:28 +08:00
e337f0ffd7 up 2022-11-13 15:54:12 +08:00
0a84cbec9c Update site.js 2022-11-13 15:43:26 +08:00
fabc73be28 Update requirements.txt 2022-11-13 15:38:06 +08:00
b7cc254407 Update cert_request.py 2022-11-13 15:35:45 +08:00
4f59d07416 up 2022-11-13 15:30:01 +08:00
9abe3ec166 up 2022-11-13 10:09:32 +08:00
b2546d71a5 up 2022-11-13 09:43:33 +08:00
da56e5caff Update site_api.py 2022-11-13 01:04:37 +08:00
04b35c832a Update site_api.py 2022-11-13 01:01:52 +08:00
06780dadb2 up 2022-11-13 00:39:50 +08:00
bfba24c66d Update cert_request.py 2022-11-12 22:52:08 +08:00
8a518e70d5 Update cert_request.py 2022-11-12 22:43:52 +08:00
050c5efe4f Update cert_request.py 2022-11-12 22:37:56 +08:00
b0534f57c8 Update cert_request.py 2022-11-12 22:35:56 +08:00
b9b4c055dd Update cert_request.py 2022-11-12 22:27:42 +08:00
6a37640efb Update mw.tpl 2022-11-12 22:24:55 +08:00
4ee232a689 Update cert_request.py 2022-11-12 22:12:29 +08:00
66e5e1596d Update cert_request.py 2022-11-12 22:11:34 +08:00
0d48f3973a Update cert_request.py 2022-11-12 17:31:05 +08:00
453528e8e7 up 2022-11-12 16:11:06 +08:00
71890ca8de Update cert_request.py 2022-11-12 12:05:27 +08:00
289bca248d Update cert_request.py 2022-11-12 12:00:52 +08:00
3f22209e62 Update index.py 2022-11-12 01:10:40 +08:00
3893e24619 Update cert_request.py 2022-11-11 23:46:24 +08:00
cacbca5053 Update cert_request.py 2022-11-11 23:40:48 +08:00
c17f5b35d7 Update cert_request.py 2022-11-11 23:35:48 +08:00
d68f61de30 Update cert_request.py 2022-11-11 23:32:21 +08:00
7caef5e104 Update cert_request.py 2022-11-11 19:35:31 +08:00
9de12c1b01 Update mw.py 2022-11-11 19:32:48 +08:00
50917e4eef Update cert_request.py 2022-11-11 19:29:51 +08:00
18b9a799b3 Update cert_request.py 2022-11-11 19:28:23 +08:00
5fbae06c00 Update cert_request.py 2022-11-11 19:23:18 +08:00
a5775b16b5 Update cert_request.py 2022-11-11 19:21:14 +08:00
d377286de3 up 2022-11-11 19:06:32 +08:00
c35ee90068 Update path.html 2022-11-11 18:54:46 +08:00
d9042d7c37 up 2022-11-11 18:52:00 +08:00
6975e9adb7 Update cert_request.py 2022-11-11 18:45:23 +08:00
3caebe4399 Merge branch 'dev' of github.com:midoks/mdserver-web into dev 2022-11-11 18:44:47 +08:00
27c5b9044b Update cert_request.py 2022-11-11 18:44:41 +08:00
Mr Chen
8f85955717 Merge pull request #259 from hang666/dev
修正拼写错误
2022-11-11 18:44:03 +08:00
87b0d087d4 Create cert_request.py 2022-11-11 18:40:57 +08:00
e25eed0f97 up 2022-11-11 18:34:42 +08:00
hang666
786df5911e Update site_api.py
函数名拼写错误 0.0
2022-11-11 18:28:14 +08:00
hang666
a6c5c843db Merge pull request #1 from midoks/dev
Dev
2022-11-11 18:19:23 +08:00
3f993ffa61 Delete cert_request.py 2022-11-11 13:04:43 +08:00
eae5729e35 up 2022-11-11 13:04:35 +08:00
38dce0d70a Update info.json 2022-11-11 13:02:59 +08:00
f6178c3ac2 Update install_dev.sh 2022-11-11 09:32:19 +08:00
798f413d6e Update install.sh 2022-11-11 03:31:12 +08:00
5a7b2512ac Update install_dev.sh 2022-11-11 03:30:25 +08:00
c177b6f7b7 Update ubuntu.sh 2022-11-11 03:21:16 +08:00
84f2c20f2a 实体字符编码 2022-11-11 02:38:31 +08:00
ab338dc8a7 Update soft.js 2022-11-11 00:49:18 +08:00
e00fe09851 up 2022-11-10 23:14:47 +08:00
20416e46b6 up 2022-11-10 22:51:16 +08:00
1dbf9a21f9 优化安装更新 2022-11-10 22:49:24 +08:00
37e852b411 Update common.py 2022-11-10 22:26:45 +08:00
deb44571ef Update mw.service.tpl 2022-11-10 21:22:21 +08:00
1dd39b569e Update mw.service.tpl 2022-11-10 21:21:55 +08:00
0531c484ab up 2022-11-10 21:20:12 +08:00
2dd6a25890 Update mw-task.service.tpl 2022-11-10 21:12:22 +08:00
d1a55ffa52 Update common.py 2022-11-10 21:03:43 +08:00
467692f586 Update common.py 2022-11-10 21:02:06 +08:00
284552c02d Update mw.py 2022-11-10 20:58:16 +08:00
6c4f69e2c7 Update common.py 2022-11-10 20:50:01 +08:00
22af57840e Update mw.py 2022-11-10 20:49:31 +08:00
212e537334 Update mw.py 2022-11-10 20:45:23 +08:00
49ae49b501 Update common.py 2022-11-10 20:40:56 +08:00
48777a5924 Create cert_request.py 2022-11-10 20:33:53 +08:00
eafe6b9762 Update mw.py 2022-11-10 20:32:52 +08:00
3eedc949a1 up 2022-11-10 20:32:17 +08:00
4e53ce3a1c up 2022-11-09 11:14:45 +08:00
Mr Chen
994d2feeed Merge pull request #258 from midoks/dev
添加 mysql-yum 插件
2022-11-08 22:19:09 +08:00
4b34049c5f Update index.py 2022-11-08 22:17:31 +08:00
dad3c295d4 Update index.py 2022-11-08 22:15:20 +08:00
b91d680d25 Update index.py 2022-11-08 22:07:23 +08:00
942ed2b79f Update index.py 2022-11-08 22:07:08 +08:00
0dd72160f5 Update index.py 2022-11-08 20:47:00 +08:00
7fd4e7177b Update install.sh 2022-11-08 19:25:09 +08:00
6fe9302108 Update mysql5.7.service.tpl 2022-11-08 19:16:47 +08:00
50020056ca up 2022-11-08 19:08:56 +08:00
aaf5ed2cf4 up 2022-11-08 19:02:23 +08:00
c629a7e682 up 2022-11-08 18:51:41 +08:00
13d5d1f2be Update install.sh 2022-11-08 18:11:43 +08:00
aa7ce151a9 up 2022-11-08 18:03:34 +08:00
2603d1673c Update index.py 2022-11-08 17:55:25 +08:00
2eab126986 update 2022-11-08 17:52:49 +08:00
fc58c5265c Update index.py 2022-11-08 17:46:14 +08:00
d9cfc41574 Update index.html 2022-11-08 17:23:48 +08:00
e009615454 up 2022-11-08 17:10:38 +08:00
f435919179 up 2022-11-08 17:01:11 +08:00
e9a4aeacc9 Update backup.py 2022-11-08 16:36:48 +08:00
3771e0f429 Update backup.py 2022-11-08 16:35:58 +08:00
4bed9cb7b6 Update backup.py 2022-11-08 16:34:44 +08:00
759e8dce7d Update backup.py 2022-11-08 16:32:15 +08:00
20ea48c0f5 up 2022-11-08 16:07:08 +08:00
99f2fad1f3 Update index.py 2022-11-08 15:55:37 +08:00
4cb20ad907 Update install.sh 2022-11-08 15:28:57 +08:00
5e1f316898 Update install.sh 2022-11-08 15:17:23 +08:00
c99cb8c859 up 2022-11-08 15:13:31 +08:00
89f2746da0 u 2022-11-08 15:06:12 +08:00
eb52435ce7 Update backup.py 2022-11-08 14:51:00 +08:00
099971f768 Merge branch 'dev' of github.com:midoks/mdserver-web into dev 2022-11-08 14:40:13 +08:00
2f8d808c8f Merge branch 'master' into dev 2022-11-08 14:40:03 +08:00
Mr Chen
faa8c05690 Merge pull request #257 from hang666/dev
修正获取证书内反向代理设置检测
2022-11-08 14:39:37 +08:00
b3dc35abca Update index.py 2022-11-08 14:35:42 +08:00
3880d443b4 Update index.py 2022-11-08 14:26:29 +08:00
671b174034 update 2022-11-08 14:19:11 +08:00
hang666
667b3c9724 修正获取证书反向代理设置检测
之前判断PROXY-END在关闭反向代理时仍会检测到,必须删除规则。
修改后正常
2022-11-08 14:16:51 +08:00
20e7c7ae9a Update index.py 2022-11-08 14:16:19 +08:00
1a9dfb8302 Update index.py 2022-11-08 14:12:54 +08:00
5bcff64aa6 Update index.py 2022-11-08 14:09:16 +08:00
924c1aa077 Update my8.0.cnf 2022-11-08 14:07:24 +08:00
384bef1dce Update mysql.service.tpl 2022-11-08 14:03:54 +08:00
dd81275439 up 2022-11-08 14:01:25 +08:00
e033e783ac Update index.py 2022-11-08 13:44:48 +08:00
f965a8760f Update index.py 2022-11-08 13:40:33 +08:00
4ff7d0c02c Update index.py 2022-11-08 13:38:24 +08:00
45e797024a Update index.py 2022-11-08 13:30:04 +08:00
b26d8a6224 Update mysql.sql 2022-11-08 13:20:17 +08:00
86e88d88d0 Update mysql.service.tpl 2022-11-08 13:08:07 +08:00
db12d96793 Update index.py 2022-11-08 13:05:16 +08:00
e1e785299d Update files.js 2022-11-08 13:00:11 +08:00
37fd032ed8 Update index.py 2022-11-08 12:51:44 +08:00
85f2eb63da Update mysql-yum.js 2022-11-08 12:39:26 +08:00
b2af6dbce0 Update index.py 2022-11-08 12:38:38 +08:00
25de758943 Update mysql.service.tpl 2022-11-08 12:31:00 +08:00
2b587d952e Update install.sh 2022-11-08 12:00:41 +08:00
4c6dcb7c0a up 2022-11-08 11:29:22 +08:00
f9a3ac5cec Update install.sh 2022-11-08 03:11:25 +08:00
5f40286bff Update install.sh 2022-11-08 02:49:42 +08:00
bcde85d24e Update install.sh 2022-11-08 02:45:13 +08:00
73c8d85f88 Update install.sh 2022-11-08 02:41:08 +08:00
3cfbf554e1 up 2022-11-08 02:26:23 +08:00
5a635fcbba Update install.sh 2022-11-08 02:25:19 +08:00
c573449524 Update install.sh 2022-11-08 02:24:22 +08:00
b0536b37ec Update my8.0.cnf 2022-11-08 02:21:16 +08:00
02f73e6487 Update install.sh 2022-11-08 02:11:44 +08:00
6ca64a07be Update install.sh 2022-11-08 01:14:03 +08:00
9d1e934f9a mysql-ya init 2022-11-08 00:24:15 +08:00
Mr Chen
77e154d567 Merge pull request #256 from midoks/dev
mysql-apt
2022-11-07 23:53:25 +08:00
b2d78d53d1 Update index.py 2022-11-07 23:33:25 +08:00
4ca234b41f Update index.py 2022-11-07 23:11:05 +08:00
309d8291aa Update install.sh 2022-11-07 22:38:05 +08:00
5ddacf9b20 up 2022-11-07 21:50:53 +08:00
d647c124e6 up 2022-11-07 21:43:11 +08:00
9c99a55a4f Update index.py 2022-11-07 20:31:52 +08:00
24a4640940 up 2022-11-07 20:31:18 +08:00
b3f0358814 up 2022-11-07 20:14:40 +08:00
e3fcb14efc up 2022-11-07 19:34:09 +08:00
1f643d0657 Update index.py 2022-11-07 17:56:48 +08:00
d68e505ba2 up 2022-11-07 17:54:16 +08:00
3e593bb652 Update my5.7.cnf 2022-11-07 17:46:42 +08:00
a917598d80 up 2022-11-07 17:38:33 +08:00
49028a1ffd Update my5.7.cnf 2022-11-07 17:21:50 +08:00
c399e73800 Update index.py 2022-11-07 17:13:01 +08:00
b2a18e6816 Update my5.7.cnf 2022-11-07 16:25:29 +08:00
1438715c94 Update my5.7.cnf 2022-11-07 16:03:27 +08:00
4e7165a248 Update my5.7.cnf 2022-11-07 16:00:34 +08:00
35c9ca7e4e Update index.py 2022-11-07 15:52:00 +08:00
985106d3cf Update index.py 2022-11-07 15:46:11 +08:00
b7e90f81e2 Update my5.7.cnf 2022-11-07 15:41:25 +08:00
21e2b2b31b up 2022-11-07 15:40:45 +08:00
79700aa561 Update index.py 2022-11-07 15:30:07 +08:00
598909d6c8 Update install.sh 2022-11-07 14:58:07 +08:00
d36db9d5b7 Update install.sh 2022-11-07 14:56:03 +08:00
77d22c459e Update install.sh 2022-11-07 14:55:29 +08:00
4cdb791ab4 up 2022-11-07 14:46:14 +08:00
e7673bb428 Update index.py 2022-11-07 14:39:27 +08:00
77f98ac663 Update my8.0.cnf 2022-11-07 14:34:05 +08:00
a1831e3cd6 Update index.py 2022-11-07 14:30:55 +08:00
65a364ef33 up 2022-11-07 14:29:46 +08:00
3b9d874678 Update mysql.service.tpl 2022-11-07 14:26:33 +08:00
375e657030 Update mysql.service.tpl 2022-11-07 14:24:29 +08:00
774154784d Update index.py 2022-11-07 14:17:37 +08:00
656c453f4f Update install.sh 2022-11-07 14:16:02 +08:00
e4e41bced3 Update install.sh 2022-11-07 13:59:51 +08:00
e5f63d876b Update install.sh 2022-11-07 13:54:47 +08:00
96f8622ac1 up 2022-11-07 13:39:44 +08:00
166d462224 up 2022-11-07 13:31:47 +08:00
502e5a1877 up 2022-11-07 13:31:27 +08:00
eb8ff69598 update 2022-11-07 13:29:48 +08:00
2c9d9dd19c Update install.sh 2022-11-07 13:28:03 +08:00
f117b2098d Update backup.py 2022-11-07 13:18:14 +08:00
66274be102 up 2022-11-07 13:12:01 +08:00
19b4fe375e Update backup.py 2022-11-07 12:48:07 +08:00
c330a357a2 Update install.sh 2022-11-07 12:47:40 +08:00
ed02d8a10b up 2022-11-07 12:39:27 +08:00
c583f83448 up 2022-11-07 12:26:29 +08:00
4c459c8676 Update backup.py 2022-11-07 12:09:59 +08:00
47bb1a98d4 Update index.py 2022-11-07 12:04:31 +08:00
8e29d117c0 Update index.py 2022-11-07 12:03:26 +08:00
806ac7c032 Update backup.py 2022-11-07 12:00:48 +08:00
07fece751b Update backup.py 2022-11-07 12:00:16 +08:00
ac65efde61 Update backup.py 2022-11-07 12:00:00 +08:00
0b0773851a Update index.py 2022-11-07 11:50:32 +08:00
53e6307693 Update index.py 2022-11-07 11:50:13 +08:00
89540b6256 Update phpmyadmin.js 2022-11-07 11:43:18 +08:00
834b0ea80a Update mysql.js 2022-11-07 11:41:35 +08:00
630fba02be Update mysql-apt.js 2022-11-07 11:39:55 +08:00
77657233c9 Update info.json 2022-11-07 11:33:08 +08:00
26224a37c8 Update index.py 2022-11-07 11:29:39 +08:00
70998c0d04 up 2022-11-07 11:28:08 +08:00
94dce5c01c Update mysql-apt.js 2022-11-07 11:11:49 +08:00
fc344fe89a Update info.json 2022-11-07 11:06:12 +08:00
cba594447a up 2022-11-07 11:02:25 +08:00
8d09ceef27 Update index.py 2022-11-07 10:57:08 +08:00
b32fcd43f6 Update index.py 2022-11-07 10:55:00 +08:00
78f3151c3d Update index.py 2022-11-07 10:52:35 +08:00
31815c489b Update index.py 2022-11-07 10:48:14 +08:00
a7f73e10ae Update index.py 2022-11-07 10:42:24 +08:00
3dccb2620d Update install.sh 2022-11-07 10:33:55 +08:00
248d8ad27e Update index.py 2022-11-07 10:29:37 +08:00
c3be68c3fb Update index.py 2022-11-07 10:29:13 +08:00
d7f8510284 Update index.py 2022-11-07 10:22:31 +08:00
6f30354c38 Update info.json 2022-11-07 10:14:52 +08:00
48b9023e67 Update info.json 2022-11-07 10:14:22 +08:00
7fa7ee6770 Update index.py 2022-11-07 10:13:30 +08:00
d810165ed4 Update my8.0.cnf 2022-11-07 10:11:42 +08:00
3909a584c1 Update index.py 2022-11-07 10:09:19 +08:00
74d0db13d4 up 2022-11-07 10:02:33 +08:00
c78cb88774 up 2022-11-07 09:57:29 +08:00
816cd89dd1 Update index.py 2022-11-07 09:54:49 +08:00
caaa930eaa Update index.py 2022-11-07 09:52:13 +08:00
0622346852 up 2022-11-07 09:50:44 +08:00
18f320bf25 up 2022-11-07 09:45:30 +08:00
309c4cc9f4 Update my8.0.cnf 2022-11-07 09:41:23 +08:00
984615a9f7 Update index.py 2022-11-07 09:38:59 +08:00
b512a7fa85 up 2022-11-07 09:28:53 +08:00
Mr Chen
d72d4c8d99 Merge pull request #255 from midoks/dev
AD
2022-11-07 00:32:47 +08:00
238b46ebfd Update README.md 2022-11-07 00:30:11 +08:00
98773983da up 2022-11-06 21:57:11 +08:00
7c390e4af6 Update install.sh 2022-11-06 21:15:00 +08:00
046f77d6c2 Update info.json 2022-11-06 21:12:51 +08:00
983aecdf9f Update mysql.sql 2022-11-06 21:10:40 +08:00
cc074a7c8f Update mysql-apt.js 2022-11-06 21:09:51 +08:00
076ae674ad Update index.py 2022-11-06 21:04:44 +08:00
f3da1c6ce9 up 2022-11-06 20:59:32 +08:00
f5d2fa8238 Update install.sh 2022-11-06 20:47:40 +08:00
60e9f8e143 再次加入到核心,测试 2022-11-06 20:32:02 +08:00
Mr Chen
aefd77876a Merge pull request #254 from midoks/dev
优化requirements.txt
2022-11-06 17:39:55 +08:00
Mr Chen
25cdacc98f Merge branch 'master' into dev 2022-11-06 17:39:47 +08:00
4393605832 Update requirements.txt 2022-11-06 16:30:07 +08:00
4d88e79202 Update requirements.txt 2022-11-06 16:29:10 +08:00
d9e615d265 Update install.sh 2022-11-06 10:11:08 +08:00
c3b77ee645 再次优化编译安装脚本 2022-11-06 10:10:34 +08:00
891a311be2 Merge branch 'master' into dev 2022-11-06 00:10:52 +08:00
Mr Chen
dd5d070bb8 Merge pull request #253 from midoks/dependabot/pip/urllib3-1.26.5
Bump urllib3 from 1.25.2 to 1.26.5
2022-11-06 00:10:18 +08:00
dependabot[bot]
1574b3a010 Bump urllib3 from 1.25.2 to 1.26.5
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.2 to 1.26.5.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.25.2...1.26.5)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 16:09:19 +00:00
Mr Chen
2d15a3fed5 Merge pull request #252 from midoks/dev
fix requirements.txt
2022-11-06 00:08:20 +08:00
8c11cfb14a Update requirements.txt 2022-11-06 00:07:01 +08:00
a7b9522afa Update webstats_common.lua 2022-11-06 00:02:55 +08:00
Mr Chen
d0e4e5fcae Merge pull request #251 from midoks/dev
网站统计优化
2022-11-05 23:42:56 +08:00
bcbaf1d26d Update requirements.txt 2022-11-05 23:39:30 +08:00
fd6160e30f Update requirements.txt 2022-11-05 23:38:34 +08:00
8bdd24daa1 Update webstats_common.lua 2022-11-05 23:37:16 +08:00
ee93d2fc21 Update webstats_common.lua 2022-11-05 23:34:52 +08:00
Mr Chen
410cb7d277 Merge pull request #250 from midoks/dev
添加临时访问授权功能
2022-11-05 23:04:43 +08:00
140561ba74 Update __init__.py 2022-11-05 23:01:41 +08:00
c6bd1298ea Update __init__.py 2022-11-05 23:00:53 +08:00
8058cb0068 Update __init__.py 2022-11-05 22:58:42 +08:00
16e29821cc Update __init__.py 2022-11-05 22:57:59 +08:00
116e4e0efc Update __init__.py 2022-11-05 22:49:44 +08:00
cd5e6e1ec7 添加临时访问授权功能 2022-11-05 22:41:37 +08:00
4fad0b9270 Update mw.py 2022-11-05 22:18:01 +08:00
67d931b581 Update default.sql 2022-11-05 22:16:43 +08:00
996f13c5f5 Update default.sql 2022-11-05 12:31:30 +08:00
f89afe5a91 Update mw.tpl 2022-11-05 01:01:13 +08:00
f3061fd084 Update setting.py 2022-11-05 00:36:39 +08:00
c72092f5af Update setting.py 2022-11-05 00:35:55 +08:00
Mr Chen
f0ed396701 Merge pull request #248 from midoks/dev
安全入口功能优化
2022-11-05 00:19:50 +08:00
902e8a91ee 安全入口功能优化 2022-11-05 00:12:07 +08:00
fb2ae13465 Update index.py 2022-11-04 23:50:32 +08:00
9da7470b4e Update index.py 2022-11-04 23:47:43 +08:00
d036f23f4a Update index.py 2022-11-04 23:39:14 +08:00
64223402c4 Update phpmyadmin.js 2022-11-04 23:21:02 +08:00
fecdf0660f Update index.py 2022-11-04 23:18:32 +08:00
f6d1610234 Update mw.tpl 2022-11-04 23:14:34 +08:00
ffaed6706c Update index.py 2022-11-04 23:02:27 +08:00
d50e4196cb Update install.sh 2022-11-04 22:17:57 +08:00
c77382f082 Update install.sh 2022-11-04 21:03:06 +08:00
8cafb1c86e Update setting.py 2022-11-04 21:02:47 +08:00
a0d69fc68a Update install.sh 2022-11-04 20:58:26 +08:00
Mr Chen
10db90764f Merge pull request #246 from midoks/dev
脚本修复
2022-11-04 12:55:06 +08:00
5a690702cf 脚本修复 2022-11-04 12:54:07 +08:00
Mr Chen
032d4f9b57 Merge pull request #245 from midoks/dev
mysql和mariadb UI优化
2022-11-04 12:10:16 +08:00
8753f45bcb 提示优化 2022-11-04 12:04:55 +08:00
1d02896349 up 2022-11-04 11:50:57 +08:00
Mr Chen
d4fb0be60b Merge pull request #244 from midoks/dev
#218
2022-11-04 00:43:42 +08:00
a233d440ef mariadb修复功能OK 2022-11-04 00:38:56 +08:00
e2962146cf 调整debian和ubuntu的安装 2022-11-04 00:25:47 +08:00
ab2f55282d Update backup.py 2022-11-04 00:21:23 +08:00
098f0ffdd2 Update mariadb.js 2022-11-04 00:00:53 +08:00
8e544fee93 Update mariadb.js 2022-11-03 23:53:47 +08:00
ea20cc6e89 mariadb加入修复功能和外部导入功能 2022-11-03 23:49:56 +08:00
176112b332 mysql加入修复功能。
密码错误时重置。这种错误一般安装时,有一个定几率出现。
2022-11-03 22:22:06 +08:00
53332e9b6b Update README.md 2022-11-03 21:12:37 +08:00
600cd80676 计算优化 2022-11-03 18:11:12 +08:00
6cd3a09584 up 2022-11-03 18:07:38 +08:00
0d3a533c11 Update install.sh 2022-11-03 18:03:56 +08:00
Mr Chen
63f9b577aa Merge pull request #243 from midoks/dev
query_cache_size优化
2022-11-03 11:52:13 +08:00
57786cb95a Update mysql.js 2022-11-03 11:51:10 +08:00
5b9bd6e0bf up 2022-11-03 11:31:24 +08:00
96c9bc38ca query_cache_size 设置优化 2022-11-03 11:25:36 +08:00
141fd8fb34 Merge branch 'master' into dev 2022-11-03 10:40:46 +08:00
Mr Chen
063f13ef69 Merge pull request #242 from msycn/dev
Update cloudfare_real_ip.conf
2022-11-03 10:22:22 +08:00
msycn
1054fd1400 update cloudfare_real_ip.conf to 2022.11
Apr 8, 2021:
104.16.0.0/12 removed from ips-v4
104.16.0.0/13 added to ips-v4
104.24.0.0/14 added to ips-v4
https://www.cloudflare.com/ips-v4
https://www.cloudflare.com/ips-v6
2022-11-02 17:15:55 -04:00
Mr Chen
d795242fdd Merge pull request #241 from midoks/dev
webhook 1.0
2022-11-03 00:20:25 +08:00
8ed36c1781 webhook 1.0 2022-11-03 00:11:16 +08:00
Mr Chen
b17bfb0da6 Merge pull request #240 from midoks/dev
细节优化
2022-11-02 18:53:09 +08:00
105f12cba6 Update phplib.conf 2022-11-02 18:32:09 +08:00
00b978dd70 Update apcu.sh 2022-11-02 18:24:20 +08:00
fd23a4c572 phpmysqladmin保存优化 2022-11-02 18:22:21 +08:00
421c9a673c up 2022-11-02 18:04:05 +08:00
9295455628 Update phplib.conf 2022-11-02 17:40:43 +08:00
93f79a7e69 Update phplib.conf 2022-11-02 17:35:59 +08:00
7e627856d7 Update phplib.conf 2022-11-02 17:32:20 +08:00
f068bf1292 写访问日志+提示 2022-11-02 16:02:41 +08:00
Mr Chen
2d495e498e Merge pull request #238 from midoks/dev
站点相关优化
2022-11-02 14:20:07 +08:00
496ef3cc36 站点相关优化
1.修复伪静态模版保存。
2.伪静态保存检测。
3.修复写入日志开关。
2022-11-02 13:48:19 +08:00
008bb49365 Update tools.py 2022-11-02 10:19:24 +08:00
2f94f9b856 Update tools.py 2022-11-02 10:19:01 +08:00
Mr Chen
a2e6073858 Merge pull request #237 from midoks/dev
mariadb版本更新
2022-11-02 01:37:46 +08:00
4580f10ba7 mariadb为了稳定安装,与最新的相差2个版本 2022-11-02 01:36:52 +08:00
d2974c0d79 mariadb版本更新 2022-11-02 01:31:44 +08:00
ee255086ac Update install.sh 2022-11-02 01:21:37 +08:00
Mr Chen
7f1643720a Merge pull request #236 from midoks/dev
rsyncd优化
2022-11-02 01:12:14 +08:00
0b3ddd22a5 安装优化 2022-11-02 01:10:35 +08:00
4db3650b59 Update index.py 2022-11-02 01:04:18 +08:00
Mr Chen
a86588ee01 Merge pull request #235 from midoks/dev
添加卸载脚本
2022-11-02 00:45:18 +08:00
72af570958 卸载脚本 2022-11-02 00:42:41 +08:00
df0d980d24 Update uninstall.sh 2022-11-02 00:35:26 +08:00
b06308c842 Update uninstall.sh 2022-11-02 00:31:42 +08:00
e0f1a74f74 Update uninstall.sh 2022-11-02 00:31:14 +08:00
4a5f6fef6b Update uninstall.sh 2022-11-02 00:29:56 +08:00
9eaabab738 Update uninstall.sh 2022-11-02 00:25:46 +08:00
1615e7c580 Update uninstall.sh 2022-11-02 00:13:10 +08:00
b2d0c4815e up 2022-11-02 00:12:56 +08:00
2ac903be9b Update uninstall.sh 2022-11-02 00:09:35 +08:00
c3979d5f55 Update index.py 2022-11-01 22:25:01 +08:00
0d618b1b68 Update index.py 2022-11-01 22:01:08 +08:00
d0e6954680 Update install.sh 2022-11-01 21:54:14 +08:00
57be5fd61c Update index.py 2022-11-01 21:44:35 +08:00
59987eb502 Update uninstall.sh 2022-11-01 21:28:39 +08:00
04fe781241 Update uninstall.sh 2022-11-01 21:22:42 +08:00
31fcd80877 rsyncd添加目录后统一为www权限,避免混乱 2022-11-01 21:06:32 +08:00
a13c366813 Update rsyncd.js 2022-11-01 20:43:35 +08:00
6e978b668e up 2022-11-01 20:27:20 +08:00
bf09f29f48 Update lib.sh 2022-11-01 20:11:46 +08:00
e035330eac Update lib.sh 2022-11-01 20:11:16 +08:00
668f135b71 Update debian.sh 2022-11-01 20:00:06 +08:00
e9296fbecb Update requirements.txt 2022-11-01 19:37:13 +08:00
c8feecfb2a Update debian.sh 2022-11-01 18:18:27 +08:00
02bc554afb Update mw.tpl 2022-11-01 14:57:41 +08:00
9f3c7e0479 Update mw.tpl 2022-11-01 14:57:28 +08:00
ad315cf37c phpmyadmin初始安装优化 2022-11-01 14:29:31 +08:00
3d807cd0c8 Update index.py 2022-11-01 14:09:49 +08:00
e0ca9b4654 Update index.py 2022-11-01 13:55:50 +08:00
a852cdeead Update __init__.py 2022-11-01 12:03:33 +08:00
Mr Chen
6b3c40baea Merge pull request #233 from midoks/dev
为了严格登录,验证码输入错误4次,也直接关闭。
2022-11-01 11:56:57 +08:00
852f236bb5 为了严格登录,验证码输入错误4次,也直接关闭。 2022-11-01 11:47:13 +08:00
Mr Chen
9ad2bf8bf0 Merge pull request #232 from midoks/dev
在线编辑优化-识别其他编码FIX
2022-10-31 13:13:11 +08:00
1284ddd1af 在线编辑优化-识别其他编码FIX 2022-10-31 13:12:10 +08:00
Mr Chen
412ff74f0c Merge pull request #231 from midoks/dev
修改计划任务-JS修复
2022-10-31 09:52:49 +08:00
2eceff82e8 修改计划任务-JS修复 2022-10-31 09:51:48 +08:00
Mr Chen
6b164c58e9 Merge pull request #230 from midoks/dev
计划任务-JS修复
2022-10-31 09:37:56 +08:00
e9802040d9 Update pull_request_template.md 2022-10-31 09:37:20 +08:00
5dd84c12f3 Update crontab.js 2022-10-31 09:35:51 +08:00
Mr Chen
b1a8c5c02f Merge pull request #228 from midoks/dev
0.10.2
2022-10-31 02:59:12 +08:00
3ed0ceed70 Update crontab.js 2022-10-31 02:57:58 +08:00
6948d503c0 Update crontab.js 2022-10-31 02:49:22 +08:00
39bca95e62 Update crontab.js 2022-10-31 02:39:12 +08:00
063bc092e6 0.10.2
* 修复上次更新的UI问题。
* `FTP存储空间` 备份数据库修复。
* 修复计划任务执行Python脚本的编码问题。
* 添加,修改计划任务参数强校验。
2022-10-31 02:30:55 +08:00
aa97982f6f Update crontab_api.py 2022-10-31 00:12:45 +08:00
af73ce7af8 优化 2022-10-30 23:34:18 +08:00
e46ed828d9 Update index.py 2022-10-30 23:24:54 +08:00
f5ec3bba3d ftp备份数据库优化 2022-10-30 22:34:18 +08:00
2f7ec60e89 Update index.html 2022-10-30 21:16:41 +08:00
5df4b9ee57 Update mw.py 2022-10-30 18:04:42 +08:00
71dbfbf5d8 登录界面统一显示设置面板名 2022-10-30 18:03:31 +08:00
Mr Chen
93fcdd2e27 Merge pull request #227 from midoks/dev
OP防火墙安装校验
2022-10-30 13:22:53 +08:00
a725220577 Update info.json 2022-10-30 13:17:09 +08:00
783c4ebc60 Update firewall_api.py 2022-10-30 11:56:37 +08:00
a06db0e8c3 Update firewall_api.py 2022-10-30 11:46:49 +08:00
Mr Chen
d7c4dcda66 Merge pull request #226 from midoks/dev
小问题优化
2022-10-30 11:28:50 +08:00
2866e1a602 优化 2022-10-30 10:27:58 +08:00
77e4ee1053 debian首先同步时间再安装 2022-10-30 00:27:10 +08:00
Mr Chen
7589c14f81 Merge pull request #224 from midoks/dev
0.10.1
2022-10-29 23:23:23 +08:00
4344d774c1 Update config_api.py 2022-10-29 23:21:26 +08:00
4859792096 Update README.md 2022-10-29 22:00:36 +08:00
e55c40e973 优化文件多选的bug 2022-10-29 21:58:29 +08:00
103beb62a4 Update files_api.py 2022-10-29 20:59:00 +08:00
76a34578ad Update index.py 2022-10-29 20:36:37 +08:00
f82fdbf939 Update README.md 2022-10-29 20:19:18 +08:00
4eaf9eb36c phpmyadmin+路径随机 2022-10-29 20:12:01 +08:00
9c9f9fc42c 初始化卸载脚本 2022-10-29 16:31:59 +08:00
8301ad6f62 Update ubuntu.sh 2022-10-29 16:19:53 +08:00
d42fb48749 Update mw.tpl 2022-10-29 16:13:23 +08:00
fa49a3dbeb Update README.md 2022-10-29 15:24:28 +08:00
dd1147c891 Update debian.sh 2022-10-29 14:39:06 +08:00
67b015a50b up 2022-10-29 13:46:16 +08:00
57831168a3 debian 9 兼容 2022-10-29 13:35:12 +08:00
f6f7cabddc Update debian.sh 2022-10-29 12:18:07 +08:00
dfec241c3f Update README.md 2022-10-29 11:54:58 +08:00
8a78dff571 Update ubuntu.sh 2022-10-29 11:38:27 +08:00
a9486d4fbe Update ubuntu.sh 2022-10-29 11:38:08 +08:00
78d3a091cd openresty增加性能调整功能 2022-10-29 02:46:27 +08:00
314005e478 Update openresty.js 2022-10-28 19:06:27 +08:00
55fa911485 Update mysql.js 2022-10-28 17:52:43 +08:00
a72046462c Update index.py 2022-10-28 17:49:30 +08:00
0b8fe15b65 Update index.py 2022-10-28 16:47:53 +08:00
34f5d12ad9 mysql 部分操作优化 2022-10-28 14:20:12 +08:00
e88544d290 Update mysql.js 2022-10-28 14:08:56 +08:00
a211746de7 mysql导入功能 2022-10-28 14:08:50 +08:00
c417b02844 Update install.sh 2022-10-27 23:44:40 +08:00
Mr Chen
034aaedf48 Merge pull request #223 from midoks/dev
小优化
2022-10-27 15:51:03 +08:00
af0ec79072 统计一下用户量,让我的开发更有激情 2022-10-27 15:44:42 +08:00
195ccf409e openresty 默认加入ipv6支持 2022-10-27 14:38:44 +08:00
Mr Chen
7cec26b8a3 Merge pull request #222 from midoks/dev
优化logo
2022-10-26 23:47:01 +08:00
aacb816b11 优化logo 2022-10-26 23:40:48 +08:00
Mr Chen
411798f4bf Merge pull request #221 from midoks/dev
0.10.0
2022-10-26 23:25:55 +08:00
2179db5f8b 0.10.0 2022-10-26 23:24:33 +08:00
dcced8c0fb Update crontab_api.py 2022-10-26 22:08:29 +08:00
3e0e42d8a1 优化 2022-10-26 19:41:51 +08:00
e5355d3e2f Update ftp_client.py 2022-10-26 18:56:57 +08:00
0a22e25611 Update ftp_client.py 2022-10-26 18:49:05 +08:00
5f7a3e5bf6 Update index.py 2022-10-26 18:43:48 +08:00
3518548c61 backup ftp 80% 2022-10-26 17:47:40 +08:00
08c4b0845d Update crontab_api.py 2022-10-26 11:34:52 +08:00
8f5fae8e79 Update index.py 2022-10-26 02:50:11 +08:00
a151db1c30 Update install.sh 2022-10-26 02:48:08 +08:00
628c69ed22 Update index.html 2022-10-26 02:48:05 +08:00
13bcbc0f3e Update soft.js 2022-10-26 02:47:57 +08:00
c94838462c backup_ftp 50% 2022-10-26 02:42:10 +08:00
a147ef6962 Update centos.sh 2022-10-25 22:06:32 +08:00
4ccda15933 Update ftp.js 2022-10-25 14:11:49 +08:00
01074c743d Update pure-ftpd.conf 2022-10-25 14:10:46 +08:00
0871fa1763 up 2022-10-25 13:51:24 +08:00
aade0ccd98 Update install.sh 2022-10-25 12:28:57 +08:00
4aed2f91de Update ftp.js 2022-10-25 12:28:49 +08:00
d49dd9f2ac Update install.sh 2022-10-25 03:37:48 +08:00
cff29194f4 Revert "安装优化"
This reverts commit ecbfb2500f.
2022-10-25 03:34:00 +08:00
ecbfb2500f 安装优化 2022-10-25 03:20:35 +08:00
9c43170d4b Update install.sh 2022-10-25 03:11:06 +08:00
1239a2807f up 2022-10-25 02:53:19 +08:00
1c0a130b49 up 2022-10-25 01:43:29 +08:00
ffb1eb34e0 waf 0.2.3 2022-10-25 00:41:27 +08:00
82874d1f7a Update url_white.json 2022-10-24 23:42:26 +08:00
4e05f29fcd OP防火墙-0.2.3 2022-10-24 23:12:45 +08:00
d5f3b0d442 初始安装 ipv6 优化 2022-10-24 21:55:44 +08:00
81eec04037 Update mw.tpl 2022-10-24 21:44:34 +08:00
5a5dc43e17 Update mw.tpl 2022-10-24 21:38:10 +08:00
b4eb2b3192 Update mw.tpl 2022-10-24 21:20:04 +08:00
2d1c070e1b Update mw.tpl 2022-10-24 21:16:17 +08:00
81364fdfa3 Update common.lua 2022-10-24 21:12:41 +08:00
9d0d88d465 Update init.lua 2022-10-24 20:56:18 +08:00
7e2eef8bbf Update init.lua 2022-10-24 20:54:41 +08:00
8d1315e5be Update init.lua 2022-10-24 20:39:07 +08:00
fe6a51540e Update init.lua 2022-10-24 20:38:24 +08:00
6e35683505 Update init.lua 2022-10-24 20:35:39 +08:00
713c0d1a3c up 2022-10-24 20:18:34 +08:00
8323e0ec73 up 2022-10-24 20:06:38 +08:00
6eae94658f up 2022-10-24 19:55:09 +08:00
07d173d2cf up 2022-10-24 19:11:48 +08:00
23f2b9efac Update index.py 2022-10-24 15:14:14 +08:00
9b2ab9276c Update common.lua 2022-10-24 14:53:54 +08:00
7903e1a286 Update common.lua 2022-10-24 14:53:39 +08:00
662e05511f Update common.lua 2022-10-24 14:51:58 +08:00
1f8785acbc Update init.lua 2022-10-24 14:49:20 +08:00
3eb87cf953 Update init.lua 2022-10-24 11:57:46 +08:00
124b24885e Update op_waf.js 2022-10-24 11:23:35 +08:00
2196983455 Update ip_white.json 2022-10-24 11:22:39 +08:00
80a67c4f58 Update webstats_log.lua 2022-10-24 11:10:23 +08:00
ff06f7ef91 Update webstats_common.lua 2022-10-24 11:06:35 +08:00
b16506c8bc #211 优化
phpmyadmin安全设置处修改端口保存后当前用修改后的端口能打开,一旦停止phpmyadmin后,再重启phpmyadmin端口又变为888,需要手工再次改变
2022-10-23 14:07:18 +08:00
2d3801dcc0 up 2022-10-23 13:49:08 +08:00
Mr Chen
9b83a2ef79 Merge pull request #216 from midoks/dev
0.9.14
2022-10-23 01:12:02 +08:00
6aefa3b7dc Update config_api.py 2022-10-23 01:11:20 +08:00
566fabbf24 Update README.md 2022-10-23 01:08:41 +08:00
ea8aa5102b Update common.lua 2022-10-23 00:41:39 +08:00
b8421d36ae up 2022-10-23 00:37:42 +08:00
24bd8daca0 Update install.sh 2022-10-22 22:57:04 +08:00
d8047b43fa Update install.sh 2022-10-22 22:49:32 +08:00
016dde04e7 Update my8.0.cnf 2022-10-22 22:36:33 +08:00
df5d86a883 Update README.md 2022-10-22 22:26:55 +08:00
84077de5d1 Update common.lua 2022-10-22 22:22:53 +08:00
04ed4b180a up 2022-10-22 21:58:35 +08:00
f980dba7ed up 2022-10-22 21:36:12 +08:00
f702f70f89 up 2022-10-22 20:25:46 +08:00
a8e6ee052c init 2022-10-22 18:32:11 +08:00
b3d0a36dcd up 2022-10-22 16:29:11 +08:00
96275303c6 Update index.py 2022-10-22 13:30:08 +08:00
0337a1bded up 2022-10-22 13:19:35 +08:00
8bd985fca9 up 2022-10-21 19:53:36 +08:00
b6ef8d1625 up 2022-10-21 19:16:07 +08:00
3dc695508f up 2022-10-21 19:09:34 +08:00
0c769b02e5 Update op_waf.js 2022-10-21 17:45:30 +08:00
e289037598 up 2022-10-21 17:34:38 +08:00
63e6a95553 up 2022-10-21 12:08:43 +08:00
8e1d95bf82 up 2022-10-21 01:33:35 +08:00
24fe8b6f5f up 2022-10-21 01:25:57 +08:00
3d366ee774 up 2022-10-20 23:40:28 +08:00
0428956141 up 2022-10-20 20:59:15 +08:00
37747427be up 2022-10-20 17:59:16 +08:00
fb94fb8304 up 2022-10-20 16:31:30 +08:00
65d07d3934 0.2.2 2022-10-20 14:52:51 +08:00
5e6ffafeb5 Update install.sh 2022-10-20 14:10:20 +08:00
572f231fae up 2022-10-20 14:03:17 +08:00
0328dd21e7 Update webstats_common.lua 2022-10-20 13:20:54 +08:00
597d171733 Update webstats_common.lua 2022-10-20 13:10:40 +08:00
745ab9dcd0 Update webstats_common.lua 2022-10-20 12:59:26 +08:00
30323b031c Update webstats_common.lua 2022-10-20 12:58:41 +08:00
f47e6a47df Update webstats_common.lua 2022-10-20 12:57:20 +08:00
0eccebd9da Update webstats_common.lua 2022-10-20 12:45:24 +08:00
0ad5e74fae Update webstats_common.lua 2022-10-20 12:38:54 +08:00
2640ba97c5 Update webstats_common.lua 2022-10-18 18:03:35 +08:00
e5f440ff02 up 2022-10-18 17:41:29 +08:00
7bc9c44ec1 Update webstats_log.lua 2022-10-18 16:38:18 +08:00
9cd74db011 Update webstats_common.lua 2022-10-18 03:14:00 +08:00
5da8e5a7f6 Update webstats_common.lua 2022-10-18 03:07:12 +08:00
4da895b8df Update webstats_common.lua 2022-10-18 02:54:31 +08:00
42eca14168 Update webstats_common.lua 2022-10-18 02:13:07 +08:00
43a3dfd9bd Update webstats_common.lua 2022-10-18 01:48:18 +08:00
794eba4186 Update webstats_common.lua 2022-10-18 01:41:26 +08:00
a4f533acba Update webstats_common.lua 2022-10-18 01:20:08 +08:00
adb3c5250c Update webstats_common.lua 2022-10-18 01:08:05 +08:00
e4226fcdd4 Update webstats_log.lua 2022-10-18 00:58:08 +08:00
d3e9353589 up 2022-10-18 00:56:31 +08:00
757284cdf1 up 2022-10-17 23:48:20 +08:00
58232e10ab Update index.py 2022-10-17 23:40:44 +08:00
fde211e026 Update webstats_log.lua 2022-10-17 23:30:34 +08:00
c9a527e487 up 2022-10-17 23:29:57 +08:00
c501efdfac up 2022-10-17 21:12:42 +08:00
80c0bbed71 Update webstats_log.lua 2022-10-17 14:54:53 +08:00
1fb3c30775 Update webstats_log.lua 2022-10-17 14:29:52 +08:00
24ab203770 Update webstats_log.lua 2022-10-17 14:08:00 +08:00
bd0242db2f Update webstats_common.lua 2022-10-17 14:03:35 +08:00
42bf5edd1f Update webstats_common.lua 2022-10-17 13:45:21 +08:00
7b2a011b6a Update webstats_common.lua 2022-10-17 13:44:35 +08:00
76e01201a2 Update webstats_common.lua 2022-10-17 13:31:36 +08:00
16e45cabfc Update webstats_common.lua 2022-10-17 13:30:30 +08:00
c08542ff54 Update webstats_common.lua 2022-10-17 13:23:48 +08:00
5beb76d0b7 Update webstats_common.lua 2022-10-17 13:07:22 +08:00
f16a7e016e up 2022-10-17 13:06:34 +08:00
eb86ac3ee6 Update webstats_common.lua 2022-10-17 12:17:37 +08:00
14c2606532 Update webstats_common.lua 2022-10-17 12:12:17 +08:00
86b8939cb8 Update webstats_common.lua 2022-10-17 12:10:15 +08:00
dd28c1ef56 Update webstats_common.lua 2022-10-17 11:43:37 +08:00
6b24dfc21e Update webstats_common.lua 2022-10-17 11:36:29 +08:00
dc06573125 Update webstats_common.lua 2022-10-17 03:03:32 +08:00
df35e5a780 Update webstats_common.lua 2022-10-17 02:56:28 +08:00
a678d851a0 Update webstats_common.lua 2022-10-17 02:49:16 +08:00
6a706651e4 Update webstats_common.lua 2022-10-17 02:45:18 +08:00
1acdfe4368 Update webstats_common.lua 2022-10-17 02:30:36 +08:00
cae245efca up 2022-10-17 02:04:01 +08:00
238f1e76d8 Update webstats.conf 2022-10-17 01:09:57 +08:00
f3a754d1ae Update webstats_common.lua 2022-10-17 01:06:50 +08:00
21aab0573a Update webstats_common.lua 2022-10-17 00:58:20 +08:00
011949ba85 up 2022-10-17 00:44:04 +08:00
f3e7dd1cc0 Update init_worker.lua 2022-10-15 23:44:53 +08:00
b49d2025eb Update install.sh 2022-10-15 23:38:12 +08:00
556b0869f2 Update config.json 2022-10-15 23:34:20 +08:00
aad6deeb78 Update init_worker.lua 2022-10-15 23:28:36 +08:00
64601e42c1 up 2022-10-15 23:16:25 +08:00
6555d927ea Update common.lua 2022-10-15 21:20:40 +08:00
444ff40570 up 2022-10-15 19:13:01 +08:00
7bdcd0ac2b up 2022-10-15 17:38:42 +08:00
6e6a41e6df Update ngx_demo.sh 2022-10-15 10:03:22 +08:00
feca2a6d33 aa 2022-10-15 03:23:08 +08:00
5e382e7347 Update init.lua 2022-10-15 03:16:02 +08:00
abc778fb52 up 2022-10-15 02:05:29 +08:00
6b42d35cd4 up 2022-10-15 00:34:14 +08:00
c74a2c9655 Update common.lua 2022-10-14 23:46:10 +08:00
01543f951a Update init.lua 2022-10-14 23:45:57 +08:00
d78a5d8f27 Update init.lua 2022-10-14 23:45:43 +08:00
2a1d759cd2 Update config.json 2022-10-14 23:23:08 +08:00
43889f83f7 up 2022-10-14 21:41:25 +08:00
79a0a93959 up 2022-10-14 17:50:26 +08:00
735cf9b872 up 2022-10-14 12:41:32 +08:00
e7c318e560 Update info.json 2022-10-14 12:18:09 +08:00
78d03754f6 Update install.sh 2022-10-14 12:09:19 +08:00
67cc1cac86 Update install.sh 2022-10-14 12:08:14 +08:00
77ec90980a Update install.sh 2022-10-14 12:06:57 +08:00
d07b2babfd up 2022-10-14 12:05:54 +08:00
4d9ee94038 up 2022-10-14 11:36:54 +08:00
61479d5db6 Update init.lua 2022-10-13 22:23:46 +08:00
897c28034d up 2022-10-13 22:18:57 +08:00
b3fef4c104 up 2022-10-13 21:29:28 +08:00
48cec8ee47 up 2022-10-13 21:05:06 +08:00
7c369ef19f up 2022-10-13 21:03:26 +08:00
1411bb1639 up 2022-10-13 20:43:46 +08:00
be875d9d8c Update soft.js 2022-10-13 17:39:41 +08:00
746dc7ee4d Update soft.js 2022-10-13 17:34:44 +08:00
ea7ba7d461 软件界面优化 2022-10-13 17:29:41 +08:00
48ed4156b5 Update common.lua 2022-10-13 17:06:42 +08:00
ca73d0e280 Update common.lua 2022-10-13 17:01:57 +08:00
8cef43d9a7 Update info.json 2022-10-13 16:51:13 +08:00
75445774a1 test & op 2022-10-13 16:46:44 +08:00
9b29f19b96 up 2022-10-13 14:59:49 +08:00
1e6655e7f9 Update readme.md 2022-10-13 14:46:48 +08:00
363656e06c up 2022-10-13 14:46:29 +08:00
a1860bc4fc up 2022-10-13 14:21:39 +08:00
f8ce39bc74 up 2022-10-13 11:46:03 +08:00
969d02ef93 Update ngx_debug.sh 2022-10-13 04:35:23 +08:00
a54410df6e up 2022-10-13 04:18:47 +08:00
01e388ea45 up 2022-10-13 03:12:44 +08:00
ef75f22a86 Update index.py 2022-10-13 01:38:20 +08:00
97f6b232fd Update ngx_debug.sh 2022-10-13 01:36:53 +08:00
2506f5e940 Update install.sh 2022-10-13 01:10:03 +08:00
dcb23ada41 Update ngx_debug.sh 2022-10-13 01:06:32 +08:00
35e1bf048c Update ngx_debug.sh 2022-10-13 00:58:47 +08:00
a9e24f8eaf Update ngx_debug.sh 2022-10-13 00:58:05 +08:00
2f4ac74f52 Create ngx_debug.sh 2022-10-13 00:42:51 +08:00
522122feb6 Update common.lua 2022-10-12 20:37:56 +08:00
a3c677a926 Update common.lua 2022-10-12 19:41:35 +08:00
fd1c52530e Update common.lua 2022-10-12 19:35:59 +08:00
071c690583 Update linux.conf 2022-10-12 18:04:20 +08:00
67c9cd0277 up 2022-10-12 17:51:50 +08:00
61292868ad 统计变为ngx.timer.every执行 2022-10-12 17:18:51 +08:00
54b2a00b23 Update safe_js.html 2022-10-12 16:56:36 +08:00
af6d377664 Update safe_js.html 2022-10-12 16:47:29 +08:00
6d55e345b0 Update common.lua 2022-10-12 16:39:55 +08:00
fab4e68d8d Update common.lua 2022-10-12 15:42:48 +08:00
8864e91f21 Update install.sh 2022-10-12 15:31:42 +08:00
f14ce1b66c Update info.json 2022-10-12 15:29:03 +08:00
48098efd56 Update safe_js.html 2022-10-12 15:28:09 +08:00
04eba8e33f Update init.lua 2022-10-12 15:26:38 +08:00
89cf7ffafc Update init.lua 2022-10-12 15:19:08 +08:00
47544520e8 Update init.lua 2022-10-12 15:03:51 +08:00
bc1fd9a8af Update init.lua 2022-10-12 14:51:46 +08:00
27efc7ef6e Update config_api.py 2022-10-12 14:38:45 +08:00
47ead816c0 Update init.lua 2022-10-12 14:37:43 +08:00
31d36182c3 Update init.lua 2022-10-12 14:37:11 +08:00
c9a58c7ea5 Update init.lua 2022-10-12 14:36:57 +08:00
a6e59ae37c Update init.lua 2022-10-12 14:36:42 +08:00
328e1b0ff1 up 2022-10-12 14:30:37 +08:00
f76cc5ceb8 Update init.lua 2022-10-12 13:59:30 +08:00
d6c74c3f7d waf demo 3 2022-10-12 13:49:57 +08:00
4f932c36e7 up 2022-10-12 10:11:55 +08:00
0d02d0ebea Update init.lua 2022-10-12 00:53:00 +08:00
9e207ad4d3 添加 强制安全验证 功能 2022-10-12 00:38:23 +08:00
f6cfe29956 Update debian.sh 2022-10-11 18:03:36 +08:00
e439111761 Update mw.py 2022-10-11 17:47:48 +08:00
e576d0b443 listen.backlog = 4096 设置默认 2022-10-11 17:28:07 +08:00
02e2c42225 up 2022-10-11 17:10:13 +08:00
45dec0a3d6 ip 2022-10-11 16:35:44 +08:00
28e2abc829 demo 2022-10-11 16:26:15 +08:00
d59c82b7c8 Update common.lua 2022-10-11 15:46:04 +08:00
32b2158795 Update common.lua 2022-10-11 15:45:49 +08:00
5a37305c73 Update common.lua 2022-10-11 15:45:08 +08:00
c043963e8e Update common.lua 2022-10-11 15:43:10 +08:00
40d755b44e up 2022-10-11 15:39:13 +08:00
00aa791205 waf debug3 2022-10-11 15:34:02 +08:00
431b3646af waf debug2 2022-10-11 15:27:08 +08:00
910aaa81de waf debug1 2022-10-11 15:22:28 +08:00
Mr Chen
c4a844cadb Merge pull request #209 from midoks/dev
0.9.13
2022-10-11 12:47:26 +08:00
a88a281175 0.9.13
0.9.13
2022-10-11 12:46:35 +08:00
f3f3b1c6bd Update init.lua 2022-10-11 12:35:59 +08:00
4259ac51cb up 2022-10-11 11:41:32 +08:00
4db1357d3d 更新mysql版本 2022-10-11 09:03:53 +08:00
15873e0824 Update op_waf.js 2022-10-11 00:40:21 +08:00
dcdb07f76d up 2022-10-11 00:35:13 +08:00
8b70637479 Update index.py 2022-10-10 23:28:36 +08:00
c77085fea4 Update index.py 2022-10-10 23:27:20 +08:00
a265f3d0d5 Update index.py 2022-10-10 23:24:54 +08:00
7ea486cd1d Update index.py 2022-10-10 23:22:43 +08:00
0e31e87e28 Update index.py 2022-10-10 23:22:04 +08:00
8c621c892e Update index.py 2022-10-10 23:16:59 +08:00
32bcae603c Update index.py 2022-10-10 23:16:48 +08:00
98ec21446d Update index.py 2022-10-10 22:41:36 +08:00
0ee3682502 Update redis.service.tpl 2022-10-10 22:11:51 +08:00
c609d1a012 Update redis.service.tpl 2022-10-10 22:05:55 +08:00
27b1a78879 up 2022-10-10 22:03:21 +08:00
773de840a5 Update redis.js 2022-10-10 21:55:00 +08:00
91d6ff3c54 Update index.py 2022-10-10 21:52:11 +08:00
03376bd42d Update redis.conf 2022-10-10 21:50:04 +08:00
036c5114c2 Update index.py 2022-10-10 21:35:51 +08:00
a772e70fde Update index.py 2022-10-10 21:33:20 +08:00
53055bbdef Update index.py 2022-10-10 21:31:43 +08:00
f81d598fcf Update index.py 2022-10-10 21:13:44 +08:00
3530e83bb9 up 2022-10-10 21:09:35 +08:00
1271b2f637 Update index.py 2022-10-10 21:00:30 +08:00
2dc6bc7753 Update index.py 2022-10-10 20:58:45 +08:00
e52d9e3ea3 Update index.py 2022-10-10 20:55:45 +08:00
d8a570e55e Update index.html 2022-10-10 20:46:07 +08:00
f4ceaf667b php-yum更新 2022-10-10 20:43:48 +08:00
958ba16b85 Update index.html 2022-10-10 20:28:44 +08:00
73039777bb Update index.py 2022-10-10 20:06:00 +08:00
864e4c910c PHP添加会话管理功能 2022-10-10 19:54:23 +08:00
4da57405af Update init.lua 2022-10-10 13:01:27 +08:00
dff638571a Update init.lua 2022-10-10 12:45:31 +08:00
c7d9ec51cc up 2022-10-10 12:36:42 +08:00
501c575f73 up 2022-10-10 12:13:45 +08:00
0fd966ca65 up 2022-10-10 02:14:31 +08:00
172dde2794 Update mariadb.js 2022-10-09 23:26:50 +08:00
78fdc80652 优化mysql进入phpmyadmin 2022-10-09 23:24:47 +08:00
01b8c9b8ff Update init.lua 2022-10-09 22:47:28 +08:00
b840086d4d op防火墙更新1 2022-10-09 21:29:40 +08:00
4c73f13f2d up 2022-10-09 11:36:57 +08:00
f31c1aae96 up 2022-10-09 10:39:46 +08:00
5c24a831db Update index.py 2022-10-09 02:04:17 +08:00
91d07eebad Update install.sh 2022-10-09 01:59:17 +08:00
3b51ef2434 up 2022-10-09 01:49:17 +08:00
31c5e42b09 Update index.html 2022-10-09 01:38:15 +08:00
b8b3a237ef up 2022-10-09 01:37:14 +08:00
5cb2aefbbc up 2022-10-09 01:25:53 +08:00
19173af3e2 Update logs_backup.py 2022-10-09 00:31:15 +08:00
3dc493108b Update mw.tpl 2022-10-09 00:30:03 +08:00
55af62000b Update logs_backup.py 2022-10-09 00:26:28 +08:00
a1c8c48761 Update index.js 2022-10-08 22:45:44 +08:00
8c3ec0a103 Update index.js 2022-10-08 22:40:23 +08:00
5cbde31105 Update tool_task.py 2022-10-08 18:15:57 +08:00
04dd94032e Update tool_task.py 2022-10-08 18:12:45 +08:00
8a11195b0d Update tool_task.py 2022-10-08 18:08:38 +08:00
1eb76baae7 改变弹框方式 2022-10-08 16:05:24 +08:00
2669d6f021 Update init.lua 2022-10-08 15:21:17 +08:00
6f13a03a2c Update config_api.py 2022-10-08 14:24:58 +08:00
Mr Chen
9c97e1c41c Merge pull request #205 from midoks/dev
0.9.12
2022-10-08 14:21:46 +08:00
37245ca1e8 0.9.12
* 日志清理插件优化。
* 计划任务显示完整。
* 加入gitea插件。
* 融合mw-cli命令。
* 加快php编译速度。
* swap加上调整功能。
* 其他细节优化。
2022-10-08 14:20:47 +08:00
f706a8a2ea up 2022-10-08 14:03:01 +08:00
e6af6b2062 up 2022-10-07 21:29:00 +08:00
f5b056c965 init 2022-10-07 01:00:02 +08:00
8c768e8a04 Create tool_task.py 2022-10-07 00:47:26 +08:00
1d6f4feccb Update soft.js 2022-10-07 00:46:32 +08:00
49c32dc9c1 Update index.py 2022-10-06 17:52:25 +08:00
17a865c45d Update install.sh 2022-10-06 17:28:37 +08:00
0090681ab2 Update index.py 2022-10-06 17:25:15 +08:00
4d3a6c27f7 up 2022-10-06 17:19:36 +08:00
abf39428fc Update index.py 2022-10-06 17:08:46 +08:00
ec11904959 up 2022-10-06 17:07:26 +08:00
d18f16a2b8 up 2022-10-06 15:32:30 +08:00
7fbe421b0c 加快php编译速度 2022-10-06 14:16:46 +08:00
81c7929240 Update install.sh 2022-10-06 14:09:46 +08:00
76c655872b Update install.sh 2022-10-06 14:09:22 +08:00
7b09776392 Update install.sh 2022-10-06 14:08:52 +08:00
0b28077e08 up 2022-10-06 14:07:10 +08:00
ccc00e8b5d 更新版本 2022-10-06 13:40:52 +08:00
202e04c62d Update install.sh 2022-10-06 13:30:50 +08:00
01cd35305e Update ubuntu.sh 2022-10-06 13:10:44 +08:00
2f0d7d1d07 融合mw-cli结束2 2022-10-06 11:22:42 +08:00
714af23627 融合mw-cli结束 2022-10-06 11:13:09 +08:00
0a9eb721c6 Delete mw-cli 2022-10-06 11:12:18 +08:00
5e71c20e2a up 2022-10-06 11:12:01 +08:00
3c24d9f9a9 Update mw.tpl 2022-10-06 09:32:46 +08:00
78bdcb79c8 Update index.py 2022-10-05 20:51:38 +08:00
aaf3389460 Update index.py 2022-10-05 20:50:39 +08:00
9f2cb58812 Update index.py 2022-10-05 20:50:31 +08:00
c6099fb7ce Update gitea.service.tpl 2022-10-05 20:45:01 +08:00
3fb4d88c4a Update gitea.service.tpl 2022-10-05 20:44:43 +08:00
f90fec182c Update install.sh 2022-10-05 20:39:55 +08:00
ba86217a1a Update mw.py 2022-10-05 20:37:02 +08:00
9a7bcdc1c4 up 2022-10-05 20:34:43 +08:00
43b1f5ed86 Update gitea.service.tpl 2022-10-05 20:08:41 +08:00
68ca194c2d Update gitea.service.tpl 2022-10-05 20:05:27 +08:00
061eaabe79 Update gitea.service.tpl 2022-10-05 19:50:08 +08:00
420e830ed9 Update crontab_api.py 2022-10-05 17:52:09 +08:00
8e9cba6646 Update phplib.conf 2022-10-05 14:06:20 +08:00
e0c183c1ac 加入gitea 2022-10-03 12:27:44 +08:00
18c59da28d Update crontab.js 2022-10-02 15:33:14 +08:00
71f2d66966 计划任务 显示完整 2022-10-02 15:23:29 +08:00
abd6cdd738 日志清理 插件优化 2022-10-02 15:05:13 +08:00
dd7b1707c3 Update README.md 2022-10-02 09:33:21 +08:00
Mr Chen
1282babb06 Merge pull request #202 from midoks/dev
0.9.11
2022-10-02 09:27:12 +08:00
71770ec406 0.9.11 2022-10-02 09:25:33 +08:00
f36495f0fd Update app.sh 2022-10-02 02:04:29 +08:00
1cc4813c52 up 2022-10-01 20:38:28 +08:00
2ae74d6199 up 2022-10-01 20:14:28 +08:00
92d83bb82d Update index.py 2022-10-01 20:09:32 +08:00
f14d55fcc6 Update index.py 2022-10-01 20:09:11 +08:00
062de09b3b Update app.sh 2022-10-01 19:53:11 +08:00
5cbd53a667 Update mw.tpl 2022-10-01 19:49:00 +08:00
cf645d1f20 Update mw.tpl 2022-10-01 19:45:45 +08:00
5b8cf7bb0a #201 2022-10-01 18:57:15 +08:00
f5161bca66 随机端口-WEB面板 2022-10-01 17:58:51 +08:00
5934be02bd Update setting.py 2022-10-01 16:56:18 +08:00
9e9f10b06f 端口随机 2022-10-01 16:41:55 +08:00
0fafeabcf0 up 2022-09-30 16:13:49 +08:00
f98e4db019 Update index.py 2022-09-29 23:07:12 +08:00
ec00e9d17e Update index.py 2022-09-29 23:06:53 +08:00
b236bd85c9 up 2022-09-29 22:21:12 +08:00
40a8620745 Update task.py 2022-09-29 18:56:20 +08:00
0307828a82 Update index.py 2022-09-28 23:20:38 +08:00
e7d2eddc20 Update install.sh 2022-09-28 19:49:35 +08:00
8c41b4c3fa Update install.sh 2022-09-28 19:46:22 +08:00
3ea67beea9 Update install.sh 2022-09-28 19:46:13 +08:00
a346da07ad Update install.sh 2022-09-28 19:45:52 +08:00
067ee597a7 Update index.py 2022-09-28 19:15:58 +08:00
aac7704208 Update index.py 2022-09-28 19:15:34 +08:00
3a10aa7809 Update index.py 2022-09-28 19:12:50 +08:00
1b4582574c Update imail.service.tpl 2022-09-28 19:10:41 +08:00
51b8738cbc Update index.py 2022-09-28 19:10:22 +08:00
0dd3c1844e Update index.py 2022-09-28 19:09:46 +08:00
0dabfdacbd Update imail.tpl 2022-09-28 19:08:21 +08:00
d0166f03bb Update info.json 2022-09-28 19:04:09 +08:00
b102d4dd1f up 2022-09-28 19:02:07 +08:00
576f553317 Update index.html 2022-09-26 21:44:58 +08:00
31a0903514 Update public.js 2022-09-26 21:15:26 +08:00
796c19b5dc Update install.sh 2022-09-26 21:00:52 +08:00
b7902ae2d0 Update install.sh 2022-09-26 21:00:07 +08:00
7deaf2822a Update index.py 2022-09-26 20:57:37 +08:00
7e78c2dac4 up 2022-09-26 20:57:26 +08:00
f341c80fbe up imail 2022-09-26 20:51:23 +08:00
b593cc4708 init 2022-09-26 17:04:32 +08:00
7a8c83ee90 Update index.py 2022-09-25 18:54:47 +08:00
8c410b272d Update index.py 2022-09-25 17:59:16 +08:00
ecacb44df8 Update index.py 2022-09-25 13:54:48 +08:00
dcfaa1a6c9 Update index.py 2022-09-25 13:52:37 +08:00
c51e50f815 Update index.py 2022-09-25 13:52:21 +08:00
84b0fbc8ef Update index.py 2022-09-25 13:41:52 +08:00
4d83c44a73 Update index.py 2022-09-25 13:11:28 +08:00
4d82835658 mysql 初始化 删除冗余账户 2022-09-25 13:09:19 +08:00
cf863662e0 Update mw.py 2022-09-23 17:09:44 +08:00
4a66b76963 Update mw.py 2022-09-23 16:54:38 +08:00
0da43b6ccb 调整接口 2022-09-23 16:10:24 +08:00
c2ad19a4de 后台解压测试 2022-09-22 09:50:18 +08:00
db6538b57c 网站同步优化 2022-09-22 00:27:28 +08:00
Mr Chen
535f6ddc77 Merge pull request #199 from midoks/dev
0.9.10
2022-09-21 23:11:44 +08:00
aa3950ccfe 0.9.10 2022-09-21 23:10:18 +08:00
8a81f8bb83 Update site_api.py 2022-09-21 17:54:32 +08:00
55d987c0bd 修复批量添加 2022-09-21 17:42:32 +08:00
416e9e7cda 如果目录存在,就不初始化 2022-09-21 17:30:59 +08:00
eedaef7eec Update site_api.py 2022-09-21 17:06:19 +08:00
3265deed3d Update site_api.py 2022-09-21 17:01:41 +08:00
1c7db0e2ec 优化open_basedir配置2 2022-09-21 16:51:42 +08:00
7872891797 Update site.js 2022-09-21 16:17:11 +08:00
8b074090a7 前端配置 2022-09-21 15:37:00 +08:00
50f198e2d3 优化open_basedir配置 2022-09-21 15:12:10 +08:00
07e017c9a7 Update lib.sh 2022-09-20 17:46:01 +08:00
ca0aed7240 up 2022-09-20 17:17:47 +08:00
0126bcb68c Update info.json 2022-09-20 17:14:38 +08:00
7c37df5dec Update all_test.sh 2022-09-20 17:12:06 +08:00
33bc6e19e7 up 2022-09-20 17:10:09 +08:00
35d42a5603 up 2022-09-20 16:32:11 +08:00
8a79beab89 up 2022-09-20 14:40:45 +08:00
cafff1d522 up 2022-09-20 14:29:46 +08:00
e266d85c91 ip 2022-09-20 12:10:27 +08:00
e873ea8639 Update install.sh 2022-09-20 12:01:02 +08:00
0cdc23a096 Update install.sh 2022-09-20 11:55:32 +08:00
2c0231155d 优化 日志读取 2022-09-20 11:30:04 +08:00
5583db0c70 Update crontab_api.py 2022-09-20 00:24:40 +08:00
2eeef4d8bd Update mw.py 2022-09-20 00:22:11 +08:00
5a93b07968 加入开发模式开关 2022-09-19 20:47:12 +08:00
b5195ba685 mail 开发阶段 2022-09-19 20:07:34 +08:00
4c05747942 移动到:https://github.com/mw-plugin/mail
稳定后,再合并。
2022-09-19 20:05:05 +08:00
3722f57347 up 2022-09-19 16:16:25 +08:00
b7a3c32d3f ip 2022-09-19 15:01:17 +08:00
6c0cb42e35 优化 urllib + header 2022-09-19 14:34:47 +08:00
a84e7a16a3 Update index.html 2022-09-19 14:13:18 +08:00
fab1cb1bbe Update install.sh 2022-09-19 13:41:20 +08:00
b46d7c1dee Update mail.js 2022-09-19 13:31:55 +08:00
8f4dda2d65 up 2022-09-19 11:25:43 +08:00
e21d17e342 up 2022-09-18 21:16:22 +08:00
87eab46ed6 Update index.py 2022-09-18 20:37:10 +08:00
e0ebed3080 up 2022-09-18 20:00:23 +08:00
372dbc8995 mail 添加域名 2022-09-18 00:05:45 +08:00
33faf1e54c Update index.html 2022-09-17 22:39:42 +08:00
47f67275d5 up 2022-09-17 21:09:53 +08:00
e45ebc5f11 Update index.py 2022-09-16 13:47:57 +08:00
9ee570e3bb Update config_api.py 2022-09-16 12:15:39 +08:00
cc80ec7839 Update index.js 2022-09-16 12:14:07 +08:00
e7174a2111 Update index.js 2022-09-16 12:13:34 +08:00
ef6adfd82d Update index.js 2022-09-16 12:11:09 +08:00
daf6c9bff8 优化 2022-09-16 12:05:50 +08:00
9f02092788 Update system_api.py 2022-09-16 11:52:20 +08:00
b314ebeed3 cpu tips 优化
gogs 统计优化
2022-09-16 11:49:20 +08:00
38f8fe9a38 画丿 2022-09-15 17:59:37 +08:00
c0e1512195 init 2022-09-15 00:16:08 +08:00
b616854baa redis 添加性能调整功能 2022-09-14 20:50:32 +08:00
1ad9546ae4 Update install.sh 2022-09-13 23:48:01 +08:00
fb3aac37ec Update install.sh 2022-09-13 23:42:54 +08:00
598f964e91 Update install.sh 2022-09-13 23:41:34 +08:00
d9e46f1065 Update install.sh 2022-09-13 23:34:37 +08:00
565d011191 Update index.html 2022-09-13 22:04:18 +08:00
6ae6e5fafc Update info.json 2022-09-13 21:53:30 +08:00
eb1c0efda1 Update gettext.sh 2022-09-13 21:06:11 +08:00
98bc816b21 up 2022-09-13 21:02:55 +08:00
Mr Chen
85735287c3 Merge pull request #195 from midoks/dev
Update README.md
2022-09-12 10:06:43 +08:00
d59022ae44 Update README.md 2022-09-12 10:02:24 +08:00
Mr Chen
70a17af9d8 Merge pull request #192 from midoks/dev
优化OP反代面板之后显示错误
2022-09-11 20:07:48 +08:00
09feeb11d2 zhu 2022-09-11 20:00:10 +08:00
d95e1e68c4 优化OP反代面板之后显示错误的错误 2022-09-11 19:58:15 +08:00
Mr Chen
6e484babe9 Merge pull request #191 from h88782481/dev
Update index.py
2022-09-11 19:00:37 +08:00
JiRan
d37ff296f6 Update index.py 2022-09-11 18:59:16 +08:00
Mr Chen
f95d25f080 Merge pull request #190 from h88782481/dev
Dev
2022-09-11 18:53:16 +08:00
JiRan
fd35db3dd8 Update index.py 2022-09-11 18:45:44 +08:00
JiRan
f22e10a496 Update mw.py 2022-09-11 18:40:41 +08:00
52f80ec3b7 Update debian.sh 2022-09-11 17:32:16 +08:00
Mr Chen
41fd11c0f4 Merge pull request #187 from midoks/dev
fix cmd.md
2022-09-10 11:08:36 +08:00
f8a5e7dab5 Update cmd.md 2022-09-10 11:07:33 +08:00
Mr Chen
4b71d6b3d7 Merge pull request #185 from midoks/dev
0.9.9
2022-09-09 21:31:36 +08:00
becb7f8c7f Update README.md 2022-09-09 21:21:33 +08:00
3da7b57242 Update README.md 2022-09-08 23:39:33 +08:00
42e8057356 Update memcached.sh 2022-09-08 21:49:03 +08:00
e082baabe8 PHP加入igbinary扩展 2022-09-08 21:16:59 +08:00
74d565c99a 0.9.9 2022-09-08 15:40:47 +08:00
750efbf430 Update xhprof.sh 2022-09-07 14:39:43 +08:00
68112ba978 Update install.sh 2022-09-07 10:16:03 +08:00
e994375fc8 Update cloudfare_real_ip.conf 2022-09-07 09:54:20 +08:00
998f677ee7 Create cloudfare_real_ip.conf 2022-09-07 09:06:15 +08:00
8b1b50938d Update README.md 2022-09-06 22:41:11 +08:00
3dbece0b5e Update README.md 2022-09-06 22:19:57 +08:00
e9f1e522de Update README.md 2022-09-06 22:19:21 +08:00
8a815159c1 Update README.md 2022-09-06 22:08:42 +08:00
c8af676d6f up 2022-09-06 22:07:12 +08:00
3bee84a52f Update README.md 2022-09-06 21:54:07 +08:00
82828aacf6 优化gogs插件 2022-09-06 17:45:56 +08:00
e4de3cff61 更新图标 2022-09-06 15:35:03 +08:00
4ed7f5d7fd Update index.py 2022-09-05 23:06:31 +08:00
7b956c73e4 Update index.py 2022-09-05 22:58:53 +08:00
8535dd2306 up 2022-09-05 22:56:38 +08:00
e13df3ae58 Update index.py 2022-09-05 22:49:57 +08:00
44fa68f52d Update index.py 2022-09-05 22:48:25 +08:00
d72abb1e30 修复php-yum无法更改性能调整 2022-09-05 22:33:30 +08:00
aad4343a59 Update whmcs.conf 2022-09-05 11:36:00 +08:00
6b5717b04f 优化的配置模板 2022-09-04 18:16:04 +08:00
655946a467 Update install.sh 2022-09-04 17:18:45 +08:00
80f3d98162 Update update_dev.sh 2022-09-04 17:07:51 +08:00
d73be680e2 Update README.md 2022-09-04 17:04:48 +08:00
ad9595b3b2 Update update_dev.sh 2022-09-04 17:01:47 +08:00
8a337fcfd6 Update site_api.py 2022-09-03 23:37:17 +08:00
38b1dba395 卸载是停止 2022-09-03 23:08:41 +08:00
7195de0418 up 2022-09-03 21:31:22 +08:00
20cb30ba51 Update update_dev.sh 2022-09-03 21:24:26 +08:00
2a7c96b0f5 Update install_dev.sh 2022-09-03 21:24:08 +08:00
8503e6ebe9 增加 amazon 2022-09-03 21:21:12 +08:00
be2c2a2436 Update phplib.conf 2022-09-03 19:00:18 +08:00
8a247c93d4 Update memcached.sh 2022-09-03 17:54:55 +08:00
b4cdc7fc2d Update memcached.sh 2022-09-03 17:43:23 +08:00
cc3f1ed01a Update README.md 2022-09-03 15:53:22 +08:00
4db4284362 Update README.md 2022-09-03 15:51:03 +08:00
3c2e517c61 Update README.md 2022-09-03 14:17:01 +08:00
1d712d1f84 Update README.md 2022-09-03 14:08:17 +08:00
f1e1e3c82c Update README.md 2022-09-03 13:43:18 +08:00
8e587cf055 Update install.sh 2022-09-02 23:16:41 +08:00
Mr Chen
277b95f74b Merge pull request #183 from itcbx/dev
修复rsyncd在debian或ubuntu下安装失败的bug.
2022-09-01 19:41:19 +08:00
iOSHackers
b89b180ee9 修复rsyncd在debian或ubuntu下安装失败的bug. 2022-09-01 19:21:52 +08:00
3e89c35111 Update phplib.conf 2022-08-31 23:22:34 +08:00
52f7939b06 Update phplib.conf 2022-08-31 23:21:39 +08:00
13d038e855 mysql,mariadb删除,不再支持程序删除。 2022-08-31 22:00:23 +08:00
325046d3c2 Update index.py 2022-08-31 21:53:59 +08:00
8cb3b578e0 Update index.py 2022-08-31 21:52:19 +08:00
3b5a5206fc Update index.py 2022-08-31 21:50:03 +08:00
Mr Chen
1517d8d2d7 Merge pull request #181 from midoks/dev
0.9.7
2022-08-29 13:15:36 +08:00
ba55477492 up 2022-08-29 13:14:41 +08:00
e363833437 Update install.sh 2022-08-29 13:12:37 +08:00
6ec51baedb Update install.sh 2022-08-29 12:48:28 +08:00
0fdf62499b Update index.py 2022-08-29 12:22:59 +08:00
1498e23b48 Update haproxy.js 2022-08-29 12:14:13 +08:00
106ce839d8 Update index.html 2022-08-29 12:13:40 +08:00
eed561dadc Update haproxy.conf 2022-08-29 12:09:13 +08:00
c97ec1cbba up 2022-08-29 12:08:02 +08:00
29802d8066 up 2022-08-29 11:32:29 +08:00
9a51bc4b4e Update index.py 2022-08-29 00:35:46 +08:00
082f697706 Update index.py 2022-08-29 00:34:58 +08:00
6e026f2998 Update install.sh 2022-08-28 23:35:31 +08:00
c647f0c02d Update haproxy.tpl 2022-08-28 23:26:02 +08:00
da99297253 Update haproxy.service.tpl 2022-08-28 23:25:31 +08:00
4ab982827e 优化 2022-08-28 23:02:37 +08:00
d3a4db511a haproxy init 2022-08-28 22:50:17 +08:00
fa9e4e3b06 Update index.py 2022-08-24 15:31:44 +08:00
e7cd941f0f Update index.py 2022-08-24 15:16:59 +08:00
c641606ecd #175
统计流量区分类型
2022-08-23 11:13:44 +08:00
Mr Chen
021a360462 Merge pull request #177 from midoks/dev
优化getLocalIp方法
2022-08-23 07:37:59 +08:00
9104280ff1 不再全部测试 2022-08-23 07:37:11 +08:00
0ea0f2d13d 优化getLocalIp方法 2022-08-23 07:35:34 +08:00
Mr Chen
289e251480 Merge pull request #176 from midoks/dev
php74版本退回
2022-08-23 07:03:14 +08:00
ce421cfb89 Update install.sh 2022-08-23 06:52:54 +08:00
Mr Chen
bec41f2c63 Merge pull request #174 from midoks/dev
代码改变版本号
2022-08-22 13:28:50 +08:00
3a34974ec9 Update config_api.py 2022-08-22 13:26:48 +08:00
a7c9fff283 up 2022-08-22 11:55:30 +08:00
c36cca61a1 Update centos.sh 2022-08-22 11:52:05 +08:00
Mr Chen
42edf12d01 Merge pull request #172 from midoks/dev
0.9.6
2022-08-22 11:44:39 +08:00
d6799e89c4 0.9.6 2022-08-22 11:43:11 +08:00
4b4006c9da Update index.html 2022-08-21 12:23:39 +08:00
33bb042b41 up 2022-08-17 19:16:51 +08:00
be2e91b9ce mariadb up 2022-08-17 19:14:36 +08:00
db424f8912 mariadb up 2022-08-17 19:12:12 +08:00
bfca2e313a Update rsyncd.js 2022-08-17 12:01:28 +08:00
1de51747e6 Update supervisor.js 2022-08-17 09:28:25 +08:00
8a623b490b supervisor增加错误查看 2022-08-17 09:25:08 +08:00
b5b8ef7e46 Update .gitignore 2022-08-16 22:08:07 +08:00
daa561b6c4 Update README.md 2022-08-16 18:42:03 +08:00
9bc30db1ad Update README.md 2022-08-16 18:38:35 +08:00
1a9d506d61 Update README.md 2022-08-16 18:35:29 +08:00
62b5d812e2 Update install.sh 2022-08-16 17:29:10 +08:00
433c9ab5ea Update files_api.py 2022-08-16 11:51:46 +08:00
a7a6976204 增加插件[备份]功能。
1. json: "hook":["backup"]   -- 备份钩子开启
2.crontab的执行周期添加优化。
2022-08-16 04:45:21 +08:00
Mr Chen
a1d8523dd9 Merge pull request #165 from midoks/dev
0.9.5
2022-08-15 19:39:36 +08:00
295e456a20 Update README.md 2022-08-15 19:38:32 +08:00
453cb4cf14 0.9.5 2022-08-15 19:37:59 +08:00
56a1ffed2a Update index.py 2022-08-15 16:14:46 +08:00
b94f302fbe gogs 提示更人性 2022-08-15 13:41:01 +08:00
3a278f4cc6 Update system_api.py 2022-08-15 13:04:52 +08:00
67b7f9cf43 Update system_api.py 2022-08-15 13:04:32 +08:00
b3dc24428c Update system_api.py 2022-08-15 12:48:29 +08:00
233e6dfc0f 密码字符修复2 2022-08-15 00:17:27 +08:00
07e74a8947 密码字符修复。 2022-08-14 22:52:25 +08:00
4eed1e8a93 Update index.py 2022-08-14 20:53:15 +08:00
1b91af6f22 Update install.sh 2022-08-14 20:32:42 +08:00
9bc824906b Update index.py 2022-08-14 20:16:24 +08:00
394f345764 Update index.py 2022-08-14 20:13:36 +08:00
a10a11817b Update install.sh 2022-08-14 20:11:36 +08:00
6b82dd5eca Update index.py 2022-08-14 20:04:44 +08:00
a5d976ad36 Update install.sh 2022-08-14 19:43:49 +08:00
4bb4746a1b Update redis.sh 2022-08-14 18:08:39 +08:00
9fad06585f Squashed commit of the following:
commit 0cf35955d8
Merge: f99225f1 7fe6744c
Author: midoks <midoks@163.com>
Date:   Sun Aug 14 15:44:39 2022 +0800

    Merge branch 'master' of github.com:midoks/mdserver-web

commit 7fe6744c09
Merge: cd9b0435 beb085e9
Author: Mr Chen <midoks@users.noreply.github.com>
Date:   Sun Aug 14 15:27:42 2022 +0800

    Merge pull request #163 from WankkoRee/master

    修正`MariaDB 10.8`安装后显示为`MariaDB 10.7`的问题

commit beb085e95c
Author: Wankko Ree <wkr@wkr.moe>
Date:   Sun Aug 14 15:19:55 2022 +0800

    修正`MariaDB 10.8`安装后显示为`MariaDB 10.7`的问题
2022-08-14 15:44:53 +08:00
0cf35955d8 Merge branch 'master' of github.com:midoks/mdserver-web 2022-08-14 15:44:39 +08:00
50ed66d26a Merge branch 'master' into dev 2022-08-14 15:42:11 +08:00
ed17622a0b MySQL&MariaDB导入修复 2022-08-14 15:35:59 +08:00
b8e993cd04 Update index.py 2022-08-14 15:33:08 +08:00
Mr Chen
7fe6744c09 Merge pull request #163 from WankkoRee/master
修正`MariaDB 10.8`安装后显示为`MariaDB 10.7`的问题
2022-08-14 15:27:42 +08:00
Wankko Ree
beb085e95c 修正MariaDB 10.8安装后显示为MariaDB 10.7的问题 2022-08-14 15:20:34 +08:00
657f408a8b Update system_api.py 2022-08-14 10:43:39 +08:00
3994f1505e Update system_api.py 2022-08-14 10:18:09 +08:00
0ecc9307f1 Update site_api.py 2022-08-14 10:17:56 +08:00
93de3dd3ab Update system_api.py 2022-08-14 00:47:39 +08:00
f99225f172 Update system_api.py 2022-08-14 00:46:44 +08:00
856 changed files with 385 additions and 116190 deletions

5
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
# These are supported funding model platforms
github: midoks
custom: https://afdian.net/a/mdserver-web

View File

@@ -11,8 +11,7 @@ Debian x, Centos x, Centos x stream, Ubuntu x?
Ex:
```bash
................start mw success
bash: line 149: ./scripts/init.d/mw: No such file or directory
一个issue,一个问题。多余问题,视情况而答。
```
## 错误截图 ?

View File

@@ -1,9 +1,3 @@
### 合并描述
对pull请求的内容进行清晰、简洁的描述,即应该解决什么问题?
问题链接:<!--将问题链接粘贴到此处,如果不适用,请填写“不适用”->
### 清单
- [ ] 我添加了测试用例来覆盖新代码。
- 我添加了测试用例来覆盖新代码。

View File

@@ -5,9 +5,9 @@ name: MW APP MySQL55
on:
push:
branches: [ "master" ]
branches: [ "run_test" ]
pull_request:
branches: [ "master" ]
branches: [ "run_test" ]
permissions:
contents: read

View File

@@ -5,9 +5,9 @@ name: MW APP MySQL56
on:
push:
branches: [ "master" ]
branches: [ "run_test" ]
pull_request:
branches: [ "master" ]
branches: [ "run_test" ]
permissions:
contents: read

View File

@@ -5,9 +5,9 @@ name: MW APP MySQL57
on:
push:
branches: [ "master" ]
branches: [ "run_test" ]
pull_request:
branches: [ "master" ]
branches: [ "run_test" ]
permissions:
contents: read

View File

@@ -5,9 +5,9 @@ name: MW APP MySQL80
on:
push:
branches: [ "master" ]
branches: [ "run_test" ]
pull_request:
branches: [ "master" ]
branches: [ "run_test" ]
permissions:
contents: read

View File

@@ -5,9 +5,9 @@ name: MW APP PHP
on:
push:
branches: [ "master" ]
branches: [ "run_test" ]
pull_request:
branches: [ "master" ]
branches: [ "run_test" ]
permissions:
contents: read

33
.gitignore vendored
View File

@@ -106,8 +106,8 @@ venv.bak/
.idea/*.iml
tmp/*
*.swp
*.pem
*.zip
scripts/init.d/mw
logs/*
data/*.db
data/control.conf
@@ -117,20 +117,26 @@ data/json/config.json
data/site.pl
data/admin_path.pl
data/close.pl
ssl/input.pl
data/datadir.pl
data/502Task.pl
data/default.pl
data/backup.pl
data/debug.pl
data/default_site.pl
ssl/input.pl
lib/python*
bin
pyvenv.cfg
include
share
pip-selfcheck.json
scripts/init.d/mw
scripts/mdserver-web
data/api_login.txt
data/sessions
data/ssl.pl
@@ -140,16 +146,37 @@ data/restart.pl
data/ssl.pl
data/edate.pl
data/osname.pl
data/only_netio_counters.pl
data/system.db-journal
data/hook_*.json
data/letsencrypt.json
data/basic_auth.json
data/notify.json
data/api.json
data/bind_domain.pl
data/unauthorized_status.pl
plugins/vip_*
plugins/own_*
plugins/my_*
plugins/l2tp
plugins/openlitespeed
plugins/system_safe
plugins/tamper_proof
plugins/tamper_proof_*
plugins/cryptocurrency_trade
plugins/op_load_balance
plugins/gdrive
plugins/mtproxy
plugins/zimg
plugins/bk_demo
plugins/mail
plugins/fastdfs
plugins/v2ray
plugins/frp
plugins/file_search
debug.out

1
CNAME Normal file
View File

@@ -0,0 +1 @@
www.midoks.icu

201
LICENSE
View File

@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [midoks] [midoks of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

149
README.md
View File

@@ -1,149 +0,0 @@
### mdserver-web 0.9.4
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
复制了后台管理界面,按照自己想要的方式写了一版。
![CentOS](https://img.shields.io/badge/LINUX-CentOS-blue?style=for-the-badge&logo=CentOS)
![Ubuntu](https://img.shields.io/badge/LINUX-Ubuntu-blue?style=for-the-badge&logo=Ubuntu)
![Debian](https://img.shields.io/badge/LINUX-Debian-blue?style=for-the-badge&logo=Debian)
![Fedora](https://img.shields.io/badge/LINUX-Fedora-blue?style=for-the-badge&logo=Fedora)
[![Wiki](https://img.shields.io/badge/MW-Wiki-red?style=for-the-badge&logo=wiki)](https://github.com/midoks/mdserver-web/wiki)
[![](https://data.jsdelivr.com/v1/package/gh/midoks/mdserver-web/badge?style=for-the-badge)](https://www.jsdelivr.com/package/gh/midoks/mdserver-web)
* SSH终端工具
* 面板收藏功能
* 网站子目录绑定
* 网站备份功能
* 插件方式管理
基本上可以使用,后续会继续优化!欢迎提供意见!
- 吹水组 - https://t.me/mdserver_web
- [兼容性测试报告](/compatibility.md)
- [常用命令说明](/cmd.md)
### 主要插件介绍
* OpenResty - 轻量级,占有内存少,并发能力强。
* PHP[52-81] - PHP是世界上最好的编程语言。
* MySQL - 一种关系数据库管理系统。
* MariaDB - 是MySQL的一个重要分支。
* MongoDB - 一种非关系NOSQL数据库管理系统。
* phpMyAdmin - 著名Web端MySQL管理工具。
* Memcached - 一个高性能的分布式内存对象缓存系统。
* Redis - 一个高性能的KV数据库。
* PureFtpd - 一款专注于程序健壮和软件安全的免费FTP服务器软件。
* Gogs - 一款极易搭建的自助Git服务。
* Rsyncd - 通用同步服务。
### 插件开发相关
```
插件文档还不完善,如果有不明白的地方提Issue! 我会尽力完善。
如果你自己写了插件,想分享出来,也可以提Issue。
```
- 简单例子 - https://github.com/mw-plugin/simple-plugin
- 插件地址 - https://github.com/mw-plugin
- 开发文档 - https://github.com/midoks/mdserver-web/wiki/插件开发
# Note
```
phpMyAdmin[4.4.15]支持MySQL[5.5-5.7]
phpMyAdmin[5.2.0]支持MySQL[8.0]
PHP[53-72]支持phpMyAdmin[4.4.15]
PHP[72-81]支持phpMyAdmin[5.2.0]
```
# Docker
- 由[DDSRem](https://github.com/DDSRem)开发维护。
- https://hub.docker.com/r/ddsderek/mw-server
```
docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:443 -p 888:888 ddsderek/mw-server:latest
```
### 版本更新 0.9.4
* 修复maridb的用户管理。
* OP防火墙优化。
* phpmyadmin插件优化。
### JSDelivr安装地址
- 初始安装
```
curl -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh | bash
```
- 直接更新
```
curl -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh | bash
```
### 备用地址
- 初始安装
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash
```
- 直接更新
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
```
### 通用软件安装[命令行安装]
- 需已经安装mdserver-web
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/quick/app.sh | bash
```
### DEV使用
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
```
### 微信赞助
[![截图](/route/static/img/weixin_zz.jpg)](/route/static/img/weixin_zz.jpg)
### 无图不真相
[![截图](/route/static/mdw.jpg)](/route/static/mdw.jpg)
### Stargazers over time
[![Stargazers over time](https://starchart.cc/midoks/mdserver-web.svg)](https://starchart.cc/midoks/mdserver-web)
### 感谢开发赞助
[![digitalvirt](https://digitalvirt.com/templates/BlueWhite/img/logo-dark.svg)](https://digitalvirt.com/)
### 授权许可
本项目采用 Apache 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/midoks/mdserver-web/blob/master/LICENSE) 文件中。

1
ads.txt Normal file
View File

@@ -0,0 +1 @@
google.com, pub-7736695762519033, DIRECT, f08c47fec0942fa0

37
app.py
View File

@@ -1,37 +0,0 @@
# coding:utf-8
# pip install profiler_online
# 性能测试
# from profiler_online import run_profiler
# run_profiler()
from gevent import monkey
monkey.patch_all()
import sys
import io
import os
from route import app, socketio
from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
try:
if __name__ == "__main__":
PORT = 7200
if os.path.exists('data/port.pl'):
f = open('data/port.pl')
PORT = int(f.read())
f.close()
HOST = '0.0.0.0'
http_server = WSGIServer(
(HOST, PORT), app, handler_class=WebSocketHandler)
http_server.serve_forever()
socketio.run(app, host=HOST, port=PORT)
except Exception as ex:
print(ex)

View File

@@ -1,110 +0,0 @@
# coding: utf-8
import os
import sys
import time
import string
import json
import hashlib
import shlex
import datetime
import subprocess
import re
import hashlib
from random import Random
import mw
import db
from flask import redirect
def init():
initDB()
initUserInfo()
initInitD()
def local():
result = checkClose()
if result:
return result
# 检查面板是否关闭
def checkClose():
if os.path.exists('data/close.pl'):
return redirect('/close')
def initDB():
try:
sql = db.Sql().dbfile('default')
csql = mw.readFile('data/sql/default.sql')
csql_list = csql.split(';')
for index in range(len(csql_list)):
sql.execute(csql_list[index], ())
except Exception as ex:
print(str(ex))
def doContentReplace(src, dst):
content = mw.readFile(src)
content = content.replace("{$SERVER_PATH}", mw.getRunDir())
mw.writeFile(dst, content)
def initInitD():
# systemctl
# 有问题
# if os.path.exists('/lib/systemd/system'):
# systemd_mw = '/lib/systemd/system/mw.service'
# systemd_mw_task = '/lib/systemd/system/mw-task.service'
# systemd_mw_tpl = mw.getRunDir() + '/scripts/init.d/mw.service.tpl'
# systemd_mw_task_tpl = mw.getRunDir() + '/scripts/init.d/mw-task.service.tpl'
# os.remove(systemd_mw)
# os.remove(systemd_mw_task)
# doContentReplace(systemd_mw_tpl, systemd_mw)
# doContentReplace(systemd_mw_task_tpl, systemd_mw_task)
# mw.execShell('systemctl enable mw')
# mw.execShell('systemctl enable mw-task')
# mw.execShell('systemctl daemon-reload')
script = mw.getRunDir() + '/scripts/init.d/mw.tpl'
script_bin = mw.getRunDir() + '/scripts/init.d/mw'
doContentReplace(script, script_bin)
mw.execShell('chmod +x ' + script_bin)
# 在linux系统中,确保/etc/init.d存在
if not mw.isAppleSystem() and not os.path.exists("/etc/init.d"):
mw.execShell('mkdir -p /etc/init.d')
# initd
if os.path.exists("/etc/init.d"):
initd_bin = '/etc/init.d/mw'
if not os.path.exists(initd_bin):
import shutil
shutil.copyfile(script_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
# 加入自启动
mw.execShell('which chkconfig && chkconfig --add mw')
mw.execShell('which update-rc.d && update-rc.d -f mw defaults')
# 获取系统IPV4
mw.setHostAddr(mw.getLocalIp())
def initUserInfo():
data = mw.M('users').where('id=?', (1,)).getField('password')
if data == '21232f297a57a5a743894a0e4a801fc3':
pwd = mw.getRandomString(8).lower()
file_pw = mw.getRunDir() + '/data/default.pl'
mw.writeFile(file_pw, pwd)
mw.M('users').where('id=?', (1,)).setField(
'password', mw.md5(pwd))

View File

@@ -1,335 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import sys
import mw
import re
import json
import pwd
from flask import session
from flask import request
class config_api:
__version = '0.9.4'
def __init__(self):
pass
##### ----- start ----- ###
# 取面板列表
def getPanelListApi(self):
data = mw.M('panel').field(
'id,title,url,username,password,click,addtime').order('click desc').select()
return mw.getJson(data)
def addPanelInfoApi(self):
title = request.form.get('title', '')
url = request.form.get('url', '')
username = request.form.get('username', '')
password = request.form.get('password', '')
# 校验是还是重复
isAdd = mw.M('panel').where(
'title=? OR url=?', (title, url)).count()
if isAdd:
return mw.returnJson(False, '备注或面板地址重复!')
isRe = mw.M('panel').add('title,url,username,password,click,addtime',
(title, url, username, password, 0, int(time.time())))
if isRe:
return mw.returnJson(True, '添加成功!')
return mw.returnJson(False, '添加失败!')
# 删除面板资料
def delPanelInfoApi(self):
mid = request.form.get('id', '')
isExists = mw.M('panel').where('id=?', (mid,)).count()
if not isExists:
return mw.returnJson(False, '指定面板资料不存在!')
mw.M('panel').where('id=?', (mid,)).delete()
return mw.returnJson(True, '删除成功!')
# 修改面板资料
def setPanelInfoApi(self):
title = request.form.get('title', '')
url = request.form.get('url', '')
username = request.form.get('username', '')
password = request.form.get('password', '')
mid = request.form.get('id', '')
# 校验是还是重复
isSave = mw.M('panel').where(
'(title=? OR url=?) AND id!=?', (title, url, mid)).count()
if isSave:
return mw.returnJson(False, '备注或面板地址重复!')
# 更新到数据库
isRe = mw.M('panel').where('id=?', (mid,)).save(
'title,url,username,password', (title, url, username, password))
if isRe:
return mw.returnJson(True, '修改成功!')
return mw.returnJson(False, '修改失败!')
def syncDateApi(self):
if mw.isAppleSystem():
return mw.returnJson(True, '开发系统不必同步时间!')
data = mw.execShell('ntpdate -s time.nist.gov')
if data[0] == '':
return mw.returnJson(True, '同步成功!')
return mw.returnJson(False, '同步失败:' + data[0])
def setPasswordApi(self):
password1 = request.form.get('password1', '')
password2 = request.form.get('password2', '')
if password1 != password2:
return mw.returnJson(False, '两次输入的密码不一致,请重新输入!')
if len(password1) < 5:
return mw.returnJson(False, '用户密码不能小于5位!')
mw.M('users').where("username=?", (session['username'],)).setField(
'password', mw.md5(password1.strip()))
return mw.returnJson(True, '密码修改成功!')
def setNameApi(self):
name1 = request.form.get('name1', '')
name2 = request.form.get('name2', '')
if name1 != name2:
return mw.returnJson(False, '两次输入的用户名不一致,请重新输入!')
if len(name1) < 3:
return mw.returnJson(False, '用户名长度不能少于3位')
mw.M('users').where("username=?", (session['username'],)).setField(
'username', name1.strip())
session['username'] = name1
return mw.returnJson(True, '用户修改成功!')
def setApi(self):
webname = request.form.get('webname', '')
port = request.form.get('port', '')
host_ip = request.form.get('host_ip', '')
domain = request.form.get('domain', '')
sites_path = request.form.get('sites_path', '')
backup_path = request.form.get('backup_path', '')
if domain != '':
reg = "^([\w\-\*]{1,100}\.){1,4}(\w{1,10}|\w{1,10}\.\w{1,10})$"
if not re.match(reg, domain):
return mw.returnJson(False, '主域名格式不正确')
if int(port) >= 65535 or int(port) < 100:
return mw.returnJson(False, '端口范围不正确!')
if webname != mw.getConfig('title'):
mw.setConfig('title', webname)
if sites_path != mw.getWwwDir():
mw.setWwwDir(sites_path)
if backup_path != mw.getWwwDir():
mw.setBackupDir(backup_path)
if port != mw.getHostPort():
import system_api
import firewall_api
if os.path.exists("/lib/systemd/system/firewalld.service"):
if not firewall_api.firewall_api().getFwStatus():
return mw.returnJson(False, 'firewalld必须先启动!')
mw.setHostPort(port)
msg = mw.getInfo('放行端口[{1}]成功', (port,))
mw.writeLog("防火墙管理", msg)
addtime = time.strftime('%Y-%m-%d %X', time.localtime())
mw.M('firewall').add('port,ps,addtime', (port, "配置修改", addtime))
firewall_api.firewall_api().addAcceptPort(port)
firewall_api.firewall_api().firewallReload()
system_api.system_api().restartMw()
if host_ip != mw.getHostAddr():
mw.setHostAddr(host_ip)
mhost = mw.getHostAddr()
info = {
'uri': '/config',
'host': mhost + ':' + port
}
return mw.returnJson(True, '保存成功!', info)
def setAdminPathApi(self):
admin_path = request.form.get('admin_path', '').strip()
admin_path_checks = ['/', '/close', '/login', '/do_login', '/site',
'/sites', '/download_file', '/control', '/crontab',
'/firewall', '/files', 'config', '/soft', '/system',
'/code', '/ssl', '/plugins']
if admin_path == '':
admin_path = '/'
if admin_path != '/':
if len(admin_path) < 6:
return mw.returnJson(False, '安全入口地址长度不能小于6位!')
if admin_path in admin_path_checks:
return mw.returnJson(False, '该入口已被面板占用,请使用其它入口!')
if not re.match("^/[\w\./-_]+$", admin_path):
return mw.returnJson(False, '入口地址格式不正确,示例: /my_panel')
else:
domain = mw.readFile('data/domain.conf')
if not domain:
domain = ''
limitip = mw.readFile('data/limitip.conf')
if not limitip:
limitip = ''
if not domain.strip() and not limitip.strip():
return mw.returnJson(False, '警告,关闭安全入口等于直接暴露你的后台地址在外网,十分危险,至少开启以下一种安全方式才能关闭:<a style="color:red;"><br>1、绑定访问域名<br>2、绑定授权IP</a>')
admin_path_file = 'data/admin_path.pl'
admin_path_old = '/'
if os.path.exists(admin_path_file):
admin_path_old = mw.readFile(admin_path_file).strip()
if admin_path_old != admin_path:
mw.writeFile(admin_path_file, admin_path)
mw.restartMw()
return mw.returnJson(True, '修改成功!')
def closePanelApi(self):
filename = 'data/close.pl'
if os.path.exists(filename):
os.remove(filename)
return mw.returnJson(True, '开启成功')
mw.writeFile(filename, 'True')
mw.execShell("chmod 600 " + filename)
mw.execShell("chown root.root " + filename)
return mw.returnJson(True, '面板已关闭!')
def setIpv6StatusApi(self):
ipv6_file = 'data/ipv6.pl'
if os.path.exists('data/ipv6.pl'):
os.remove(ipv6_file)
mw.writeLog('面板设置', '关闭面板IPv6兼容!')
else:
mw.writeFile(ipv6_file, 'True')
mw.writeLog('面板设置', '开启面板IPv6兼容!')
mw.restartMw()
return mw.returnJson(True, '设置成功!')
# 获取面板证书
def getPanelSslApi(self):
cert = {}
cert['privateKey'] = mw.readFile('ssl/privateKey.pem')
cert['certPem'] = mw.readFile('ssl/certificate.pem')
cert['rep'] = os.path.exists('ssl/input.pl')
return mw.getJson(cert)
# 保存面板证书
def savePanelSslApi(self):
keyPath = 'ssl/privateKey.pem'
certPath = 'ssl/certificate.pem'
checkCert = '/tmp/cert.pl'
certPem = request.form.get('certPem', '').strip()
privateKey = request.form.get('privateKey', '').strip()
mw.writeFile(checkCert, certPem)
if privateKey:
mw.writeFile(keyPath, privateKey)
if certPem:
mw.writeFile(certPath, certPem)
if not mw.checkCert(checkCert):
return mw.returnJson(False, '证书错误,请检查!')
mw.writeFile('ssl/input.pl', 'True')
return mw.returnJson(True, '证书已保存!')
# 设置面板SSL
def setPanelSslApi(self):
sslConf = mw.getRunDir() + '/data/ssl.pl'
if os.path.exists(sslConf):
os.system('rm -f ' + sslConf)
return mw.returnJson(True, 'SSL已关闭,请使用http协议访问面板!')
else:
os.system('pip install cffi==1.10')
os.system('pip install cryptography==2.1')
os.system('pip install pyOpenSSL==16.2')
try:
if not self.createSSL():
return mw.returnJson(False, '开启失败,无法自动安装pyOpenSSL组件!<p>请尝试手动安装: pip install pyOpenSSL</p>')
mw.writeFile(sslConf, 'True')
except Exception as ex:
return mw.returnJson(False, '开启失败,无法自动安装pyOpenSSL组件!<p>请尝试手动安装: pip install pyOpenSSL</p>')
return mw.returnJson(True, '开启成功,请使用https协议访问面板!')
def getApi(self):
data = {}
return mw.getJson(data)
##### ----- end ----- ###
# 自签证书
def createSSL(self):
if os.path.exists('ssl/input.pl'):
return True
import OpenSSL
key = OpenSSL.crypto.PKey()
key.generate_key(OpenSSL.crypto.TYPE_RSA, 2048)
cert = OpenSSL.crypto.X509()
cert.set_serial_number(0)
cert.get_subject().CN = mw.getLocalIp()
cert.set_issuer(cert.get_subject())
cert.gmtime_adj_notBefore(0)
cert.gmtime_adj_notAfter(86400 * 3650)
cert.set_pubkey(key)
cert.sign(key, 'md5')
cert_ca = OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, cert)
private_key = OpenSSL.crypto.dump_privatekey(
OpenSSL.crypto.FILETYPE_PEM, key)
if len(cert_ca) > 100 and len(private_key) > 100:
mw.writeFile('ssl/certificate.pem', cert_ca)
mw.writeFile('ssl/privateKey.pem', private_key)
print(cert_ca, private_key)
return True
return False
def getVersion(self):
return self.__version
def get(self):
data = {}
data['title'] = mw.getConfig('title')
data['site_path'] = mw.getWwwDir()
data['backup_path'] = mw.getBackupDir()
sformat = 'date +"%Y-%m-%d %H:%M:%S %Z %z"'
data['systemdate'] = mw.execShell(sformat)[0].strip()
data['port'] = mw.getHostPort()
data['ip'] = mw.getHostAddr()
admin_path_file = 'data/admin_path.pl'
if not os.path.exists(admin_path_file):
data['admin_path'] = '/'
else:
data['admin_path'] = mw.readFile(admin_path_file)
ipv6_file = 'data/ipv6.pl'
if os.path.exists('data/ipv6.pl'):
data['ipv6'] = 'checked'
else:
data['ipv6'] = ''
ssl_file = 'data/ssl.pl'
if os.path.exists('data/ssl.pl'):
data['ssl'] = 'checked'
else:
data['ssl'] = ''
data['site_count'] = mw.M('sites').count()
data['username'] = mw.M('users').where(
"id=?", (1,)).getField('username')
return data

View File

@@ -1,542 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import sys
import mw
import re
import json
import pwd
from flask import request
class crontab_api:
field = 'id,name,type,where1,where_hour,where_minute,echo,addtime,status,save,backup_to,stype,sname,sbody,urladdress'
def __init__(self):
pass
##### ----- start ----- ###
def listApi(self):
p = request.args.get('p', 1)
psize = 10
startPage = (int(p) - 1) * psize
pageInfo = str(startPage) + ',' + str(psize)
_list = mw.M('crontab').where('', ()).field(
self.field).limit(pageInfo).order('id desc').select()
data = []
for i in range(len(_list)):
tmp = _list[i]
if _list[i]['type'] == "day":
tmp['type'] = '每天'
tmp['cycle'] = mw.getInfo('每天, {1}点{2}分 执行', (str(
_list[i]['where_hour']), str(_list[i]['where_minute'])))
elif _list[i]['type'] == "day-n":
tmp['type'] = mw.getInfo(
'每{1}天', (str(_list[i]['where1']),))
tmp['cycle'] = mw.getInfo('每隔{1}天, {2}点{3}分 执行', (str(
_list[i]['where1']), str(_list[i]['where_hour']), str(_list[i]['where_minute'])))
elif _list[i]['type'] == "hour":
tmp['type'] = '每小时'
tmp['cycle'] = mw.getInfo(
'每小时, 第{1}分钟 执行', (str(_list[i]['where_minute']),))
elif _list[i]['type'] == "hour-n":
tmp['type'] = mw.getInfo(
'每{1}小时', (str(_list[i]['where1']),))
tmp['cycle'] = mw.getInfo('每{1}小时, 第{2}分钟 执行', (str(
_list[i]['where1']), str(_list[i]['where_minute'])))
elif _list[i]['type'] == "minute-n":
tmp['type'] = mw.getInfo(
'每{1}分钟', (str(_list[i]['where1']),))
tmp['cycle'] = mw.getInfo(
'每隔{1}分钟执行', (str(_list[i]['where1']),))
elif _list[i]['type'] == "week":
tmp['type'] = '每周'
if not _list[i]['where1']:
_list[i]['where1'] = '0'
tmp['cycle'] = mw.getInfo('每周{1}, {2}点{3}分执行', (self.toWeek(int(
_list[i]['where1'])), str(_list[i]['where_hour']), str(_list[i]['where_minute'])))
elif _list[i]['type'] == "month":
tmp['type'] = '每月'
tmp['cycle'] = mw.getInfo('每月, {1}日 {2}点{3}分执行', (str(_list[i]['where1']), str(
_list[i]['where_hour']), str(_list[i]['where_minute'])))
data.append(tmp)
_ret = {}
_ret['data'] = data
count = mw.M('crontab').where('', ()).count()
_page = {}
_page['count'] = count
_page['p'] = p
_page['row'] = psize
_page['tojs'] = "getCronData"
_ret['list'] = mw.getPage(_page)
_ret['p'] = p
return mw.getJson(_ret)
# 设置计划任务状态
def setCronStatusApi(self):
mid = request.form.get('id', '')
cronInfo = mw.M('crontab').where(
'id=?', (mid,)).field(self.field).find()
status = 1
if cronInfo['status'] == status:
status = 0
self.removeForCrond(cronInfo['echo'])
else:
cronInfo['status'] = 1
self.syncToCrond(cronInfo)
mw.M('crontab').where('id=?', (mid,)).setField('status', status)
mw.writeLog(
'计划任务', '修改计划任务[' + cronInfo['name'] + ']状态为[' + str(status) + ']')
return mw.returnJson(True, '设置成功')
# 获取指定任务数据
def getCrondFindApi(self):
sid = request.form.get('id', '')
data = mw.M('crontab').where(
'id=?', (sid,)).field(self.field).find()
return mw.getJson(data)
def modifyCrondApi(self):
sid = request.form.get('id', '')
iname = request.form.get('name', '')
field_type = request.form.get('type', '')
week = request.form.get('week', '')
where1 = request.form.get('where1', '')
hour = request.form.get('hour', '')
minute = request.form.get('minute', '')
save = request.form.get('save', '')
backup_to = request.form.get('backup_to', '')
stype = request.form.get('stype', '')
sname = request.form.get('sname', '')
sbody = request.form.get('sbody', '')
urladdress = request.form.get('urladdress', '')
if len(iname) < 1:
return mw.returnJson(False, '任务名称不能为空!')
params = {
'name': iname,
'type': field_type,
'week': week,
'where1': where1,
'hour': hour,
'minute': minute,
'save': save,
'backup_to': backup_to,
'stype': stype,
'sname': sname,
'sbody': sbody,
'urladdress': urladdress,
}
cuonConfig, get, name = self.getCrondCycle(params)
cronInfo = mw.M('crontab').where(
'id=?', (sid,)).field(self.field).find()
del(cronInfo['id'])
del(cronInfo['addtime'])
cronInfo['name'] = get['name']
cronInfo['type'] = get['type']
cronInfo['where1'] = get['where1']
cronInfo['where_hour'] = get['hour']
cronInfo['where_minute'] = get['minute']
cronInfo['save'] = get['save']
cronInfo['backup_to'] = get['backup_to']
cronInfo['sbody'] = get['sbody']
cronInfo['urladdress'] = get['urladdress']
addData = mw.M('crontab').where('id=?', (sid,)).save('name,type,where1,where_hour,where_minute,save,backup_to,sbody,urladdress', (get[
'name'], field_type, get['where1'], get['hour'], get['minute'], get['save'], get['backup_to'], get['sbody'], get['urladdress']))
self.removeForCrond(cronInfo['echo'])
self.syncToCrond(cronInfo)
mw.writeLog('计划任务', '修改计划任务[' + cronInfo['name'] + ']成功')
return mw.returnJson(True, '修改成功')
def logsApi(self):
sid = request.form.get('id', '')
echo = mw.M('crontab').where("id=?", (sid,)).field('echo').find()
logFile = mw.getServerDir() + '/cron/' + echo['echo'] + '.log'
if not os.path.exists(logFile):
return mw.returnJson(False, '当前日志为空!')
log = mw.getNumLines(logFile, 500)
return mw.returnJson(True, log)
def addApi(self):
iname = request.form.get('name', '')
field_type = request.form.get('type', '')
week = request.form.get('week', '')
where1 = request.form.get('where1', '')
hour = request.form.get('hour', '')
minute = request.form.get('minute', '')
save = request.form.get('save', '')
backup_to = request.form.get('backupTo', '')
stype = request.form.get('sType', '')
sname = request.form.get('sName', '')
sbody = request.form.get('sBody', '')
urladdress = request.form.get('urladdress', '')
if len(iname) < 1:
return mw.returnJson(False, '任务名称不能为空!')
params = {
'name': iname,
'type': field_type,
'week': week,
'where1': where1,
'hour': hour,
'minute': minute,
'save': save,
'backup_to': backup_to,
'stype': stype,
'sname': sname,
'sbody': sbody,
'urladdress': urladdress,
}
addData = self.add(params)
if addData > 0:
return mw.returnJson(True, '添加成功')
return mw.returnJson(False, '添加失败')
def add(self, params):
iname = params["name"]
field_type = params["type"]
week = params["week"]
where1 = params["where1"]
hour = params["hour"]
minute = params["minute"]
save = params["save"]
backup_to = params["backup_to"]
stype = params["stype"]
sname = params["sname"]
sbody = params["sbody"]
urladdress = params["urladdress"]
# print params
cronConfig, get, name = self.getCrondCycle(params)
cronPath = mw.getServerDir() + '/cron'
cronName = self.getShell(params)
if type(cronName) == dict:
return cronName
cronConfig += ' ' + cronPath + '/' + cronName + \
' >> ' + cronPath + '/' + cronName + '.log 2>&1'
# print(cronConfig)
if not mw.isAppleSystem():
wRes = self.writeShell(cronConfig)
if type(wRes) != bool:
return wRes
self.crondReload()
add_time = time.strftime('%Y-%m-%d %X', time.localtime())
task_id = mw.M('crontab').add('name,type,where1,where_hour,where_minute,echo,addtime,status,save,backup_to,stype,sname,sbody,urladdress',
(iname, field_type, where1, hour, minute, cronName, add_time, 1, save, backup_to, stype, sname, sbody, urladdress,))
return task_id
def startTaskApi(self):
sid = request.form.get('id', '')
echo = mw.M('crontab').where('id=?', (sid,)).getField('echo')
execstr = mw.getServerDir() + '/cron/' + echo
os.system('chmod +x ' + execstr)
os.system('nohup ' + execstr + ' >> ' + execstr + '.log 2>&1 &')
return mw.returnJson(True, '任务已执行!')
def delApi(self):
task_id = request.form.get('id', '')
try:
data = self.delete(task_id)
if not data[0]:
return mw.returnJson(False, data[1])
return mw.returnJson(True, '删除成功')
except Exception as e:
return mw.returnJson(False, '删除失败:' + str(e))
def delete(self, tid):
find = mw.M('crontab').where("id=?", (tid,)).field('name,echo').find()
if not self.removeForCrond(find['echo']):
return (False, '无法写入文件,请检查是否开启了系统加固功能!')
cronPath = mw.getServerDir() + '/cron'
sfile = cronPath + '/' + find['echo']
if os.path.exists(sfile):
os.remove(sfile)
sfile = cronPath + '/' + find['echo'] + '.log'
if os.path.exists(sfile):
os.remove(sfile)
mw.M('crontab').where("id=?", (tid,)).delete()
mw.writeLog('计划任务', mw.getInfo('删除计划任务[{1}]成功!', (find['name'],)))
return (True, "OK")
def delLogsApi(self):
sid = request.form.get('id', '')
try:
echo = mw.M('crontab').where("id=?", (sid,)).getField('echo')
logFile = mw.getServerDir() + '/cron/' + echo + '.log'
os.remove(logFile)
return mw.returnJson(True, '任务日志已清空!')
except:
return mw.returnJson(False, '任务日志清空失败!')
# 取数据列表
def getDataListApi(self):
stype = request.form.get('type', '')
if stype == 'databases':
db_list = {}
db_list['orderOpt'] = []
path = mw.getServerDir() + '/mysql'
if not os.path.exists(path + '/mysql.db'):
db_list['data'] = []
else:
db_list['data'] = mw.M('databases').dbPos(
path, 'mysql').field('name,ps').select()
return mw.getJson(db_list)
data = {}
data['data'] = mw.M(stype).field('name,ps').select()
data['orderOpt'] = []
return mw.getJson(data)
##### ----- start ----- ###
# 转换大写星期
def toWeek(self, num):
wheres = {
0: '日',
1: '一',
2: '二',
3: '三',
4: '四',
5: '五',
6: '六'
}
try:
return wheres[num]
except:
return ''
def getCrondCycle(self, params):
cuonConfig = ''
name = ''
if params['type'] == "day":
cuonConfig = self.getDay(params)
name = '每天'
elif params['type'] == "day-n":
cuonConfig = self.getDay_N(params)
name = mw.getInfo('每{1}天', (params['where1'],))
elif params['type'] == "hour":
cuonConfig = self.getHour(params)
name = '每小时'
elif params['type'] == "hour-n":
cuonConfig = self.getHour_N(params)
name = '每小时'
elif params['type'] == "minute-n":
cuonConfig = self.minute_N(params)
elif params['type'] == "week":
params['where1'] = params['week']
cuonConfig = self.week(params)
elif params['type'] == "month":
cuonConfig = self.month(params)
return cuonConfig, params, name
# 取任务构造Day
def getDay(self, param):
cuonConfig = "{0} {1} * * * ".format(param['minute'], param['hour'])
return cuonConfig
# 取任务构造Day_n
def getDay_N(self, param):
cuonConfig = "{0} {1} */{2} * * ".format(
param['minute'], param['hour'], param['where1'])
return cuonConfig
# 取任务构造Hour
def getHour(self, param):
cuonConfig = "{0} * * * * ".format(param['minute'])
return cuonConfig
# 取任务构造Hour-N
def getHour_N(self, param):
cuonConfig = "{0} */{1} * * * ".format(
param['minute'], param['where1'])
return cuonConfig
# 取任务构造Minute-N
def minute_N(self, param):
cuonConfig = "*/{0} * * * * ".format(param['where1'])
return cuonConfig
# 取任务构造week
def week(self, param):
cuonConfig = "{0} {1} * * {2}".format(
param['minute'], param['hour'], param['week'])
return cuonConfig
# 取任务构造Month
def month(self, param):
cuonConfig = "{0} {1} {2} * * ".format(
param['minute'], param['hour'], param['where1'])
return cuonConfig
# 取执行脚本
def getShell(self, param):
# try:
stype = param['stype']
if stype == 'toFile':
shell = param.sFile
else:
head = "#!/bin/bash\nPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin\nexport PATH\n"
log = '.log'
script_dir = mw.getServerDir() + "/mdserver-web/scripts"
wheres = {
'path': head + "python " + script_dir + "/backup.py path " + param['sname'] + " " + str(param['save']),
'site': head + "python " + script_dir + "/backup.py site " + param['sname'] + " " + str(param['save']),
'database': head + "python " + script_dir + "/backup.py database " + param['sname'] + " " + str(param['save']),
'logs': head + "python " + script_dir + "/logs_backup.py " + param['sname'] + log + " " + str(param['save']),
'rememory': head + "/bin/bash " + script_dir + '/rememory.sh'
}
if param['backup_to'] != 'localhost':
cfile = mw.getServerDir() + "/mdserver-web/plugin/" + \
param['backup_to'] + "/" + param['backup_to'] + "_main.py"
if not os.path.exists(cfile):
cfile = script_dir + "/backup_" + \
param['backup_to'] + ".py"
wheres = {
'path': head + "python " + cfile + " path " + param['sname'] + " " + str(param['save']),
'site': head + "python " + cfile + " site " + param['sname'] + " " + str(param['save']),
'database': head + "python " + cfile + " database " + param['sname'] + " " + str(param['save']),
'logs': head + "python " + script_dir + "/logs_backup.py " + param['sname'] + log + " " + str(param['save']),
'rememory': head + "/bin/bash " + script_dir + '/rememory.sh'
}
try:
shell = wheres[stype]
except:
if stype == 'toUrl':
shell = head + "curl -sS --connect-timeout 10 -m 60 '" + \
param['urladdress'] + "'"
else:
shell = head + param['sbody'].replace("\r\n", "\n")
shell += '''
echo "----------------------------------------------------------------------------"
endDate=`date +"%Y-%m-%d %H:%M:%S"`
echo "★[$endDate] Successful"
echo "----------------------------------------------------------------------------"
'''
cronPath = mw.getServerDir() + '/cron'
if not os.path.exists(cronPath):
mw.execShell('mkdir -p ' + cronPath)
if not 'echo' in param:
cronName = mw.md5(mw.md5(str(time.time()) + '_mw'))
else:
cronName = param['echo']
file = cronPath + '/' + cronName
mw.writeFile(file, self.checkScript(shell))
mw.execShell('chmod 750 ' + file)
return cronName
# 检查脚本
def checkScript(self, shell):
keys = ['shutdown', 'init 0', 'mkfs', 'passwd',
'chpasswd', '--stdin', 'mkfs.ext', 'mke2fs']
for key in keys:
shell = shell.replace(key, '[***]')
return shell
# 将Shell脚本写到文件
def writeShell(self, config):
u_file = '/var/spool/cron/crontabs/root'
if not os.path.exists(u_file):
file = '/var/spool/cron/root'
if mw.isAppleSystem():
file = '/etc/crontab'
else:
file = u_file
if not os.path.exists(file):
mw.writeFile(file, '')
conf = mw.readFile(file)
conf += str(config) + "\n"
if mw.writeFile(file, conf):
if not os.path.exists(u_file):
mw.execShell("chmod 600 '" + file +
"' && chown root.root " + file)
else:
mw.execShell("chmod 600 '" + file +
"' && chown root.crontab " + file)
return True
return mw.returnJson(False, '文件写入失败,请检查是否开启系统加固功能!')
# 重载配置
def crondReload(self):
if mw.isAppleSystem():
if os.path.exists('/etc/crontab'):
pass
# mw.execShell('/usr/sbin/cron restart')
else:
if os.path.exists('/etc/init.d/crond'):
mw.execShell('/etc/init.d/crond reload')
elif os.path.exists('/etc/init.d/cron'):
mw.execShell('service cron restart')
else:
mw.execShell("systemctl reload crond")
# 从crond删除
def removeForCrond(self, echo):
u_file = '/var/spool/cron/crontabs/root'
if not os.path.exists(u_file):
file = '/var/spool/cron/root'
if mw.isAppleSystem():
file = '/etc/crontab'
if not os.path.exists(file):
return False
else:
file = u_file
if mw.isAppleSystem():
return True
conf = mw.readFile(file)
rep = ".+" + str(echo) + ".+\n"
conf = re.sub(rep, "", conf)
if not mw.writeFile(file, conf):
return False
self.crondReload()
return True
def syncToCrond(self, cronInfo):
if 'status' in cronInfo:
if cronInfo['status'] == 0:
return False
if 'where_hour' in cronInfo:
cronInfo['hour'] = cronInfo['where_hour']
cronInfo['minute'] = cronInfo['where_minute']
cronInfo['week'] = cronInfo['where1']
cuonConfig, cronInfo, name = self.getCrondCycle(cronInfo)
cronPath = mw.getServerDir() + '/cron'
cronName = self.getShell(cronInfo)
if type(cronName) == dict:
return cronName
cuonConfig += ' ' + cronPath + '/' + cronName + \
' >> ' + cronPath + '/' + cronName + '.log 2>&1'
wRes = self.writeShell(cuonConfig)
if type(wRes) != bool:
return False
self.crondReload()

View File

@@ -1,356 +0,0 @@
# coding: utf-8
import sqlite3
import os
import sys
class Sql():
#------------------------------
# 数据库操作类 For sqlite3
#------------------------------
__DB_FILE = None # 数据库文件
__DB_CONN = None # 数据库连接对象
__DB_TABLE = "" # 被操作的表名称
__OPT_WHERE = "" # where条件
__OPT_LIMIT = "" # limit条件
__OPT_GROUP = "" # group条件
__OPT_ORDER = "" # order条件
__OPT_FIELD = "*" # field条件
__OPT_PARAM = () # where值
def __init__(self):
self.__DB_FILE = 'data/default.db'
def __GetConn(self):
# 取数据库对象
try:
if self.__DB_CONN == None:
self.__DB_CONN = sqlite3.connect(self.__DB_FILE)
self.__DB_CONN.text_factory = str
except Exception as ex:
return "error: " + str(ex)
def autoTextFactory(self):
if sys.version_info[0] == 3:
self.__DB_CONN.text_factory = lambda x: str(
x, encoding="utf-8", errors='ignore')
else:
self.__DB_CONN.text_factory = lambda x: unicode(
x, "utf-8", "ignore")
def dbfile(self, name):
self.__DB_FILE = 'data/' + name + '.db'
return self
def dbPos(self, path, name):
self.__DB_FILE = path + '/' + name + '.db'
return self
def table(self, table):
# 设置表名
self.__DB_TABLE = table
return self
def where(self, where, param):
# WHERE条件
if where:
self.__OPT_WHERE = " WHERE " + where
self.__OPT_PARAM = param
return self
def andWhere(self, where, param):
# WHERE条件
if where:
self.__OPT_WHERE = self.__OPT_WHERE + " and " + where
# print(param)
# print(self.__OPT_PARAM)
self.__OPT_PARAM = self.__OPT_PARAM + param
return self
def order(self, order):
# ORDER条件
if len(order):
self.__OPT_ORDER = " ORDER BY " + order
else:
self.__OPT_ORDER = ""
return self
def group(self, group):
if len(group):
self.__OPT_GROUP = " GROUP BY " + group
else:
self.__OPT_GROUP = ""
return self
def limit(self, limit):
# LIMIT条件
if len(limit):
self.__OPT_LIMIT = " LIMIT " + limit
else:
self.__OPT_LIMIT = ""
return self
def field(self, field):
# FIELD条件
if len(field):
self.__OPT_FIELD = field
return self
def select(self):
# 查询数据集
self.__GetConn()
try:
sql = "SELECT " + self.__OPT_FIELD + " FROM " + self.__DB_TABLE + \
self.__OPT_WHERE + self.__OPT_GROUP + self.__OPT_ORDER + self.__OPT_LIMIT
result = self.__DB_CONN.execute(sql, self.__OPT_PARAM)
data = result.fetchall()
# 构造字曲系列
if self.__OPT_FIELD != "*":
field = self.__OPT_FIELD.split(',')
tmp = []
for row in data:
i = 0
tmp1 = {}
for key in field:
tmp1[key] = row[i]
i += 1
tmp.append(tmp1)
del(tmp1)
data = tmp
del(tmp)
else:
# 将元组转换成列表
tmp = map(list, data)
data = tmp
del(tmp)
self.__close()
return data
except Exception as ex:
return "error: " + str(ex)
def inquiry(self, input_field=''):
# 查询数据集
# 不清空查询参数
self.__GetConn()
try:
sql = "SELECT " + self.__OPT_FIELD + " FROM " + self.__DB_TABLE + \
self.__OPT_WHERE + self.__OPT_GROUP + self.__OPT_ORDER + self.__OPT_LIMIT
# print(sql, self.__OPT_PARAM)
result = self.__DB_CONN.execute(sql, self.__OPT_PARAM)
data = result.fetchall()
# 构造字曲系列
if self.__OPT_FIELD != "*":
if input_field != "":
field = input_field.split(',')
else:
field = self.__OPT_FIELD.split(',')
tmp = []
for row in data:
i = 0
tmp1 = {}
for key in field:
tmp1[key] = row[i]
i += 1
tmp.append(tmp1)
del(tmp1)
data = tmp
del(tmp)
else:
# 将元组转换成列表
tmp = map(list, data)
data = tmp
del(tmp)
return data
except Exception as ex:
return "error: " + str(ex)
def getField(self, keyName):
# 取回指定字段
result = self.field(keyName).select()
if len(result) == 1:
return result[0][keyName]
return result
def setField(self, keyName, keyValue):
# 更新指定字段
return self.save(keyName, (keyValue,))
def find(self):
# 取一行数据
result = self.limit("1").select()
if len(result) == 1:
return result[0]
return result
def count(self):
# 取行数
key = "COUNT(*)"
data = self.field(key).select()
try:
return int(data[0][key])
except:
return 0
def add(self, keys, param):
# 插入数据
self.__GetConn()
try:
values = ""
for key in keys.split(','):
values += "?,"
values = self.checkInput(values[0:len(values) - 1])
sql = "INSERT INTO " + self.__DB_TABLE + \
"(" + keys + ") " + "VALUES(" + values + ")"
result = self.__DB_CONN.execute(sql, param)
last_id = result.lastrowid
self.__close()
self.__DB_CONN.commit()
return last_id
except Exception as ex:
return "error: " + str(ex)
def checkInput(self, data):
if not data:
return data
if type(data) != str:
return data
checkList = [
{'d': '<', 'r': '<'},
{'d': '>', 'r': '>'},
{'d': '\'', 'r': '‘'},
{'d': '"', 'r': '“'},
{'d': '&', 'r': '&'},
{'d': '#', 'r': '#'},
{'d': '<', 'r': '<'}
]
for v in checkList:
data = data.replace(v['d'], v['r'])
return data
def addAll(self, keys, param):
# 插入数据
self.__GetConn()
try:
values = ""
for key in keys.split(','):
values += "?,"
values = values[0:len(values) - 1]
sql = "INSERT INTO " + self.__DB_TABLE + \
"(" + keys + ") " + "VALUES(" + values + ")"
result = self.__DB_CONN.execute(sql, param)
return True
except Exception as ex:
return "error: " + str(ex)
def commit(self):
self.__close()
self.__DB_CONN.commit()
def save(self, keys, param):
# 更新数据
self.__GetConn()
try:
opt = ""
for key in keys.split(','):
opt += key + "=?,"
opt = opt[0:len(opt) - 1]
sql = "UPDATE " + self.__DB_TABLE + " SET " + opt + self.__OPT_WHERE
# import mw
# mw.writeFile('/tmp/test.pl', sql)
# 处理拼接WHERE与UPDATE参数
tmp = list(param)
for arg in self.__OPT_PARAM:
tmp.append(arg)
self.__OPT_PARAM = tuple(tmp)
result = self.__DB_CONN.execute(sql, self.__OPT_PARAM)
self.__close()
self.__DB_CONN.commit()
return result.rowcount
except Exception as ex:
return "error: " + str(ex)
def delete(self, id=None):
# 删除数据
self.__GetConn()
try:
if id:
self.__OPT_WHERE = " WHERE id=?"
self.__OPT_PARAM = (id,)
sql = "DELETE FROM " + self.__DB_TABLE + self.__OPT_WHERE
result = self.__DB_CONN.execute(sql, self.__OPT_PARAM)
self.__close()
self.__DB_CONN.commit()
return result.rowcount
except Exception as ex:
return "error: " + str(ex)
def originExecute(self, sql, param=()):
self.__GetConn()
try:
result = self.__DB_CONN.execute(sql, param)
self.__DB_CONN.commit()
return result
except Exception as ex:
return "error: " + str(ex)
def execute(self, sql, param=()):
# 执行SQL语句返回受影响行
self.__GetConn()
# print sql, param
try:
result = self.__DB_CONN.execute(sql, param)
self.__DB_CONN.commit()
return result.rowcount
except Exception as ex:
return "error: " + str(ex)
def query(self, sql, param):
# 执行SQL语句返回数据集
self.__GetConn()
try:
result = self.__DB_CONN.execute(sql, param)
# 将元组转换成列表
# data = map(list, result)
return result
except Exception as ex:
return "error: " + str(ex)
def create(self, name):
# 创建数据表
self.__GetConn()
import mw
script = mw.readFile('data/' + name + '.sql')
result = self.__DB_CONN.executescript(script)
self.__DB_CONN.commit()
return result.rowcount
def fofile(self, filename):
# 执行脚本
self.__GetConn()
import mw
script = mw.readFile(filename)
result = self.__DB_CONN.executescript(script)
self.__DB_CONN.commit()
return result.rowcount
def __close(self):
# 清理条件属性
self.__OPT_WHERE = ""
self.__OPT_FIELD = "*"
self.__OPT_ORDER = ""
self.__OPT_LIMIT = ""
self.__OPT_PARAM = ()
def close(self):
# 释放资源
try:
self.__DB_CONN.close()
self.__DB_CONN = None
except:
pass

View File

@@ -1,879 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import sys
import mw
import re
import json
import pwd
import shutil
from flask import request
from flask import send_file, send_from_directory
from flask import make_response
from flask import session
class files_api:
rPath = None
def __init__(self):
self.rPath = mw.getRootDir() + '/recycle_bin/'
##### ----- start ----- ###
def getBodyApi(self):
path = request.form.get('path', '')
return self.getBody(path)
def getLastBodyApi(self):
path = request.form.get('path', '')
line = request.form.get('line', '100')
if not os.path.exists(path):
return mw.returnJson(False, '文件不存在', (path,))
try:
data = mw.getNumLines(path, int(line))
return mw.returnJson(True, 'OK', data)
except Exception as ex:
return mw.returnJson(False, u'无法正确读取文件!' + str(ex))
def saveBodyApi(self):
path = request.form.get('path', '')
data = request.form.get('data', '')
encoding = request.form.get('encoding', '')
return self.saveBody(path, data, encoding)
def downloadApi(self):
filename = request.args.get('filename', '')
if not os.path.exists(filename):
return ''
response = make_response(send_from_directory(
os.path.dirname(filename), os.path.basename(filename), as_attachment=True))
return response
def zipApi(self):
sfile = request.form.get('sfile', '')
dfile = request.form.get('dfile', '')
stype = request.form.get('type', '')
path = request.form.get('path', '')
return self.zip(sfile, dfile, stype, path)
def unzipApi(self):
sfile = request.form.get('sfile', '')
dfile = request.form.get('dfile', '')
stype = request.form.get('type', '')
path = request.form.get('path', '')
return self.unzip(sfile, dfile, stype, path)
# 移动文件或目录
def mvFileApi(self):
sfile = request.form.get('sfile', '')
dfile = request.form.get('dfile', '')
if not self.checkFileName(dfile):
return mw.returnJson(False, '文件名中不能包含特殊字符!')
if not os.path.exists(sfile):
return mw.returnJson(False, '指定文件不存在!')
if not self.checkDir(sfile):
return mw.returnJson(False, 'FILE_DANGER')
import shutil
try:
shutil.move(sfile, dfile)
msg = mw.getInfo('移动文件或目录[{1}]到[{2}]成功!', (sfile, dfile,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '移动文件或目录成功!')
except:
return mw.returnJson(False, '移动文件或目录失败!')
def deleteApi(self):
path = request.form.get('path', '')
return self.delete(path)
def fileAccessApi(self):
filename = request.form.get('filename', '')
data = self.getAccess(filename)
return mw.getJson(data)
def setFileAccessApi(self):
if mw.isAppleSystem():
return mw.returnJson(True, '开发机不设置!')
filename = request.form.get('filename', '')
user = request.form.get('user', '')
access = request.form.get('access', '755')
sall = '-R'
try:
if not self.checkDir(filename):
return mw.returnJson(False, '请不要花样作死')
if not os.path.exists(filename):
return mw.returnJson(False, '指定文件不存在!')
os.system('chmod ' + sall + ' ' + access + " '" + filename + "'")
os.system('chown ' + sall + ' ' + user +
':' + user + " '" + filename + "'")
msg = mw.getInfo(
'设置[{1}]权限为[{2}]所有者为[{3}]', (filename, access, user,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '设置成功!')
except:
return mw.returnJson(False, '设置失败!')
def getDirSizeApi(self):
path = request.form.get('path', '')
tmp = self.getDirSize(path)
return mw.returnJson(True, tmp[0].split()[0])
def getDirApi(self):
path = request.form.get('path', '')
if not os.path.exists(path):
path = mw.getRootDir() + "/wwwroot"
search = request.args.get('search', '').strip().lower()
page = request.args.get('p', '1').strip().lower()
row = request.args.get('showRow', '10')
disk = request.form.get('disk', '')
if disk == 'True':
row = 1000
return self.getDir(path, int(page), int(row), search)
def createFileApi(self):
file = request.form.get('path', '')
try:
if not self.checkFileName(file):
return mw.returnJson(False, '文件名中不能包含特殊字符!')
if os.path.exists(file):
return mw.returnJson(False, '指定文件已存在!')
_path = os.path.dirname(file)
if not os.path.exists(_path):
os.makedirs(_path)
open(file, 'w+').close()
self.setFileAccept(file)
msg = mw.getInfo('创建文件[{1}]成功!', (file,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '文件创建成功!')
except Exception as e:
return mw.returnJson(True, '文件创建失败!')
def createDirApi(self):
path = request.form.get('path', '')
try:
if not self.checkFileName(path):
return mw.returnJson(False, '目录名中不能包含特殊字符!')
if os.path.exists(path):
return mw.returnJson(False, '指定目录已存在!')
os.makedirs(path)
self.setFileAccept(path)
msg = mw.getInfo('创建目录[{1}]成功!', (path,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '目录创建成功!')
except Exception as e:
return mw.returnJson(False, '目录创建失败!')
def downloadFileApi(self):
import db
import time
url = request.form.get('url', '')
path = request.form.get('path', '')
filename = request.form.get('filename', '')
execstr = url + '|mw|' + path + '/' + filename
execstr = execstr.strip()
mw.M('tasks').add('name,type,status,addtime,execstr',
('下载文件[' + filename + ']', 'download', '-1', time.strftime('%Y-%m-%d %H:%M:%S'), execstr))
# self.setFileAccept(path + '/' + filename)
mw.triggerTask()
return mw.returnJson(True, '已将下载任务添加到队列!')
# 删除进程下的所有进程
def removeTaskRecursion(self, pid):
cmd = "ps -ef|grep " + pid + \
" | grep -v grep |sed -n '2,1p' | awk '{print $2}'"
sub_pid = mw.execShell(cmd)
if sub_pid[0].strip() == '':
return 'ok'
self.removeTaskRecursion(sub_pid[0].strip())
mw.execShell('kill -9 ' + sub_pid[0].strip())
return sub_pid[0].strip()
def removeTaskApi(self):
import system_api
mid = request.form.get('id', '')
try:
name = mw.M('tasks').where('id=?', (mid,)).getField('name')
status = mw.M('tasks').where('id=?', (mid,)).getField('status')
mw.M('tasks').delete(mid)
if status == '-1':
task_pid = mw.execShell(
"ps aux | grep 'task.py' | grep -v grep |awk '{print $2}'")
task_list = task_pid[0].strip().split("\n")
for i in range(len(task_list)):
self.removeTaskRecursion(task_list[i])
mw.triggerTask()
system_api.system_api().restartTask()
except:
system_api.system_api().restartTask()
return mw.returnJson(True, '任务已删除!')
# 上传文件
def uploadFileApi(self):
from werkzeug.utils import secure_filename
from flask import request
path = request.args.get('path', '')
if not os.path.exists(path):
os.makedirs(path)
f = request.files['zunfile']
filename = os.path.join(path, f.filename)
s_path = path
if os.path.exists(filename):
s_path = filename
p_stat = os.stat(s_path)
f.save(filename)
os.chown(filename, p_stat.st_uid, p_stat.st_gid)
os.chmod(filename, p_stat.st_mode)
msg = mw.getInfo('上传文件[{1}] 到 [{2}]成功!', (filename, path))
mw.writeLog('文件管理', msg)
return mw.returnMsg(True, '上传成功!')
def getRecycleBinApi(self):
rPath = self.rPath
if not os.path.exists(rPath):
os.system('mkdir -p ' + rPath)
data = {}
data['dirs'] = []
data['files'] = []
data['status'] = os.path.exists('data/recycle_bin.pl')
data['status_db'] = os.path.exists('data/recycle_bin_db.pl')
for file in os.listdir(rPath):
try:
tmp = {}
fname = rPath + file
tmp1 = file.split('_mw_')
tmp2 = tmp1[len(tmp1) - 1].split('_t_')
tmp['rname'] = file
tmp['dname'] = file.replace('_mw_', '/').split('_t_')[0]
tmp['name'] = tmp2[0]
tmp['time'] = int(float(tmp2[1]))
if os.path.islink(fname):
filePath = os.readlink(fname)
link = ' -> ' + filePath
if os.path.exists(filePath):
tmp['size'] = os.path.getsize(filePath)
else:
tmp['size'] = 0
else:
tmp['size'] = os.path.getsize(fname)
if os.path.isdir(fname):
data['dirs'].append(tmp)
else:
data['files'].append(tmp)
except Exception as e:
continue
return mw.returnJson(True, 'OK', data)
# 回收站开关
def recycleBinApi(self):
c = 'data/recycle_bin.pl'
db = request.form.get('db', '')
if db != '':
c = 'data/recycle_bin_db.pl'
if os.path.exists(c):
os.remove(c)
mw.writeLog('文件管理', '已关闭回收站功能!')
return mw.returnJson(True, '已关闭回收站功能!')
else:
mw.writeFile(c, 'True')
mw.writeLog('文件管理', '已开启回收站功能!')
return mw.returnJson(True, '已开启回收站功能!')
def reRecycleBinApi(self):
rPath = self.rPath
path = request.form.get('path', '')
dFile = path.replace('_mw_', '/').split('_t_')[0]
try:
import shutil
shutil.move(rPath + path, dFile)
msg = mw.getInfo('移动文件[{1}]到回收站成功!', (dFile,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '恢复成功!')
except Exception as e:
msg = mw.getInfo('从回收站恢复[{1}]失败!', (dFile,))
mw.writeLog('文件管理', msg)
return mw.returnJson(False, '恢复失败!')
def delRecycleBinApi(self):
rPath = self.rPath
path = request.form.get('path', '')
empty = request.form.get('empty', '')
dFile = path.split('_t_')[0]
if not self.checkDir(path):
return mw.returnJson(False, '敏感目录,请不要花样作死!')
os.system('which chattr && chattr -R -i ' + rPath + path)
if os.path.isdir(rPath + path):
import shutil
shutil.rmtree(rPath + path)
else:
os.remove(rPath + path)
tfile = path.replace('_mw_', '/').split('_t_')[0]
msg = mw.getInfo('已彻底从回收站删除{1}!', (tfile,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, msg)
# 获取进度
def getSpeedApi(self):
data = mw.getSpeed()
return mw.returnJson(True, '已清空回收站!', data)
def closeRecycleBinApi(self):
rPath = self.rPath
os.system('which chattr && chattr -R -i ' + rPath)
rlist = os.listdir(rPath)
i = 0
l = len(rlist)
for name in rlist:
i += 1
path = rPath + name
mw.writeSpeed(name, i, l)
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
mw.writeSpeed(None, 0, 0)
mw.writeLog('文件管理', '已清空回收站!')
return mw.returnJson(True, '已清空回收站!')
def deleteDirApi(self):
path = request.form.get('path', '')
if not os.path.exists(path):
return mw.returnJson(False, '指定文件不存在!')
# 检查是否为.user.ini
if path.find('.user.ini'):
os.system("which chattr && chattr -i '" + path + "'")
try:
if os.path.exists('data/recycle_bin.pl'):
if self.mvRecycleBin(path):
return mw.returnJson(True, '已将文件移动到回收站!')
mw.execShell('rm -rf ' + path)
mw.writeLog('文件管理', '删除文件成功!', (path,))
return mw.returnJson(True, '删除文件成功!')
except:
return mw.returnJson(False, '删除文件失败!')
def closeLogsApi(self):
logPath = mw.getLogsDir()
os.system('rm -f ' + logPath + '/*')
os.system('kill -USR1 `cat ' + mw.getServerDir() +
'openresty/nginx/logs/nginx.pid`')
mw.writeLog('文件管理', '网站日志已被清空!')
tmp = self.getDirSize(logPath)
return mw.returnJson(True, tmp[0].split()[0])
def setBatchDataApi(self):
path = request.form.get('path', '')
stype = request.form.get('type', '')
access = request.form.get('access', '')
user = request.form.get('user', '')
data = request.form.get('data')
if stype == '1' or stype == '2':
session['selected'] = {
'path': path,
'type': stype,
'access': access,
'user': user,
'data': data
}
return mw.returnJson(True, '标记成功,请在目标目录点击粘贴所有按钮!')
elif stype == '3':
for key in json.loads(data):
try:
filename = path + '/' + key
if not self.checkDir(filename):
return mw.returnJson(False, 'FILE_DANGER')
os.system('chmod -R ' + access + " '" + filename + "'")
os.system('chown -R ' + user + ':' +
user + " '" + filename + "'")
except:
continue
mw.writeLog('文件管理', '批量设置权限成功!')
return mw.returnJson(True, '批量设置权限成功!')
else:
import shutil
isRecyle = os.path.exists('data/recycle_bin.pl')
data = json.loads(data)
l = len(data)
i = 0
for key in data:
try:
filename = path + '/' + key
topath = filename
if not os.path.exists(filename):
continue
i += 1
mw.writeSpeed(key, i, l)
if os.path.isdir(filename):
if not self.checkDir(filename):
return mw.returnJson(False, '请不要花样作死!')
if isRecyle:
self.mvRecycleBin(topath)
else:
shutil.rmtree(filename)
else:
if key == '.user.ini':
os.system('which chattr && chattr -i ' + filename)
if isRecyle:
self.mvRecycleBin(topath)
else:
os.remove(filename)
except:
continue
mw.writeSpeed(None, 0, 0)
mw.writeLog('文件管理', '批量删除成功!')
return mw.returnJson(True, '批量删除成功!')
def checkExistsFilesApi(self):
dfile = request.form.get('dfile', '')
filename = request.form.get('filename', '')
data = []
filesx = []
if filename == '':
filesx = json.loads(session['selected']['data'])
else:
filesx.append(filename)
for fn in filesx:
if fn == '.':
continue
filename = dfile + '/' + fn
if os.path.exists(filename):
tmp = {}
stat = os.stat(filename)
tmp['filename'] = fn
tmp['size'] = os.path.getsize(filename)
tmp['mtime'] = str(int(stat.st_mtime))
data.append(tmp)
return mw.returnJson(True, 'ok', data)
def batchPasteApi(self):
path = request.form.get('path', '')
stype = request.form.get('type', '')
# filename = request.form.get('filename', '')
import shutil
if not self.checkDir(path):
return mw.returnJson(False, '请不要花样作死!')
i = 0
myfiles = json.loads(session['selected']['data'])
l = len(myfiles)
if stype == '1':
for key in myfiles:
i += 1
mw.writeSpeed(key, i, l)
try:
sfile = session['selected'][
'path'] + '/' + key
dfile = path + '/' + key
if os.path.isdir(sfile):
shutil.copytree(sfile, dfile)
else:
shutil.copyfile(sfile, dfile)
stat = os.stat(sfile)
os.chown(dfile, stat.st_uid, stat.st_gid)
except:
continue
msg = mw.getInfo('从[{1}]批量复制到[{2}]成功',
(session['selected']['path'], path,))
mw.writeLog('文件管理', msg)
else:
for key in myfiles:
try:
i += 1
mw.writeSpeed(key, i, l)
sfile = session['selected'][
'path'] + '/' + key
dfile = path + '/' + key
shutil.move(sfile, dfile)
except:
continue
msg = mw.getInfo('从[{1}]批量移动到[{2}]成功',
(session['selected']['path'], path,))
mw.writeLog('文件管理', msg)
mw.writeSpeed(None, 0, 0)
errorCount = len(myfiles) - i
del(session['selected'])
msg = mw.getInfo('批量操作成功[{1}],失败[{2}]', (str(i), str(errorCount)))
return mw.returnJson(True, msg)
def copyFileApi(self):
sfile = request.form.get('sfile', '')
dfile = request.form.get('dfile', '')
if sfile == dfile:
return mw.returnJson(False, '源与目的一致!')
if not os.path.exists(sfile):
return mw.returnJson(False, '指定文件不存在!')
if os.path.isdir(sfile):
return self.copyDir(sfile, dfile)
try:
import shutil
shutil.copyfile(sfile, dfile)
msg = mw.getInfo('复制文件[{1}]到[{2}]成功!', (sfile, dfile,))
mw.writeLog('文件管理', msg)
stat = os.stat(sfile)
os.chown(dfile, stat.st_uid, stat.st_gid)
return mw.returnJson(True, '文件复制成功!')
except:
return mw.returnJson(False, '文件复制失败!')
##### ----- end ----- ###
def copyDir(self, sfile, dfile):
if not os.path.exists(sfile):
return mw.returnJson(False, '指定目录不存在!')
if os.path.exists(dfile):
return mw.returnJson(False, '指定目录已存在!')
import shutil
try:
shutil.copytree(sfile, dfile)
stat = os.stat(sfile)
os.chown(dfile, stat.st_uid, stat.st_gid)
msg = mw.getInfo('复制目录[{1}]到[{2}]成功!', (sfile, dfile))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '目录复制成功!')
except:
return mw.returnJson(False, '目录复制失败!')
# 检查敏感目录
def checkDir(self, path):
# path = str(path, encoding='utf-8')
path = path.replace('//', '/')
if path[-1:] == '/':
path = path[:-1]
nDirs = ('',
'/',
'/*',
'/www',
'/root',
'/boot',
'/bin',
'/etc',
'/home',
'/dev',
'/sbin',
'/var',
'/usr',
'/tmp',
'/sys',
'/proc',
'/media',
'/mnt',
'/opt',
'/lib',
'/srv',
'/selinux',
'/www/server',
mw.getRootDir())
return not path in nDirs
def getDirSize(self, path):
if mw.getOs() == 'darwin':
tmp = mw.execShell('du -sh ' + path)
else:
tmp = mw.execShell('du -sbh ' + path)
return tmp
def checkFileName(self, filename):
# 检测文件名
nots = ['\\', '&', '*', '|', ';']
if filename.find('/') != -1:
filename = filename.split('/')[-1]
for n in nots:
if n in filename:
return False
return True
def setFileAccept(self, filename):
auth = 'www:www'
if mw.getOs() == 'darwin':
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
auth = user + ':staff'
os.system('chown -R ' + auth + ' ' + filename)
os.system('chmod -R 755 ' + filename)
# 移动到回收站
def mvRecycleBin(self, path):
rPath = self.rPath
if not os.path.exists(rPath):
os.system('mkdir -p ' + rPath)
rFile = rPath + path.replace('/', '_mw_') + '_t_' + str(time.time())
try:
import shutil
shutil.move(path, rFile)
mw.writeLog('文件管理', mw.getInfo(
'移动文件[{1}]到回收站成功!', (path)))
return True
except:
mw.writeLog('文件管理', mw.getInfo(
'移动文件[{1}]到回收站失败!', (path)))
return False
def getBody(self, path):
if not os.path.exists(path):
return mw.returnJson(False, '文件不存在', (path,))
if os.path.getsize(path) > 2097152:
return mw.returnJson(False, u'不能在线编辑大于2MB的文件!')
fp = open(path, 'rb')
data = {}
data['status'] = True
try:
if fp:
from chardet.universaldetector import UniversalDetector
detector = UniversalDetector()
srcBody = b""
for line in fp.readlines():
detector.feed(line)
srcBody += line
detector.close()
char = detector.result
data['encoding'] = char['encoding']
if char['encoding'] == 'GB2312' or not char['encoding'] or char[
'encoding'] == 'TIS-620' or char['encoding'] == 'ISO-8859-9':
data['encoding'] = 'GBK'
if char['encoding'] == 'ascii' or char[
'encoding'] == 'ISO-8859-1':
data['encoding'] = 'utf-8'
if char['encoding'] == 'Big5':
data['encoding'] = 'BIG5'
if not char['encoding'] in ['GBK', 'utf-8',
'BIG5']:
data['encoding'] = 'utf-8'
try:
if sys.version_info[0] == 2:
data['data'] = srcBody.decode(
data['encoding']).encode('utf-8', errors='ignore')
else:
data['data'] = srcBody.decode(data['encoding'])
except:
data['encoding'] = char['encoding']
if sys.version_info[0] == 2:
data['data'] = srcBody.decode(
data['encoding']).encode('utf-8', errors='ignore')
else:
data['data'] = srcBody.decode(data['encoding'])
else:
if sys.version_info[0] == 2:
data['data'] = srcBody.decode('utf-8').encode('utf-8')
else:
data['data'] = srcBody.decode('utf-8')
data['encoding'] = u'utf-8'
return mw.returnJson(True, 'OK', data)
except Exception as ex:
return mw.returnJson(False, u'文件编码不被兼容,无法正确读取文件!' + str(ex))
def saveBody(self, path, data, encoding='utf-8'):
if not os.path.exists(path):
return mw.returnJson(False, '文件不存在')
try:
if encoding == 'ascii':
encoding = 'utf-8'
if sys.version_info[0] == 2:
data = data.encode(encoding, errors='ignore')
fp = open(path, 'w+')
else:
data = data.encode(
encoding, errors='ignore').decode(encoding)
fp = open(path, 'w+', encoding=encoding)
fp.write(data)
fp.close()
if path.find("web_conf") > 0:
mw.restartWeb()
mw.writeLog('文件管理', '文件保存成功', (path,))
return mw.returnJson(True, '文件保存成功')
except Exception as ex:
return mw.returnJson(False, 'FILE_SAVE_ERR:' + str(ex))
def zip(self, sfile, dfile, stype, path):
if sfile.find(',') == -1:
if not os.path.exists(path + '/' + sfile):
return mw.returnMsg(False, '指定文件不存在!')
try:
tmps = mw.getRunDir() + '/tmp/panelExec.log'
if stype == 'zip':
os.system("cd '" + path + "' && zip '" + dfile +
"' -r '" + sfile + "' > " + tmps + " 2>&1")
else:
sfiles = ''
for sfile in sfile.split(','):
if not sfile:
continue
sfiles += " '" + sfile + "'"
os.system("cd '" + path + "' && tar -zcvf '" +
dfile + "' " + sfiles + " > " + tmps + " 2>&1")
self.setFileAccept(dfile)
mw.writeLog("文件管理", '文件压缩成功!', (sfile, dfile))
return mw.returnJson(True, '文件压缩成功!')
except:
return mw.returnJson(False, '文件压缩失败!')
def unzip(self, sfile, dfile, stype, path):
if not os.path.exists(sfile):
return mw.returnMsg(False, '指定文件不存在!')
try:
tmps = mw.getRunDir() + '/tmp/panelExec.log'
if stype == 'zip':
os.system("cd " + path + " && unzip -d '" + dfile +
"' '" + sfile + "' > " + tmps + " 2>&1")
else:
sfiles = ''
for sfile in sfile.split(','):
if not sfile:
continue
sfiles += " '" + sfile + "'"
os.system("cd " + path + " && tar -zxvf " + sfiles +
" -C " + dfile + " > " + tmps + " 2>&1")
self.setFileAccept(dfile)
mw.writeLog("文件管理", '文件解压成功!', (sfile, dfile))
return mw.returnJson(True, '文件解压成功!')
except:
return mw.returnJson(False, '文件解压失败!')
def delete(self, path):
if not os.path.exists(path):
return mw.returnJson(False, '指定文件不存在!')
# 检查是否为.user.ini
if path.find('.user.ini') >= 0:
os.system("which chattr && chattr -i '" + path + "'")
try:
if os.path.exists('data/recycle_bin.pl'):
if self.mvRecycleBin(path):
return mw.returnJson(True, '已将文件移动到回收站!')
os.remove(path)
mw.writeLog('文件管理', mw.getInfo(
'删除文件[{1}]成功!', (path)))
return mw.returnJson(True, '删除文件成功!')
except:
return mw.returnJson(False, '删除文件失败!')
def getAccess(self, filename):
data = {}
try:
stat = os.stat(filename)
data['chmod'] = str(oct(stat.st_mode)[-3:])
data['chown'] = pwd.getpwuid(stat.st_uid).pw_name
except:
data['chmod'] = 755
data['chown'] = 'www'
return data
# 计算文件数量
def getCount(self, path, search):
i = 0
for name in os.listdir(path):
if search:
if name.lower().find(search) == -1:
continue
# if name[0:1] == '.':
# continue
i += 1
return i
def getDir(self, path, page=1, page_size=10, search=None):
data = {}
dirnames = []
filenames = []
info = {}
info['count'] = self.getCount(path, search)
info['row'] = page_size
info['p'] = page
info['tojs'] = 'getFiles'
pageObj = mw.getPageObject(info, '1,2,3,4,5,6,7,8')
data['PAGE'] = pageObj[0]
i = 0
n = 0
for filename in os.listdir(path):
if search:
if filename.lower().find(search) == -1:
continue
i += 1
if n >= pageObj[1].ROW:
break
if i < pageObj[1].SHIFT:
continue
try:
filePath = path + '/' + filename
link = ''
if os.path.islink(filePath):
filePath = os.readlink(filePath)
link = ' -> ' + filePath
if not os.path.exists(filePath):
filePath = path + '/' + filePath
if not os.path.exists(filePath):
continue
stat = os.stat(filePath)
accept = str(oct(stat.st_mode)[-3:])
mtime = str(int(stat.st_mtime))
user = ''
try:
user = pwd.getpwuid(stat.st_uid).pw_name
except Exception as ee:
user = str(stat.st_uid)
size = str(stat.st_size)
if os.path.isdir(filePath):
dirnames.append(filename + ';' + size + ';' +
mtime + ';' + accept + ';' + user + ';' + link)
else:
filenames.append(filename + ';' + size + ';' +
mtime + ';' + accept + ';' + user + ';' + link)
n += 1
except Exception as e:
continue
data['DIR'] = sorted(dirnames)
data['FILES'] = sorted(filenames)
data['PATH'] = path.replace('//', '/')
return mw.getJson(data)

View File

@@ -1,410 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import sys
import mw
import re
import json
import pwd
from flask import request
class firewall_api:
__isFirewalld = False
__isUfw = False
__isMac = False
def __init__(self):
if os.path.exists('/usr/sbin/firewalld'):
self.__isFirewalld = True
if os.path.exists('/usr/sbin/ufw'):
self.__isUfw = True
if mw.isAppleSystem():
self.__isMac = True
##### ----- start ----- ###
# 添加屏蔽IP
def addDropAddressApi(self):
import re
port = request.form.get('port', '').strip()
ps = request.form.get('ps', '').strip()
rep = "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d{1,2})?$"
if not re.search(rep, port):
return mw.returnJson(False, '您输入的IP地址不合法!')
address = port
if mw.M('firewall').where("port=?", (address,)).count() > 0:
return mw.returnJson(False, '您要放屏蔽的IP已存在屏蔽列表,无需重复处理!')
if self.__isUfw:
mw.execShell('ufw deny from ' + address + ' to any')
else:
if self.__isFirewalld:
cmd = 'firewall-cmd --permanent --add-rich-rule=\'rule family=ipv4 source address="' + \
address + '" drop\''
mw.execShell(cmd)
else:
cmd = 'iptables -I INPUT -s ' + address + ' -j DROP'
mw.execShell(cmd)
msg = mw.getInfo('屏蔽IP[{1}]成功!', (address,))
mw.writeLog("防火墙管理", msg)
addtime = time.strftime('%Y-%m-%d %X', time.localtime())
mw.M('firewall').add('port,ps,addtime', (address, ps, addtime))
self.firewallReload()
return mw.returnJson(True, '添加成功!')
# 添加放行端口
def addAcceptPortApi(self):
if not self.getFwStatus():
return mw.returnJson(False, '防火墙启动时,才能添加规则!')
import re
import time
port = request.form.get('port', '').strip()
ps = request.form.get('ps', '').strip()
stype = request.form.get('type', '').strip()
rep = "^\d{1,5}(:\d{1,5})?$"
if not re.search(rep, port):
return mw.returnJson(False, '端口范围不正确!')
if mw.M('firewall').where("port=?", (port,)).count() > 0:
return mw.returnJson(False, '您要放行的端口已存在,无需重复放行!')
msg = mw.getInfo('放行端口[{1}]成功', (port,))
mw.writeLog("防火墙管理", msg)
addtime = time.strftime('%Y-%m-%d %X', time.localtime())
mw.M('firewall').add('port,ps,addtime', (port, ps, addtime))
self.addAcceptPort(port)
self.firewallReload()
return mw.returnJson(True, '添加放行(' + port + ')端口成功!')
# 删除IP屏蔽
def delDropAddressApi(self):
if not self.getFwStatus():
return mw.returnJson(False, '防火墙启动时,才能删除规则!')
port = request.form.get('port', '').strip()
ps = request.form.get('ps', '').strip()
sid = request.form.get('id', '').strip()
address = port
if self.__isUfw:
mw.execShell('ufw delete deny from ' + address + ' to any')
else:
if self.__isFirewalld:
mw.execShell(
'firewall-cmd --permanent --remove-rich-rule=\'rule family=ipv4 source address="' + address + '" drop\'')
elif self.__isMac:
pass
else:
cmd = 'iptables -D INPUT -s ' + address + ' -j DROP'
mw.execShell(cmd)
msg = mw.getInfo('解除IP[{1}]的屏蔽!', (address,))
mw.writeLog("防火墙管理", msg)
mw.M('firewall').where("id=?", (sid,)).delete()
self.firewallReload()
return mw.returnJson(True, '删除成功!')
# 删除放行端口
def delAcceptPortApi(self):
port = request.form.get('port', '').strip()
sid = request.form.get('id', '').strip()
mw_port = mw.readFile('data/port.pl')
try:
if(port == mw_port):
return mw.returnJson(False, '失败,不能删除当前面板端口!')
if self.__isUfw:
mw.execShell('ufw delete allow ' + port + '/tcp')
else:
if self.__isFirewalld:
mw.execShell(
'firewall-cmd --permanent --zone=public --remove-port=' + port + '/tcp')
mw.execShell(
'firewall-cmd --permanent --zone=public --remove-port=' + port + '/udp')
else:
mw.execShell(
'iptables -D INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT')
msg = mw.getInfo('删除防火墙放行端口[{1}]成功!', (port,))
mw.writeLog("防火墙管理", msg)
mw.M('firewall').where("id=?", (sid,)).delete()
self.firewallReload()
return mw.returnJson(True, '删除成功!')
except Exception as e:
return mw.returnJson(False, '删除失败!:' + str(e))
def getWwwPathApi(self):
path = mw.getLogsDir()
return mw.getJson({'path': path})
def getListApi(self):
p = request.form.get('p', '1').strip()
limit = request.form.get('limit', '10').strip()
return self.getList(int(p), int(limit))
def getLogListApi(self):
p = request.form.get('p', '1').strip()
limit = request.form.get('limit', '10').strip()
search = request.form.get('search', '').strip()
return self.getLogList(int(p), int(limit), search)
def getSshInfoApi(self):
file = '/etc/ssh/sshd_config'
conf = mw.readFile(file)
rep = "#*Port\s+([0-9]+)\s*\n"
port = re.search(rep, conf).groups(0)[0]
isPing = True
try:
if mw.isAppleSystem():
isPing = True
else:
file = '/etc/sysctl.conf'
conf = mw.readFile(file)
rep = "#*net\.ipv4\.icmp_echo_ignore_all\s*=\s*([0-9]+)"
tmp = re.search(rep, conf).groups(0)[0]
if tmp == '1':
isPing = False
except:
isPing = True
import system_api
panelsys = system_api.system_api()
version = panelsys.getSystemVersion()
if os.path.exists('/usr/bin/apt-get'):
if os.path.exists('/etc/init.d/sshd'):
cmd = "service sshd status | grep -P '(dead|stop)'|grep -v grep"
status = mw.execShell(cmd)
else:
cmd = "service ssh status | grep -P '(dead|stop)'|grep -v grep"
status = mw.execShell(cmd)
else:
if version.find(' 7.') != -1:
cmd = "systemctl status sshd.service | grep 'dead'|grep -v grep"
status = mw.execShell(cmd)
else:
cmd = "/etc/init.d/sshd status | grep -e 'stopped' -e '已停'|grep -v grep"
status = mw.execShell(cmd)
if len(status[0]) > 3:
status = False
else:
status = True
data = {}
data['port'] = port
data['status'] = status
data['ping'] = isPing
if mw.isAppleSystem():
data['firewall_status'] = False
else:
data['firewall_status'] = self.getFwStatus()
return mw.getJson(data)
def setSshPortApi(self):
port = request.form.get('port', '1').strip()
if int(port) < 22 or int(port) > 65535:
return mw.returnJson(False, '端口范围必需在22-65535之间!')
ports = ['21', '25', '80', '443', '7200', '8080', '888', '8888']
if port in ports:
return mw.returnJson(False, '(' + port + ')' + '特殊端口不可设置!')
file = '/etc/ssh/sshd_config'
conf = mw.readFile(file)
rep = "#*Port\s+([0-9]+)\s*\n"
conf = re.sub(rep, "Port " + port + "\n", conf)
mw.writeFile(file, conf)
if self.__isFirewalld:
mw.execShell('setenforce 0')
mw.execShell(
'sed -i "s#SELINUX=enforcing#SELINUX=disabled#" /etc/selinux/config')
mw.execShell("systemctl restart sshd.service")
elif self.__isUfw:
mw.execShell('ufw allow ' + port + '/tcp')
mw.execShell("service ssh restart")
else:
mw.execShell(
'iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT')
mw.execShell("/etc/init.d/sshd restart")
self.firewallReload()
# mw.M('firewall').where(
# "ps=?", ('SSH远程管理服务',)).setField('port', port)
msg = mw.getInfo('改SSH端口为[{1}]成功!', port)
mw.writeLog("防火墙管理", msg)
return mw.returnJson(True, '修改成功!')
def setSshStatusApi(self):
if mw.isAppleSystem():
return mw.returnJson(True, '开发机不能操作!')
status = request.form.get('status', '1').strip()
version = mw.readFile('/etc/redhat-release')
if int(status) == 1:
msg = 'SSH服务已停用'
act = 'stop'
else:
msg = 'SSH服务已启用'
act = 'start'
if not os.path.exists('/etc/redhat-release'):
mw.execShell('service ssh ' + act)
elif version.find(' 7.') != -1:
mw.execShell("systemctl " + act + " sshd.service")
else:
mw.execShell("/etc/init.d/sshd " + act)
mw.writeLog("防火墙管理", msg)
return mw.returnJson(True, '操作成功!')
def setPingApi(self):
if mw.isAppleSystem():
return mw.returnJson(True, '开发机不能操作!')
status = request.form.get('status')
filename = '/etc/sysctl.conf'
conf = mw.readFile(filename)
if conf.find('net.ipv4.icmp_echo') != -1:
rep = u"net\.ipv4\.icmp_echo.*"
conf = re.sub(rep, 'net.ipv4.icmp_echo_ignore_all=' + status, conf)
else:
conf += "\nnet.ipv4.icmp_echo_ignore_all=" + status
mw.writeFile(filename, conf)
mw.execShell('sysctl -p')
return mw.returnJson(True, '设置成功!')
def setFwApi(self):
if mw.isAppleSystem():
return mw.returnJson(True, '开发机不能设置!')
status = request.form.get('status', '1')
if status == '1':
if self.__isUfw:
mw.execShell('/usr/sbin/ufw disable')
if self.__isFirewalld:
mw.execShell('systemctl stop firewalld.service')
mw.execShell('systemctl disable firewalld.service')
elif self.__isMac:
pass
else:
mw.execShell('/etc/init.d/iptables save')
mw.execShell('/etc/init.d/iptables stop')
else:
if self.__isUfw:
mw.execShell("echo 'y'|sudo ufw enable")
if self.__isFirewalld:
mw.execShell('systemctl start firewalld.service')
mw.execShell('systemctl enable firewalld.service')
elif self.__isMac:
pass
else:
mw.execShell('/etc/init.d/iptables save')
mw.execShell('/etc/init.d/iptables restart')
return mw.returnJson(True, '设置成功!')
def delPanelLogsApi(self):
mw.M('logs').where('id>?', (0,)).delete()
mw.writeLog('面板设置', '面板操作日志已清空!')
return mw.returnJson(True, '面板操作日志已清空!')
##### ----- start ----- ###
def getList(self, page, limit):
start = (page - 1) * limit
_list = mw.M('firewall').field('id,port,ps,addtime').limit(
str(start) + ',' + str(limit)).order('id desc').select()
data = {}
data['data'] = _list
count = mw.M('firewall').count()
_page = {}
_page['count'] = count
_page['tojs'] = 'showAccept'
_page['p'] = page
data['page'] = mw.getPage(_page)
return mw.getJson(data)
def getLogList(self, page, limit, search=''):
find_search = ''
if search != '':
find_search = "type like '%" + search + "%' or log like '%" + \
search + "%' or addtime like '%" + search + "%'"
start = (page - 1) * limit
_list = mw.M('logs').where(find_search, ()).field(
'id,type,log,addtime').limit(str(start) + ',' + str(limit)).order('id desc').select()
data = {}
data['data'] = _list
count = mw.M('logs').where(find_search, ()).count()
_page = {}
_page['count'] = count
_page['tojs'] = 'getLogs'
_page['p'] = page
data['page'] = mw.getPage(_page)
return mw.getJson(data)
def addAcceptPort(self, port):
if self.__isUfw:
mw.execShell('ufw allow ' + port + '/tcp')
elif self.__isFirewalld:
port = port.replace(':', '-')
cmd = 'firewall-cmd --permanent --zone=public --add-port=' + port + '/tcp'
mw.execShell(cmd)
elif self.__isMac:
pass
else:
cmd = 'iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport ' + port + ' -j ACCEPT'
mw.execShell(cmd)
def firewallReload(self):
if self.__isUfw:
mw.execShell('/usr/sbin/ufw reload')
return
if self.__isFirewalld:
mw.execShell('firewall-cmd --reload')
elif self.__isMac:
pass
else:
mw.execShell('/etc/init.d/iptables save')
mw.execShell('/etc/init.d/iptables restart')
def getFwStatus(self):
if self.__isUfw:
cmd = "/usr/sbin/ufw status| grep Status | awk -F ':' '{print $2}'"
data = mw.execShell(cmd)
if data[0].strip() == 'inactive':
return False
return True
if self.__isFirewalld:
cmd = "ps -ef|grep firewalld |grep -v grep | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return False
return True
elif self.__isMac:
return False
else:
cmd = "ps -ef|grep iptables |grep -v grep | awk '{print $2}'"
data = mw.execShell(cmd)
if data[0] == '':
return False
return True

File diff suppressed because it is too large Load Diff

View File

@@ -1,224 +0,0 @@
# coding: utf-8
import math
import string
class Page():
#--------------------------
# 分页类 - JS回调版
#--------------------------
__PREV = '上一页'
__NEXT = '下一页'
__START = '首页'
__END = '尾页'
__COUNT_START = '共'
__COUNT_END = '条数据'
__FO = '从'
__LINE = '条'
__LIST_NUM = 4
SHIFT = None # 偏移量
ROW = None # 每页行数
__C_PAGE = None # 当前页
__COUNT_PAGE = None # 总页数
__COUNT_ROW = None # 总行数
__URI = None # URI
__RTURN_JS = False # 是否返回JS回调
__START_NUM = None # 起始行
__END_NUM = None # 结束行
def __init__(self):
if False:
self.__PREV = tmp['PREV']
self.__NEXT = tmp['NEXT']
self.__START = tmp['START']
self.__END = tmp['END']
self.__COUNT_START = tmp['COUNT_START']
self.__COUNT_END = tmp['COUNT_END']
self.__FO = tmp['FO']
self.__LINE = tmp['LINE']
def GetPage(self, pageInfo, limit='1,2,3,4,5,6,7,8'):
# 取分页信息
# @param pageInfo 传入分页参数字典
# @param limit 返回系列
self.__RTURN_JS = pageInfo['return_js']
self.__COUNT_ROW = pageInfo['count']
self.ROW = pageInfo['row']
self.__C_PAGE = self.__GetCpage(pageInfo['p'])
self.__START_NUM = self.__StartRow()
self.__END_NUM = self.__EndRow()
self.__COUNT_PAGE = self.__GetCountPage()
self.__URI = self.__SetUri(pageInfo['uri'])
self.SHIFT = self.__START_NUM - 1
keys = limit.split(',')
pages = {}
# 起始页
pages['1'] = self.__GetStart()
# 上一页
pages['2'] = self.__GetPrev()
# 分页
pages['3'] = self.__GetPages()
# 下一页
pages['4'] = self.__GetNext()
# 尾页
pages['5'] = self.__GetEnd()
# 当前显示页与总页数
pages['6'] = "<span class='Pnumber'>" + \
str(self.__C_PAGE) + "/" + \
str(self.__COUNT_PAGE) + "</span>"
# 本页显示开始与结束行
pages['7'] = "<span class='Pline'>" + str(self.__FO) + \
str(self.__START_NUM) + "-" + \
str(self.__END_NUM) + str(self.__LINE) + "</span>"
# 行数
pages['8'] = "<span class='Pcount'>" + str(self.__COUNT_START) + \
str(self.__COUNT_ROW) + str(self.__COUNT_END) + "</span>"
# 构造返回数据
retuls = '<div>'
for value in keys:
retuls += pages[value]
retuls += '</div>'
# 返回分页数据
return retuls
def __GetEnd(self):
# 构造尾页
endStr = ""
if self.__C_PAGE >= self.__COUNT_PAGE:
endStr = ''
else:
if self.__RTURN_JS == "":
endStr = "<a class='Pend' href='" + self.__URI + "p=" + \
str(self.__COUNT_PAGE) + "'>" + str(self.__END) + "</a>"
else:
endStr = "<a class='Pend' onclick='" + self.__RTURN_JS + \
"(" + str(self.__COUNT_PAGE) + ")'>" + \
str(self.__END) + "</a>"
return endStr
def __GetNext(self):
# 构造下一页
nextStr = ""
if self.__C_PAGE >= self.__COUNT_PAGE:
nextStr = ''
else:
if self.__RTURN_JS == "":
nextStr = "<a class='Pnext' href='" + self.__URI + "p=" + \
str(self.__C_PAGE + 1) + "'>" + str(self.__NEXT) + "</a>"
else:
nextStr = "<a class='Pnext' onclick='" + self.__RTURN_JS + \
"(" + str(self.__C_PAGE + 1) + ")'>" + \
str(self.__NEXT) + "</a>"
return nextStr
def __GetPages(self):
# 构造分页
pages = ''
num = 0
# 当前页之前
if (self.__COUNT_PAGE - self.__C_PAGE) < self.__LIST_NUM:
num = self.__LIST_NUM + \
(self.__LIST_NUM - (self.__COUNT_PAGE - self.__C_PAGE))
else:
num = self.__LIST_NUM
n = 0
for i in range(num):
n = num - i
page = self.__C_PAGE - n
if page > 0:
if self.__RTURN_JS == "":
pages += "<a class='Pnum' href='" + self.__URI + \
"p=" + str(page) + "'>" + str(page) + "</a>"
else:
pages += "<a class='Pnum' onclick='" + self.__RTURN_JS + \
"(" + str(page) + ")'>" + str(page) + "</a>"
# 当前页
if self.__C_PAGE > 0:
pages += "<span class='Pcurrent'>" + \
str(self.__C_PAGE) + "</span>"
# 当前页之后
if self.__C_PAGE <= self.__LIST_NUM:
num = self.__LIST_NUM + (self.__LIST_NUM - self.__C_PAGE) + 1
else:
num = self.__LIST_NUM
for i in range(num):
if i == 0:
continue
page = self.__C_PAGE + i
if page > self.__COUNT_PAGE:
break
if self.__RTURN_JS == "":
pages += "<a class='Pnum' href='" + self.__URI + \
"p=" + str(page) + "'>" + str(page) + "</a>"
else:
pages += "<a class='Pnum' onclick='" + self.__RTURN_JS + \
"(" + str(page) + ")'>" + str(page) + "</a>"
return pages
def __GetPrev(self):
# 构造上一页
startStr = ''
if self.__C_PAGE == 1:
startStr = ''
else:
if self.__RTURN_JS == "":
startStr = "<a class='Ppren' href='" + self.__URI + "p=" + \
str(self.__C_PAGE - 1) + "'>" + str(self.__PREV) + "</a>"
else:
startStr = "<a class='Ppren' onclick='" + self.__RTURN_JS + \
"(" + str(self.__C_PAGE - 1) + ")'>" + \
str(self.__PREV) + "</a>"
return startStr
def __GetStart(self):
# 构造起始分页
startStr = ''
if self.__C_PAGE == 1:
startStr = ''
else:
if self.__RTURN_JS == "":
startStr = "<a class='Pstart' href='" + \
self.__URI + "p=1'>" + str(self.__START) + "</a>"
else:
startStr = "<a class='Pstart' onclick='" + \
self.__RTURN_JS + "(1)'>" + str(self.__START) + "</a>"
return startStr
def __GetCpage(self, p):
# 取当前页
if p:
return p
return 1
def __StartRow(self):
# 从多少行开始
return (self.__C_PAGE - 1) * self.ROW + 1
def __EndRow(self):
# 从多少行结束
if self.ROW > self.__COUNT_ROW:
return self.__COUNT_ROW
return self.__C_PAGE * self.ROW
def __GetCountPage(self):
# 取总页数
return int(math.ceil(self.__COUNT_ROW / float(self.ROW)))
def __SetUri(self, sinput):
# 构造URI
uri = '?'
for key in sinput:
if key == 'p':
continue
uri += key + '=' + sinput[key] + '&'
return str(uri)

View File

@@ -1,867 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import mw
import re
import json
import sys
# reload(sys)
# sys.setdefaultencoding('utf8')
import threading
import multiprocessing
from flask import request
class pa_thread(threading.Thread):
def __init__(self, func, args, name=''):
threading.Thread.__init__(self)
self.name = name
self.func = func
self.args = args
self.result = self.func(*self.args)
def getResult(self):
try:
return self.result
except Exception:
return None
class plugins_api:
__tasks = None
__plugin_dir = 'plugins'
__type = 'data/json/type.json'
__index = 'data/json/index.json'
setupPath = None
def __init__(self):
self.setupPath = 'server'
self.__plugin_dir = mw.getRunDir() + '/plugins'
self.__type = mw.getRunDir() + '/data/json/type.json'
self.__index = mw.getRunDir() + '/data/json/index.json'
##### ----- start ----- ###
def listApi(self):
sType = request.args.get('type', '0')
sPage = request.args.get('p', '1')
if not mw.isNumber(sPage):
sPage = 1
if not mw.isNumber(sType):
sType = 0
# print sPage
data = self.getPluginList(sType, int(sPage))
return mw.getJson(data)
def fileApi(self):
name = request.args.get('name', '')
if name.strip() == '':
return ''
f = request.args.get('f', '')
if f.strip() == '':
return ''
file = mw.getPluginDir() + '/' + name + '/' + f
if not os.path.exists(file):
return ''
c = open(file, 'rb').read()
return c
def indexListApi(self):
data = self.getIndexList()
return mw.getJson(data)
def indexSortApi(self):
sort = request.form.get('ssort', '')
if sort.strip() == '':
return mw.returnJson(False, '排序数据不能为空!')
data = self.setIndexSort(sort)
if data:
return mw.returnJson(True, '成功!')
return mw.returnJson(False, '失败!')
def installApi(self):
rundir = mw.getRunDir()
name = request.form.get('name', '')
version = request.form.get('version', '')
mmsg = '安装'
if hasattr(request.form, 'upgrade'):
mtype = 'update'
mmsg = 'upgrade'
if name.strip() == '':
return mw.returnJson(False, '缺少插件名称!', ())
if version.strip() == '':
return mw.returnJson(False, '缺少版本信息!', ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
# print infoJsonPos
if not os.path.exists(infoJsonPos):
return mw.returnJson(False, '配置文件不存在!', ())
pluginInfo = json.loads(mw.readFile(infoJsonPos))
execstr = "cd " + os.getcwd() + "/plugins/" + \
name + " && /bin/bash " + pluginInfo["shell"] \
+ " install " + version
if mw.isAppleSystem():
print(execstr)
taskAdd = (None, mmsg + '[' + name + '-' + version + ']',
'execshell', '0', time.strftime('%Y-%m-%d %H:%M:%S'), execstr)
mw.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
# 任务执行相关
mw.triggerTask()
return mw.returnJson(True, '已将安装任务添加到队列!')
def uninstallOldApi(self):
rundir = mw.getRunDir()
name = request.form.get('name', '')
version = request.form.get('version', '')
if name.strip() == '':
return mw.returnJson(False, "缺少插件名称!", ())
if version.strip() == '':
return mw.returnJson(False, "缺少版本信息!", ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
if not os.path.exists(infoJsonPos):
return mw.returnJson(False, "配置文件不存在!", ())
pluginInfo = json.loads(mw.readFile(infoJsonPos))
execstr = "cd " + os.getcwd() + "/plugins/" + \
name + " && /bin/bash " + pluginInfo["shell"] \
+ " uninstall " + version
taskAdd = (None, '卸载[' + name + '-' + version + ']',
'execshell', '0', time.strftime('%Y-%m-%d %H:%M:%S'), execstr)
mw.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
return mw.returnJson(True, '已将卸载任务添加到队列!')
# 卸载时间短,不加入任务中...
def uninstallApi(self):
rundir = mw.getRunDir()
name = request.form.get('name', '')
version = request.form.get('version', '')
if name.strip() == '':
return mw.returnJson(False, "缺少插件名称!", ())
if version.strip() == '':
return mw.returnJson(False, "缺少版本信息!", ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
if not os.path.exists(infoJsonPos):
return mw.returnJson(False, "配置文件不存在!", ())
pluginInfo = json.loads(mw.readFile(infoJsonPos))
execstr = "cd " + os.getcwd() + "/plugins/" + \
name + " && /bin/bash " + pluginInfo["shell"] \
+ " uninstall " + version
data = mw.execShell(execstr)
if mw.isAppleSystem():
print(execstr)
print(data[0], data[1])
self.removeIndex(name, version)
return mw.returnJson(True, '卸载执行成功!')
# if data[1] == '':
# return mw.returnJson(True, '已将卸载成功!')
# else:
# return mw.returnJson(False, '卸载出现错误信息!' + data[1])
def checkApi(self):
name = request.form.get('name', '')
if name.strip() == '':
return mw.returnJson(False, "缺少插件名称!", ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
if not os.path.exists(infoJsonPos):
return mw.returnJson(False, "配置文件不存在!", ())
return mw.returnJson(True, "插件存在!", ())
def setIndexApi(self):
name = request.form.get('name', '')
status = request.form.get('status', '0')
version = request.form.get('version', '')
if status == '1':
return self.addIndex(name, version)
return self.removeIndex(name, version)
def settingApi(self):
name = request.args.get('name', '')
html = self.__plugin_dir + '/' + name + '/index.html'
return mw.readFile(html)
def runApi(self):
name = request.form.get('name', '')
func = request.form.get('func', '')
version = request.form.get('version', '')
args = request.form.get('args', '')
script = request.form.get('script', 'index')
data = self.run(name, func, version, args, script)
if data[1] == '':
r = mw.returnJson(True, "OK", data[0].strip())
else:
r = mw.returnJson(False, data[1].strip())
return r
def callbackApi(self):
name = request.form.get('name', '')
func = request.form.get('func', '')
args = request.form.get('args', '')
script = request.form.get('script', 'index')
data = self.callback(name, func, args, script)
if data[0]:
return mw.returnJson(True, "OK", data[1])
return mw.returnJson(False, data[1])
def updateZipApi(self):
tmp_path = mw.getRootDir() + '/temp'
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)
mw.execShell("rm -rf " + tmp_path + '/*')
tmp_file = tmp_path + '/plugin_tmp.zip'
from werkzeug.utils import secure_filename
from flask import request
f = request.files['plugin_zip']
if f.filename[-4:] != '.zip':
return mw.returnJson(False, '仅支持zip文件!')
f.save(tmp_file)
mw.execShell('cd ' + tmp_path + ' && unzip ' + tmp_file)
os.remove(tmp_file)
p_info = tmp_path + '/info.json'
if not os.path.exists(p_info):
d_path = None
for df in os.walk(tmp_path):
if len(df[2]) < 3:
continue
if not 'info.json' in df[2]:
continue
if not 'install.sh' in df[2]:
continue
if not os.path.exists(df[0] + '/info.json'):
continue
d_path = df[0]
if d_path:
tmp_path = d_path
p_info = tmp_path + '/info.json'
try:
data = json.loads(mw.readFile(p_info))
data['size'] = mw.getPathSize(tmp_path)
if not 'author' in data:
data['author'] = '未知'
if not 'home' in data:
data['home'] = 'https://github.com/midoks/mdserver-web'
plugin_path = mw.getPluginDir() + data['name'] + '/info.json'
data['old_version'] = '0'
data['tmp_path'] = tmp_path
if os.path.exists(plugin_path):
try:
old_info = json.loads(mw.ReadFile(plugin_path))
data['old_version'] = old_info['versions']
except:
pass
except:
mw.execShell("rm -rf " + tmp_path)
return mw.returnJson(False, '在压缩包中没有找到插件信息,请检查插件包!')
protectPlist = ('openresty', 'mysql', 'php', 'redis', 'memcached'
'mongodb', 'swap', 'gogs', 'pureftp')
if data['name'] in protectPlist:
return mw.returnJson(False, '[' + data['name'] + '],重要插件不可修改!')
return mw.getJson(data)
def inputZipApi(self):
plugin_name = request.form.get('plugin_name', '')
tmp_path = request.form.get('tmp_path', '')
if not os.path.exists(tmp_path):
return mw.returnJson(False, '临时文件不存在,请重新上传!')
plugin_path = mw.getPluginDir() + '/' + plugin_name
if not os.path.exists(plugin_path):
print(mw.execShell('mkdir -p ' + plugin_path))
mw.execShell("\cp -rf " + tmp_path + '/* ' + plugin_path + '/')
mw.execShell('chmod -R 755 ' + plugin_path)
p_info = mw.readFile(plugin_path + '/info.json')
if p_info:
mw.writeLog('软件管理', '安装第三方插件[%s]' %
json.loads(p_info)['title'])
return mw.returnJson(True, '安装成功!')
mw.execShell("rm -rf " + plugin_path)
return mw.returnJson(False, '安装失败!')
##### ----- end ----- ###
# 进程是否存在
def processExists(self, pname, exe=None):
try:
if not self.pids:
self.pids = psutil.pids()
for pid in self.pids:
try:
p = psutil.Process(pid)
if p.name() == pname:
if not exe:
return True
else:
if p.exe() == exe:
return True
except:
pass
return False
except:
return True
# 检查是否正在安装
def checkSetupTask(self, sName, sVer, sCoexist):
if not self.__tasks:
self.__tasks = mw.M('tasks').where(
"status!=?", ('1',)).field('status,name').select()
isTask = '1'
for task in self.__tasks:
tmpt = mw.getStrBetween('[', ']', task['name'])
if not tmpt:
continue
task_sign = tmpt.split('-')
task_len = len(task_sign)
task_name = task_sign[0].lower()
task_ver = task_sign[1]
if task_len > 2:
nameArr = task_sign[0:task_len - 1]
task_name = '-'.join(nameArr).lower()
task_ver = task_sign[task_len - 1]
if sCoexist:
if task_name == sName and task_ver == sVer:
isTask = task['status']
else:
if task_name == sName:
isTask = task['status']
return isTask
def checkStatus(self, info):
if not info['setup']:
return False
data = self.run(info['name'], 'status', info['setup_version'])
if data[0] == 'start':
return True
return False
def checkStatusProcess(self, info, i, return_dict):
if not info['setup']:
return_dict[i] = False
return
data = self.run(info['name'], 'status', info['setup_version'])
if data[0] == 'start':
return_dict[i] = True
else:
return_dict[i] = False
def checkStatusThreads(self, info, i):
if not info['setup']:
return False
data = self.run(info['name'], 'status', info['setup_version'])
if data[0] == 'start':
return True
else:
return False
# 还无法正常运行,先保留
def checkStatusThreadsCallback(self, info, i):
if not info['setup']:
return False
try:
data = self.callback(info['name'], 'status', info['setup_version'])
except Exception as e:
data = self.callback(info['name'], 'status')
# data = self.run(info['name'], 'status', info['setup_version'])
if data[0] == 'start':
return True
else:
return False
def checkStatusMThreads(self, plugins_info):
try:
threads = []
ntmp_list = range(len(plugins_info))
for i in ntmp_list:
t = pa_thread(self.checkStatusThreads,
(plugins_info[i], i))
threads.append(t)
for i in ntmp_list:
threads[i].start()
for i in ntmp_list:
threads[i].join()
for i in ntmp_list:
t = threads[i].getResult()
plugins_info[i]['status'] = t
except Exception as e:
print('checkStatusMThreads:', str(e))
return plugins_info
def checkStatusMProcess(self, plugins_info):
manager = multiprocessing.Manager()
return_dict = manager.dict()
jobs = []
for i in range(len(plugins_info)):
p = multiprocessing.Process(
target=self.checkStatusProcess, args=(plugins_info[i], i, return_dict))
jobs.append(p)
p.start()
for proc in jobs:
proc.join()
returnData = return_dict.values()
for i in ntmp_list:
plugins_info[i]['status'] = returnData[i]
return plugins_info
def checkDisplayIndex(self, name, version):
if not os.path.exists(self.__index):
mw.writeFile(self.__index, '[]')
indexList = json.loads(mw.readFile(self.__index))
if type(version) == list:
for index in range(len(version)):
vname = name + '-' + version[index]
if vname in indexList:
return True
else:
vname = name + '-' + version
if vname in indexList:
return True
return False
def getVersion(self, path):
version_f = path + '/version.pl'
if os.path.exists(version_f):
return mw.readFile(version_f).strip()
return ''
# 构造本地插件信息
def getPluginInfo(self, info):
checks = ''
path = ''
coexist = False
if info["checks"][0:1] == '/':
checks = info["checks"]
else:
checks = mw.getRootDir() + '/' + info['checks']
if 'path' in info:
path = info['path']
if path[0:1] != '/':
path = mw.getRootDir() + '/' + path
if 'coexist' in info and info['coexist']:
coexist = True
pInfo = {
"id": 10000,
"pid": info['pid'],
"type": 1000,
"name": info['name'],
"title": info['title'],
"ps": info['ps'],
"dependnet": "",
"mutex": "",
"path": path,
"install_checks": checks,
"uninsatll_checks": checks,
"coexist": coexist,
"versions": info['versions'],
# "updates": info['updates'],
"display": False,
"setup": False,
"setup_version": "",
"status": False,
"install_pre_inspection": False,
"uninstall_pre_inspection": False,
}
if checks.find('VERSION') > -1:
pInfo['install_checks'] = checks.replace(
'VERSION', info['versions'])
if path.find('VERSION') > -1:
pInfo['path'] = path.replace(
'VERSION', info['versions'])
pInfo['task'] = self.checkSetupTask(
pInfo['name'], info['versions'], coexist)
pInfo['display'] = self.checkDisplayIndex(
info['name'], pInfo['versions'])
pInfo['setup'] = os.path.exists(pInfo['install_checks'])
if coexist and pInfo['setup']:
pInfo['setup_version'] = info['versions']
else:
pInfo['setup_version'] = self.getVersion(pInfo['install_checks'])
# pluginInfo['status'] = self.checkStatus(pluginInfo)
if 'install_pre_inspection' in info:
pInfo['install_pre_inspection'] = info['install_pre_inspection']
if 'uninstall_pre_inspection' in info:
pInfo['uninstall_pre_inspection'] = info[
'uninstall_pre_inspection']
pInfo['status'] = False
return pInfo
def makeCoexist(self, data):
plugins_info = []
for index in range(len(data['versions'])):
tmp = data.copy()
tmp['title'] = tmp['title'] + \
'-' + data['versions'][index]
tmp['versions'] = data['versions'][index]
pg = self.getPluginInfo(tmp)
plugins_info.append(pg)
return plugins_info
def makeList(self, data, sType='0'):
plugins_info = []
if (data['pid'] == sType):
if type(data['versions']) == list and 'coexist' in data and data['coexist']:
tmp_data = self.makeCoexist(data)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
else:
pg = self.getPluginInfo(data)
plugins_info.append(pg)
return plugins_info
if sType == '0':
if type(data['versions']) == list and 'coexist' in data and data['coexist']:
tmp_data = self.makeCoexist(data)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
else:
pg = self.getPluginInfo(data)
plugins_info.append(pg)
# print plugins_info, data
return plugins_info
def getAllList(self, sType='0'):
plugins_info = []
for dirinfo in os.listdir(self.__plugin_dir):
if dirinfo[0:1] == '.':
continue
path = self.__plugin_dir + '/' + dirinfo
json_file = path + '/info.json'
if os.path.exists(json_file):
try:
data = json.loads(mw.readFile(json_file))
tmp_data = self.makeList(data, sType)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
except Exception as e:
print(e)
return plugins_info
def getAllListPage(self, sType='0', page=1, pageSize=10):
plugins_info = []
for dirinfo in os.listdir(self.__plugin_dir):
if dirinfo[0:1] == '.':
continue
path = self.__plugin_dir + '/' + dirinfo
if os.path.isdir(path):
json_file = path + '/info.json'
if os.path.exists(json_file):
try:
data = json.loads(mw.readFile(json_file))
tmp_data = self.makeList(data, sType)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
except Exception as e:
print(e)
start = (page - 1) * pageSize
end = start + pageSize
_plugins_info = plugins_info[start:end]
_plugins_info = self.checkStatusMThreads(_plugins_info)
return (_plugins_info, len(plugins_info))
def makeListThread(self, data, sType='0'):
plugins_info = []
if (data['pid'] == sType):
if type(data['versions']) == list and data.has_key('coexist') and data['coexist']:
tmp_data = self.makeCoexist(data)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
else:
pg = self.getPluginInfo(data)
plugins_info.append(pg)
return plugins_info
if sType == '0':
if type(data['versions']) == list and data.has_key('coexist') and data['coexist']:
tmp_data = self.makeCoexist(data)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
else:
pg = self.getPluginInfo(data)
plugins_info.append(pg)
# print plugins_info, data
return plugins_info
def getAllListThread(self, sType='0'):
plugins_info = []
tmp_list = []
threads = []
for dirinfo in os.listdir(self.__plugin_dir):
if dirinfo[0:1] == '.':
continue
path = self.__plugin_dir + '/' + dirinfo
if os.path.isdir(path):
json_file = path + '/info.json'
if os.path.exists(json_file):
data = json.loads(mw.readFile(json_file))
if sType == '0':
tmp_list.append(data)
if (data['pid'] == sType):
tmp_list.append(data)
ntmp_list = range(len(tmp_list))
for i in ntmp_list:
t = pa_thread(self.makeListThread, (tmp_list[i], sType))
threads.append(t)
for i in ntmp_list:
threads[i].start()
for i in ntmp_list:
threads[i].join()
for i in ntmp_list:
t = threads[i].getResult()
for index in range(len(t)):
plugins_info.append(t[index])
return plugins_info
def makeListProcess(self, data, sType, i, return_dict):
plugins_info = []
if (data['pid'] == sType):
if type(data['versions']) == list and data.has_key('coexist') and data['coexist']:
tmp_data = self.makeCoexist(data)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
else:
pg = self.getPluginInfo(data)
plugins_info.append(pg)
# return plugins_info
if sType == '0':
if type(data['versions']) == list and data.has_key('coexist') and data['coexist']:
tmp_data = self.makeCoexist(data)
for index in range(len(tmp_data)):
plugins_info.append(tmp_data[index])
else:
pg = self.getPluginInfo(data)
plugins_info.append(pg)
return_dict[i] = plugins_info
# return plugins_info
def getAllListProcess(self, sType='0'):
plugins_info = []
tmp_list = []
manager = multiprocessing.Manager()
return_dict = manager.dict()
jobs = []
for dirinfo in os.listdir(self.__plugin_dir):
if dirinfo[0:1] == '.':
continue
path = self.__plugin_dir + '/' + dirinfo
if os.path.isdir(path):
json_file = path + '/info.json'
if os.path.exists(json_file):
data = json.loads(mw.readFile(json_file))
if sType == '0':
tmp_list.append(data)
if (data['pid'] == sType):
tmp_list.append(data)
ntmp_list = range(len(tmp_list))
for i in ntmp_list:
p = multiprocessing.Process(
target=self.makeListProcess, args=(tmp_list[i], sType, i, return_dict))
jobs.append(p)
p.start()
for proc in jobs:
proc.join()
returnData = return_dict.values()
for i in ntmp_list:
for index in range(len(returnData[i])):
plugins_info.append(returnData[i][index])
return plugins_info
def getPluginList(self, sType, sPage=1, sPageSize=10):
# print sType, sPage, sPageSize
ret = {}
ret['type'] = json.loads(mw.readFile(self.__type))
# plugins_info = self.getAllListThread(sType)
# plugins_info = self.getAllListProcess(sType)
data = self.getAllListPage(sType, sPage, sPageSize)
ret['data'] = data[0]
args = {}
args['count'] = data[1]
args['p'] = sPage
args['tojs'] = 'getSList'
args['row'] = sPageSize
ret['list'] = mw.getPage(args)
return ret
def getIndexList(self):
if not os.path.exists(self.__index):
mw.writeFile(self.__index, '[]')
indexList = json.loads(mw.readFile(self.__index))
plist = []
for i in indexList:
tmp = i.split('-')
tmp_len = len(tmp)
plugin_name = tmp[0]
plugin_ver = tmp[1]
if tmp_len > 2:
tmpArr = tmp[0:tmp_len - 1]
plugin_name = '-'.join(tmpArr)
plugin_ver = tmp[tmp_len - 1]
json_file = self.__plugin_dir + '/' + plugin_name + '/info.json'
if os.path.exists(json_file):
content = mw.readFile(json_file)
try:
data = json.loads(content)
data = self.makeList(data)
for index in range(len(data)):
if data[index]['versions'] == plugin_ver or plugin_ver in data[index]['versions']:
data[index]['display'] = True
plist.append(data[index])
continue
except Exception as e:
print('getIndexList:', e)
# 使用gevent模式时,无法使用多进程
#plist = self.checkStatusMProcess(plist)
plist = self.checkStatusMThreads(plist)
return plist
def setIndexSort(self, sort):
data = sort.split('|')
mw.writeFile(self.__index, json.dumps(data))
return True
def addIndex(self, name, version):
if not os.path.exists(self.__index):
mw.writeFile(self.__index, '[]')
indexList = json.loads(mw.readFile(self.__index))
vname = name + '-' + version
if vname in indexList:
return mw.returnJson(False, '请不要重复添加!')
if len(indexList) > 12:
return mw.returnJson(False, '首页最多只能显示12个软件!')
indexList.append(vname)
mw.writeFile(self.__index, json.dumps(indexList))
return mw.returnJson(True, '添加成功!')
def removeIndex(self, name, version):
if not os.path.exists(self.__index):
mw.writeFile(self.__index, '[]')
indexList = json.loads(mw.readFile(self.__index))
vname = name + '-' + version
if not vname in indexList:
return mw.returnJson(True, '删除成功!')
indexList.remove(vname)
mw.writeFile(self.__index, json.dumps(indexList))
return mw.returnJson(True, '删除成功!')
# shell 调用
def run(self, name, func, version='', args='', script='index'):
path = self.__plugin_dir + \
'/' + name + '/' + script + '.py'
py = 'python3 ' + path
if args == '':
py_cmd = py + ' ' + func + ' ' + version
else:
py_cmd = py + ' ' + func + ' ' + version + ' ' + args
if not os.path.exists(path):
return ('', '')
data = mw.execShell(py_cmd)
if mw.isDebugMode():
print('run', py_cmd)
print(data)
# print os.path.exists(py_cmd)
return (data[0].strip(), data[1].strip())
# 映射包调用
def callback(self, name, func, args='', script='index'):
package = self.__plugin_dir + '/' + name
if not os.path.exists(package):
return (False, "插件不存在!")
sys.path.append(package)
eval_str = "__import__('" + script + "')." + func + '(' + args + ')'
newRet = eval(eval_str)
if mw.isDebugMode():
print('callback', eval_str)
return (True, newRet)

File diff suppressed because it is too large Load Diff

View File

@@ -1,718 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import re
import math
import sys
import json
from flask import Flask, session
from flask import request
import db
import mw
import config_api
import requests
from threading import Thread
from time import sleep
def mw_async(f):
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kwargs=kwargs)
thr.start()
return wrapper
class system_api:
setupPath = None
pids = None
def __init__(self):
self.setupPath = mw.getServerDir()
##### ----- start ----- ###
def networkApi(self):
data = self.getNetWork()
return mw.getJson(data)
def updateServerApi(self):
stype = request.args.get('type', 'check')
version = request.args.get('version', '')
return self.updateServer(stype, version)
def systemTotalApi(self):
data = self.getSystemTotal()
return mw.getJson(data)
def diskInfoApi(self):
diskInfo = self.getDiskInfo()
return mw.getJson(diskInfo)
def setControlApi(self):
stype = request.form.get('type', '')
day = request.form.get('day', '')
data = self.setControl(stype, day)
return data
def getLoadAverageApi(self):
start = request.args.get('start', '')
end = request.args.get('end', '')
data = self.getLoadAverageData(start, end)
return mw.getJson(data)
def getCpuIoApi(self):
start = request.args.get('start', '')
end = request.args.get('end', '')
data = self.getCpuIoData(start, end)
return mw.getJson(data)
def getDiskIoApi(self):
start = request.args.get('start', '')
end = request.args.get('end', '')
data = self.getDiskIoData(start, end)
return mw.getJson(data)
def getNetworkIoApi(self):
start = request.args.get('start', '')
end = request.args.get('end', '')
data = self.getNetWorkIoData(start, end)
return mw.getJson(data)
def rememoryApi(self):
os.system('sync')
scriptFile = mw.getRunDir() + '/script/rememory.sh'
mw.execShell("/bin/bash " + scriptFile)
data = self.getMemInfo()
return mw.getJson(data)
# 重启面板
def restartApi(self):
self.restartMw()
return mw.returnJson(True, '面板已重启!')
def restartServerApi(self):
if mw.isAppleSystem():
return mw.returnJson(False, "开发环境不可重起")
self.restartServer()
return mw.returnJson(True, '正在重启服务器!')
##### ----- end ----- ###
def restartTask(self):
initd = mw.getRunDir() + '/scripts/init.d/mw'
if os.path.exists(initd):
os.system(initd + ' ' + 'restart_task')
return True
def restartMw(self):
mw.writeFile('data/restart.pl', 'True')
return True
@mw_async
def restartServer(self):
if not mw.isRestart():
return mw.returnJson(False, '请等待所有安装任务完成再执行!')
mw.execShell("sync && init 6 &")
return mw.returnJson(True, '命令发送成功!')
# 名取PID
def getPid(self, pname):
try:
if not self.pids:
self.pids = psutil.pids()
for pid in self.pids:
if psutil.Process(pid).name() == pname:
return True
return False
except:
return False
# 检查端口是否占用
def isOpen(self, port):
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect(('127.0.0.1', int(port)))
s.shutdown(2)
return True
except:
return False
# 检测指定进程是否存活
def checkProcess(self, pid):
try:
if not self.pids:
self.pids = psutil.pids()
if int(pid) in self.pids:
return True
return False
except:
return False
def getPanelInfo(self, get=None):
# 取面板配置
address = mw.GetLocalIp()
try:
try:
port = web.ctx.host.split(':')[1]
except:
port = mw.readFile('data/port.pl')
except:
port = '8888'
domain = ''
if os.path.exists('data/domain.conf'):
domain = mw.readFile('data/domain.conf')
autoUpdate = ''
if os.path.exists('data/autoUpdate.pl'):
autoUpdate = 'checked'
limitip = ''
if os.path.exists('data/limitip.conf'):
limitip = mw.readFile('data/limitip.conf')
templates = []
for template in os.listdir('templates/'):
if os.path.isdir('templates/' + template):
templates.append(template)
template = mw.readFile('data/templates.pl')
check502 = ''
if os.path.exists('data/502Task.pl'):
check502 = 'checked'
return {'port': port, 'address': address, 'domain': domain, 'auto': autoUpdate, '502': check502, 'limitip': limitip, 'templates': templates, 'template': template}
def getSystemTotal(self, interval=1):
# 取系统统计信息
data = self.getMemInfo()
cpu = self.getCpuInfo(interval)
data['cpuNum'] = cpu[1]
data['cpuRealUsed'] = cpu[0]
data['time'] = self.getBootTime()
data['system'] = self.getSystemVersion()
data['isuser'] = mw.M('users').where(
'username=?', ('admin',)).count()
data['version'] = '0.0.1'
return data
def getLoadAverage(self):
c = os.getloadavg()
data = {}
data['one'] = float(c[0])
data['five'] = float(c[1])
data['fifteen'] = float(c[2])
data['max'] = psutil.cpu_count() * 2
data['limit'] = data['max']
data['safe'] = data['max'] * 0.75
return data
def getAllInfo(self, get):
data = {}
data['load_average'] = self.GetLoadAverage(get)
data['title'] = self.GetTitle()
data['network'] = self.GetNetWorkApi(get)
data['panel_status'] = not os.path.exists(
'/www/server/mdserver-web/data/close.pl')
import firewalls
ssh_info = firewalls.firewalls().GetSshInfo(None)
data['enable_ssh_status'] = ssh_info['status']
data['disable_ping_status'] = not ssh_info['ping']
data['time'] = self.GetBootTime()
# data['system'] = self.GetSystemVersion();
# data['mem'] = self.GetMemInfo();
data['version'] = web.ctx.session.version
return data
def getTitle(self):
titlePl = 'data/title.pl'
title = 'Linux面板'
if os.path.exists(titlePl):
title = mw.readFile(titlePl).strip()
return title
def getSystemVersion(self):
# 取操作系统版本
if mw.getOs() == 'darwin':
data = mw.execShell('sw_vers')[0]
data_list = data.strip().split("\n")
mac_version = ''
for x in data_list:
mac_version += x.split("\t")[1] + ' '
return mac_version
redhat_series = '/etc/redhat-release'
if os.path.exists(redhat_series):
version = mw.readFile('/etc/redhat-release')
version = version.replace('release ', '').strip()
return version
os_series = '/etc/os-release'
if os.path.exists(os_series):
version = mw.execShell(
"cat /etc/*-release | grep PRETTY_NAME | awk -F = '{print $2}' | awk -F '\"' '{print $2}'")
return version[0].strip()
return '未识别系统信息'
def getBootTime(self):
# 取系统启动时间
uptime = mw.readFile('/proc/uptime')
if uptime == False:
start_time = psutil.boot_time()
run_time = time.time() - start_time
else:
run_time = uptime.split()[0]
tStr = float(run_time)
min = tStr / 60
hours = min / 60
days = math.floor(hours / 24)
hours = math.floor(hours - (days * 24))
min = math.floor(min - (days * 60 * 24) - (hours * 60))
return mw.getInfo('已不间断运行: {1}天{2}小时{3}分钟', (str(int(days)), str(int(hours)), str(int(min))))
def getCpuInfo(self, interval=1):
# 取CPU信息
cpuCount = psutil.cpu_count()
used = psutil.cpu_percent(interval=interval)
return used, cpuCount
def getMemInfo(self):
# 取内存信息
mem = psutil.virtual_memory()
if mw.getOs() == 'darwin':
memInfo = {
'memTotal': mem.total / 1024 / 1024
}
memInfo['memRealUsed'] = memInfo['memTotal'] * (mem.percent / 100)
else:
memInfo = {
'memTotal': mem.total / 1024 / 1024,
'memFree': mem.free / 1024 / 1024,
'memBuffers': mem.buffers / 1024 / 1024,
'memCached': mem.cached / 1024 / 1024
}
memInfo['memRealUsed'] = memInfo['memTotal'] - \
memInfo['memFree'] - memInfo['memBuffers'] - \
memInfo['memCached']
return memInfo
def getMemUsed(self):
# 取内存使用率
try:
import psutil
mem = psutil.virtual_memory()
if mw.getOs() == 'darwin':
return mem.percent
memInfo = {'memTotal': mem.total / 1024 / 1024, 'memFree': mem.free / 1024 / 1024,
'memBuffers': mem.buffers / 1024 / 1024, 'memCached': mem.cached / 1024 / 1024}
tmp = memInfo['memTotal'] - memInfo['memFree'] - \
memInfo['memBuffers'] - memInfo['memCached']
tmp1 = memInfo['memTotal'] / 100
return (tmp / tmp1)
except Exception as ex:
return 1
def getDiskInfo(self):
info = self.getDiskInfo2()
if len(info) != 0:
return info
# 取磁盘分区信息
diskIo = psutil.disk_partitions()
diskInfo = []
for disk in diskIo:
if disk[1] == '/mnt/cdrom':
continue
if disk[1] == '/boot':
continue
tmp = {}
tmp['path'] = disk[1]
size_tmp = psutil.disk_usage(disk[1])
tmp['size'] = [mw.toSize(size_tmp[0]), mw.toSize(
size_tmp[1]), mw.toSize(size_tmp[2]), str(size_tmp[3]) + '%']
diskInfo.append(tmp)
return diskInfo
def getDiskInfo2(self):
# 取磁盘分区信息
temp = mw.execShell(
"df -h -P|grep '/'|grep -v tmpfs | grep -v devfs")[0]
tempInodes = mw.execShell(
"df -i -P|grep '/'|grep -v tmpfs | grep -v devfs")[0]
temp1 = temp.split('\n')
tempInodes1 = tempInodes.split('\n')
diskInfo = []
n = 0
cuts = ['/mnt/cdrom', '/boot', '/boot/efi', '/dev',
'/dev/shm', '/zroot', '/run/lock', '/run', '/run/shm', '/run/user']
for tmp in temp1:
n += 1
inodes = tempInodes1[n - 1].split()
disk = tmp.split()
if len(disk) < 5:
continue
if disk[1].find('M') != -1:
continue
if disk[1].find('K') != -1:
continue
if len(disk[5].split('/')) > 4:
continue
if disk[5] in cuts:
continue
arr = {}
arr['path'] = disk[5]
tmp1 = [disk[1], disk[2], disk[3], disk[4]]
arr['size'] = tmp1
arr['inodes'] = [inodes[1], inodes[2], inodes[3], inodes[4]]
diskInfo.append(arr)
return diskInfo
# 清理系统垃圾
def clearSystem(self, get):
count = total = 0
tmp_total, tmp_count = self.ClearMail()
count += tmp_count
total += tmp_total
tmp_total, tmp_count = self.ClearOther()
count += tmp_count
total += tmp_total
return count, total
# 清理邮件日志
def clearMail(self):
rpath = '/var/spool'
total = count = 0
import shutil
con = ['cron', 'anacron', 'mail']
for d in os.listdir(rpath):
if d in con:
continue
dpath = rpath + '/' + d
time.sleep(0.2)
num = size = 0
for n in os.listdir(dpath):
filename = dpath + '/' + n
fsize = os.path.getsize(filename)
size += fsize
if os.path.isdir(filename):
shutil.rmtree(filename)
else:
os.remove(filename)
print('mail clear ok')
num += 1
total += size
count += num
return total, count
# 清理其它
def clearOther(self):
clearPath = [
{'path': '/www/server/mdserver-web', 'find': 'testDisk_'},
{'path': '/www/wwwlogs', 'find': 'log'},
{'path': '/tmp', 'find': 'panelBoot.pl'},
{'path': '/www/server/mdserver-web/install', 'find': '.rpm'}
]
total = count = 0
for c in clearPath:
for d in os.listdir(c['path']):
if d.find(c['find']) == -1:
continue
filename = c['path'] + '/' + d
fsize = os.path.getsize(filename)
total += fsize
if os.path.isdir(filename):
shutil.rmtree(filename)
else:
os.remove(filename)
count += 1
mw.serviceReload()
os.system('echo > /tmp/panelBoot.pl')
return total, count
def getNetWork(self):
# return self.GetNetWorkApi(get);
# 取网络流量信息
try:
# 取网络流量信息
networkIo = psutil.net_io_counters()[:4]
if not "otime" in session:
session['up'] = networkIo[0]
session['down'] = networkIo[1]
session['otime'] = time.time()
ntime = time.time()
networkInfo = {}
networkInfo['upTotal'] = networkIo[0]
networkInfo['downTotal'] = networkIo[1]
networkInfo['up'] = round(float(
networkIo[0] - session['up']) / 1024 / (ntime - session['otime']), 2)
networkInfo['down'] = round(
float(networkIo[1] - session['down']) / 1024 / (ntime - session['otime']), 2)
networkInfo['downPackets'] = networkIo[3]
networkInfo['upPackets'] = networkIo[2]
# print networkIo[1], session['down'], ntime, session['otime']
session['up'] = networkIo[0]
session['down'] = networkIo[1]
session['otime'] = time.time()
networkInfo['cpu'] = self.getCpuInfo()
networkInfo['load'] = self.getLoadAverage()
networkInfo['mem'] = self.getMemInfo()
return networkInfo
except Exception as e:
# print(e)
return None
def getNetWorkApi(self):
# 取网络流量信息
try:
tmpfile = 'data/network.temp'
networkIo = psutil.net_io_counters()[:4]
if not os.path.exists(tmpfile):
mw.writeFile(tmpfile, str(
networkIo[0]) + '|' + str(networkIo[1]) + '|' + str(int(time.time())))
lastValue = mw.readFile(tmpfile).split('|')
ntime = time.time()
networkInfo = {}
networkInfo['upTotal'] = networkIo[0]
networkInfo['downTotal'] = networkIo[1]
networkInfo['up'] = round(
float(networkIo[0] - int(lastValue[0])) / 1024 / (ntime - int(lastValue[2])), 2)
networkInfo['down'] = round(
float(networkIo[1] - int(lastValue[1])) / 1024 / (ntime - int(lastValue[2])), 2)
networkInfo['downPackets'] = networkIo[3]
networkInfo['upPackets'] = networkIo[2]
mw.writeFile(tmpfile, str(
networkIo[0]) + '|' + str(networkIo[1]) + '|' + str(int(time.time())))
# networkInfo['cpu'] = self.GetCpuInfo(0.1)
return networkInfo
except:
return None
def getNetWorkIoData(self, start, end):
# 取指定时间段的网络Io
data = mw.M('network').dbfile('system').where("addtime>=? AND addtime<=?", (start, end)).field(
'id,up,down,total_up,total_down,down_packets,up_packets,addtime').order('id asc').select()
return self.toAddtime(data)
def getDiskIoData(self, start, end):
# 取指定时间段的磁盘Io
data = mw.M('diskio').dbfile('system').where("addtime>=? AND addtime<=?", (start, end)).field(
'id,read_count,write_count,read_bytes,write_bytes,read_time,write_time,addtime').order('id asc').select()
return self.toAddtime(data)
def getCpuIoData(self, start, end):
# 取指定时间段的CpuIo
data = mw.M('cpuio').dbfile('system').where("addtime>=? AND addtime<=?",
(start, end)).field('id,pro,mem,addtime').order('id asc').select()
return self.toAddtime(data, True)
def getLoadAverageData(self, start, end):
data = mw.M('load_average').dbfile('system').where("addtime>=? AND addtime<=?", (
start, end)).field('id,pro,one,five,fifteen,addtime').order('id asc').select()
return self.toAddtime(data)
# 格式化addtime列
def toAddtime(self, data, tomem=False):
import time
if tomem:
import psutil
mPre = (psutil.virtual_memory().total / 1024 / 1024) / 100
length = len(data)
he = 1
if length > 100:
he = 1
if length > 1000:
he = 3
if length > 10000:
he = 15
if he == 1:
for i in range(length):
data[i]['addtime'] = time.strftime(
'%m/%d %H:%M', time.localtime(float(data[i]['addtime'])))
if tomem and data[i]['mem'] > 100:
data[i]['mem'] = data[i]['mem'] / mPre
return data
else:
count = 0
tmp = []
for value in data:
if count < he:
count += 1
continue
value['addtime'] = time.strftime(
'%m/%d %H:%M', time.localtime(float(value['addtime'])))
if tomem and value['mem'] > 100:
value['mem'] = value['mem'] / mPre
tmp.append(value)
count = 0
return tmp
def setControl(self, stype, day):
filename = 'data/control.conf'
if stype == '0':
mw.execShell("rm -f " + filename)
elif stype == '1':
_day = int(day)
if _day < 1:
return mw.returnJson(False, "设置失败!")
mw.writeFile(filename, day)
elif stype == 'del':
if not mw.isRestart():
return mw.returnJson(False, '请等待所有安装任务完成再执行')
os.remove("data/system.db")
sql = db.Sql().dbfile('system')
csql = mw.readFile('data/sql/system.sql')
csql_list = csql.split(';')
for index in range(len(csql_list)):
sql.execute(csql_list[index], ())
return mw.returnJson(True, "监控服务已关闭")
else:
data = {}
if os.path.exists(filename):
try:
data['day'] = int(mw.readFile(filename))
except:
data['day'] = 30
data['status'] = True
else:
data['day'] = 30
data['status'] = False
return mw.getJson(data)
return mw.returnJson(True, "设置成功!")
def versionDiff(self, old, new):
'''
test 测试
new 有新版本
none 没有新版本
'''
new_list = new.split('.')
if len(new_list) > 3:
return 'test'
old_list = old.split('.')
ret = 'none'
isHasNew = True
if int(new_list[0]) == int(old_list[0]) and int(new_list[1]) == int(old_list[1]) and int(new_list[2]) == int(old_list[2]):
isHasNew = False
if isHasNew:
return 'new'
return ret
def getServerInfo(self):
import urllib.request
import ssl
upAddr = 'https://api.github.com/repos/midoks/mdserver-web/releases/latest'
try:
context = ssl._create_unverified_context()
req = urllib.request.urlopen(upAddr, context=context, timeout=3)
result = req.read().decode('utf-8')
version = json.loads(result)
return version
except Exception as e:
print('getServerInfo', e)
return {}
def updateServer(self, stype, version=''):
# 更新服务
try:
if not mw.isRestart():
return mw.returnJson(False, '请等待所有安装任务完成再执行!')
version_new_info = self.getServerInfo()
version_now = config_api.config_api().getVersion()
new_ver = version_new_info['name']
if stype == 'check':
if not 'name' in version_new_info:
return mw.returnJson(False, '服务器数据或网络有问题!')
diff = self.versionDiff(version_now, new_ver)
if diff == 'new':
return mw.returnJson(True, '有新版本!', new_ver)
elif diff == 'test':
return mw.returnJson(True, '有测试版本!', new_ver)
else:
return mw.returnJson(False, '已经是最新,无需更新!')
if stype == 'info':
if not 'name' in version_new_info:
return mw.returnJson(False, '服务器数据有问题!')
diff = self.versionDiff(version_now, new_ver)
data = {}
data['version'] = new_ver
data['content'] = version_new_info[
'body'].replace("\n", "<br/>")
return mw.returnJson(True, '更新信息!', data)
if stype == 'update':
if version == '':
return mw.returnJson(False, '缺少版本信息!')
if new_ver != version:
return mw.returnJson(False, '更新失败,请重试!')
toPath = mw.getRootDir() + '/temp'
if not os.path.exists(toPath):
mw.execShell('mkdir -p ' + toPath)
newUrl = "https://github.com/midoks/mdserver-web/archive/refs/tags/" + version + ".zip"
dist_mw = toPath + '/mw.zip'
if not os.path.exists(dist_mw):
mw.execShell('wget -O ' + dist_mw + ' ' + newUrl)
dist_to = toPath + "/mdserver-web-" + version
if not os.path.exists(dist_to):
mw.execShell('unzip -o ' + toPath +
'/mw.zip' + ' -d ' + toPath)
cmd_cp = "cp -rf " + toPath + '/mdserver-web-' + \
version + "/* " + mw.getServerDir() + "/mdserver-web"
mw.execShell(cmd_cp)
mw.execShell('rm -rf ' + toPath + '/mdserver-web-' + version)
mw.execShell('rm -rf ' + toPath + '/mw.zip')
self.restartMw()
return mw.returnJson(True, '安装更新成功,需自己重启!')
return mw.returnJson(False, '已经是最新,无需更新!')
except Exception as ex:
# print('updateServer', ex)
return mw.returnJson(False, "连接服务器失败!" + str(ex))
# 修复面板
def repPanel(self, get):
vp = ''
if mw.readFile('/www/server/mdserver-web/class/common.py').find('checkSafe') != -1:
vp = '_pro'
mw.ExecShell("wget -O update.sh " + mw.get_url() +
"/install/update" + vp + ".sh && bash update.sh")
if hasattr(web.ctx.session, 'getCloudPlugin'):
del(web.ctx.session['getCloudPlugin'])
return True

View File

@@ -1,90 +0,0 @@
# coding: utf-8
import psutil
import time
import os
import sys
import mw
import re
import json
import pwd
from flask import request
class task_api:
def __init__(self):
pass
def countApi(self):
c = mw.M('tasks').where("status!=?", ('1',)).count()
return str(c)
def listApi(self):
p = request.form.get('p', '1')
limit = request.form.get('limit', '10').strip()
search = request.form.get('search', '').strip()
start = (int(p) - 1) * int(limit)
limit_str = str(start) + ',' + str(limit)
_list = mw.M('tasks').where('', ()).field(
'id,name,type,status,addtime,start,end').limit(limit_str).order('id desc').select()
_ret = {}
_ret['data'] = _list
count = mw.M('tasks').where('', ()).count()
_page = {}
_page['count'] = count
_page['tojs'] = 'remind'
_page['p'] = p
# return data
_ret['count'] = count
_ret['page'] = mw.getPage(_page)
return mw.getJson(_ret)
def getExecLogApi(self):
file = os.getcwd() + "/tmp/panelExec.log"
v = mw.getLastLine(file, 100)
return v
def getTaskSpeedApi(self):
tempFile = mw.getRunDir() + '/tmp/panelExec.log'
freshFile = mw.getRunDir() + '/tmp/panelFresh'
find = mw.M('tasks').where('status=? OR status=?',
('-1', '0')).field('id,type,name,execstr').find()
if not len(find):
return mw.returnJson(False, '当前没有任务队列在执行-2!')
mw.triggerTask()
data = {}
data['name'] = find['name']
data['execstr'] = find['execstr']
if find['type'] == 'download':
readLine = ""
for i in range(3):
try:
readLine = mw.readFile(tempFile)
if len(readLine) > 10:
data['msg'] = json.loads(readLine)
data['isDownload'] = True
break
except Exception as e:
if i == 2:
mw.M('tasks').where("id=?", (find['id'],)).save(
'status', ('0',))
return mw.returnJson(False, '当前没有任务队列在执行-4:' + str(e))
time.sleep(0.5)
else:
data['msg'] = mw.getLastLine(tempFile, 10)
data['isDownload'] = False
data['task'] = mw.M('tasks').where("status!=?", ('1',)).field(
'id,status,name,type').order("id asc").select()
return mw.getJson(data)

View File

@@ -1,132 +0,0 @@
#!/usr/bin/env python
# coding: utf-8
import random
import math
from PIL import Image, ImageDraw, ImageFont, ImageFilter
class vieCode:
__fontSize = 20 # 字体大小
__width = 120 # 画布宽度
__heigth = 45 # 画布高度
__length = 4 # 验证码长度
__draw = None # 画布
__img = None # 图片资源
__code = None # 验证码字符
__str = None # 自定义验证码字符集
__inCurve = True # 是否画干扰线
__inNoise = True # 是否画干扰点
__type = 2 # 验证码类型 1、纯字母 2、数字字母混合
__fontPatn = 'class/fonts/2.ttf' # 字体
def GetCodeImage(self, size=80, length=4):
'''获取验证码图片
@param int size 验证码大小
@param int length 验证码长度
'''
# 准备基础数据
self.__length = length
self.__fontSize = size
self.__width = self.__fontSize * self.__length
self.__heigth = int(self.__fontSize * 1.5)
# 生成验证码图片
self.__createCode()
self.__createImage()
self.__createNoise()
self.__printString()
self.__cerateFilter()
return self.__img, self.__code
def __cerateFilter(self):
'''模糊处理'''
self.__img = self.__img.filter(ImageFilter.BLUR)
filter = ImageFilter.ModeFilter(8)
self.__img = self.__img.filter(filter)
def __createCode(self):
'''创建验证码字符'''
# 是否自定义字符集合
if not self.__str:
# 源文本
number = "3456789"
srcLetter = "qwertyuipasdfghjkzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"
srcUpper = srcLetter.upper()
if self.__type == 1:
self.__str = number
else:
self.__str = srcLetter + srcUpper + number
# 构造验证码
self.__code = random.sample(self.__str, self.__length)
def __createImage(self):
'''创建画布'''
bgColor = (random.randint(200, 255), random.randint(
200, 255), random.randint(200, 255))
self.__img = Image.new('RGB', (self.__width, self.__heigth), bgColor)
self.__draw = ImageDraw.Draw(self.__img)
def __createNoise(self):
'''画干扰点'''
if not self.__inNoise:
return
font = ImageFont.truetype(self.__fontPatn, int(self.__fontSize / 1.5))
for i in range(5):
# 杂点颜色
noiseColor = (random.randint(150, 200), random.randint(
150, 200), random.randint(150, 200))
putStr = random.sample(self.__str, 2)
for j in range(2):
# 绘杂点
size = (random.randint(-10, self.__width),
random.randint(-10, self.__heigth))
self.__draw.text(size, putStr[j], font=font, fill=noiseColor)
pass
def __createCurve(self):
'''画干扰线'''
if not self.__inCurve:
return
x = y = 0
# 计算曲线系数
a = random.uniform(1, self.__heigth / 2)
b = random.uniform(-self.__width / 4, self.__heigth / 4)
f = random.uniform(-self.__heigth / 4, self.__heigth / 4)
t = random.uniform(self.__heigth, self.__width * 2)
xend = random.randint(self.__width / 2, self.__width * 2)
w = (2 * math.pi) / t
# 画曲线
color = (random.randint(30, 150), random.randint(
30, 150), random.randint(30, 150))
for x in range(xend):
if w != 0:
for k in range(int(self.__heigth / 10)):
y = a * math.sin(w * x + f) + b + self.__heigth / 2
i = int(self.__fontSize / 5)
while i > 0:
px = x + i
py = y + i + k
self.__draw.point((px, py), color)
i -= i
def __printString(self):
'''打印验证码字符串'''
font = ImageFont.truetype(self.__fontPatn, self.__fontSize)
x = 0
# 打印字符到画板
for i in range(self.__length):
# 设置字体随机颜色
color = (random.randint(30, 150), random.randint(
30, 150), random.randint(30, 150))
# 计算座标
x = random.uniform(self.__fontSize * i * 0.95,
self.__fontSize * i * 1.1)
y = self.__fontSize * random.uniform(0.3, 0.5)
# 打印字符
self.__draw.text((x, y), self.__code[i], font=font, fill=color)

Binary file not shown.

View File

View File

@@ -1,5 +0,0 @@
- fcgi-client.py
```
https://pypi.org/project/flup6/1.1.1/#files
```

View File

@@ -1,408 +0,0 @@
# Copyright (c) 2006 Allan Saddi <allan@saddi.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id$
#
# Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
__author__ = 'Allan Saddi <allan@saddi.com>'
__version__ = '$Revision$'
import sys
import select
import struct
import socket
import errno
import types
__all__ = ['FCGIApp']
# Constants from the spec.
FCGI_LISTENSOCK_FILENO = 0
FCGI_HEADER_LEN = 8
FCGI_VERSION_1 = 1
FCGI_BEGIN_REQUEST = 1
FCGI_ABORT_REQUEST = 2
FCGI_END_REQUEST = 3
FCGI_PARAMS = 4
FCGI_STDIN = 5
FCGI_STDOUT = 6
FCGI_STDERR = 7
FCGI_DATA = 8
FCGI_GET_VALUES = 9
FCGI_GET_VALUES_RESULT = 10
FCGI_UNKNOWN_TYPE = 11
FCGI_MAXTYPE = FCGI_UNKNOWN_TYPE
FCGI_NULL_REQUEST_ID = 0
FCGI_KEEP_CONN = 1
FCGI_RESPONDER = 1
FCGI_AUTHORIZER = 2
FCGI_FILTER = 3
FCGI_REQUEST_COMPLETE = 0
FCGI_CANT_MPX_CONN = 1
FCGI_OVERLOADED = 2
FCGI_UNKNOWN_ROLE = 3
FCGI_MAX_CONNS = 'FCGI_MAX_CONNS'
FCGI_MAX_REQS = 'FCGI_MAX_REQS'
FCGI_MPXS_CONNS = 'FCGI_MPXS_CONNS'
FCGI_Header = '!BBHHBx'
FCGI_BeginRequestBody = '!HB5x'
FCGI_EndRequestBody = '!LB3x'
FCGI_UnknownTypeBody = '!B7x'
FCGI_BeginRequestBody_LEN = struct.calcsize(FCGI_BeginRequestBody)
FCGI_EndRequestBody_LEN = struct.calcsize(FCGI_EndRequestBody)
FCGI_UnknownTypeBody_LEN = struct.calcsize(FCGI_UnknownTypeBody)
if __debug__:
import time
# Set non-zero to write debug output to a file.
DEBUG = 0
DEBUGLOG = '/www/server/mdserver-web/logs/fastcgi.log'
def _debug(level, msg):
if DEBUG < level:
return
try:
f = open(DEBUGLOG, 'a')
f.write('%sfcgi: %s\n' % (time.ctime()[4:-4], msg))
f.close()
except:
pass
def decode_pair(s, pos=0):
"""
Decodes a name/value pair.
The number of bytes decoded as well as the name/value pair
are returned.
"""
nameLength = ord(s[pos])
if nameLength & 128:
nameLength = struct.unpack('!L', s[pos:pos + 4])[0] & 0x7fffffff
pos += 4
else:
pos += 1
valueLength = ord(s[pos])
if valueLength & 128:
valueLength = struct.unpack('!L', s[pos:pos + 4])[0] & 0x7fffffff
pos += 4
else:
pos += 1
name = s[pos:pos + nameLength]
pos += nameLength
value = s[pos:pos + valueLength]
pos += valueLength
return (pos, (name, value))
def encode_pair(name, value):
"""
Encodes a name/value pair.
The encoded string is returned.
"""
nameLength = len(name)
if nameLength < 128:
s = chr(nameLength).encode()
else:
s = struct.pack('!L', nameLength | 0x80000000)
valueLength = len(value)
if valueLength < 128:
s += chr(valueLength).encode()
else:
s += struct.pack('!L', valueLength | 0x80000000)
return s + name + value
class Record(object):
"""
A FastCGI Record.
Used for encoding/decoding records.
"""
def __init__(self, type=FCGI_UNKNOWN_TYPE, requestId=FCGI_NULL_REQUEST_ID):
self.version = FCGI_VERSION_1
self.type = type
self.requestId = requestId
self.contentLength = 0
self.paddingLength = 0
self.contentData = ''
def _recvall(sock, length):
"""
Attempts to receive length bytes from a socket, blocking if necessary.
(Socket may be blocking or non-blocking.)
"""
dataList = []
recvLen = 0
while length:
try:
data = sock.recv(length)
except socket.error as e:
if e[0] == errno.EAGAIN:
select.select([sock], [], [])
continue
else:
raise
if not data: # EOF
break
dataList.append(data)
dataLen = len(data)
recvLen += dataLen
length -= dataLen
return b''.join(dataList), recvLen
_recvall = staticmethod(_recvall)
def read(self, sock):
"""Read and decode a Record from a socket."""
try:
header, length = self._recvall(sock, FCGI_HEADER_LEN)
except:
raise EOFError
if length < FCGI_HEADER_LEN:
raise EOFError
self.version, self.type, self.requestId, self.contentLength, \
self.paddingLength = struct.unpack(FCGI_Header, header)
if __debug__:
_debug(9, 'read: fd = %d, type = %d, requestId = %d, '
'contentLength = %d' %
(sock.fileno(), self.type, self.requestId,
self.contentLength))
if self.contentLength:
try:
self.contentData, length = self._recvall(sock,
self.contentLength)
except:
raise EOFError
if length < self.contentLength:
raise EOFError
if self.paddingLength:
try:
self._recvall(sock, self.paddingLength)
except:
raise EOFError
def _sendall(sock, data):
"""
Writes data to a socket and does not return until all the data is sent.
"""
length = len(data)
while length:
try:
sent = sock.send(data)
except socket.error as e:
if e[0] == errno.EAGAIN:
select.select([], [sock], [])
continue
else:
raise
data = data[sent:]
length -= sent
_sendall = staticmethod(_sendall)
def write(self, sock):
"""Encode and write a Record to a socket."""
self.paddingLength = -self.contentLength & 7
if __debug__:
_debug(9, 'write: fd = %d, type = %d, requestId = %d, '
'contentLength = %d' %
(sock.fileno(), self.type, self.requestId,
self.contentLength))
header = struct.pack(FCGI_Header, self.version, self.type,
self.requestId, self.contentLength,
self.paddingLength)
self._sendall(sock, header)
if self.contentLength:
self._sendall(sock, self.contentData)
if self.paddingLength:
self._sendall(sock, b'\x00' * self.paddingLength)
class FCGIApp(object):
def __init__(self, connect=None, host=None, port=None, filterEnviron=True):
if host is not None:
assert port is not None
connect = (host, port)
self._connect = connect
self._filterEnviron = filterEnviron
def __call__(self, environ, io, start_response=None):
# For sanity's sake, we don't care about FCGI_MPXS_CONN
# (connection multiplexing). For every request, we obtain a new
# transport socket, perform the request, then discard the socket.
# This is, I believe, how mod_fastcgi does things...
sock = self._getConnection()
# Since this is going to be the only request on this connection,
# set the request ID to 1.
requestId = 1
# Begin the request
rec = Record(FCGI_BEGIN_REQUEST, requestId)
rec.contentData = struct.pack(FCGI_BeginRequestBody, FCGI_RESPONDER, 0)
rec.contentLength = FCGI_BeginRequestBody_LEN
rec.write(sock)
# Filter WSGI environ and send it as FCGI_PARAMS
if self._filterEnviron:
params = self._defaultFilterEnviron(environ)
else:
params = self._lightFilterEnviron(environ)
# TODO: Anything not from environ that needs to be sent also?
# return '200 OK',[],str(params),''
self._fcgiParams(sock, requestId, params)
self._fcgiParams(sock, requestId, {})
# Transfer wsgi.input to FCGI_STDIN
content_length = int(environ.get('CONTENT_LENGTH') or 0)
s = ''
#io = StringIO(stdin)
while True:
if not io:
break
chunk_size = min(content_length, 4096)
s = io.read(chunk_size)
content_length -= len(s)
rec = Record(FCGI_STDIN, requestId)
rec.contentData = s
rec.contentLength = len(s)
rec.write(sock)
if not s:
break
# Empty FCGI_DATA stream
rec = Record(FCGI_DATA, requestId)
rec.write(sock)
return sock
def _getConnection(self):
if self._connect is not None:
# The simple case. Create a socket and connect to the
# application.
if isinstance(self._connect, str):
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect(self._connect)
elif hasattr(socket, 'create_connection'):
sock = socket.create_connection(self._connect)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(self._connect)
return sock
# To be done when I have more time...
# , 'Launching and managing FastCGI programs not yet implemented'
raise NotImplementedError
def _fcgiGetValues(self, sock, vars):
# Construct FCGI_GET_VALUES record
outrec = Record(FCGI_GET_VALUES)
data = []
for name in vars:
data.append(encode_pair(name, ''))
data = ''.join(data)
outrec.contentData = data
outrec.contentLength = len(data)
outrec.write(sock)
# Await response
inrec = Record()
inrec.read(sock)
result = {}
if inrec.type == FCGI_GET_VALUES_RESULT:
pos = 0
while pos < inrec.contentLength:
pos, (name, value) = decode_pair(inrec.contentData, pos)
result[name] = value
return result
def _fcgiParams(self, sock, requestId, params):
rec = Record(FCGI_PARAMS, requestId)
data = []
for name, value in params.items():
data.append(encode_pair(name.encode(
'latin-1'), value.encode('latin-1')))
data = b''.join(data)
rec.contentData = data
rec.contentLength = len(data)
rec.write(sock)
_environPrefixes = ['SERVER_', 'HTTP_', 'REQUEST_', 'REMOTE_', 'PATH_',
'CONTENT_', 'DOCUMENT_', 'SCRIPT_']
_environCopies = ['SCRIPT_NAME', 'QUERY_STRING', 'AUTH_TYPE']
_environRenames = []
def _defaultFilterEnviron(self, environ):
result = {}
for n in environ.keys():
iv = False
for p in self._environPrefixes:
if n.startswith(p):
result[n] = environ[n]
iv = True
if n in self._environCopies:
result[n] = environ[n]
iv = True
if n in self._environRenames:
result[self._environRenames[n]] = environ[n]
iv = True
if not iv:
result[n] = environ[n]
return result
def _lightFilterEnviron(self, environ):
result = {}
for n in environ.keys():
if n.upper() == n:
result[n] = environ[n]
return result

View File

@@ -1,208 +0,0 @@
# coding:utf-8
import json
import os
import time
import re
import sys
import time
import struct
import fcgi_client
FCGI_Header = '!BBHHBx'
if sys.version_info[0] == 2:
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
else:
from io import BytesIO as StringIO
def get_header_data(sock):
'''
@name 获取头部32KB数据
@param sock socketobject(fastcgi套接字对象)
@return bytes
'''
headers_data = b''
total_len = 0
header_len = 1024 * 128
while True:
fastcgi_header = sock.recv(8)
if not fastcgi_header:
break
if len(fastcgi_header) != 8:
headers_data += fastcgi_header
break
fast_pack = struct.unpack(FCGI_Header, fastcgi_header)
if fast_pack[1] == 3:
break
tlen = fast_pack[3]
while tlen > 0:
sd = sock.recv(tlen)
if not sd:
break
headers_data += sd
tlen -= len(sd)
total_len += fast_pack[3]
if fast_pack[4]:
sock.recv(fast_pack[4])
if total_len > header_len:
break
return headers_data
def format_header_data(headers_data):
'''
@name 格式化响应头
@param headers_data bytes(fastcgi头部32KB数据)
@return status int(响应状态), headers dict(响应头), bdata bytes(格式化响应头后的多余数据)
'''
status = '200 OK'
headers = {}
pos = 0
while True:
eolpos = headers_data.find(b'\n', pos)
if eolpos < 0:
break
line = headers_data[pos:eolpos - 1]
pos = eolpos + 1
line = line.strip()
if len(line) < 2:
break
if line.find(b':') == -1:
continue
header, value = line.split(b':', 1)
header = header.strip()
value = value.strip()
if isinstance(header, bytes):
header = header.decode()
value = value.decode()
if header == 'Status':
status = value
if status.find(' ') < 0:
status += ' BTPanel'
else:
headers[header] = value
bdata = headers_data[pos:]
status = int(status.split(' ')[0])
return status, headers, bdata
def resp_sock(sock, bdata):
'''
@name 以流的方式发送剩余数据
@param sock socketobject(fastcgi套接字对象)
@param bdata bytes(格式化响应头后的多余数据)
@return yield bytes
'''
# 发送除响应头以外的多余头部数据
yield bdata
while True:
fastcgi_header = sock.recv(8)
if not fastcgi_header:
break
if len(fastcgi_header) != 8:
yield fastcgi_header
break
fast_pack = struct.unpack(FCGI_Header, fastcgi_header)
if fast_pack[1] == 3:
break
tlen = fast_pack[3]
while tlen > 0:
sd = sock.recv(tlen)
if not sd:
break
tlen -= len(sd)
if sd:
yield sd
if fast_pack[4]:
sock.recv(fast_pack[4])
sock.close()
class fpm(object):
def __init__(self, sock=None, document_root='', last_path=''):
'''
@name 实例化FPM对象
@param sock string(unixsocket路径)
@param document_root string(PHP文档根目录)
@return FPM
'''
if sock:
self.fcgi_sock = sock
if document_root[-1:] != '/':
document_root += '/'
self.document_root = document_root
self.last_path = last_path
def load_url_public(self, url, content=b'', method='GET', content_type='application/x-www-form-urlencoded'):
'''
@name 转发URL到PHP-FPM 公共
@param url string(URI地址)
@param content stream(POST数据io对象)
@return fastcgi-socket
'''
fcgi = fcgi_client.FCGIApp(connect=self.fcgi_sock)
try:
script_name, query_string = url.split('?')
except ValueError:
script_name = url
query_string = ''
content_length = len(content)
if content:
content = StringIO(content)
env = {
'SCRIPT_FILENAME': '%s%s' % (self.document_root, script_name),
'QUERY_STRING': query_string,
'REQUEST_METHOD': method,
'SCRIPT_NAME': self.last_path + script_name,
'REQUEST_URI': url,
'GATEWAY_INTERFACE': 'CGI/1.1',
'SERVER_SOFTWARE': 'MW-Panel',
'REDIRECT_STATUS': '200',
'CONTENT_TYPE': content_type,
'CONTENT_LENGTH': str(content_length),
'DOCUMENT_URI': script_name,
'DOCUMENT_ROOT': self.document_root,
'SERVER_PROTOCOL': 'HTTP/1.1',
'REMOTE_ADDR': '127.0.0.1',
'REMOTE_PORT': '7200',
'SERVER_ADDR': '127.0.0.1',
'SERVER_PORT': '80',
'SERVER_NAME': 'MW-Panel'
}
fpm_sock = fcgi(env, content)
_data = b''
while True:
fastcgi_header = fpm_sock.recv(8)
if not fastcgi_header:
break
if len(fastcgi_header) != 8:
_data += fastcgi_header
break
fast_pack = struct.unpack(FCGI_Header, fastcgi_header)
if fast_pack[1] == 3:
break
tlen = fast_pack[3]
while tlen > 0:
sd = fpm_sock.recv(tlen)
if not sd:
break
tlen -= len(sd)
_data += sd
if fast_pack[4]:
fpm_sock.recv(fast_pack[4])
status, headers, data = format_header_data(_data)
return data

View File

@@ -1,110 +0,0 @@
# coding: utf-8
import re
import os
import sys
import pymysql.cursors
class ORM:
__DB_PASS = None
__DB_USER = 'root'
__DB_PORT = 3306
__DB_NAME = ''
__DB_HOST = 'localhost'
__DB_CONN = None
__DB_CUR = None
__DB_ERR = None
__DB_CNF = '/etc/my.cnf'
__DB_SOCKET = '/www/server/mysql/mysql.sock'
__DB_CHARSET = "utf8"
def __Conn(self):
'''连接数据库'''
try:
if os.path.exists(self.__DB_SOCKET):
try:
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
database=self.__DB_NAME,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
unix_socket=self.__DB_SOCKET, cursorclass=pymysql.cursors.DictCursor)
except Exception as e:
self.__DB_HOST = '127.0.0.1'
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
database=self.__DB_NAME,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
unix_socket=self.__DB_SOCKET, cursorclass=pymysql.cursors.DictCursor)
else:
try:
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
database=self.__DB_NAME,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
cursorclass=pymysql.cursors.DictCursor)
except Exception as e:
self.__DB_HOST = '127.0.0.1'
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
database=self.__DB_NAME,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
cursorclass=pymysql.cursors.DictCursor)
self.__DB_CUR = self.__DB_CONN.cursor()
return True
except Exception as e:
self.__DB_ERR = e
return False
def setDbConf(self, conf):
self.__DB_CNF = conf
def setSocket(self, sock):
self.__DB_SOCKET = sock
def setCharset(self, charset):
self.__DB_CHARSET = charset
def setPort(self, port):
self.__DB_PORT = port
def setPwd(self, pwd):
self.__DB_PASS = pwd
def getPwd(self):
return self.__DB_PASS
def setDbName(self, name):
self.__DB_NAME = name
def execute(self, sql):
# 执行SQL语句返回受影响行
if not self.__Conn():
return self.__DB_ERR
try:
result = self.__DB_CUR.execute(sql)
self.__DB_CONN.commit()
self.__Close()
return result
except Exception as ex:
return ex
def query(self, sql):
# 执行SQL语句返回数据集
if not self.__Conn():
return self.__DB_ERR
try:
self.__DB_CUR.execute(sql)
result = self.__DB_CUR.fetchall()
# print(result)
# 将元组转换成列表
# data = map(list, result)
self.__Close()
return result
except Exception as ex:
return ex
def __Close(self):
# 关闭连接
self.__DB_CUR.close()
self.__DB_CONN.close()

View File

@@ -1,109 +0,0 @@
# coding: utf-8
import re
import os
import sys
class ORM:
__DB_PASS = None
__DB_USER = 'root'
__DB_PORT = 3306
__DB_HOST = 'localhost'
__DB_CONN = None
__DB_CUR = None
__DB_ERR = None
__DB_CNF = '/etc/my.cnf'
__DB_SOCKET = '/www/server/mysql/mysql.sock'
__DB_CHARSET = 'utf8'
def __Conn(self):
'''连接MYSQL数据库'''
try:
try:
import MySQLdb
except Exception as ex:
self.__DB_ERR = ex
return False
# print(self.__DB_HOST)
# print(self.__DB_USER)
# print(self.__DB_PASS)
# print(self.__DB_PORT)
# print(self.__DB_CHARSET)
# print(self.__DB_SOCKET)
if os.path.exists(self.__DB_SOCKET):
try:
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1, unix_socket=self.__DB_SOCKET)
except Exception as e:
print(e)
self.__DB_HOST = '127.0.0.1'
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1, unix_socket=self.__DB_SOCKET)
else:
try:
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1)
except Exception as e:
self.__DB_HOST = '127.0.0.1'
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1)
self.__DB_CUR = self.__DB_CONN.cursor()
return True
except MySQLdb.Error as e:
self.__DB_ERR = e
return False
def setDbConf(self, conf):
self.__DB_CNF = conf
def setSocket(self, sock):
self.__DB_SOCKET = sock
def setCharset(self, charset):
self.__DB_CHARSET = charset
def setPort(self, port):
self.__DB_PORT = port
def setPwd(self, pwd):
self.__DB_PASS = pwd
def getPwd(self):
return self.__DB_PASS
def execute(self, sql):
# 执行SQL语句返回受影响行
if not self.__Conn():
return self.__DB_ERR
try:
result = self.__DB_CUR.execute(sql)
self.__DB_CONN.commit()
self.__Close()
return result
except Exception as ex:
return ex
def query(self, sql):
# 执行SQL语句返回数据集
if not self.__Conn():
return self.__DB_ERR
try:
self.__DB_CUR.execute(sql)
result = self.__DB_CUR.fetchall()
# 将元组转换成列表
data = map(list, result)
self.__Close()
return data
except Exception as ex:
return ex
# 关闭连接
def __Close(self):
self.__DB_CUR.close()
self.__DB_CONN.close()

View File

@@ -1,7 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/local/lib/python2.7/bin
find . -name .DS_Store | xargs rm -rf
find . -type d -name "*.pyc" | xargs rm -rf

86
cli.sh
View File

@@ -1,86 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
DIR=$(cd "$(dirname "$0")"; pwd)
MDIR=$(dirname "$DIR")
PATH=$PATH:$DIR/bin
if [ -f bin/activate ];then
source bin/activate
fi
# export LC_ALL="en_US.UTF-8"
mw_start_task()
{
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
echo -e "Starting mw-tasks... \c"
cd $DIR && python3 task.py >> ${DIR}/logs/task.log 2>&1 &
sleep 0.3
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
echo -e "\033[31mfailed\033[0m"
echo '------------------------------------------------------'
tail -n 20 $DIR/logs/task.log
echo '------------------------------------------------------'
echo -e "\033[31mError: mw-tasks service startup failed.\033[0m"
return;
fi
echo -e "\033[32mdone\033[0m"
else
echo "Starting mw-tasks... mw-tasks (pid $(echo $isStart)) already running"
fi
}
mw_start(){
gunicorn -c setting.py app:app
#安全启动
mw_start_task
}
mw_start_debug(){
python3 task.py >> $DIR/logs/task.log 2>&1 &
gunicorn -b :7200 -k gevent -w 1 app:app
}
mw_start_debug2(){
python3 task.py >> $DIR/logs/task.log 2>&1 &
gunicorn -b :7200 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app
}
mw_stop()
{
PLIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'`
for i in $PLIST
do
kill -9 $i
done
pids=`ps -ef|grep task.py | grep -v grep |awk '{print $2}'`
arr=($pids)
for p in ${arr[@]}
do
kill -9 $p
done
}
case "$1" in
'start') mw_start;;
'stop') mw_stop;;
'restart')
mw_stop
mw_start
;;
'debug')
mw_stop
mw_start_debug
;;
'debug2')
mw_stop
mw_start_debug2
;;
esac

68
cmd.md
View File

@@ -1,68 +0,0 @@
### 常用命令说明
- 面板相关命令
```
/etc/init.d/mw default
service mw [start|stop|reload|restart|status]
```
- OpenResty
```
sytemctl [start|stop|reload|restart|status] openresty
```
- MySQL
```
sytemctl [start|stop|reload|restart|status] mysql
```
- MariaDB
```
sytemctl [start|stop|reload|restart|status] mariadb
```
- PHP
```
sytemctl [start|stop|reload|restart|status] php[54-81]
sytemctl start php71
```
- Redis
```
sytemctl [start|stop|reload|restart|status] redis
```
- Memcached
```
sytemctl [start|stop|reload|restart|status] memcached
```
- sphinx
```
sytemctl [start|stop|reload|restart|status] sphinx
```

View File

@@ -1,68 +0,0 @@
### 兼容性测试报告
快速测试命令
```
cd /www/server/mdserver-web/scripts/quick && bash debug.sh
cd /www/server/mdserver-web/plugins/php/versions && bash all_test.sh
```
| 系统名称 | 面板 | OpenResty |
| ----------------- |---------------|---------------|
| CentOS 7.9 |✅ |✅ |
| CentOS 8.4 |✅ |✅ |
| CentOS 8 Stream |✅ |✅ |
| CentOS 9 Stream |✅ |✅ |
| Debian 10.3 |✅ |✅ |
| Debian 11.3 |✅ |✅ |
| Ubuntu 18.04 |✅ |✅ |
| Ubuntu 20.04 |✅ |✅ |
| Ubuntu 22.04 |✅ |✅ |
| Fedora 31 |✅ |✅ |
| Fedora 32 |✅ |✅ |
| AlmaLinux 9 |✅ |✅ |
| RockyLinux 8.6 |✅ |✅ |
| Arch Linux  |✅ |✅ |
| openSUSE 15.4 |✅ |✅ |
| 系统名称 |PHP53 |PHP54 |PHP55 |PHP56 |PHP70 |PHP71 |PHP72 |PHP73 |PHP74 |PHP80 |PHP81 |
| ----------------- |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| CentOS 7.9 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| CentOS 8.4 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| CentOS 8 Stream |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| CentOS 9 Stream |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Debian 10.3 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Debian 11.3 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Ubuntu 18.04 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Ubuntu 20.04 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Ubuntu 22.04 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Fedora 31 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Fedora 32 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| AlmaLinux 9 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| RockyLinux 8.6 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| Arch Linux |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| openSUSE 15.4 |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |✅ |
| 系统名称 | MySQL55|MySQL56|MySQL57|MySQL80|
| ----------------- |-------|--------|-------|-------|
| CentOS 7.9 |✅ |✅ |✅ |✅ |
| CentOS 8.4 |✅ |✅ |✅ |✅ |
| CentOS 8 Stream |✅ |✅ |✅ |✅ |
| CentOS 9 Stream |✅ |✅ |✅ |✅ |
| Debian 10.3 |✅ |✅ |✅ |✅ |
| Debian 11.3 |✅ |✅ |✅ |✅ |
| Ubuntu 18.04 |✅ |✅ |✅ |✅ |
| Ubuntu 20.04 |✅ |✅ |✅ |✅ |
| Ubuntu 22.04 |✅ |✅ |✅ |✅ |
| Fedora 31 |✅ |✅ |✅ |✅ |
| Fedora 32 |✅ |✅ |✅ |✅ |
| AlmaLinux 9 |✅ |✅ |✅ |✅ |
| RockyLinux 8.6 |✅ |✅ |✅ |✅ |
| Arch Linux |✅ |✅ |✅ |✅ |
| openSUSE 15.4 |✅ |✅ |✅ |✅ |

View File

@@ -1,37 +0,0 @@
[
{
"title":"全部",
"type":0,
"ps":""
},
{
"title":"运行环境",
"type":1,
"ps":""
},
{
"title":"数据软件",
"type":2,
"ps":""
},
{
"title":"代码管理",
"type":3,
"ps":""
},
{
"title":"系统工具",
"type":4,
"ps":""
},
{
"title":"其他插件",
"type":5,
"ps":""
},
{
"title":"辅助插件",
"type":6,
"ps":""
}
]

View File

@@ -1 +0,0 @@
True

View File

@@ -1,121 +0,0 @@
CREATE TABLE IF NOT EXISTS `backup` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`type` INTEGER,
`name` TEXT,
`pid` INTEGER,
`filename` TEXT,
`size` INTEGER,
`addtime` TEXT
);
CREATE TABLE IF NOT EXISTS `binding` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pid` INTEGER,
`domain` TEXT,
`path` TEXT,
`port` INTEGER,
`addtime` TEXT
);
CREATE TABLE IF NOT EXISTS `crontab` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT,
`type` TEXT,
`where1` TEXT,
`where_hour` INTEGER,
`where_minute` INTEGER,
`echo` TEXT,
`addtime` TEXT,
`status` INTEGER DEFAULT '1',
`save` INTEGER DEFAULT '3',
`backup_to` TEXT DEFAULT 'off',
`sname` TEXT,
`sbody` TEXT,
'stype' TEXT,
`urladdress` TEXT
);
CREATE TABLE IF NOT EXISTS `firewall` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`port` TEXT,
`ps` TEXT,
`addtime` TEXT
);
INSERT INTO `firewall` (`id`, `port`, `ps`, `addtime`) VALUES
(1, '80', '网站默认端口', '0000-00-00 00:00:00'),
(2, '7200', 'WEB面板', '0000-00-00 00:00:00'),
(3, '22', 'SSH远程管理服务', '0000-00-00 00:00:00'),
(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00'),
(5, '443', 'HTTPS', '0000-00-00 00:00:00');
CREATE TABLE IF NOT EXISTS `logs` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`type` TEXT,
`log` TEXT,
`addtime` TEXT
);
CREATE TABLE IF NOT EXISTS `sites` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT,
`path` TEXT,
`status` TEXT,
`index` TEXT,
`type_id` INTEGER,
`ps` TEXT,
`edate` TEXT,
`addtime` TEXT
);
CREATE TABLE IF NOT EXISTS `site_types` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT
);
CREATE TABLE IF NOT EXISTS `domain` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pid` INTEGER,
`name` TEXT,
`port` INTEGER,
`addtime` TEXT
);
CREATE TABLE IF NOT EXISTS `users` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`username` TEXT,
`password` TEXT,
`login_ip` TEXT,
`login_time` TEXT,
`phone` TEXT,
`email` TEXT
);
INSERT INTO `users` (`id`, `username`, `password`, `login_ip`, `login_time`, `phone`, `email`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', '192.168.0.10', '2022-02-02 00:00:00', 0, 'midoks@163.com');
CREATE TABLE IF NOT EXISTS `tasks` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT,
`type` TEXT,
`status` TEXT,
`addtime` TEXT,
`start` INTEGER,
`end` INTEGER,
`execstr` TEXT
);
CREATE TABLE IF NOT EXISTS `panel` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`title` TEXT,
`url` TEXT,
`username` TEXT,
`password` TEXT,
`click` INTEGER,
`addtime` INTEGER
);

View File

@@ -1,37 +0,0 @@
CREATE TABLE IF NOT EXISTS `network` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`up` INTEGER,
`down` INTEGER,
`total_up` INTEGER,
`total_down` INTEGER,
`down_packets` INTEGER,
`up_packets` INTEGER,
`addtime` INTEGER
);
CREATE TABLE IF NOT EXISTS `cpuio` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pro` INTEGER,
`mem` INTEGER,
`addtime` INTEGER
);
CREATE TABLE IF NOT EXISTS `diskio` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`read_count` INTEGER,
`write_count` INTEGER,
`read_bytes` INTEGER,
`write_bytes` INTEGER,
`read_time` INTEGER,
`write_time` INTEGER,
`addtime` INTEGER
);
CREATE TABLE IF NOT EXISTS `load_average` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pro` REAL,
`one` REAL,
`five` REAL,
`fifteen` REAL,
`addtime` INTEGER
);

View File

@@ -1,57 +0,0 @@
server
{
listen {$PORT};
server_name {$SERVER_NAME};
index index.php index.html index.htm default.php default.htm default.html;
root {$ROOT_DIR};
#SSL-START
#error_page 404/404.html;
#SSL-END
#301-START
#PROXY-START
#ERROR-PAGE-START
error_page 404 /404.html;
error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START
include {$PHP_DIR}/conf/enable-php-{$PHPVER}.conf;
#PHP-INFO-END
#REWRITE-START
include {$OR_REWRITE}/{$SERVER_NAME}.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
location ~ .*\\.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
access_log {$LOGPATH}/{$SERVER_NAME}.log main;
error_log {$LOGPATH}/{$SERVER_NAME}.error.log;
}

View File

@@ -1,55 +0,0 @@
#BINDING-{$DIRBIND}-START
server
{
listen {$PORT};
server_name {$DIRBIND};
index index.php index.html index.htm default.php default.htm default.html;
root {$ROOT_DIR};
#SSL-START
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START
error_page 404 /404.html;
error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START
include enable-php-{$PHPVER}.conf;
#PHP-INFO-END
#REWRITE-START
include {$OR_REWRITE}/{$SERVER_MAIN}.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
location ~ .*\\.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
access_log {$LOGPATH}/{$SERVER_MAIN}_{$DIRBIND}.log;
error_log {$LOGPATH}/{$SERVER_MAIN}_{$DIRBIND}.error.log;
}
#BINDING-{$DIRBIND}-END

View File

@@ -1,62 +0,0 @@
FROM debian:10.12-slim
STOPSIGNAL SIGRTMIN+3
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* \
/lib/systemd/system/systemd-update-utmp*
RUN apt update -y && \
apt install -y devscripts && \
apt install -y wget zip unzip && \
apt-get install -y locales && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
locale-gen en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
export LANGUAGE=en_US.UTF-8 && \
localedef -i en_US -f UTF-8 en_US.UTF-8 && \
mkdir -p /www/server && \
mkdir -p /www/wwwroot && \
mkdir -p /www/wwwlogs && \
mkdir -p /www/backup/database && \
mkdir -p /www/backup/site && \
wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip && \
cd /tmp && unzip /tmp/dev.zip && \
mv -f /tmp/mdserver-web-dev /www/server/mdserver-web && \
rm -rf /tmp/dev.zip && \
rm -rf /tmp/mdserver-web-dev && \
cd /www/server/mdserver-web && \
bash scripts/install/debian.sh && \
cd /www/server/mdserver-web/ && \
/www/server/mdserver-web/bin/python tools.py username username && \
cd /www/server/mdserver-web/ && \
/www/server/mdserver-web/bin/python tools.py panel password
RUN cd /www/server/mdserver-web/plugins/php && \
bash install.sh install 74 && \
cd /www/server/mdserver-web/plugins/openresty && \
bash install.sh install 1.21.4.1 && \
cd /www/server/mdserver-web/plugins/mysql && \
bash install.sh install 5.6 && \
cd /www/server/mdserver-web/plugins/phpmyadmin && \
bash install.sh install 4.4.15 && \
systemctl enable openresty && \
systemctl enable php74 && \
systemctl enable mysql
RUN rm -rf /www/server/mysql/data
ADD ./start.sh /start.sh
ADD start.service /usr/lib/systemd/system/start.service
#RUN systemctl enable start
CMD [ "/lib/systemd/systemd", "log-level=info", "unit=sysinit.target" ]
EXPOSE 7200 80 443 888
VOLUME [ "/www" ]

View File

@@ -1,9 +0,0 @@
[Unit]
Description=Customize the script
After=network.target
[Service]
ExecStart=/start.sh
[Install]
WantedBy=multi-user.target

View File

@@ -1 +0,0 @@
#!/bin/bash

BIN
images/slideshow/mw-php.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

96
index.html Normal file
View File

@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" type="image/x-icon" href="./static/images/logo.png">
<link type="text/css" href="./static/css/pages.css" media="all" rel="stylesheet">
<title>mdserver-web | Linux开源面板</title>
<meta name="generator" content="Jekyll v3.9.3">
<meta property="og:title" content="Linux开源面板">
<meta property="og:locale" content="en_US">
<meta name="description" content="Linux开源面板">
<meta property="og:description" content="Linux开源面板">
<link rel="canonical" href="https://www.midoks.me/">
<meta property="og:url" content="https://www.midoks.me/">
<meta property="og:site_name" content="Linux开源面板">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary">
<meta property="twitter:title" content="Linux开源面板">
<meta name="twitter:site" content="@github">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7736695762519033"
crossorigin="anonymous"></script>
</head>
<body class="home" style="">
<section id="hero-spot" class="hero-spot">
<a href="https://pages.github.com/">
<img src="./static/images/logo.png" alt="Linux开源面板" class="logo">
</a>
<h1>管理你的服务器</h1>
<a href="https://github.com/midoks/mdserver-web" class="help-link">Github</a>
<div id="slideshow">
<img src="./static/images/mw.jpg" alt="mdserver-web" class="slide active" width="893">
</div>
</section>
<section id="tutorial" class="tutorial">
<h1>准备好开始了吗?</h1>
<!-- ### Start of tutorials -->
<ul id="user-site" class="tutorial-list wrapper active">
<li id="terminal-step-1" class="option-terminal">
<h4>安装面板</h4>
<div class="terminal">
<div class="header"></div>
<div class="shell">
<p><span class="path">~</span><span class="prompt">$</span>curl -fsSL https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh | bash</p>
<p><span class="path">~</span><span class="prompt">$</span>mw default</p>
<p>==================================================================</p>
<p>MW-Panel default info!</p>
<p>==================================================================</p>
<p>MW-Panel-Url: http://0.0.0.0:13148/xxx</p>
<p>username: yrajbw9q</p>
<p>password: oqxotjgb</p>
<p>Warning:</p>
<p>If you cannot access the panel. </p>
<p>release the following port (44010|888|80|443|22) in the security group.</p>
<p>==================================================================</p>
</div>
</div>
</li>
</ul>
<!-- End of user site tutorial -->
</section>
<!-- End of tutorial section -->
<script src="./static/js/jquery.js"></script>
<script>window.slides = {"mdserver-web":"mw","mw-php":"php",}</script>
<script src="./static/js/application.js"></script>
<footer class="page-footer">
<ul class="site-footer-links right">
<li><a href="https://bbs.midoks.icu">论坛</a></li>
</ul>
<ul class="site-footer-links">
<li>mdserver-web ©2018-∞ Linux面板</li>
<li><a href="https://github.com/midoks/mdserver-web">Github</a></li>
</ul>
</footer>
</body>
</html>

86
mw-cli
View File

@@ -1,86 +0,0 @@
#!/www/server/mdserver-web/bin/python
# description: mdserver-web cli tools
# ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli
import os
import sys
def mw_start():
"""
Start mdserver-web
"""
os.system('systemctl start mw')
print("服务已启动")
def mw_stop():
"""
stop mdserver-web
"""
os.system('systemctl stop mw')
print("服务已停止")
def mw_restart():
"""
restart mdserver-web
"""
os.system('systemctl restart mw')
print("服务已重启")
def mw_reset_username():
"""
reset mdserver-web username
"""
from tools import set_panel_username
user_name = input("请输入新的用户名: ")
set_panel_username(user_name)
def mw_reset_pwd():
"""
reset mdserver-web password
"""
from tools import set_panel_pwd
pwd = input("请输入新的密码: ")
set_panel_pwd(pwd, True)
if __name__ == '__main__':
if os.geteuid() != 0:
print("请使用root账户执行该命令.")
sys.exit(1)
os.chdir("/www/server/mdserver-web")
sys.path.append(os.getcwd() + "/class/core")
try:
str = '''
==== mdserver-web cli tools ====
1. 启动服务 2. 停止服务
3. 重启服务 4. 修改用户名
5. 修改密码
=================================
'''
if len(sys.argv) == 2:
sw = sys.argv[1]
else:
print(str)
sw = input("请输入您要进行的操作: ")
if sw == '1':
mw_start()
elif sw == '2':
mw_stop()
elif sw == '3':
mw_restart()
elif sw == '4':
mw_reset_username()
elif sw == '5':
mw_reset_pwd()
else:
print("操作不存在")
except KeyboardInterrupt:
print("\n操作已终止")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

View File

@@ -1,24 +0,0 @@
<div class="bt-form">
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('clean');">服务</p>
<p onclick="pluginConfig('clean');">配置修改</p>
<p onclick="pRead()">说明</p>
</div>
<div class="bt-w-con pd15">
<div class="soft-man-con"></div>
</div>
</div>
</div>
<script type="text/javascript">
pluginService('clean');
function pRead(){
var readme = '<ul class="help-info-text c7">';
readme += '<li>cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/clean/index.py clean</li>';
readme += '</ul>';
$('.soft-man-con').html(readme);
}
</script>

View File

@@ -1,200 +0,0 @@
# coding:utf-8
import sys
import io
import os
import time
sys.path.append(os.getcwd() + "/class/core")
import mw
app_debug = False
if mw.isAppleSystem():
app_debug = True
def getPluginName():
return 'clean'
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()
def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
def getInitDFile():
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
def getConf():
path = getServerDir() + "/clean.conf"
return path
def getArgs():
args = sys.argv[2:]
tmp = {}
args_len = len(args)
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':')
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':')
tmp[t[0]] = t[1]
return tmp
def status():
if os.path.exists(getConf()):
return "start"
return 'stop'
def start():
file = initDreplace()
data = mw.execShell(file + ' start')
if data[1] == '':
return 'ok'
return 'fail'
def stop():
file = initDreplace()
data = mw.execShell(file + ' stop')
if data[1] == '':
return 'ok'
return 'fail'
def reload():
file = initDreplace()
data = mw.execShell(file + ' reload')
if data[1] == '':
return 'ok'
return 'fail'
def get_filePath_fileName_fileExt(filename):
(filepath, tempfilename) = os.path.split(filename)
(shotname, extension) = os.path.splitext(tempfilename)
return filepath, shotname, extension
def cleanFileLog(path):
filepath, shotname, extension = get_filePath_fileName_fileExt(path)
if extension == ".log":
cmd = "echo \"\" > " + path
print(cmd)
print(mw.execShell(cmd))
def cleanSelfFileLog(path):
filepath, shotname, extension = get_filePath_fileName_fileExt(path)
cmd = "echo \"\" > " + path
print(cmd)
print(mw.execShell(cmd))
def cleanDirLog(path):
l = os.listdir(path)
for x in range(len(l)):
abspath = path + "/" + l[x]
if os.path.isfile(abspath):
cleanFileLog(abspath)
if os.path.isdir(abspath):
cleanDirLog(abspath)
def cleanLog():
# 清理日志
rootDir = "/var/log"
print("clean start")
clog = [
"rm -rf /var/log/cron-*",
"rm -rf /var/log/maillog-*",
"rm -rf /var/log/secure-*",
"rm -rf /var/log/spooler-*",
"rm -rf /var/log/yum.log-*",
"rm -rf /var/log/messages-*",
"rm -rf /var/log/btmp-*",
"rm -rf /var/log/audit/audit.log.*",
"rm -rf /var/log/rhsm/rhsm.log-*",
"rm -rf /var/log/rhsm/rhsmcertd.log-*",
"rm -rf /tmp/yum_save_*",
"rm -rf /tmp/tmp.*",
]
for i in clog:
print(i)
mw.execShell(i)
# 常用日志
clogcom = [
"/var/log/messages",
"/var/log/btmp",
"/var/log/wtmp",
"/var/log/secure",
"/var/log/lastlog",
"/var/log/cron",
]
for i in clogcom:
if os.path.exists(i):
mw.execShell("echo \"\" > " + i)
l = os.listdir(rootDir)
for x in range(len(l)):
abspath = rootDir + "/" + l[x]
if os.path.isfile(abspath):
cleanFileLog(abspath)
if os.path.isdir(abspath):
cleanDirLog(abspath)
print("conf clean")
confFile = getServerDir()
# mw.readFile()
confFile = confFile + "/clean.conf"
clist = mw.readFile(confFile).strip()
clist = clist.split("\n")
for x in clist:
abspath = x.strip()
if os.path.exists(abspath):
if os.path.isfile(abspath):
cleanSelfFileLog(abspath)
if os.path.isdir(abspath):
cleanDirLog(abspath)
print("conf clean end")
print("clean end")
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print(status())
elif func == 'start':
print(start())
elif func == 'stop':
print(stop())
elif func == 'restart':
print(restart())
elif func == 'reload':
print(reload())
elif func == 'conf':
print(getConf())
elif func == 'clean':
cleanLog()
else:
print('error')

View File

@@ -1,16 +0,0 @@
{
"title":"日志清理",
"tip":"soft",
"name":"clean",
"type":"运行环境",
"ps":"日志清理",
"versions":"1.0",
"updates":"1.0",
"shell":"install.sh",
"checks":"server/clean",
"path": "server/clean",
"author":"clean",
"home":"https://github.com/midoks",
"date":"2021-11-23",
"pid": "5"
}

View File

@@ -1,39 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# cd /Users/midoks/Desktop/mwdev/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 5.0.4
# cd /www/server/mdserver-web/plugins/mongodb && /bin/bash install.sh install 5.0.4
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
VERSION=$2
Install_app()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/clean
echo "" > $serverPath/clean/clean.conf
echo "${VERSION}" > $serverPath/clean/version.pl
echo '安装完成' > $install_tmp
}
Uninstall_app()
{
rm -rf $serverPath/clean
echo "Uninstall_clean" > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_app
else
Uninstall_app
fi

View File

@@ -1,704 +0,0 @@
# coding: utf-8
import time
import os
import sys
import re
sys.path.append(os.getcwd() + "/class/core")
import mw
cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\''
info = mw.execShell(cmd)
p = "/usr/local/lib/" + info[0].strip() + "/site-packages"
sys.path.append(p)
import psutil
app_debug = False
if mw.isAppleSystem():
app_debug = True
def getPluginName():
return 'gogs'
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()
sys.path.append(getPluginDir() + "/class")
import mysqlDb
def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
def getInitDFile():
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
def getArgs():
args = sys.argv[2:]
tmp = {}
args_len = len(args)
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':', 1)
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':', 1)
tmp[t[0]] = t[1]
return tmp
def getInitdConfTpl():
path = getPluginDir() + "/init.d/gogs.tpl"
return path
def getInitdConf():
path = getServerDir() + "/init.d/gogs"
return path
def getConf():
path = getServerDir() + "/custom/conf/app.ini"
return path
def getConfTpl():
path = getPluginDir() + "/conf/app.ini"
return path
def status():
data = mw.execShell(
"ps -ef|grep " + getPluginName() + " |grep -v grep | grep -v python | awk '{print $2}'")
if data[0] == '':
return 'stop'
return 'start'
def getHomeDir():
if mw.isAppleSystem():
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return '/Users/' + user
else:
return '/root'
def getRunUser():
if mw.isAppleSystem():
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return user
else:
return 'root'
__SR = '''#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export USER=%s
export HOME=%s && ''' % ( getRunUser(), getHomeDir())
def contentReplace(content):
service_path = mw.getServerDir()
content = content.replace('{$ROOT_PATH}', mw.getRootDir())
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$RUN_USER}', getRunUser())
content = content.replace('{$HOME_DIR}', getHomeDir())
return content
def initDreplace():
file_tpl = getInitdConfTpl()
service_path = mw.getServerDir()
initD_path = getServerDir() + '/init.d'
if not os.path.exists(initD_path):
os.mkdir(initD_path)
file_bin = initD_path + '/' + getPluginName()
if not os.path.exists(file_bin):
content = mw.readFile(file_tpl)
content = contentReplace(content)
mw.writeFile(file_bin, content)
mw.execShell('chmod +x ' + file_bin)
conf_bin = getConf()
if not os.path.exists(conf_bin):
mw.execShell('mkdir -p ' + getServerDir() + '/custom/conf')
conf_tpl = getConfTpl()
content = mw.readFile(conf_tpl)
content = contentReplace(content)
mw.writeFile(conf_bin, content)
log_path = getServerDir() + '/log'
if not os.path.exists(log_path):
os.mkdir(log_path)
return file_bin
def getRootUrl():
content = mw.readFile(getConf())
rep = 'ROOT_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getSshPort():
content = mw.readFile(getConf())
rep = 'SSH_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getHttpPort():
content = mw.readFile(getConf())
rep = 'HTTP_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getRootPath():
content = mw.readFile(getConf())
rep = 'ROOT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getDbConfValue():
content = mw.readFile(getConf())
rep_scope = "\[database\](.*?)\["
tmp = re.findall(rep_scope, content, re.S)
rep = '(\w*)\s*=\s*(.*)'
tmp = re.findall(rep, tmp[0])
r = {}
for x in range(len(tmp)):
k = tmp[x][0]
v = tmp[x][1]
r[k] = v
return r
def pMysqlDb():
conf = getDbConfValue()
host = conf['HOST'].split(':')
conn = mysqlDb.mysqlDb()
conn.setHost(host[0])
conn.setUser(conf['USER'])
conn.setPwd(conf['PASSWD'])
conn.setPort(int(host[1]))
conn.setDb(conf['NAME'])
return conn
def isSqlError(mysqlMsg):
# 检测数据库执行错误
_mysqlMsg = str(mysqlMsg)
# print _mysqlMsg
if "MySQLdb" in _mysqlMsg:
return mw.returnData(False, 'MySQLdb组件缺失! <br>进入SSH命令行输入: pip install mysql-python')
if "2002," in _mysqlMsg:
return mw.returnData(False, '数据库连接失败,请检查数据库服务是否启动!')
if "using password:" in _mysqlMsg:
return mw.returnData(False, '数据库管理密码错误!')
if "Connection refused" in _mysqlMsg:
return mw.returnData(False, '数据库连接失败,请检查数据库服务是否启动!')
if "1133," in _mysqlMsg:
return mw.returnData(False, '数据库用户不存在!')
if "1007," in _mysqlMsg:
return mw.returnData(False, '数据库已经存在!')
if "1044," in _mysqlMsg:
return mw.returnData(False, mysqlMsg[1])
if "2003," in _mysqlMsg:
return mw.returnData(False, "Can't connect to MySQL server on '127.0.0.1' (61)")
return mw.returnData(True, 'OK')
def start():
is_frist = True
conf_bin = getConf()
if os.path.exists(conf_bin):
is_frist = False
file = initDreplace()
if is_frist:
return "第一次启动Gogs,默认使用MySQL连接!<br>可以在配置文件中重新设置,再启动!"
conn = pMysqlDb()
list_table = conn.query('show tables')
data = isSqlError(list_table)
if not data['status']:
return data['msg']
data = mw.execShell(__SR + file + ' start')
if data[1] == '':
return 'ok'
return data[0]
def stop():
file = initDreplace()
data = mw.execShell(__SR + file + ' stop')
if data[1] == '':
return 'ok'
return data[1]
def restart():
file = initDreplace()
data = mw.execShell(__SR + file + ' restart')
if data[1] == '':
return 'ok'
return data[1]
def reload():
file = initDreplace()
data = mw.execShell(__SR + file + ' reload')
if data[1] == '':
return 'ok'
return data[1]
def initdStatus():
if not app_debug:
os_name = mw.getOs()
if os_name == 'darwin':
return "Apple Computer does not support"
initd_bin = getInitDFile()
if os.path.exists(initd_bin):
return 'ok'
return 'fail'
def initdInstall():
import shutil
if not app_debug:
os_name = mw.getOs()
if os_name == 'darwin':
return "Apple Computer does not support"
mem_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
mw.execShell('chkconfig --add ' + getPluginName())
return 'ok'
def initdUinstall():
if not app_debug:
os_name = mw.getOs()
if os_name == 'darwin':
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
mw.execShell('chkconfig --del ' + getPluginName())
return 'ok'
def runLog():
log_path = getServerDir() + '/log/gogs.log'
return log_path
def postReceiveLog():
log_path = getServerDir() + '/log/hooks/post-receive.log'
return log_path
def getGogsConf():
gets = [
{'name': 'DOMAIN', 'type': -1, 'ps': '服务器域名'},
{'name': 'ROOT_URL', 'type': -1, 'ps': '公开的完整URL路径'},
{'name': 'HTTP_ADDR', 'type': -1, 'ps': '应用HTTP监听地址'},
{'name': 'HTTP_PORT', 'type': -1, 'ps': '应用 HTTP 监听端口号'},
{'name': 'START_SSH_SERVER', 'type': 2, 'ps': '启动内置SSH服务器'},
{'name': 'SSH_PORT', 'type': -1, 'ps': 'SSH 端口号'},
{'name': 'REQUIRE_SIGNIN_VIEW', 'type': 2, 'ps': '强制登录浏览'},
{'name': 'ENABLE_CAPTCHA', 'type': 2, 'ps': '启用验证码服务'},
{'name': 'DISABLE_REGISTRATION', 'type': 2, 'ps': '禁止注册,只能由管理员创建帐号'},
{'name': 'ENABLE_NOTIFY_MAIL', 'type': 2, 'ps': '是否开启邮件通知'},
{'name': 'FORCE_PRIVATE', 'type': 2, 'ps': '强制要求所有新建的仓库都是私有'},
{'name': 'SHOW_FOOTER_BRANDING', 'type': 2, 'ps': 'Gogs推广信息'},
{'name': 'SHOW_FOOTER_VERSION', 'type': 2, 'ps': 'Gogs版本信息'},
{'name': 'SHOW_FOOTER_TEMPLATE_LOAD_TIME', 'type': 2, 'ps': 'Gogs模板加载时间'},
]
conf = mw.readFile(getConf())
result = []
for g in gets:
rep = g['name'] + '\s*=\s*(.*)'
tmp = re.search(rep, conf)
if not tmp:
continue
g['value'] = tmp.groups()[0]
result.append(g)
return mw.getJson(result)
def submitGogsConf():
gets = ['DOMAIN',
'ROOT_URL',
'HTTP_ADDR',
'HTTP_PORT',
'START_SSH_SERVER',
'SSH_PORT',
'REQUIRE_SIGNIN_VIEW',
'FORCE_PRIVATE',
'ENABLE_CAPTCHA',
'DISABLE_REGISTRATION',
'ENABLE_NOTIFY_MAIL',
'SHOW_FOOTER_BRANDING',
'SHOW_FOOTER_VERSION',
'SHOW_FOOTER_TEMPLATE_LOAD_TIME']
args = getArgs()
filename = getConf()
conf = mw.readFile(filename)
for g in gets:
if g in args:
rep = g + '\s*=\s*(.*)'
val = g + ' = ' + args[g]
conf = re.sub(rep, val, conf)
mw.writeFile(filename, conf)
reload()
return mw.returnJson(True, '设置成功')
def userList():
import math
args = getArgs()
page = 1
page_size = 10
search = ''
if 'page' in args:
page = int(args['page'])
if 'page_size' in args:
page_size = int(args['page_size'])
if 'search' in args:
search = args['search']
data = {}
data['root_url'] = getRootUrl()
pm = pMysqlDb()
start = (page - 1) * page_size
list_count = pm.query('select count(id) as num from user')
count = list_count[0][0]
list_data = pm.query(
'select id,name,email from user order by id desc limit ' + str(start) + ',' + str(page_size))
page_info = {'count': count, 'p': page,
'row': page_size, 'tojs': 'gogsUserList'}
data['list'] = mw.getPage(page_info)
data['page'] = page
data['page_size'] = page_size
data['page_count'] = int(math.ceil(count / page_size))
data['data'] = list_data
return mw.returnJson(True, 'OK', data)
def getAllUserProject(user, search=''):
path = getRootPath() + '/' + user
dlist = []
if os.path.exists(path):
for filename in os.listdir(path):
tmp = {}
filePath = path + '/' + filename
if os.path.isdir(filePath):
if search == '':
tmp['name'] = filename.replace('.git', '')
dlist.append(tmp)
else:
if filename.find(search) != -1:
tmp['name'] = filename.replace('.git', '')
dlist.append(tmp)
return dlist
def checkProjectListIsHasScript(user, data):
path = getRootPath() + '/' + user
for x in range(len(data)):
name = data[x]['name'] + '.git'
path_tmp = path + '/' + name + '/custom_hooks/post-receive'
if os.path.exists(path_tmp):
data[x]['has_hook'] = True
else:
data[x]['has_hook'] = False
return data
def userProjectList():
import math
args = getArgs()
# print args
page = 1
page_size = 5
search = ''
if not 'name' in args:
return mw.returnJson(False, '缺少参数name')
if 'page' in args:
page = int(args['page'])
if 'page_size' in args:
page_size = int(args['page_size'])
if 'search' in args:
search = args['search']
data = {}
ulist = getAllUserProject(args['name'])
dlist_sum = len(ulist)
start = (page - 1) * page_size
ret_data = ulist[start:start + page_size]
ret_data = checkProjectListIsHasScript(args['name'], ret_data)
data['root_url'] = getRootUrl()
data['data'] = ret_data
data['args'] = args
data['list'] = mw.getPage(
{'count': dlist_sum, 'p': page, 'row': page_size, 'tojs': 'userProjectList'})
return mw.returnJson(True, 'OK', data)
def projectScriptEdit():
args = getArgs()
if not 'user' in args:
return mw.returnJson(True, 'username missing')
if not 'name' in args:
return mw.returnJson(True, 'project name missing')
user = args['user']
name = args['name'] + '.git'
post_receive = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/commit'
if os.path.exists(post_receive):
return mw.returnJson(True, 'OK', {'path': post_receive})
else:
return mw.returnJson(False, 'file does not exist')
def projectScriptLoad():
args = getArgs()
if not 'user' in args:
return mw.returnJson(True, 'username missing')
if not 'name' in args:
return mw.returnJson(True, 'project name missing')
user = args['user']
name = args['name'] + '.git'
path = getRootPath() + '/' + user + '/' + name
post_receive_tpl = getPluginDir() + '/hook/post-receive.tpl'
post_receive = path + '/custom_hooks/post-receive'
if not os.path.exists(path + '/custom_hooks'):
mw.execShell('mkdir -p ' + path + '/custom_hooks')
pct_content = mw.readFile(post_receive_tpl)
pct_content = pct_content.replace('{$PATH}', path + '/custom_hooks')
mw.writeFile(post_receive, pct_content)
mw.execShell('chmod 777 ' + post_receive)
commit_tpl = getPluginDir() + '/hook/commit.tpl'
commit = path + '/custom_hooks/commit'
codeDir = mw.getRootDir() + '/git'
cc_content = mw.readFile(commit_tpl)
sshUrl = 'http://127.0.0.1:' + getHttpPort()
cc_content = cc_content.replace('{$GITROOTURL}', sshUrl)
cc_content = cc_content.replace('{$CODE_DIR}', codeDir)
cc_content = cc_content.replace('{$USERNAME}', user)
cc_content = cc_content.replace('{$PROJECT}', args['name'])
cc_content = cc_content.replace('{$WEB_ROOT}', mw.getWwwDir())
mw.writeFile(commit, cc_content)
mw.execShell('chmod 777 ' + commit)
return 'ok'
def projectScriptUnload():
args = getArgs()
if not 'user' in args:
return mw.returnJson(True, 'username missing')
if not 'name' in args:
return mw.returnJson(True, 'project name missing')
user = args['user']
name = args['name'] + '.git'
post_receive = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/post-receive'
mw.execShell('rm -f ' + post_receive)
commit = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/commit'
mw.execShell('rm -f ' + commit)
return 'ok'
def projectScriptDebug():
args = getArgs()
if not 'user' in args:
return mw.returnJson(True, 'username missing')
if not 'name' in args:
return mw.returnJson(True, 'project name missing')
user = args['user']
name = args['name'] + '.git'
commit_log = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/sh.log'
data = {}
if os.path.exists(commit_log):
data['status'] = True
data['path'] = commit_log
else:
data['status'] = False
data['msg'] = '没有日志文件'
return mw.getJson(data)
def gogsEdit():
data = {}
data['post_receive'] = getPluginDir() + '/hook/post-receive.tpl'
data['commit'] = getPluginDir() + '/hook/commit.tpl'
return mw.getJson(data)
def getRsaPublic():
path = getHomeDir()
path += '/.ssh/id_rsa.pub'
content = mw.readFile(path)
data = {}
data['mw'] = content
return mw.getJson(data)
def getTotalStatistics():
st = status()
data = {}
if st.strip() == 'start':
pm = pMysqlDb()
list_count = pm.query('select count(id) as num from repository')
if list_count.find("error") > -1:
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)
data['status'] = True
data['count'] = count
data['ver'] = mw.readFile(getServerDir() + '/version.pl').strip()
return mw.returnJson(True, 'ok', data)
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print(status())
elif func == 'start':
print(start())
elif func == 'stop':
print(stop())
elif func == 'restart':
print(restart())
elif func == 'reload':
print(reload())
elif func == 'initd_status':
print(initdStatus())
elif func == 'initd_install':
print(initdInstall())
elif func == 'initd_uninstall':
print(initdUinstall())
elif func == 'run_log':
print(runLog())
elif func == 'post_receive_log':
print(postReceiveLog())
elif func == 'conf':
print(getConf())
elif func == 'init_conf':
print(getInitdConf())
elif func == 'get_gogs_conf':
print(getGogsConf())
elif func == 'submit_gogs_conf':
print(submitGogsConf())
elif func == 'user_list':
print(userList())
elif func == 'user_project_list':
print(userProjectList())
elif func == 'project_script_edit':
print(projectScriptEdit())
elif func == 'project_script_load':
print(projectScriptLoad())
elif func == 'project_script_unload':
print(projectScriptUnload())
elif func == 'project_script_debug':
print(projectScriptDebug())
elif func == 'gogs_edit':
print(gogsEdit())
elif func == 'get_rsa_public':
print(getRsaPublic())
elif func == 'get_total_statistics':
print(getTotalStatistics())
else:
print('fail')

View File

@@ -1,91 +0,0 @@
# coding: utf-8
import re
import os
import sys
# sys.path.append("/usr/local/lib/python3.6/site-packages")
class mysqlDb:
__DB_PASS = None
__DB_USER = 'root'
__DB_PORT = 3306
__DB_HOST = 'localhost'
__DB_NAME = 'test'
__DB_CONN = None
__DB_CUR = None
__DB_ERR = None
__DB_CNF = '/etc/my.cnf'
def __Conn(self):
'''连接MYSQL数据库'''
try:
socket = '/www/server/mysql/mysql.sock'
try:
import MySQLdb
except Exception as ex:
self.__DB_ERR = ex
return False
try:
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
port=self.__DB_PORT, db=self.__DB_NAME, charset="utf8", connect_timeout=10, unix_socket=socket)
except MySQLdb.Error as e:
self.__DB_HOST = '127.0.0.1'
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
port=self.__DB_PORT, db=self.__DB_NAME, charset="utf8", connect_timeout=10, unix_socket=socket)
self.__DB_CUR = self.__DB_CONN.cursor()
return True
except MySQLdb.Error as e:
self.__DB_ERR = e
return False
def setHost(self, host):
self.__DB_HOST = host
def setPwd(self, pwd):
self.__DB_PASS = pwd
def setUser(self, user):
self.__DB_USER = user
def setPort(self, port):
self.__DB_PORT = port
def setDb(self, name):
self.__DB_NAME = name
def getPwd(self):
return self.__DB_PASS
def execute(self, sql):
# 执行SQL语句返回受影响行
if not self.__Conn():
return self.__DB_ERR
try:
result = self.__DB_CUR.execute(sql)
self.__DB_CONN.commit()
self.__Close()
return result
except Exception as ex:
return ex
def query(self, sql):
# 执行SQL语句返回数据集
if not self.__Conn():
return self.__DB_ERR
try:
self.__DB_CUR.execute(sql)
result = self.__DB_CUR.fetchall()
# 将元组转换成列表
# data = map(list, result)
self.__Close()
return result
except Exception as ex:
return "error: " + str(ex)
# 关闭连接
def __Close(self):
self.__DB_CUR.close()
self.__DB_CONN.close()

View File

@@ -1,63 +0,0 @@
APP_NAME = Gogs
RUN_USER = {$RUN_USER}
RUN_MODE = prod
[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3306
NAME = gogs
USER = gogs
PASSWD = gogs
SSL_MODE = disable
PATH = data/gogs.db
[repository]
ROOT = {$ROOT_PATH}/gogs-repositories
FORCE_PRIVATE = true
[server]
DOMAIN = 127.0.0.1
HTTP_PORT = 3000
ROOT_URL = http://127.0.0.1:3000/
DISABLE_SSH = true
SSH_PORT = 2000
START_SSH_SERVER = false
OFFLINE_MODE = false
LANDING_PAGE = home
[mailer]
ENABLED = false
HOST = smtp.163.com:465
USER = midoks@163.com
PASSWD = ***
USE_PLAIN_TEXT = true
[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
DISABLE_REGISTRATION = true
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = true
[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = false
[session]
PROVIDER = file
[log]
MODE = console, file
LEVEL = Info
ROOT_PATH = {$SERVER_PATH}/gogs/log
[security]
INSTALL_LOCK = true
SECRET_KEY = jmGSJXDBH5Ng4wt
[other]
SHOW_FOOTER_BRANDING = false
SHOW_FOOTER_VERSION = false
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false

View File

@@ -1,39 +0,0 @@
#!/bin/bash
echo `date`
GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}.git"
GIT_SDIR="{$CODE_DIR}"
GIT_USER_DIR="${GIT_SDIR}/{$USERNAME}"
GIT_PROJECT_DIR="${GIT_USER_DIR}/{$PROJECT}"
git config --global credential.helper store
# echo $GIT_PROJECT_DIR
if [ ! -d $GIT_PROJECT_DIR ];then
mkdir -p $GIT_USER_DIR && cd $GIT_USER_DIR
git clone $GITADDR
fi
unset GIT_DIR
cd $GIT_PROJECT_DIR && git pull
# func 2
# cd $GIT_PROJECT_DIR && env -i git pull origin master
#更新的目的地址
WEB_PATH={$WEB_ROOT}/{$USERNAME}/{$PROJECT}
mkdir -p $WEB_PATH
rsync -vauP --delete --exclude=".*" $GIT_PROJECT_DIR/ $WEB_PATH
sysName=`uname`
if [ $sysName == 'Darwin' ]; then
USER=$(who | sed -n "2,1p" |awk '{print $1}')
chown -R $USER:staff $WEB_PATH
else
chown -R www:www $WEB_PATH
fi

View File

@@ -1,36 +0,0 @@
#!/bin/bash
echo `date`
GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}"
GIT_SDIR="{$CODE_DIR}"
GIT_USER_DIR="${GIT_SDIR}/{$USERNAME}"
GIT_PROJECT_DIR="${GIT_USER_DIR}/{$PROJECT}"
# echo $GIT_PROJECT_DIR
if [ ! -d $GIT_PROJECT_DIR ];then
mkdir -p $GIT_USER_DIR && cd $GIT_USER_DIR
git clone $GITADDR
fi
unset GIT_DIR
cd $GIT_PROJECT_DIR && git pull
# func 2
# cd $GIT_PROJECT_DIR && env -i git pull origin master
WEB_PATH={$WEB_ROOT}/{$USERNAME}/{$PROJECT}
mkdir -p $WEB_PATH
rsync -vauP --delete --exclude=".*" $GIT_PROJECT_DIR/ $WEB_PATH
sysName=`uname`
if [ $sysName == 'Darwin' ]; then
USER=$(who | sed -n "2,1p" |awk '{print $1}')
chown -R $USER:staff $WEB_PATH
else
chown -R www:www $WEB_PATH
fi

View File

@@ -1,3 +0,0 @@
#!/bin/bash
sh -x {$PATH}/commit 2>{$PATH}/sh.log

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,23 +0,0 @@
<div class="bt-form">
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('gogs');">服务</p>
<p onclick="pluginInitD('gogs');">自启动</p>
<!-- <p onclick="pluginConfig('gogs',null, 'init_conf');">启动配置</p> -->
<p onclick="gogsEdit();">手动编辑</p>
<p onclick="pluginConfig('gogs',null, 'conf');">配置文件</p>
<p onclick="gogsSetConfig();">配置修改</p>
<p onclick="gogsUserList();">用户列表</p>
<p onclick="pluginLogs('gogs',null,'run_log');">运行日志</p>
<p onclick="pluginLogs('gogs',null,'post_receive_log');" title="提交post-receive日志">提交日志</p>
<p onclick="gogsRead();">使用说明</p>
</div>
<div class="bt-w-con pd15">
<div class="soft-man-con"></div>
</div>
</div>
</div>
<script type="text/javascript">
$.getScript( "/plugins/file?name=gogs&f=js/gogs.js");
pluginService('gogs');
</script>

View File

@@ -1,749 +0,0 @@
# coding: utf-8
import time
import os
import sys
import re
sys.path.append(os.getcwd() + "/class/core")
import mw
# cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\''
# info = mw.execShell(cmd)
# p = "/usr/local/lib/" + info[0].strip() + "/site-packages"
# sys.path.append(p)
import psutil
app_debug = False
if mw.isAppleSystem():
app_debug = True
def getPluginName():
return 'gogs'
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()
sys.path.append(getPluginDir() + "/class")
import mysqlDb
def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
def getInitDFile():
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
def getArgs():
args = sys.argv[2:]
tmp = {}
args_len = len(args)
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':', 1)
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':', 1)
tmp[t[0]] = t[1]
return tmp
def checkArgs(data, ck=[]):
for i in range(len(ck)):
if not ck[i] in data:
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
return (True, mw.returnJson(True, 'ok'))
def getInitdConfTpl():
path = getPluginDir() + "/init.d/gogs.tpl"
return path
def getInitdConf():
path = getServerDir() + "/init.d/gogs"
return path
def getConf():
path = getServerDir() + "/custom/conf/app.ini"
return path
def getConfTpl():
path = getPluginDir() + "/conf/app.ini"
return path
def status():
data = mw.execShell(
"ps -ef|grep " + getPluginName() + " |grep -v grep | grep -v python | awk '{print $2}'")
if data[0] == '':
return 'stop'
return 'start'
def getHomeDir():
if mw.isAppleSystem():
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return '/Users/' + user
else:
return '/root'
def getRunUser():
if mw.isAppleSystem():
user = mw.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return user
else:
return 'root'
__SR = '''#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export USER=%s
export HOME=%s && ''' % ( getRunUser(), getHomeDir())
def contentReplace(content):
service_path = mw.getServerDir()
content = content.replace('{$ROOT_PATH}', mw.getRootDir())
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$RUN_USER}', getRunUser())
content = content.replace('{$HOME_DIR}', getHomeDir())
return content
def initDreplace():
file_tpl = getInitdConfTpl()
service_path = mw.getServerDir()
initD_path = getServerDir() + '/init.d'
if not os.path.exists(initD_path):
os.mkdir(initD_path)
file_bin = initD_path + '/' + getPluginName()
if not os.path.exists(file_bin):
content = mw.readFile(file_tpl)
content = contentReplace(content)
mw.writeFile(file_bin, content)
mw.execShell('chmod +x ' + file_bin)
# conf_bin = getConf()
# if not os.path.exists(conf_bin):
# mw.execShell('mkdir -p ' + getServerDir() + '/custom/conf')
# conf_tpl = getConfTpl()
# content = mw.readFile(conf_tpl)
# content = contentReplace(content)
# mw.writeFile(conf_bin, content)
# systemd
systemDir = mw.systemdCfgDir()
systemService = systemDir + '/gogs.service'
systemServiceTpl = getPluginDir() + '/init.d/gogs.service.tpl'
if os.path.exists(systemDir) and not os.path.exists(systemService):
service_path = mw.getServerDir()
se_content = mw.readFile(systemServiceTpl)
se_content = se_content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(systemService, se_content)
mw.execShell('systemctl daemon-reload')
log_path = getServerDir() + '/log'
if not os.path.exists(log_path):
os.mkdir(log_path)
return file_bin
def getRootUrl():
content = mw.readFile(getConf())
rep = 'ROOT_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0]
rep = 'EXTERNAL_URL\s*=\s*(.*)'
tmp = re.search(rep, content)
if tmp:
return tmp.groups()[0]
return ''
def getSshPort():
content = mw.readFile(getConf())
rep = 'SSH_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getHttpPort():
content = mw.readFile(getConf())
rep = 'HTTP_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getRootPath():
content = mw.readFile(getConf())
rep = 'ROOT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getDbConfValue():
conf = getConf()
if not os.path.exists(conf):
return {}
content = mw.readFile(conf)
rep_scope = "\[database\](.*?)\["
tmp = re.findall(rep_scope, content, re.S)
rep = '(\w*)\s*=\s*(.*)'
tmp = re.findall(rep, tmp[0])
r = {}
for x in range(len(tmp)):
k = tmp[x][0]
v = tmp[x][1]
r[k] = v
return r
def pMysqlDb(conf):
host = conf['HOST'].split(':')
conn = mysqlDb.mysqlDb()
conn.setHost(host[0])
conn.setUser(conf['USER'])
conn.setPwd(conf['PASSWD'])
conn.setPort(int(host[1]))
conn.setDb(conf['NAME'])
return conn
def pSqliteDb(conf):
# print(conf)
import db
psDb = db.Sql()
# 默认
gsdir = getServerDir() + '/data'
dbname = 'gogs'
if conf['PATH'][0] == '/':
# 绝对路径
pass
else:
path = conf['PATH'].split('/')
gsdir = getServerDir() + '/' + path[0]
dbname = path[1].split('.')[0]
# print(gsdir, dbname)
psDb.dbPos(gsdir, dbname)
return psDb
def getGogsDbType(conf):
if 'DB_TYPE' in conf:
return conf['DB_TYPE']
if 'TYPE' in conf:
return conf['TYPE']
return 'NONE'
def pQuery(sql):
conf = getDbConfValue()
gtype = getGogsDbType(conf)
if gtype == 'sqlite3':
db = pSqliteDb(conf)
data = db.query(sql, []).fetchall()
return data
elif gtype == 'mysql':
db = pMysqlDb(conf)
return db.query(sql)
print("仅支持mysql|sqlite3配置")
exit(0)
def isSqlError(mysqlMsg):
# 检测数据库执行错误
_mysqlMsg = str(mysqlMsg)
# print _mysqlMsg
if "MySQLdb" in _mysqlMsg:
return mw.returnData(False, 'MySQLdb组件缺失! <br>进入SSH命令行输入: pip install mysql-python')
if "2002," in _mysqlMsg:
return mw.returnData(False, '数据库连接失败,请检查数据库服务是否启动!')
if "using password:" in _mysqlMsg:
return mw.returnData(False, '数据库管理密码错误!')
if "Connection refused" in _mysqlMsg:
return mw.returnData(False, '数据库连接失败,请检查数据库服务是否启动!')
if "1133," in _mysqlMsg:
return mw.returnData(False, '数据库用户不存在!')
if "1007," in _mysqlMsg:
return mw.returnData(False, '数据库已经存在!')
if "1044," in _mysqlMsg:
return mw.returnData(False, mysqlMsg[1])
if "2003," in _mysqlMsg:
return mw.returnData(False, "Can't connect to MySQL server on '127.0.0.1' (61)")
return mw.returnData(True, 'OK')
def gogsOp(method):
file = initDreplace()
if not mw.isAppleSystem():
data = mw.execShell('systemctl ' + method + ' gogs')
if data[1] == '':
return 'ok'
return 'fail'
data = mw.execShell(__SR + file + ' ' + method)
if data[1] == '':
return 'ok'
return data[0]
def start():
return gogsOp('start')
def stop():
return gogsOp('stop')
def restart():
return gogsOp('restart')
def reload():
return gogsOp('reload')
def initdStatus():
if mw.isAppleSystem():
return "Apple Computer does not support"
shell_cmd = 'systemctl status gogs | grep loaded | grep "enabled;"'
data = mw.execShell(shell_cmd)
if data[0] == '':
return 'fail'
return 'ok'
def initdInstall():
if mw.isAppleSystem():
return "Apple Computer does not support"
mw.execShell('systemctl enable gogs')
return 'ok'
def initdUinstall():
if mw.isAppleSystem():
return "Apple Computer does not support"
mw.execShell('systemctl disable gogs')
return 'ok'
def runLog():
log_path = getServerDir() + '/log/gogs.log'
return log_path
def postReceiveLog():
log_path = getServerDir() + '/log/hooks/post-receive.log'
return log_path
def getGogsConf():
conf = getConf()
if not os.path.exists(conf):
return mw.returnJson(False, "请先安装初始化!")
gets = [
{'name': 'DOMAIN', 'type': -1, 'ps': '服务器域名'},
{'name': 'ROOT_URL', 'type': -1, 'ps': '公开的完整URL路径'},
{'name': 'HTTP_ADDR', 'type': -1, 'ps': '应用HTTP监听地址'},
{'name': 'HTTP_PORT', 'type': -1, 'ps': '应用 HTTP 监听端口号'},
{'name': 'START_SSH_SERVER', 'type': 2, 'ps': '启动内置SSH服务器'},
{'name': 'SSH_PORT', 'type': -1, 'ps': 'SSH 端口号'},
{'name': 'REQUIRE_SIGNIN_VIEW', 'type': 2, 'ps': '强制登录浏览'},
{'name': 'ENABLE_CAPTCHA', 'type': 2, 'ps': '启用验证码服务'},
{'name': 'DISABLE_REGISTRATION', 'type': 2, 'ps': '禁止注册,只能由管理员创建帐号'},
{'name': 'ENABLE_NOTIFY_MAIL', 'type': 2, 'ps': '是否开启邮件通知'},
{'name': 'FORCE_PRIVATE', 'type': 2, 'ps': '强制要求所有新建的仓库都是私有'},
{'name': 'SHOW_FOOTER_BRANDING', 'type': 2, 'ps': 'Gogs推广信息'},
{'name': 'SHOW_FOOTER_VERSION', 'type': 2, 'ps': 'Gogs版本信息'},
{'name': 'SHOW_FOOTER_TEMPLATE_LOAD_TIME', 'type': 2, 'ps': 'Gogs模板加载时间'},
]
conf = mw.readFile(conf)
result = []
for g in gets:
rep = g['name'] + '\s*=\s*(.*)'
tmp = re.search(rep, conf)
if not tmp:
continue
g['value'] = tmp.groups()[0]
result.append(g)
return mw.returnJson(True, 'OK', result)
def submitGogsConf():
gets = ['DOMAIN',
'ROOT_URL',
'HTTP_ADDR',
'HTTP_PORT',
'START_SSH_SERVER',
'SSH_PORT',
'REQUIRE_SIGNIN_VIEW',
'FORCE_PRIVATE',
'ENABLE_CAPTCHA',
'DISABLE_REGISTRATION',
'ENABLE_NOTIFY_MAIL',
'SHOW_FOOTER_BRANDING',
'SHOW_FOOTER_VERSION',
'SHOW_FOOTER_TEMPLATE_LOAD_TIME']
args = getArgs()
filename = getConf()
conf = mw.readFile(filename)
for g in gets:
if g in args:
rep = g + '\s*=\s*(.*)'
val = g + ' = ' + args[g]
conf = re.sub(rep, val, conf)
mw.writeFile(filename, conf)
reload()
return mw.returnJson(True, '设置成功')
def userList():
conf = getConf()
if not os.path.exists(conf):
return mw.returnJson(False, "请先安装初始化!")
import math
args = getArgs()
data = checkArgs(args, ['page', 'page_size'])
if not data[0]:
return data[1]
page = int(args['page'])
page_size = int(args['page_size'])
search = ''
if 'search' in args:
search = args['search']
data = {}
data['root_url'] = getRootUrl()
start = (page - 1) * page_size
list_count = pQuery('select count(id) as num from user')
count = list_count[0][0]
list_data = pQuery(
'select id,name,email from user order by id desc limit ' + str(start) + ',' + str(page_size))
data['list'] = mw.getPage({'count': count, 'p': page,
'row': page_size, 'tojs': 'gogsUserList'})
data['page'] = page
data['page_size'] = page_size
data['page_count'] = int(math.ceil(count / page_size))
data['data'] = list_data
return mw.returnJson(True, 'OK', data)
def getAllUserProject(user, search=''):
path = getRootPath() + '/' + user
dlist = []
if os.path.exists(path):
for filename in os.listdir(path):
tmp = {}
filePath = path + '/' + filename
if os.path.isdir(filePath):
if search == '':
tmp['name'] = filename.replace('.git', '')
dlist.append(tmp)
else:
if filename.find(search) != -1:
tmp['name'] = filename.replace('.git', '')
dlist.append(tmp)
return dlist
def checkProjectListIsHasScript(user, data):
path = getRootPath() + '/' + user
for x in range(len(data)):
name = data[x]['name'] + '.git'
path_tmp = path + '/' + name + '/custom_hooks/post-receive'
if os.path.exists(path_tmp):
data[x]['has_hook'] = True
else:
data[x]['has_hook'] = False
return data
def userProjectList():
import math
args = getArgs()
# print args
page = 1
page_size = 5
search = ''
if not 'name' in args:
return mw.returnJson(False, '缺少参数name')
if 'page' in args:
page = int(args['page'])
if 'page_size' in args:
page_size = int(args['page_size'])
if 'search' in args:
search = args['search']
data = {}
ulist = getAllUserProject(args['name'])
dlist_sum = len(ulist)
start = (page - 1) * page_size
ret_data = ulist[start:start + page_size]
ret_data = checkProjectListIsHasScript(args['name'], ret_data)
data['root_url'] = getRootUrl()
data['data'] = ret_data
data['args'] = args
data['list'] = mw.getPage(
{'count': dlist_sum, 'p': page, 'row': page_size, 'tojs': 'userProjectList'})
return mw.returnJson(True, 'OK', data)
def projectScriptEdit():
args = getArgs()
if not 'user' in args:
return mw.returnJson(True, 'username missing')
if not 'name' in args:
return mw.returnJson(True, 'project name missing')
user = args['user']
name = args['name'] + '.git'
post_receive = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/commit'
if os.path.exists(post_receive):
return mw.returnJson(True, 'OK', {'path': post_receive})
else:
return mw.returnJson(False, 'file does not exist')
def projectScriptLoad():
args = getArgs()
if not 'user' in args:
return mw.returnJson(True, 'username missing')
if not 'name' in args:
return mw.returnJson(True, 'project name missing')
user = args['user']
name = args['name'] + '.git'
path = getRootPath() + '/' + user + '/' + name
post_receive_tpl = getPluginDir() + '/hook/post-receive.tpl'
post_receive = path + '/custom_hooks/post-receive'
if not os.path.exists(path + '/custom_hooks'):
mw.execShell('mkdir -p ' + path + '/custom_hooks')
pct_content = mw.readFile(post_receive_tpl)
pct_content = pct_content.replace('{$PATH}', path + '/custom_hooks')
mw.writeFile(post_receive, pct_content)
mw.execShell('chmod 777 ' + post_receive)
commit_tpl = getPluginDir() + '/hook/commit.tpl'
commit = path + '/custom_hooks/commit'
codeDir = mw.getRootDir() + '/git'
cc_content = mw.readFile(commit_tpl)
gitPath = getRootPath()
cc_content = cc_content.replace('{$GITROOTURL}', gitPath)
cc_content = cc_content.replace('{$CODE_DIR}', codeDir)
cc_content = cc_content.replace('{$USERNAME}', user)
cc_content = cc_content.replace('{$PROJECT}', args['name'])
cc_content = cc_content.replace('{$WEB_ROOT}', mw.getWwwDir())
mw.writeFile(commit, cc_content)
mw.execShell('chmod 777 ' + commit)
return 'ok'
def projectScriptUnload():
args = getArgs()
data = checkArgs(args, ['user', 'name'])
if not data[0]:
return data[1]
user = args['user']
name = args['name'] + '.git'
post_receive = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/post-receive'
mw.execShell('rm -f ' + post_receive)
commit = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/commit'
mw.execShell('rm -f ' + commit)
return 'ok'
def projectScriptDebug():
args = getArgs()
data = checkArgs(args, ['user', 'name'])
if not data[0]:
return data[1]
user = args['user']
name = args['name'] + '.git'
commit_log = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/sh.log'
data = {}
if os.path.exists(commit_log):
data['status'] = True
data['path'] = commit_log
else:
data['status'] = False
data['msg'] = '没有日志文件'
return mw.getJson(data)
def gogsEdit():
data = {}
data['post_receive'] = getPluginDir() + '/hook/post-receive.tpl'
data['commit'] = getPluginDir() + '/hook/commit.tpl'
return mw.getJson(data)
def getRsaPublic():
path = getHomeDir()
path += '/.ssh/id_rsa.pub'
content = mw.readFile(path)
data = {}
data['mw'] = content
return mw.getJson(data)
def getTotalStatistics():
st = status()
data = {}
if st.strip() == 'start':
list_count = pQuery('select count(id) as num from repository')
if list_count.find("error") > -1:
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)
data['status'] = True
data['count'] = count
data['ver'] = mw.readFile(getServerDir() + '/version.pl').strip()
return mw.returnJson(True, 'ok', data)
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print(status())
elif func == 'start':
print(start())
elif func == 'stop':
print(stop())
elif func == 'restart':
print(restart())
elif func == 'reload':
print(reload())
elif func == 'initd_status':
print(initdStatus())
elif func == 'initd_install':
print(initdInstall())
elif func == 'initd_uninstall':
print(initdUinstall())
elif func == 'run_log':
print(runLog())
elif func == 'post_receive_log':
print(postReceiveLog())
elif func == 'conf':
print(getConf())
elif func == 'init_conf':
print(getInitdConf())
elif func == 'get_gogs_conf':
print(getGogsConf())
elif func == 'submit_gogs_conf':
print(submitGogsConf())
elif func == 'user_list':
print(userList())
elif func == 'user_project_list':
print(userProjectList())
elif func == 'project_script_edit':
print(projectScriptEdit())
elif func == 'project_script_load':
print(projectScriptLoad())
elif func == 'project_script_unload':
print(projectScriptUnload())
elif func == 'project_script_debug':
print(projectScriptDebug())
elif func == 'gogs_edit':
print(gogsEdit())
elif func == 'get_rsa_public':
print(getRsaPublic())
elif func == 'get_total_statistics':
print(getTotalStatistics())
else:
print('fail')

View File

@@ -1,16 +0,0 @@
{
"ps": "Gogs是一款极易搭建的自助Git服务",
"name": "gogs",
"title": "Gogs",
"versions": ["0.11.86","0.12.9"],
"tip": "soft",
"checks": "server/gogs",
"path":"server/gogs",
"author": "midoks",
"date": "2018-04-01",
"home": "https://gogs.io",
"type": "Git服务器",
"shell": "install.sh",
"pid": "3",
"sort": 7
}

View File

@@ -1,29 +0,0 @@
[Unit]
Description=Gogs
After=network.target
[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=git
Group=git
WorkingDirectory={$SERVER_PATH}/gogs
ExecStart={$SERVER_PATH}/gogs/gogs web
ExecReload=/bin/kill -USR2 $MAINPID
Restart=always
Environment=USER=git HOME=/home/git
# 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

View File

@@ -1,12 +0,0 @@
[Unit]
Description=Gogs
After=network.target
[Service]
Type=forking
ExecStart={$SERVER_PATH}/gogs/init.d/gogs start
ExecStop={$SERVER_PATH}/gogs/init.d/gogs stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@@ -1,110 +0,0 @@
#!/bin/sh
#
# /etc/rc.d/init.d/gogs
#
# Runs the Gogs
#
#
# chkconfig: - 85 15
#
### BEGIN INIT INFO
# Provides: gogs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: mysql postgresql
# Should-Stop: mysql postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start gogs at boot time.
# Description: Control gogs.
### END INIT INFO
# Source function library.
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
# Default values
export HOME={$HOME_DIR}
export USER={$RUN_USER}
NAME=gogs
GOGS_HOME={$SERVER_PATH}/gogs
GOGS_PATH=${GOGS_HOME}/$NAME
GOGS_USER={$RUN_USER}
SERVICENAME="Gogs"
LOCKFILE=/tmp/gogs.lock
LOGPATH=${GOGS_HOME}/log
LOGFILE=${LOGPATH}/gogs.log
RETVAL=0
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
DAEMON_OPTS="--check $NAME"
[ ! -z "$GOGS_USER" ] && DAEMON_OPTS="$DAEMON_OPTS --user=${GOGS_USER}"
status(){
isStart=`ps -ef|grep 'gogs web' |grep -v grep|awk '{print $2}'`
if [ "$isStart" == '' ];then
echo -e "${SERVICENAME} not running"
else
echo -e "${SERVICENAME}(pid $(echo $isStart)) already running"
fi
}
start() {
isStart=`ps -ef|grep 'gogs web' |grep -v grep|awk '{print $2}'`
if [ "$isStart" != '' ];then
echo "${SERVICENAME}(pid $(echo $isStart)) already running"
return $RETVAL
fi
cd ${GOGS_HOME}
echo -e "Starting ${SERVICENAME}: \c"
${GOGS_PATH} web > ${LOGFILE} 2>&1 &
RETVAL=$?
[ $RETVAL = 0 ] && touch ${LOCKFILE} && echo -e "\033[32mdone\033[0m"
return $RETVAL
}
stop() {
pids=`ps -ef|grep 'gogs web' |grep -v grep|awk '{print $2}'`
arr=($pids)
echo -e "Stopping gogs... \c"
for p in ${arr[@]}
do
kill -9 $p
done
echo -e "\033[32mdone\033[0m"
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
reload)
stop
start
;;
*)
echo "Usage: ${NAME} {start|stop|status|restart}"
exit 1
;;
esac
exit $RETVAL

View File

@@ -1,104 +0,0 @@
#!/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")
install_tmp=${rootPath}/tmp/mw_install.pl
GOGS_DOWNLOAD='https://dl.gogs.io'
getOs(){
os=`uname`
if [ "Darwin" == "$os" ];then
echo 'darwin'
else
echo 'linux'
fi
return 0
}
getBit(){
echo `getconf LONG_BIT`
}
Install_gogs()
{
mkdir -p $serverPath/source/gogs
echo '正在安装脚本文件...' > $install_tmp
version=$1
os=`getOs`
# if id git &> /dev/null ;then
# echo "git uid is `id -u git`"
# echo "git shell is `grep "^git:" /etc/passwd |cut -d':' -f7 `"
# else
# groupadd git
# useradd -g git git
# fi
git config --global push.default simple
if [ "darwin" == "$os" ];then
file=gogs_${version}_darwin_amd64.zip
else
file=gogs_${version}_linux_amd64.zip
fi
if [ ! -f $serverPath/source/gogs/$file ];then
wget -O $serverPath/source/gogs/$file ${GOGS_DOWNLOAD}/${version}/${file}
fi
cd $serverPath/source/gogs && unzip -o $file -d gogs_${version}
mv $serverPath/source/gogs/gogs_${version}/gogs/ $serverPath/gogs
if [ -d $serverPath/gogs ];then
echo $version > $serverPath/gogs/version.pl
cd ${rootPath} && python3 ${rootPath}/plugins/gogs/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/gogs/index.py initd_install
fi
# if id -u gogs > /dev/null 2>&1; then
# echo "gogs user exists"
# else
# useradd gogs
# cp /etc/sudoers{,.`date +"%Y-%m-%d_%H-%M-%S"`}
# echo "gogs ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# fi
echo 'install success' > $install_tmp
}
Uninstall_gogs()
{
if [ -f /usr/lib/systemd/system/gogs.service ];then
systemctl stop gogs
systemctl disable gogs
rm -rf /usr/lib/systemd/system/gogs.service
systemctl daemon-reload
fi
if [ -f $serverPath/gogs/initd/gogs ];then
$serverPath/gogs/initd/gogs stop
fi
rm -rf $serverPath/gogs
echo 'uninstall success' > $install_tmp
}
action=$1
version=$2
if [ "${1}" == 'install' ];then
Install_gogs $version
else
Uninstall_gogs $version
fi

View File

@@ -1,352 +0,0 @@
function str2Obj(str){
var data = {};
kv = str.split('&');
for(i in kv){
v = kv[i].split('=');
data[v[0]] = v[1];
}
return data;
}
function gogsPost(method,args,callback, title){
var _args = null;
if (typeof(args) == 'string'){
_args = JSON.stringify(str2Obj(args));
} else {
_args = JSON.stringify(args);
}
var _title = '正在获取...';
if (typeof(title) != 'undefined'){
_title = title;
}
var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 });
$.post('/plugins/run', {name:'gogs', func:method, args:_args}, 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 gogsSetConfig(){
gogsPost('get_gogs_conf', '', function(data){
var rrdata = $.parseJSON(data.data);
if (!rrdata.status){
layer.msg(rrdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
var rdata = rrdata.data;
var mlist = '';
for (var i = 0; i < rdata.length; i++) {
var w = '140';
if (rdata[i].name == 'error_reporting') w = '250';
var ibody = '<input style="width: ' + w + 'px;" class="bt-input-text mr5" name="' + rdata[i].name + '" value="' + rdata[i].value + '" type="text" >';
switch (rdata[i].type) {
case 0:
var selected_1 = (rdata[i].value == 1) ? 'selected' : '';
var selected_0 = (rdata[i].value == 0) ? 'selected' : '';
ibody = '<select class="bt-input-text mr5" name="' + rdata[i].name + '" style="width: ' + w + 'px;">\
<option value="1" ' + selected_1 + '>开启</option>\
<option value="0" ' + selected_0 + '>关闭</option>\
</select>';
break;
case 1:
var selected_1 = (rdata[i].value == 'On') ? 'selected' : '';
var selected_0 = (rdata[i].value == 'Off') ? 'selected' : '';
ibody = '<select class="bt-input-text mr5" name="' + rdata[i].name + '" style="width: ' + w + 'px;">\
<option value="On" ' + selected_1 + '>开启</option>\
<option value="Off" ' + selected_0 + '>关闭</option></select>'
break;
case 2:
var selected_1 = (rdata[i].value == 'true') ? 'selected' : '';
var selected_0 = (rdata[i].value == 'false') ? 'selected' : '';
ibody = '<select class="bt-input-text mr5" name="' + rdata[i].name + '" style="width: ' + w + 'px;">\
<option value="true" ' + selected_1 + '>开启</option>\
<option value="false" ' + selected_0 + '>关闭</option></select>'
break;
}
mlist += '<p><span>' + rdata[i].name + '</span>' + ibody + ', <font>' + rdata[i].ps + '</font></p>'
}
var html = '<style>.conf_p p{margin-bottom: 2px}</style><div class="conf_p" style="margin-bottom:0">\
' + mlist + '\
<div style="margin-top:10px; padding-right:15px" class="text-right">\
<button class="btn btn-success btn-sm mr5" onclick="gogsSetConfig()">刷新</button>\
<button class="btn btn-success btn-sm" onclick="submitGogsConf()">保存</button></div>\
</div>';
$(".soft-man-con").html(html);
});
}
//提交PHP配置
function submitGogsConf() {
var data = {
DOMAIN: $("input[name='DOMAIN']").val(),
ROOT_URL: $("input[name='ROOT_URL']").val(),
HTTP_ADDR: $("select[name='HTTP_ADDR']").val(),
HTTP_PORT: $("input[name='HTTP_PORT']").val(),
START_SSH_SERVER: $("select[name='START_SSH_SERVER']").val() || 'false',
SSH_PORT: $("input[name='SSH_PORT']").val(),
REQUIRE_SIGNIN_VIEW: $("select[name='REQUIRE_SIGNIN_VIEW']").val() || 'false',
ENABLE_CAPTCHA: $("select[name='ENABLE_CAPTCHA']").val() || 'true',
DISABLE_REGISTRATION: $("select[name='DISABLE_REGISTRATION']").val() || 'false',
ENABLE_NOTIFY_MAIL: $("select[name='ENABLE_NOTIFY_MAIL']").val() || 'false',
FORCE_PRIVATE: $("select[name='FORCE_PRIVATE']").val() || 'false',
SHOW_FOOTER_BRANDING: $("select[name='SHOW_FOOTER_BRANDING']").val() || 'false',
SHOW_FOOTER_VERSION: $("select[name='SHOW_FOOTER_VERSION']").val() || 'false',
SHOW_FOOTER_TEMPLATE_LOAD_TIME: $("select[name='SHOW_FOOTER_TEMPLATE_LOAD_TIME']").val() || 'false',
};
gogsPost('submit_gogs_conf', data, function(ret_data){
var rdata = $.parseJSON(ret_data.data);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
gogsSetConfig();
});
}
function gogsEdit(){
gogsPost('gogs_edit',{} , function(data){
// console.log(data);
var rdata = $.parseJSON(data.data);
var edit = '<p class="status">通用的手动编辑:</p>';
edit +='<div class="sfm-opt">\
<button class="btn btn-default btn-sm" onclick="onlineEditFile(0,\''+rdata['post_receive']+'\');">post-receive.tpl</button>\
<button class="btn btn-default btn-sm" onclick="onlineEditFile(0,\''+rdata['commit']+'\');">commit.tpl</button>\
</div>';
$(".soft-man-con").html(edit);
});
}
function gogsUserList(page, search) {
var _data = {};
if (typeof(page) =='undefined'){
var page = 1;
}
_data['page'] = page;
_data['page_size'] = 10;
if(typeof(search) != 'undefined'){
_data['search'] = search;
}
gogsPost('user_list', _data, function(data){
var rdata = $.parseJSON(data.data);
if (!rdata.status){
layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
content = '<div class="finduser"><input class="bt-input-text mr5 outline_no" type="text" placeholder="查找用户名" id="find_user" style="height: 28px; border-radius: 3px;width: 435px;">';
content += '<button class="btn btn-success btn-sm" onclick="userFind();">查找</button></div>';
content += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
content += '<thead><tr>';
content += '<th>序号</th>';
content += '<th>用户或组织</th>';
content += '<th>邮件地址</th>';
content += '<th>操作(<a href="'+rdata['data']['root_url']+'" class="btlink" target="_blank">WEB管理</a>)</th>';
content += '</tr></thead>';
content += '<tbody>';
ulist = rdata['data']['data'];
for (i in ulist){
email = ulist[i][2] == '' ? '无' : ulist[i][2];
content += '<tr><td>'+ulist[i][0]+'</td>'+
'<td>'+ulist[i][1]+'</td>'+
'<td>'+email+'</td>'+
'<td><a class="btlink" onclick="userProjectList(\''+ulist[i][1]+'\')">项目管理</a></td>'+
'</tr>';
}
content += '</tbody>';
content += '</table></div>';
var page = '<div class="dataTables_paginate paging_bootstrap pagination" style="margin-top:0px;"><ul id="softPage" class="page"><div>';
page += rdata['data']['list'];
page += '</div></ul></div>';
content += page;
$(".soft-man-con").html(content);
});
}
function userProjectList(user, search){
var req = {};
if (!isNaN(user)){
req['page'] = user;
req['name'] = user = getCookie('gogsUserSelected');
} else {
req['page'] = 1;
req['name'] = user;
setCookie('gogsUserSelected', user);
}
req['page_size'] = 5;
req['search'] = '';
if(typeof(search) != 'undefined'){
req['search'] = search;
}
$('.layui-layer-close1').click();
gogsPost('user_project_list', req, function(data){
var rdata = [];
try {
rdata = $.parseJSON(data.data);
} catch(e){}
if (!rdata['status']){
layer.msg(rdata['msg'], { icon: 2 });
return;
}
var list = '';
// console.log(rdata);
var project_list = rdata['data']['data'];
for (i in project_list) {
var name = project_list[i]['name'];
list += '<tr><td>'+name+'</td>\
<td>\
<a class="btlink" target="_blank" href="'+rdata['data']['root_url']+user+'/'+name+'">源码</a> | \
<a class="btlink" onclick="projectScript(\''+user+'\',\''+name+'\','+project_list[i]['has_hook']+');">脚本</a>\
</td>\
</tr>';
}
var page = '<div class="dataTables_paginate paging_bootstrap pagination" style="margin-top:0px;"><ul id="softPage" class="page"><div>';
page += rdata['data']['list'];
page += '</div></ul></div>';
var loadOpen = layer.open({
type: 1,
title: '用户('+user+')项目列表',
area: '500px',
content:"<div class='bt-form pd20 c6'>\
<div>\
<div class='divtable' style='margin-top:5px;'>\
<table class='table table-hover'>\
<thead><tr><th>项目</th><th>操作</th></tr></thead>\
<tbody>" + list + "</tbody>\
</table>" +
page +
"</div></div></div>"
});
});
}
function projectScript(user, name,has_hook){
// console.log(user,name,has_hook);
var html = '';
if (has_hook){
html += '<button onclick="projectScriptEdit(\''+user+'\',\''+name+'\')" class="btn btn-default btn-sm">手动编辑</button>';
html += '<button onclick="projectScriptDebug(\''+user+'\',\''+name+'\')" class="btn btn-default btn-sm">调试日志</button>';
html += '<button onclick="projectScriptLoad(\''+user+'\',\''+name+'\')" class="btn btn-default btn-sm">重新加载</button>';
html += '<button onclick="projectScriptUnload(\''+user+'\',\''+name+'\')" class="btn btn-default btn-sm">卸载脚本</button>';
} else {
html += '<button onclick="projectScriptLoad(\''+user+'\',\''+name+'\')" class="btn btn-default btn-sm">加载脚本</button>';
}
var loadOpen = layer.open({
type: 1,
title: '['+user+']['+name+']脚本设置',
area: '240px',
content:'<div class="change-default pd20">'+html+'</div>'
});
}
function projectScriptEdit(user,name){
gogsPost('project_script_edit', {'user':user,'name':name}, function(data){
var rdata = $.parseJSON(data.data);
if (rdata['status']){
onlineEditFile(0, rdata['data']['path']);
} else {
layer.msg(rdata.msg,{icon:1,time:2000,shade: [0.3, '#000']});
}
});
}
function projectScriptLoad(user,name){
gogsPost('project_script_load', {'user':user,'name':name}, function(data){
if (data.data != 'ok'){
layer.msg(data.data,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
layer.msg('加载成功!',{icon:1,time:2000,shade: [0.3, '#000']});
setTimeout(function(){
userProjectList(1);
}, 2000);
});
}
function projectScriptUnload(user,name){
gogsPost('project_script_unload', {'user':user,'name':name}, function(data){
if (data.data != 'ok'){
layer.msg(data.data,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
layer.msg('卸载成功!',{icon:1,time:2000,shade: [0.3, '#000']});
setTimeout(function(){
userProjectList(1);
}, 2000);
});
}
function projectScriptDebug(user,name){
gogsPost('project_script_debug', {'user':user,'name':name}, function(data){
var rdata = $.parseJSON(data.data);
if (rdata['status']){
onlineEditFile(0, rdata['path']);
} else {
layer.msg(rdata.msg,{icon:1,time:2000,shade: [0.3, '#000']});
}
});
}
function getRsaPublic(){
gogsPost('get_rsa_public', {}, function(data){
var rdata = $.parseJSON(data.data);
var con = '<div class="tab-con">\
<div class="myKeyCon ptb15">\
<textarea style="margin:0px;width:580px;height:110px;outline:none;" spellcheck="false">'+rdata.mw+'</textarea>\
</div>\
<ul class="help-info-text c7 pull-left"></ul>\
</div>'
layer.open({
type: 1,
area: "600px",
title: '本机公钥',
closeBtn: 2,
shift: 5,
shadeClose: false,
content:con
});
});
}
function gogsRead(){
var readme = '<ul class="help-info-text c7">';
readme += '<li>默认使用MySQL,第一个启动加载各种配置,并修改成正确的数据库配置</li>';
readme += '<li>邮件端口使用456,gogs仅支持使用STARTTLS的SMTP协议</li>';
readme += '<li>如果使用项目中脚本本地同步,<a target="_blank" href="https://github.com/midoks/mdserver-web/wiki/%E6%8F%92%E4%BB%B6%E7%AE%A1%E7%90%86%5Bgogs%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%5D#%E5%90%AF%E5%8A%A8gogs%E5%90%8E%E5%A6%82%E6%9E%9C%E8%A6%81%E4%BD%BF%E7%94%A8hook%E8%84%9A%E6%9C%AC%E5%90%8C%E6%AD%A5%E4%BB%A3%E7%A0%81%E9%9C%80%E8%A6%81%E5%BC%80%E5%90%AFssh%E7%AB%AF%E5%8F%A3">点击查看</></li>';
readme += '<li><a href="#" onclick="getRsaPublic();">点击查看本机公钥</></li>';
readme += '</ul>';
$('.soft-man-con').html(readme);
}

View File

@@ -1,4 +0,0 @@
[mysqld]
# SHOW GLOBAL VARIABLES LIKE '%gtid%'
gtid_mode=ON
enforce_gtid_consistency=ON

View File

@@ -1,43 +0,0 @@
CREATE TABLE IF NOT EXISTS `config` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`mysql_root` TEXT
);
INSERT INTO `config` (`id`, `mysql_root`) VALUES (1, 'admin');
CREATE TABLE IF NOT EXISTS `databases` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pid` INTEGER,
`name` TEXT,
`username` TEXT,
`password` TEXT,
`accept` TEXT,
`rw` TEXT DEFAULT 'rw',
`ps` TEXT,
`addtime` TEXT
);
-- ALTER TABLE `databases` ADD COLUMN `rw` TEXT DEFAULT 'rw';
CREATE TABLE IF NOT EXISTS `master_replication_user` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`username` TEXT,
`password` TEXT,
`accept` TEXT,
`ps` TEXT,
`addtime` TEXT
);
-- 从库配置主库的[ssh private key]
-- drop table `slave_id_rsa`;
CREATE TABLE IF NOT EXISTS `slave_id_rsa` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`ip` TEXT,
`port` TEXT,
`user` TEXT,
`db_user` TEXT,
`id_rsa` TEXT,
`ps` TEXT,
`addtime` TEXT
);

View File

@@ -1,103 +0,0 @@
[client]
user = root
#password = your_password
port = 33106
socket = {$SERVER_APP_PATH}/mysql.sock
[mysqld]
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
user = mysql
port = 33106
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}
default_storage_engine = InnoDB
key_buffer_size = 8M
max_allowed_packet = 100M
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=1
query_cache_size = 4M
tmp_table_size = 8M
max_connections = 500
max_connect_errors = 100
open_files_limit = 65535
skip-name-resolve = on
#skip-networking
#skip-external-locking
#loose-skip-innodb
#skip-grant-tables
log-bin=mysql-bin
binlog_format=mixed
slow_query_log=1
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on
binlog-expire-logs-seconds = 2592000
relay-log=mdserver
relay-log-index=mdserver
#master
#binlog-do-db
binlog-ignore-db = test
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
#slave
log-slave-updates
#replicate-do-db
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_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 = 2
innodb_file_per_table=1
secure-file-priv={$SERVER_APP_PATH}/tmp
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,61 +0,0 @@
<div class="bt-form">
<div class='plugin_version'></div>
<div class="bt-w-main">
<div class="bt-w-menu">
<script type="text/javascript">console.log($('.plugin_version').attr('version'));</script>
<p class="bgw" onclick="pluginService('mariadb', $('.plugin_version').attr('version'));">服务</p>
<p onclick="pluginInitD('mariadb', $('.plugin_version').attr('version'));">自启动</p>
<p onclick="pluginConfig('mariadb', $('.plugin_version').attr('version'));">配置文件</p>
<p onclick="myDbPos();">存储位置</p>
<p onclick="myPort();">端口</p>
<p onclick="runInfo();">当前状态</p>
<p onclick="myPerfOpt();">性能优化</p>
<p onclick="myLogs();">日志</p>
<p onclick="pluginLogs('mariadb',$('.plugin_version').attr('version'),'show_log');">慢日志</p>
<p onclick="dbList()">管理列表</p>
<p onclick="masterOrSlaveConf($('.plugin_version').attr('version'))">主从配置</p>
</div>
<div class="bt-w-con pd15">
<div class="soft-man-con"></div>
</div>
</div>
</div>
<style type="text/css">
.db_list{
padding: 0px 0 10px 0;
font-size: 13px;
line-height: 35px;
height: 45px;
}
.db_list a{
margin-right: 15px;
color: #555;
font-weight: 600;
}
.db_list span:nth-child(1){
display: block;
float: left;
padding-left: 15px;
background: #ececec;
border-radius: 3px;
}
#db_tools button {
margin-right: 10px;
}
#db_tools button:last-child{
margin-right: 0;
}
</style>
<script type="text/javascript">
resetPluginWinWidth(800);
var loading = layer.msg("资源加载中...", { icon: 16, time: 0, shade: 0.3 });
$.getScript( "/plugins/file?name=mariadb&f=js/mariadb.js", function(){
layer.close(loading);
pluginService('mariadb',$('.plugin_version').attr('version'));
});
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
{
"title":"MariaDB",
"tip":"soft",
"name":"mariadb",
"type":"运行环境",
"ps":"一种关系数据库管理系统!",
"uninstall_pre_inspection":true,
"checks": "server/mariadb",
"path": "server/mariadb",
"versions":["10.6","10.7","10.8"],
"shell":"install.sh",
"checks":"server/mariadb",
"path":"server/mariadb",
"author":"mariadb",
"home":"https://mariadb.org/",
"date":"2022-07-12",
"pid": "2"
}

View File

@@ -1,22 +0,0 @@
[Unit]
Description=MariaDB Server: The open source relational database
Documentation=https://mariadb.org/download/?t=mariadb
After=network.service
After=syslog.target
[Service]
User=mysql
Group=mysql
Type=simple
ExecStart={$SERVER_PATH}/mariadb/bin/mysqld --defaults-file={$SERVER_PATH}/mariadb/etc/my.cnf
ExecReload=/bin/kill -USR2 $MAINPID
PermissionsStartOnly=true
LimitNOFILE=5000
Restart=on-failure
RestartSec=10
RestartPreventExitStatus=1
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@@ -1,384 +0,0 @@
#!/bin/sh
# chkconfig: 2345 55 25
# Description: mysql service
# distro. For CentOS/Redhat run: 'chkconfig --add mysql'
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
# MySQL daemon start/stop script.
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
# When this is done the mysql server will be started when the machine is
# started and shut down when the systems goes down.
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 64 36
# description: A very fast and reliable SQL database engine.
# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop MySQL
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO
# If you install MySQL on some other places than /www/server/mysql, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory
# - Create a /etc/my.cnf file with the following information:
# [mysqld]
# basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
# and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
# below.
#
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=
datadir=
# Default value, in seconds, afterwhich the script should timeout waiting
# for server start.
# Value here is overriden by value in my.cnf.
# 0 means don't wait at all
# Negative numbers mean to wait indefinitely
service_startup_timeout=900
# Lock directory for RedHat / SuSE.
lockdir='/var/lock/subsys'
lock_file_path="$lockdir/mysql"
# The following variables are only set for letting mysql.server find things.
# Set some defaults
mysqld_pid_file_path=
if test -z "$basedir"
then
basedir={$SERVER_APP_PATH}
bindir={$SERVER_APP_PATH}/bin
if test -z "$datadir"
then
datadir={$SERVER_APP_PATH}/data
fi
sbindir={$SERVER_APP_PATH}/bin
libexecdir={$SERVER_APP_PATH}/bin
else
bindir="$basedir/bin"
if test -z "$datadir"
then
datadir="$basedir/data"
fi
sbindir="$basedir/sbin"
libexecdir="$basedir/libexec"
fi
# datadir_set is used to determine if datadir was set (and so should be
# *not* set inside of the --basedir= handler.)
datadir_set=
#
# Use LSB init script functions for printing messages, if possible
#
lsb_functions="/lib/lsb/init-functions"
if test -f $lsb_functions ; then
. $lsb_functions
else
log_success_msg()
{
echo " SUCCESS! $@"
}
log_failure_msg()
{
echo " ERROR! $@"
}
fi
PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
export PATH
mode=$1 # start or stop
[ $# -ge 1 ] && shift
other_args=--sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" # uncommon, but needed when called from an RPM upgrade action
# Expected: "--skip-networking --skip-grant-tables"
# They are not checked here, intentionally, as it is the resposibility
# of the "spec" file author to give correct arguments only.
case `echo "testing\c"`,`echo -n testing` in
*c*,-n*) echo_n= echo_c= ;;
*c*,*) echo_n=-n echo_c= ;;
*) echo_n= echo_c='\c' ;;
esac
parse_server_arguments() {
for arg do
case "$arg" in
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
bindir="$basedir/bin"
if test -z "$datadir_set"; then
datadir="$basedir/data"
fi
sbindir="$basedir/sbin"
libexecdir="$basedir/libexec"
;;
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
datadir_set=1
;;
--pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
done
}
wait_for_pid () {
verb="$1" # created | removed
pid="$2" # process ID of the program operating on the pid-file
pid_file_path="$3" # path to the PID file.
i=0
avoid_race_condition="by checking again"
while test $i -ne $service_startup_timeout ; do
case "$verb" in
'created')
# wait for a PID-file to pop into existence.
test -s "$pid_file_path" && i='' && break
;;
'removed')
# wait for this PID-file to disappear
test ! -s "$pid_file_path" && i='' && break
;;
*)
echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
exit 1
;;
esac
# if server isn't running, then pid-file will never be updated
if test -n "$pid"; then
if kill -0 "$pid" 2>/dev/null; then
: # the server still runs
else
# The server may have exited between the last pid-file check and now.
if test -n "$avoid_race_condition"; then
avoid_race_condition=""
continue # Check again.
fi
# there's nothing that will affect the file.
log_failure_msg "The server quit without updating PID file ($pid_file_path)."
return 1 # not waiting any more.
fi
fi
echo $echo_n ".$echo_c"
i=`expr $i + 1`
sleep 1
done
if test -z "$i" ; then
log_success_msg
return 0
else
log_failure_msg
return 1
fi
}
# Get arguments from the my.cnf file,
# the only group, which is read from now on is [mysqld]
if test -x "$bindir/my_print_defaults"; then
print_defaults="$bindir/my_print_defaults"
else
# Try to find basedir in /etc/my.cnf
conf=/etc/my.cnf
print_defaults=
if test -r $conf
then
subpat='^[^=]*basedir[^=]*=\(.*\)$'
dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
for d in $dirs
do
d=`echo $d | sed -e 's/[ ]//g'`
if test -x "$d/bin/my_print_defaults"
then
print_defaults="$d/bin/my_print_defaults"
break
fi
done
fi
# Hope it's in the PATH ... but I doubt it
test -z "$print_defaults" && print_defaults="my_print_defaults"
fi
#
# Read defaults file from 'basedir'. If there is no defaults file there
# check if it's in the old (depricated) place (datadir) and read it from there
#
extra_args=""
if test -r "$basedir/my.cnf"
then
extra_args="-e $basedir/my.cnf"
else
if test -r "$datadir/my.cnf"
then
extra_args="-e $datadir/my.cnf"
fi
fi
parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
#
# Set pid file if not given
#
found_pid=`cd $datadir && ls |grep '.pid'`
if test -z "$mysqld_pid_file_path"
then
mysqld_pid_file_path=$datadir/$found_pid
else
case "$mysqld_pid_file_path" in
/* ) ;;
* ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
esac
fi
#ulimit -s unlimited
case "$mode" in
'start')
# Start daemon
# Safeguard (relative paths, core dumps..)
cd $basedir
echo $echo_n "Starting MySQL"
if test -x $bindir/mysqld_safe
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
$bindir/mysqld_safe --defaults-file=$basedir/etc/my.cnf --datadir="$datadir" $other_args >/dev/null &
wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# Make lock for RedHat / SuSE
if test -w "$lockdir"
then
touch "$lock_file_path"
fi
exit $return_value
else
log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
fi
;;
'stop')
# Stop daemon. We use a signal here to avoid having to know the
# root password.
if test -s "$mysqld_pid_file_path"
then
mysqld_pid=`cat "$mysqld_pid_file_path"`
if (kill -0 $mysqld_pid 2>/dev/null)
then
echo $echo_n "Shutting down MySQL"
kill $mysqld_pid
# mysqld should remove the pid file when it exits, so wait for it.
wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
else
log_failure_msg "MySQL server process #$mysqld_pid is not running!"
rm "$mysqld_pid_file_path"
fi
# Delete lock for RedHat / SuSE
if test -f "$lock_file_path"
then
rm -f "$lock_file_path"
fi
exit $return_value
else
log_failure_msg "MySQL server PID file could not be found!"
fi
;;
'restart')
# Stop the service and regardless of whether it was
# running or not, start it again.
if $0 stop $other_args; then
$0 start $other_args
else
log_failure_msg "Failed to stop running server, so refusing to try to start."
exit 1
fi
;;
'reload'|'force-reload')
if test -s "$mysqld_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path"
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
touch "$mysqld_pid_file_path"
else
log_failure_msg "MySQL PID file could not be found!"
exit 1
fi
;;
'status')
# First, check to see if pid file exists
if test -s "$mysqld_pid_file_path" ; then
read mysqld_pid < "$mysqld_pid_file_path"
if kill -0 $mysqld_pid 2>/dev/null ; then
log_success_msg "MySQL running ($mysqld_pid)"
exit 0
else
log_failure_msg "MySQL is not running, but PID file exists"
exit 1
fi
else
# Try to find appropriate mysqld process
mysqld_pid=`pidof $libexecdir/mysqld`
# test if multiple pids exist
pid_count=`echo $mysqld_pid | wc -w`
if test $pid_count -gt 1 ; then
log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
exit 5
elif test -z $mysqld_pid ; then
if test -f "$lock_file_path" ; then
log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
exit 2
fi
log_failure_msg "MySQL is not running"
exit 3
else
log_failure_msg "MySQL is running but PID file could not be found"
exit 4
fi
fi
;;
*)
# usage
basename=`basename "$0"`
echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
exit 1
;;
esac
exit 0

View File

@@ -1,44 +0,0 @@
#!/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")
install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
type=$2
if [ "${2}" == "" ];then
echo '缺少安装脚本...' > $install_tmp
exit 0
fi
if [ ! -d $curPath/versions/$2 ];then
echo '缺少安装脚本2...' > $install_tmp
exit 0
fi
if [ "${action}" == "uninstall" ];then
if [ -f /usr/lib/systemd/system/mariadb.service ] || [ -f /lib/systemd/system/mariadb.service ];then
systemctl stop mariadb
systemctl disable mariadb
rm -rf /usr/lib/systemd/system/mariadb.service
rm -rf /lib/systemd/system/mariadb.service
systemctl daemon-reload
fi
fi
sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "install" ] && [ -d $serverPath/mariadb ];then
#初始化
cd ${rootPath} && python3 ${rootPath}/plugins/mariadb/index.py start ${type}
cd ${rootPath} && python3 ${rootPath}/plugins/mariadb/index.py initd_install ${type}
fi

File diff suppressed because it is too large Load Diff

View File

@@ -1,125 +0,0 @@
# coding: utf-8
#-----------------------------
# 网站备份工具
#-----------------------------
import sys
import os
if sys.platform != 'darwin':
os.chdir('/www/server/mdserver-web')
chdir = os.getcwd()
sys.path.append(chdir + '/class/core')
# reload(sys)
# sys.setdefaultencoding('utf-8')
import mw
import db
import time
class backupTools:
def backupDatabase(self, name, count):
db_path = mw.getServerDir() + '/mariadb'
db_name = 'mysql'
name = mw.M('databases').dbPos(db_path, 'mysql').where(
'name=?', (name,)).getField('name')
startTime = time.time()
if not name:
endDate = time.strftime('%Y/%m/%d %X', time.localtime())
log = "数据库[" + name + "]不存在!"
print("★[" + endDate + "] " + log)
print(
"----------------------------------------------------------------------------")
return
backup_path = mw.getRootDir() + '/backup/database'
if not os.path.exists(backup_path):
mw.execShell("mkdir -p " + backup_path)
filename = backup_path + "/db_" + name + "_" + \
time.strftime('%Y%m%d_%H%M%S', time.localtime()) + ".sql.gz"
import re
mysql_root = mw.M('config').dbPos(db_path, db_name).where(
"id=?", (1,)).getField('mysql_root')
mycnf = mw.readFile(db_path + '/etc/my.cnf')
rep = "\[mysqldump\]\nuser=root"
sea = "[mysqldump]\n"
subStr = sea + "user=root\npassword=" + mysql_root + "\n"
mycnf = mycnf.replace(sea, subStr)
if len(mycnf) > 100:
mw.writeFile(db_path + '/etc/my.cnf', mycnf)
# mw.execShell(db_path + "/bin/mysqldump --opt --default-character-set=utf8 " +
# name + " | gzip > " + filename)
# mw.execShell(db_path + "/bin/mysqldump --skip-lock-tables --default-character-set=utf8 " +
# name + " | gzip > " + filename)
mw.execShell(db_path + "/bin/mysqldump --single-transaction --quick --default-character-set=utf8 " +
name + " | gzip > " + filename)
if not os.path.exists(filename):
endDate = time.strftime('%Y/%m/%d %X', time.localtime())
log = "数据库[" + name + "]备份失败!"
print("★[" + endDate + "] " + log)
print(
"----------------------------------------------------------------------------")
return
mycnf = mw.readFile(db_path + '/etc/my.cnf')
mycnf = mycnf.replace(subStr, sea)
if len(mycnf) > 100:
mw.writeFile(db_path + '/etc/my.cnf', mycnf)
endDate = time.strftime('%Y/%m/%d %X', time.localtime())
outTime = time.time() - startTime
pid = mw.M('databases').dbPos(db_path, db_name).where(
'name=?', (name,)).getField('id')
mw.M('backup').add('type,name,pid,filename,addtime,size', (1, os.path.basename(
filename), pid, filename, endDate, os.path.getsize(filename)))
log = "数据库[" + name + "]备份成功,用时[" + str(round(outTime, 2)) + "]秒"
mw.writeLog('计划任务', log)
print("★[" + endDate + "] " + log)
print("|---保留最新的[" + count + "]份备份")
print("|---文件名:" + filename)
# 清理多余备份
backups = mw.M('backup').where(
'type=? and pid=?', ('1', pid)).field('id,filename').select()
num = len(backups) - int(count)
if num > 0:
for backup in backups:
mw.execShell("rm -f " + backup['filename'])
mw.M('backup').where('id=?', (backup['id'],)).delete()
num -= 1
print("|---已清理过期备份文件:" + backup['filename'])
if num < 1:
break
def backupDatabaseAll(self, save):
db_path = mw.getServerDir() + '/mariadb'
db_name = 'mysql'
databases = mw.M('databases').dbPos(
db_path, db_name).field('name').select()
for database in databases:
self.backupDatabase(database['name'], save)
if __name__ == "__main__":
backup = backupTools()
type = sys.argv[1]
if type == 'database':
if sys.argv[2] == 'ALL':
backup.backupDatabaseAll(sys.argv[3])
else:
backup.backupDatabase(sys.argv[2], sys.argv[3])

View File

@@ -1,66 +0,0 @@
# coding:utf-8
import sys
import io
import os
import time
import subprocess
import re
import json
cur_dir = os.getcwd()
plugin_dir = os.path.dirname(cur_dir)
# print(plugin_dir)
root_dir = os.path.dirname(os.path.dirname(plugin_dir))
# print(root_dir)
sys.path.append(root_dir + "/class/core")
import mw
os.chdir(root_dir)
def getPluginName():
return 'mariadb'
def getPluginDir():
return root_dir + '/plugins/' + getPluginName()
def getServerDir():
return os.path.dirname(root_dir) + '/' + getPluginName()
def pSqliteDb(dbname='databases'):
file = getServerDir() + '/mariadb.db'
name = 'mysql'
if not os.path.exists(file):
conn = mw.M(dbname).dbPos(getServerDir(), name)
csql = mw.readFile(getPluginDir() + '/conf/mariadb.sql')
csql_list = csql.split(';')
for index in range(len(csql_list)):
conn.execute(csql_list[index], ())
else:
conn = mw.M(dbname).dbPos(getServerDir(), name)
return conn
def getConf():
path = getServerDir() + '/etc/my.cnf'
return path
def pMysqlDb():
db = mw.getMyORM()
db.setDbConf(getConf())
db.__DB_SOCKET = mw.getServerDir() + '/mysql/mysql.socket'
print(mw.getServerDir() + '/mysql/mysql.socket')
db.setPwd(pSqliteDb('config').where('id=?', (1,)).getField('mysql_root'))
return db
if __name__ == '__main__':
p = pMysqlDb()
print(p.query("select User,Host from mysql.user where User!='root' AND Host!='localhost' AND Host!=''"))

View File

@@ -1,69 +0,0 @@
# coding: utf-8
import sys
import os
import json
import time
sys.path.append(os.getcwd() + "/class/core")
import mw
import db
cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\''
info = mw.execShell(cmd)
p = "/usr/local/lib/" + info[0].strip() + "/site-packages"
sys.path.append(p)
def set_mysql_root(password):
# 设置MySQL密码
import db
import os
sql = db.Sql()
root_mysql = '''#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
pwd=$1
${server}/init.d/mysql stop
${server}/bin/mysqld_safe --skip-grant-tables&
echo '正在修改密码...';
echo 'The set password...';
sleep 6
m_version=$(cat ${server}/version.pl|grep -E "(5.1.|5.5.|5.6.|mariadb)")
if [ "$m_version" != "" ];then
${server}/bin/mysql -uroot -e "insert into mysql.user(Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_priv,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv,Event_priv,Trigger_priv,Create_tablespace_priv,User,Password,host)values('Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','root',password('${pwd}'),'127.0.0.1')"
${server}/bin/mysql -uroot -e "insert into mysql.user(Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_priv,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv,Event_priv,Trigger_priv,Create_tablespace_priv,User,Password,host)values('Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','root',password('${pwd}'),'localhost')"
${server}/bin/mysql -uroot -e "UPDATE mysql.user SET password=PASSWORD('${pwd}') WHERE user='root'";
else
${server}/bin/mysql -uroot -e "UPDATE mysql.user SET authentication_string='' WHERE user='root'";
${server}/bin/mysql -uroot -e "FLUSH PRIVILEGES";
${server}/bin/mysql -uroot -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${pwd}';";
fi
${server} -uroot -e "FLUSH PRIVILEGES";
pkill -9 mysqld_safe
pkill -9 mysqld
sleep 2
${server}/init.d/mysql start
echo '==========================================='
echo "root密码成功修改为: ${pwd}"
echo "The root password set ${pwd} successuful"'''
server = mw.getServerDir() + '/mariadb'
root_mysql = root_mysql.replace('${server}', server)
mw.writeFile('mysql_root.sh', root_mysql)
os.system("/bin/bash mysql_root.sh " + password)
os.system("rm -f mysql_root.sh")
pos = mw.getServerDir() + '/mariadb'
result = sql.table('config').dbPos(pos, 'mysql').where(
'id=?', (1,)).setField('mysql_root', password)
if __name__ == "__main__":
type = sys.argv[1]
if type == 'root':
set_mysql_root(sys.argv[2])
else:
print('ERROR: Parameter error')

View File

@@ -1,118 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#https://dev.mysql.com/downloads/mysql/5.5.html#downloads
#https://dev.mysql.com/downloads/file/?id=480541
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=10.6.8
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
fi
# ----- 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 "1" ];then
cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`
fi
# ----- cpu end ------
if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then
# https://mirrors.aliyun.com/mariadb/mariadb-10.8.3/source/mariadb-10.8.3.tar.gz
wget -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://mirrors.aliyun.com/mariadb/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
# wget -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://downloads.mariadb.org/interstitial/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
fi
if [ ! -d ${mariadbDir}/mariadb-${MY_VER} ];then
cd ${mariadbDir} && tar -zxvf ${mariadbDir}/mariadb-${MY_VER}.tar.gz
fi
OPTIONS=''
if [ "$sysName" == "Darwin" ];then
OPTIONS='-DPLUGIN_TOKUDB=NO'
fi
if [ ! -d $serverPath/mariadb ];then
cd ${mariadbDir}/mariadb-${MY_VER} && cmake \
-DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \
-DMYSQL_DATADIR=$serverPath/mariadb/data/ \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=$serverPath/mariadb/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 \
$OPTIONS \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++
make -j${cpuCore} && make install && make clean
if [ -d $serverPath/mariadb ];then
echo '10.6' > $serverPath/mariadb/version.pl
echo '安装完成' > $install_tmp
else
# rm -rf ${mariadbDir}/mariadb-${MY_VER}
echo '安装失败' > $install_tmp
echo 'install fail'>&2
exit 1
fi
fi
}
Uninstall_app()
{
rm -rf $serverPath/mariadb
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_app
else
Uninstall_app
fi

View File

@@ -1,111 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#https://dev.mysql.com/downloads/mysql/5.5.html#downloads
#https://dev.mysql.com/downloads/file/?id=480541
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=10.7.4
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
fi
# ----- 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 "1" ];then
cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`
fi
# ----- cpu end ------
if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then
wget -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://mirrors.aliyun.com/mariadb/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
# wget -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://downloads.mariadb.org/interstitial/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
fi
if [ ! -d ${mariadbDir}/mariadb-${MY_VER} ];then
cd ${mariadbDir} && tar -zxvf ${mariadbDir}/mariadb-${MY_VER}.tar.gz
fi
if [ ! -d $serverPath/mariadb ];then
cd ${mariadbDir}/mariadb-${MY_VER} && cmake \
-DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \
-DMYSQL_DATADIR=$serverPath/mariadb/data/ \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=$serverPath/mariadb/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 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++
make -j${cpuCore} && make install && make clean
if [ -d $serverPath/mariadb ];then
echo '10.7' > $serverPath/mariadb/version.pl
echo '安装完成' > $install_tmp
else
# rm -rf ${mariadbDir}/mariadb-${MY_VER}
echo '安装失败' > $install_tmp
echo 'install fail'>&2
exit 1
fi
fi
}
Uninstall_app()
{
rm -rf $serverPath/mariadb
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_app
else
Uninstall_app
fi

View File

@@ -1,111 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#https://dev.mysql.com/downloads/mysql/5.5.html#downloads
#https://dev.mysql.com/downloads/file/?id=480541
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
mariadbDir=${serverPath}/source/mariadb
MY_VER=10.8.3
Install_app()
{
mkdir -p ${mariadbDir}
echo '正在安装脚本文件...' > $install_tmp
if id mysql &> /dev/null ;then
echo "mysql UID is `id -u www`"
echo "mysql Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
else
groupadd mysql
useradd -g mysql mysql
fi
if [ "$sysName" != "Darwin" ];then
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
fi
# ----- 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 "1" ];then
cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`
fi
# ----- cpu end ------
if [ ! -f ${mariadbDir}/mariadb-${MY_VER}.tar.gz ];then
wget -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://mirrors.aliyun.com/mariadb/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
# wget -O ${mariadbDir}/mariadb-${MY_VER}.tar.gz --tries=3 https://downloads.mariadb.org/interstitial/mariadb-${MY_VER}/source/mariadb-${MY_VER}.tar.gz
fi
if [ ! -d ${mariadbDir}/mariadb-${MY_VER} ];then
cd ${mariadbDir} && tar -zxvf ${mariadbDir}/mariadb-${MY_VER}.tar.gz
fi
if [ ! -d $serverPath/mariadb ];then
cd ${mariadbDir}/mariadb-${MY_VER} && cmake \
-DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \
-DMYSQL_DATADIR=$serverPath/mariadb/data/ \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=$serverPath/mariadb/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 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++
make -j${cpuCore} && make install && make clean
if [ -d $serverPath/mariadb ];then
echo '10.7' > $serverPath/mariadb/version.pl
echo '安装完成' > $install_tmp
else
# rm -rf ${mariadbDir}/mariadb-${MY_VER}
echo '安装失败' > $install_tmp
echo 'install fail'>&2
exit 1
fi
fi
}
Uninstall_app()
{
rm -rf $serverPath/mariadb
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_app
else
Uninstall_app
fi

View File

@@ -1,242 +0,0 @@
# coding:utf-8
import sys
import io
import os
import time
import re
sys.path.append(os.getcwd() + "/class/core")
import mw
app_debug = False
if mw.isAppleSystem():
app_debug = True
def getPluginName():
return 'memcached'
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()
def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
def getInitDFile():
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
def getConf():
path = getServerDir() + "/init.d/memcached"
return path
def getConfTpl():
path = getPluginDir() + "/init.d/memcached.tpl"
return path
def getMemPort():
path = getConf()
content = mw.readFile(path)
rep = 'PORT\s*=\s*(\d*)'
tmp = re.search(rep, content)
return tmp.groups()[0]
def getArgs():
args = sys.argv[2:]
tmp = {}
args_len = len(args)
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':')
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':')
tmp[t[0]] = t[1]
return tmp
def status():
data = mw.execShell(
"ps -ef|grep " + getPluginName() + " |grep -v grep | grep -v python | awk '{print $2}'")
if data[0] == '':
return 'stop'
return 'start'
def initDreplace():
file_tpl = getConfTpl()
service_path = mw.getServerDir()
initD_path = getServerDir() + '/init.d'
if not os.path.exists(initD_path):
os.mkdir(initD_path)
file_bin = initD_path + '/memcached'
if not os.path.exists(file_bin):
content = mw.readFile(file_tpl)
content = content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(file_bin, content)
mw.execShell('chmod +x ' + file_bin)
return file_bin
def memOp(method):
file = initDreplace()
data = mw.execShell(file + ' ' + method)
if data[1] == '':
return 'ok'
return data[1]
def start():
return memOp('start')
def stop():
return memOp('stop')
def restart():
return memOp('restart')
def reload():
return memOp('reload')
def runInfo():
# 获取memcached状态
import telnetlib
import re
port = getMemPort()
try:
tn = telnetlib.Telnet('127.0.0.1', int(port))
tn.write(b"stats\n")
tn.write(b"quit\n")
data = tn.read_all()
if type(data) == bytes:
data = data.decode('utf-8')
data = data.replace('STAT', '').replace('END', '').split("\n")
result = {}
res = ['cmd_get', 'get_hits', 'get_misses', 'limit_maxbytes', 'curr_items', 'bytes',
'evictions', 'limit_maxbytes', 'bytes_written', 'bytes_read', 'curr_connections']
for d in data:
if len(d) < 3:
continue
t = d.split()
if not t[0] in res:
continue
result[t[0]] = int(t[1])
result['hit'] = 1
if result['get_hits'] > 0 and result['cmd_get'] > 0:
result['hit'] = float(result['get_hits']) / \
float(result['cmd_get']) * 100
conf = mw.readFile(getConf())
result['bind'] = re.search('IP=(.+)', conf).groups()[0]
result['port'] = int(re.search('PORT=(\d+)', conf).groups()[0])
result['maxconn'] = int(re.search('MAXCONN=(\d+)', conf).groups()[0])
result['cachesize'] = int(
re.search('CACHESIZE=(\d+)', conf).groups()[0])
return mw.getJson(result)
except Exception as e:
return mw.getJson({})
def saveConf():
# 设置memcached缓存大小
import re
confFile = getConf()
# print confFile
try:
args = getArgs()
content = mw.readFile(confFile)
content = re.sub('IP=.+', 'IP=' + args['ip'], content)
content = re.sub('PORT=\d+', 'PORT=' + args['port'], content)
content = re.sub('MAXCONN=\d+', 'MAXCONN=' + args['maxconn'], content)
content = re.sub('CACHESIZE=\d+', 'CACHESIZE=' +
args['cachesize'], content)
mw.writeFile(confFile, content)
restart()
return 'save ok'
except Exception as e:
pass
return 'fail'
def initdStatus():
if not app_debug:
if mw.isAppleSystem():
return "Apple Computer does not support"
initd_bin = getInitDFile()
if os.path.exists(initd_bin):
return 'ok'
return 'fail'
def initdInstall():
import shutil
if not app_debug:
if mw.isAppleSystem():
return "Apple Computer does not support"
mem_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
mw.execShell('chmod +x ' + initd_bin)
mw.execShell('chkconfig --add ' + getPluginName())
return 'ok'
def initdUinstall():
if not app_debug:
if mw.isAppleSystem():
return "Apple Computer does not support"
mw.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print(status())
elif func == 'start':
print(start())
elif func == 'stop':
print(stop())
elif func == 'restart':
print(restart())
elif func == 'reload':
print(reload())
elif func == 'initd_status':
print(initdStatus())
elif func == 'initd_install':
print(initdInstall())
elif func == 'initd_uninstall':
print(initdUinstall())
elif func == 'run_info':
print(runInfo())
elif func == 'conf':
print(getConf())
elif func == 'conf_tpl':
print(getConfTpl())
elif func == 'save_conf':
print(saveConf())
else:
print('fail')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

View File

@@ -1,19 +0,0 @@
<div class="bt-form">
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('memcached');">服务</p>
<p onclick="pluginInitD('memcached');">自启动</p>
<p onclick="pluginConfig('memcached', null, 'conf_env');">配置文件</p>
<p onclick="memcachedStatus();">负载状态</p>
<p onclick="memcachedCache();">性能调整</p>
</div>
<div class="bt-w-con pd15">
<div class="soft-man-con"></div>
</div>
</div>
</div>
<script type="text/javascript">
pluginService('memcached');
$.getScript( "/plugins/file?name=memcached&f=js/mem.js");
</script>

View File

@@ -1,274 +0,0 @@
# coding:utf-8
import sys
import io
import os
import time
import re
sys.path.append(os.getcwd() + "/class/core")
import mw
app_debug = False
if mw.isAppleSystem():
app_debug = True
def getPluginName():
return 'memcached'
def getPluginDir():
return mw.getPluginDir() + '/' + getPluginName()
def getServerDir():
return mw.getServerDir() + '/' + getPluginName()
def getInitDFile():
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
def getConf():
path = getServerDir() + "/init.d/memcached"
return path
def getConfEnv():
path = getServerDir() + "/memcached.env"
return path
def getConfTpl():
path = getPluginDir() + "/init.d/memcached.tpl"
return path
def getMemPort():
path = getServerDir() + '/memcached.env'
content = mw.readFile(path)
rep = 'PORT\s*=\s*(\d*)'
tmp = re.search(rep, content)
return tmp.groups()[0]
def getArgs():
args = sys.argv[2:]
tmp = {}
args_len = len(args)
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':')
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':')
tmp[t[0]] = t[1]
return tmp
def checkArgs(data, ck=[]):
for i in range(len(ck)):
if not ck[i] in data:
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
return (True, mw.returnJson(True, 'ok'))
def status():
data = mw.execShell(
"ps -ef|grep " + getPluginName() + " |grep -v grep | grep -v python | awk '{print $2}'")
if data[0] == '':
return 'stop'
return 'start'
def initDreplace():
file_tpl = getConfTpl()
service_path = mw.getServerDir()
initD_path = getServerDir() + '/init.d'
if not os.path.exists(initD_path):
os.mkdir(initD_path)
file_bin = initD_path + '/memcached'
if not os.path.exists(file_bin):
content = mw.readFile(file_tpl)
content = content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(file_bin, content)
mw.execShell('chmod +x ' + file_bin)
# systemd
systemDir = mw.systemdCfgDir()
systemService = systemDir + '/memcached.service'
systemServiceTpl = getPluginDir() + '/init.d/memcached.service.tpl'
if os.path.exists(systemDir) and not os.path.exists(systemService):
service_path = mw.getServerDir()
se_content = mw.readFile(systemServiceTpl)
se_content = se_content.replace('{$SERVER_PATH}', service_path)
mw.writeFile(systemService, se_content)
mw.execShell('systemctl daemon-reload')
envFile = getServerDir() + '/memcached.env'
if not os.path.exists(envFile):
wbody = "IP=127.0.0.1\n"
wbody = wbody + "PORT=11211\n"
wbody = wbody + "USER=root\n"
wbody = wbody + "MAXCONN=1024\n"
wbody = wbody + "CACHESIZE=1024\n"
wbody = wbody + "OPTIONS=''\n"
mw.writeFile(envFile, wbody)
return file_bin
def memOp(method):
file = initDreplace()
if not mw.isAppleSystem():
data = mw.execShell('systemctl ' + method + ' ' + getPluginName())
if data[1] == '':
return 'ok'
return data[1]
data = mw.execShell(file + ' ' + method)
if data[1] == '':
return 'ok'
return data[1]
def start():
return memOp('start')
def stop():
return memOp('stop')
def restart():
return memOp('restart')
def reload():
return memOp('reload')
def runInfo():
# 获取memcached状态
import telnetlib
import re
port = getMemPort()
try:
tn = telnetlib.Telnet('127.0.0.1', int(port))
tn.write(b"stats\n")
tn.write(b"quit\n")
data = tn.read_all()
if type(data) == bytes:
data = data.decode('utf-8')
data = data.replace('STAT', '').replace('END', '').split("\n")
result = {}
res = ['cmd_get', 'get_hits', 'get_misses', 'limit_maxbytes', 'curr_items', 'bytes',
'evictions', 'limit_maxbytes', 'bytes_written', 'bytes_read', 'curr_connections']
for d in data:
if len(d) < 3:
continue
t = d.split()
if not t[0] in res:
continue
result[t[0]] = int(t[1])
result['hit'] = 1
if result['get_hits'] > 0 and result['cmd_get'] > 0:
result['hit'] = float(result['get_hits']) / \
float(result['cmd_get']) * 100
conf = mw.readFile(getServerDir() + '/memcached.env')
result['bind'] = re.search('IP=(.+)', conf).groups()[0]
result['port'] = int(re.search('PORT=(\d+)', conf).groups()[0])
result['maxconn'] = int(re.search('MAXCONN=(\d+)', conf).groups()[0])
result['cachesize'] = int(
re.search('CACHESIZE=(\d+)', conf).groups()[0])
return mw.getJson(result)
except Exception as e:
return mw.getJson({})
def saveConf():
args = getArgs()
data = checkArgs(args, ['ip', 'port', 'maxconn', 'maxsize'])
if not data[0]:
return data[1]
envFile = getServerDir() + '/memcached.env'
wbody = "IP=" + args['ip'] + "\n"
wbody = wbody + "PORT=" + args['port'] + "\n"
wbody = wbody + "USER=root\n"
wbody = wbody + "MAXCONN=" + args['maxconn'] + "\n"
wbody = wbody + "CACHESIZE=" + args['maxconn'] + "\n"
wbody = wbody + "OPTIONS=''\n"
mw.writeFile(envFile, wbody)
restart()
return 'save ok'
def initdStatus():
if mw.isAppleSystem():
return "Apple Computer does not support"
shell_cmd = 'systemctl status ' + \
getPluginName() + ' | grep loaded | grep "enabled;"'
data = mw.execShell(shell_cmd)
if data[0] == '':
return 'fail'
return 'ok'
def initdInstall():
if mw.isAppleSystem():
return "Apple Computer does not support"
mw.execShell('systemctl enable ' + getPluginName())
return 'ok'
def initdUinstall():
if not app_debug:
if mw.isAppleSystem():
return "Apple Computer does not support"
mw.execShell('systemctl disable ' + getPluginName())
return 'ok'
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print(status())
elif func == 'start':
print(start())
elif func == 'stop':
print(stop())
elif func == 'restart':
print(restart())
elif func == 'reload':
print(reload())
elif func == 'initd_status':
print(initdStatus())
elif func == 'initd_install':
print(initdInstall())
elif func == 'initd_uninstall':
print(initdUinstall())
elif func == 'run_info':
print(runInfo())
elif func == 'conf_env':
print(getConfEnv())
elif func == 'save_conf':
print(saveConf())
else:
print('error')

View File

@@ -1,18 +0,0 @@
{
"sort": 7,
"ps": "是一个高性能的分布式内存对象缓存系统",
"name": "memcached",
"title": "Memcached",
"shell": "install.sh",
"versions":["1.6"],
"updates":["1.6.15"],
"tip": "soft",
"checks": "server/memcached",
"path":"server/memcached",
"display": 1,
"author": "memcached",
"date": "2017-04-01",
"home": "http://memcached.org/",
"type": 0,
"pid": "2"
}

View File

@@ -1,13 +0,0 @@
[Unit]
Description=Free & open source, high-performance, distributed memory object caching system.
After=network.target
[Service]
Type=forking
EnvironmentFile=-{$SERVER_PATH}/memcached/memcached.env
ExecStart={$SERVER_PATH}/memcached/bin/memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN $OPTIONS
ExecReload=/bin/kill -USR2 $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@@ -1,81 +0,0 @@
#! /bin/bash
#
# memcached: MemCached Daemon
#
# chkconfig: - 90 25
# description: MemCached Daemon
#
### BEGIN INIT INFO
# Provides: memcached
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: memcached - Memory caching daemon
# Description: memcached - Memory caching daemon
### END INIT INFO
IP=127.0.0.1
PORT=11211
USER=root
MAXCONN=1024
CACHESIZE=64
OPTIONS=""
RETVAL=0
prog="memcached"
MEM_PATH={$SERVER_PATH}/memcached
start () {
echo -n $"Starting $prog: "
$MEM_PATH/bin/memcached -d -l $IP -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P $MEM_PATH/memcached.pid $OPTIONS
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
else
echo " done"
fi
}
stop () {
echo -n $"Stopping $prog: "
if [ ! -e $MEM_PATH/$prog.pid ]; then
echo -n $"$prog is not running."
exit 1
fi
kill `cat $MEM_PATH/memcached.pid`
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
else
rm -f ${MEM_PATH}/memcached.pid
echo " done"
fi
}
restart () {
$0 stop
sleep 2
$0 start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac
exit $?

View File

@@ -1,63 +0,0 @@
#!/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")
install_tmp=${rootPath}/tmp/mw_install.pl
VERSION=1.6.15
Install_mem(){
mkdir -p $serverPath/source
# mkdir -p $serverPath/memcached
echo '正在安装脚本文件...' > $install_tmp
if [ ! -f $serverPath/source/memcached.tar.gz ];then
wget -O $serverPath/source/memcached.tar.gz http://www.memcached.org/files/memcached-${VERSION}.tar.gz
fi
cd $serverPath/source && tar -zxvf memcached.tar.gz
echo "./configure --prefix=${serverPath}/memcached && make && make install"
cd $serverPath/source/memcached-${VERSION} && ./configure --prefix=$serverPath/memcached && make && make install
if [ -d $serverPath/memcached ];then
echo '1.6' > $serverPath/memcached/version.pl
echo 'install ok' > $install_tmp
cd ${rootPath} && python3 ${rootPath}/plugins/memcached/index.py start
cd ${rootPath} && python3 ${rootPath}/plugins/memcached/index.py initd_install
fi
}
Uninstall_mem()
{
if [ -f /usr/lib/systemd/system/memcached.service ];then
systemctl stop memcached
systemctl disable memcached
rm -rf /usr/lib/systemd/system/memcached.service
systemctl daemon-reload
fi
if [ -f $serverPath/memcached/initd/memcached ];then
$serverPath/memcached/initd/memcached stop
fi
rm -rf $serverPath/memcached
}
# /www/server/memcached/bin/memcached -d -p 11211 -u root -m 100 -c 100
action=$1
if [ "${1}" == 'install' ];then
Install_mem
else
Uninstall_mem
fi

View File

@@ -1,106 +0,0 @@
//memcached负载状态
function memcachedStatus() {
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
$.post('/plugins/run', {name:'memcached', func:'run_info'}, function(data) {
layer.close(loadT);
if (!data.status){
showMsg(data.msg, function(){}, null,13000);
return;
}
var rdata = $.parseJSON(data.data);
if ($.isEmptyObject(rdata)){
showMsg('memcached服务没有启动!', function(){}, undefined, 3000);
return;
}
var Con = '<div class="divtable">\
<table class="table table-hover table-bordered" style="width: 490px;">\
<thead><th>字段</th><th>当前值</th><th>说明</th></thead>\
<tbody>\
<tr><th>BindIP</th><td>' + rdata.bind + '</td><td>监听IP</td></tr>\
<tr><th>PORT</th><td>' + rdata.port + '</td><td>监听端口</td></tr>\
<tr><th>CACHESIZE</th><td>' + rdata.cachesize + ' MB</td><td>最大缓存容量</td></tr>\
<tr><th>MAXCONN</th><td>' + rdata.maxconn + '</td><td>最大连接数限制</td></tr>\
<tr><th>curr_connections</th><td>' + rdata.curr_connections + '</td><td>当前打开的连接数</td></tr>\
<tr><th>cmd_get</th><td>' + rdata.cmd_get + '</td><td>GET请求数</td></tr>\
<tr><th>get_hits</th><td>' + rdata.get_hits + '</td><td>GET命中次数</td></tr>\
<tr><th>get_misses</th><td>' + rdata.get_misses + '</td><td>GET失败次数</td></tr>\
<tr><th>hit</th><td>' + rdata.hit.toFixed(2) + '%</td><td>GET命中率</td></tr>\
<tr><th>curr_items</th><td>' + rdata.curr_items + '</td><td>当前被缓存的数据行数</td></tr>\
<tr><th>evictions</th><td>' + rdata.evictions + '</td><td>因内存不足而被清理的缓存行数</td></tr>\
<tr><th>bytes</th><td>' + toSize(rdata.bytes) + '</td><td>当前已使用内存</td></tr>\
<tr><th>bytes_read</th><td>' + toSize(rdata.bytes_read) + '</td><td>请求总大小</td></tr>\
<tr><th>bytes_written</th><td>' + toSize(rdata.bytes_written) + '</td><td>发送总大小</td></tr>\
<tbody>\
</table></div>'
$(".soft-man-con").html(Con);
},'json');
}
//memcached性能调整
function memcachedCache() {
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
$.post('/plugins/run', {name:'memcached', func:'run_info'}, function(data) {
layer.close(loadT);
if (!data.status){
showMsg(data.msg, function(){}, null,13000);
return;
}
var rdata = $.parseJSON(data.data);
if ($.isEmptyObject(rdata)){
showMsg('memcached服务没有启动!', function(){}, undefined, 3000);
return;
}
var memCon = '<div class="conf_p" style="margin-bottom:0">\
<p><span>BindIP</span><input style="width: 120px;" class="bt-input-text mr5" name="membind" value="' + rdata.bind + '" type="text" ><font>监听IP,请勿随意修改</font></p>\
<p><span>PORT</span><input style="width: 120px;" class="bt-input-text mr5" max="65535" name="memport" value="' + rdata.port + '" type="number" ><font>监听端口,一般无需修改</font></p>\
<p><span>CACHESIZE</span><input style="width: 120px;" class="bt-input-text mr5" name="memcachesize" value="' + rdata.cachesize + '" type="number" >MB,<font>缓存大小,建议不要大于512M</font></p>\
<p><span>MAXCONN</span><input style="width: 120px;" class="bt-input-text mr5" name="memmaxconn" value="' + rdata.maxconn + '" type="number" ><font>最大连接数,建议不要大于40960</font></p>\
<div style="margin-top:10px; padding-right:230px" class="text-right"><button class="btn btn-success btn-sm" onclick="setMemcachedConf()">保存</button></div>\
</div>'
$(".soft-man-con").html(memCon);
},'json');
}
//memcached提交配置
function setMemcachedConf() {
var data = {
ip: $("input[name='membind']").val(),
port: $("input[name='memport']").val(),
cachesize: $("input[name='memcachesize']").val(),
maxconn: $("input[name='memmaxconn']").val()
}
if (data.ip.split('.').length < 4) {
layer.msg('IP地址格式不正确!', { icon: 2 });
return;
}
if (data.port < 1 || data.port > 65535) {
layer.msg('端口范围不正确!', { icon: 2 });
return;
}
if (data.cachesize < 8) {
layer.msg('缓存值过小', { icon: 2 });
return;
}
if (data.maxconn < 4) {
layer.msg('最大连接数过小', { icon: 2 });
return;
}
var loadT = layer.msg('正在保存...', { icon: 16, time: 0, shade: 0.3 });
$.post('/plugins/run', {name:'memcached', func:'save_conf',args:JSON.stringify(data) }, function(rdata) {
layer.close(loadT);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
},'json');
}

View File

@@ -1,12 +0,0 @@
dbpath = {$SERVER_PATH}/mongodb/data
logpath = {$SERVER_PATH}/mongodb/logs/mongodb.log
logappend = true
bind_ip = 127.0.0.1
port = 27017
fork = true
auth = false
# 5.0.2 - Master/slave replication is no longer supported
#master = true
pidfilepath = {$SERVER_PATH}/mongodb/mongodb.pid

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

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