Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP存储空间 插件 修复 #643

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions plugins/backup_ftp/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@
import core.mw as mw
import core.db as db

_ver = sys.version_info
is_py2 = (_ver[0] == 2)
is_py3 = (_ver[0] == 3)

DEBUG = False

if is_py2:
reload(sys)
sys.setdefaultencoding('utf-8')

app_debug = False
if mw.isAppleSystem():
app_debug = True
Expand Down Expand Up @@ -81,7 +71,10 @@ def status():
def getConf():
cfg = getServerDir() + "/cfg.json"
if not os.path.exists(cfg):
return mw.returnJson(False, "未配置", [])
rdata = {
'use_sftp':False,
}
return mw.returnJson(False, "未配置", rdata)
data = mw.readFile(cfg)
data = json.loads(data)
return mw.returnJson(True, "OK", data)
Expand Down
141 changes: 141 additions & 0 deletions plugins/mysql-apt/versions/8.4/install_generic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# -*- coding: utf-8 -*-
#!/bin/bash

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export DEBIAN_FRONTEND=noninteractive

# https://downloads.mysql.com/archives/community/

curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sysName=`uname`

myDir=${serverPath}/source/mysql-apt

bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`

# cd /www/server/mdserver-web/plugins/mysql-apt && bash install.sh install 8.4
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-apt/index.py start 8.4

if [ "$OSNAME" == 'debian' ] && [ "$VERSION_ID" -lt '12' ] ;then
VERSION_ID="12"
fi


ARCH="amd64"
TMP_ARCH=`arch`
if [ "$TMP_ARCH" == "x86_64" ];then
ARCH="amd64"
elif [ "$TMP_ARCH" == "aarch64" ];then
ARCH="arm64"
else
ARCH="amd64"
fi

if [ "$ARCH" != "amd64" ];then
echo "暂时不支持该${ARCH}"
exit 1
fi


MYSQL_VER=8.4.2
SUFFIX_NAME=${MYSQL_VER}-1${OSNAME}${VERSION_ID}_${ARCH}


# /lib/systemd/system/mysql.service
# /etc/mysql/my.cnf

APT_INSTALL()
{
########
mkdir -p $myDir
mkdir -p $serverPath/mysql-apt/bin

mkdir -p /var/run/mysqld
chown mysql -R /var/run/mysqld

# Linux - Generic

# https://cdn.mysql.com/archives/mysql-8.4/mysql-8.4.2-linux-glibc2.28-x86_64.tar.xz

# SUFFIX_NAME=${MYSQL_VER}-linux-glibc2.28_${TMP_ARCH}
# wget --no-check-certificate -O mysql-8.4.2-linux-glibc2.28-x86_64.tar.xz https://cdn.mysql.com/archives/mysql-8.4/mysql-${SUFFIX_NAME}.tar.xz

wget --no-check-certificate -O ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
chmod +x ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar
cd ${myDir} && tar vxf ${myDir}/mysql-server_${SUFFIX_NAME}.deb-bundle.tar

apt update -y
apt install -y libnuma1 libaio1 libmecab2

# 安装
dpkg -X mysql-common_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin



dpkg -X mysql-community-client-plugins_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-community-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-client_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin

dpkg -X mysql-community-server-core_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin

dpkg -X mysql-community-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin
dpkg -X mysql-server_${SUFFIX_NAME}.deb $serverPath/mysql-apt/bin

# 测试时可关闭
rm -rf $myDir
#######
}

APT_UNINSTALL()
{
###
rm -rf $myDir
# apt remove -y mysql-server
###
}


Install_mysql()
{
echo '正在安装脚本文件...'

isApt=`which apt`
if [ "$isApt" != "" ];then
APT_INSTALL
fi

if [ "$?" == "0" ];then
mkdir -p $serverPath/mysql-apt
echo '8.4' > $serverPath/mysql-apt/version.pl
echo '安装完成'
else
echo '8.4' > $serverPath/mysql-apt/version.pl
echo "暂时不支持该系统"
fi
}

Uninstall_mysql()
{

isApt=`which apt`
if [ "$isApt" != "" ];then
APT_UNINSTALL
fi

rm -rf $serverPath/mysql-apt
echo '卸载完成'
}

action=$1
if [ "${1}" == 'install' ];then
Install_mysql
else
Uninstall_mysql
fi
Loading