mirror of https://github.com/midoks/mdserver-web
parent
af32792bf1
commit
fbac71e542
@ -0,0 +1,30 @@ |
|||||||
|
--- |
||||||
|
name: BUG提交 |
||||||
|
about: 问题描述 |
||||||
|
--- |
||||||
|
|
||||||
|
## 什么系统 ? |
||||||
|
|
||||||
|
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 |
||||||
|
``` |
||||||
|
|
||||||
|
## 错误截图 ? |
||||||
|
|
||||||
|
... |
||||||
|
|
||||||
|
|
||||||
|
## 浏览器版本 ? |
||||||
|
|
||||||
|
... |
||||||
|
|
||||||
|
|
||||||
|
## 软件版本(插件/面板) ? |
||||||
|
|
||||||
|
... |
@ -0,0 +1,14 @@ |
|||||||
|
--- |
||||||
|
name: 需求提交 |
||||||
|
about: 需求描述 |
||||||
|
--- |
||||||
|
|
||||||
|
## 需求 |
||||||
|
|
||||||
|
想开发一个什么插件? |
||||||
|
想有什么功能? |
||||||
|
|
||||||
|
|
||||||
|
## 提供参考 |
||||||
|
|
||||||
|
给开发者提供参考! |
@ -0,0 +1,81 @@ |
|||||||
|
#!/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__': |
||||||
|
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操作已终止") |
@ -0,0 +1,29 @@ |
|||||||
|
[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 |
@ -1,30 +1,12 @@ |
|||||||
[Unit] |
[Unit] |
||||||
Description=Gogs |
Description=Gogs |
||||||
After=syslog.target |
|
||||||
After=network.target |
After=network.target |
||||||
After=mariadb.service mysqld.service postgresql.service memcached.service redis.service |
|
||||||
|
|
||||||
[Service] |
[Service] |
||||||
# Modify these two values and uncomment them if you have |
Type=forking |
||||||
# repos with lots of files and get an HTTP error 500 because |
ExecStart={$SERVER_PATH}/gogs/init.d/gogs start |
||||||
# of that |
ExecStop={$SERVER_PATH}/gogs/init.d/gogs stop |
||||||
### |
RemainAfterExit=yes |
||||||
#LimitMEMLOCK=infinity |
|
||||||
#LimitNOFILE=65535 |
|
||||||
Type=simple |
|
||||||
User=root |
|
||||||
Group=root |
|
||||||
WorkingDirectory={$SERVER_PATH}/gogs |
|
||||||
ExecStart={$SERVER_PATH}/gogs/gogs web |
|
||||||
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] |
[Install] |
||||||
WantedBy=multi-user.target |
WantedBy=multi-user.target |
||||||
|
@ -0,0 +1,13 @@ |
|||||||
|
[Unit] |
||||||
|
Description=Pure-FTPd is a fast, production-quality, standard-conformant FTP server |
||||||
|
After=network.target |
||||||
|
|
||||||
|
[Service] |
||||||
|
Type=forking |
||||||
|
ExecStart={$SERVER_PATH}/pureftp/sbin/pure-ftpd {$SERVER_PATH}/pureftp/etc/pure-ftpd.conf --daemonize |
||||||
|
ExecStop=/bin/kill -HUP $MAINPID |
||||||
|
ExecReload=/bin/kill -USR2 $MAINPID |
||||||
|
Restart=on-failure |
||||||
|
|
||||||
|
[Install] |
||||||
|
WantedBy=multi-user.target |
@ -1,21 +0,0 @@ |
|||||||
#! /bin/bash |
|
||||||
#禁止弱口令登录改良版 |
|
||||||
|
|
||||||
cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"="$1;}' > black.txt #尝试登录的次数和ip |
|
||||||
|
|
||||||
DEFINE="5" #单个ip尝试登录最大值 |
|
||||||
|
|
||||||
for i in `cat /root/black.txt` |
|
||||||
do |
|
||||||
|
|
||||||
IP=`echo $i |awk -F= '{print $1}'` |
|
||||||
NUM=`echo $i|awk -F= '{print $2}'` |
|
||||||
|
|
||||||
if [ $NUM -gt $DEFINE ]; then |
|
||||||
grep $IP /etc/hosts.deny > /dev/null |
|
||||||
|
|
||||||
if [ $? -gt 0 ]; then |
|
||||||
echo "sshd:$IP" >> /etc/hosts.deny #扔到hosts文件中 |
|
||||||
fi |
|
||||||
fi |
|
||||||
done |
|
Before Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 59 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,42 @@ |
|||||||
|
#!/bin/bash |
||||||
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin |
||||||
|
export PATH |
||||||
|
|
||||||
|
echo "welcome to mdserver-web panel" |
||||||
|
|
||||||
|
startTime=`date +%s` |
||||||
|
|
||||||
|
if [ ! -d /www/server/mdserver-web ];then |
||||||
|
echo "mdserver-web not exist!" |
||||||
|
exit 1 |
||||||
|
fi |
||||||
|
|
||||||
|
# openresty |
||||||
|
if [ ! -d /www/server/openresty ];then |
||||||
|
cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start |
||||||
|
else |
||||||
|
echo "openresty alreay exist!" |
||||||
|
fi |
||||||
|
|
||||||
|
|
||||||
|
# php |
||||||
|
if [ ! -d /www/server/php/71 ];then |
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 |
||||||
|
else |
||||||
|
echo "php71 alreay exist!" |
||||||
|
fi |
||||||
|
|
||||||
|
# mysql |
||||||
|
if [ ! -d /www/server/mysql ];then |
||||||
|
cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5 |
||||||
|
else |
||||||
|
echo "mysql alreay exist!" |
||||||
|
fi |
||||||
|
|
||||||
|
endTime=`date +%s` |
||||||
|
((outTime=(${endTime}-${startTime})/60)) |
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" |
||||||
|
|
@ -0,0 +1,89 @@ |
|||||||
|
#!/bin/bash |
||||||
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin |
||||||
|
export PATH |
||||||
|
|
||||||
|
echo "welcome to mdserver-web panel" |
||||||
|
|
||||||
|
startTime=`date +%s` |
||||||
|
|
||||||
|
if [ ! -d /www/server/mdserver-web ];then |
||||||
|
echo "mdserver-web not exist!" |
||||||
|
exit 1 |
||||||
|
fi |
||||||
|
|
||||||
|
# openresty |
||||||
|
if [ ! -d /www/server/openresty ];then |
||||||
|
cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start |
||||||
|
fi |
||||||
|
|
||||||
|
|
||||||
|
# php |
||||||
|
if [ ! -d /www/server/php/71 ];then |
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 |
||||||
|
fi |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# PHP_VER_LIST=(53 54 55 56 71 72 73 74 80 81) |
||||||
|
# # PHP_VER_LIST=(81) |
||||||
|
# for PHP_VER in ${PHP_VER_LIST[@]}; do |
||||||
|
# echo "php${PHP_VER} -- start" |
||||||
|
# cd $DIR/php$PHP_VER && sh install.sh |
||||||
|
# dir=$(ls -l $DIR/php$PHP_VER |awk '/^d/ {print $NF}') |
||||||
|
# for i in $dir |
||||||
|
# do |
||||||
|
# cd $DIR/php$PHP_VER/$i && sh install.sh $PHP_VER |
||||||
|
# done |
||||||
|
# echo "php${PHP_VER} -- end" |
||||||
|
# done |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 53 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 53 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 54 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 54 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 55 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 55 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 56 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 56 |
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 70 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 70 |
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 71 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 72 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 72 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 73 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 73 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 74 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 74 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 80 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 80 |
||||||
|
|
||||||
|
cd /www/server/mdserver-web/plugins/php && bash install.sh install 81 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 81 |
||||||
|
|
||||||
|
|
||||||
|
# mysql |
||||||
|
if [ ! -d /www/server/mysql ];then |
||||||
|
# cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.7 |
||||||
|
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.7 |
||||||
|
|
||||||
|
|
||||||
|
# cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.6 |
||||||
|
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.6 |
||||||
|
cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 8.0 |
||||||
|
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 8.0 |
||||||
|
fi |
||||||
|
|
||||||
|
endTime=`date +%s` |
||||||
|
((outTime=(${endTime}-${startTime})/60)) |
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" |
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue