mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 07:49:25 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2861f7f995 | ||
|
|
10d6fa2d47 | ||
|
|
16e5b4ae73 | ||
|
|
aca89d7d5e | ||
|
|
ffefe96f1f | ||
|
|
e1e1e81a90 | ||
|
|
502295125a | ||
|
|
85258dd80b | ||
|
|
ff0cb6eb31 | ||
|
|
e4e1945ea5 | ||
|
|
e7f74a482f | ||
|
|
dd27af9ede | ||
|
|
4aeffd2aa6 | ||
|
|
8924957e7f | ||
|
|
c013db9d41 | ||
|
|
e492abf354 | ||
|
|
f84cab9e98 | ||
|
|
eb5be2842d | ||
|
|
06e99096cf | ||
|
|
93f1129c0f | ||
|
|
46bc94946c | ||
|
|
0857c6aed7 | ||
|
|
fdcdd27f8e | ||
|
|
d1810606db | ||
|
|
68f5f4c6cb | ||
|
|
d40665c0f8 | ||
|
|
9d1ebba509 | ||
|
|
d0113840a3 | ||
|
|
43c287132b | ||
|
|
deb3a40fb7 | ||
|
|
88196175f4 | ||
|
|
217ba2d14e | ||
|
|
7af7e2321a | ||
|
|
20b39cbb70 | ||
|
|
66ff690bae | ||
|
|
99e8e63917 | ||
|
|
a4dfe26254 | ||
|
|
15c0ef390e | ||
|
|
a2b9658b2e | ||
|
|
5bcb0fb739 | ||
|
|
6278c9588b | ||
|
|
19d4456e2e | ||
|
|
807cb8fe98 | ||
|
|
ba2df01084 | ||
|
|
d82b0dbe9f | ||
|
|
acc18cf571 | ||
|
|
f69dd139c0 | ||
|
|
ab6f860bde | ||
|
|
febe56f430 | ||
|
|
0962e5aab8 | ||
|
|
5ea062862f | ||
|
|
cce5598f2f | ||
|
|
d88962eb56 | ||
|
|
b44e24df0d | ||
|
|
f36e540a59 | ||
|
|
992e7445f6 | ||
|
|
066729e8d9 | ||
|
|
be3e57a905 | ||
|
|
bc7a569ae9 |
@@ -149,6 +149,7 @@ data/hook_*.json
|
||||
data/letsencrypt.json
|
||||
data/basic_auth.json
|
||||
data/api.json
|
||||
data/bind_domain.pl
|
||||
|
||||
plugins/l2tp
|
||||
plugins/openlitespeed
|
||||
|
||||
@@ -79,7 +79,6 @@ PHP[72-81]支持phpMyAdmin[5.2.0]
|
||||
| 服务商 | LOGO | 推广地址 | 优惠码 |
|
||||
| ------------- |----------|-----------|-------|
|
||||
| digitalvirt |[](https://digitalvirt.com/aff.php?aff=154) | https://digitalvirt.com/aff.php?aff=154 | mdserver-web |
|
||||
| 搬瓦工 |[](https://bwh81.net/aff.php?aff=54161) | https://bwh81.net/aff.php?aff=54161 | BWH3HYATVBJW |
|
||||
|
||||
# Docker
|
||||
|
||||
@@ -91,15 +90,15 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.11.1
|
||||
### 版本更新 0.11.2
|
||||
|
||||
* 提供面板API接口访问的支持。
|
||||
* rockylinux系统安装优化。
|
||||
* 网站统计记录POST请求原文优化。
|
||||
* 针对mysql下载速度优化。
|
||||
* mysql初始化默认参数优化。
|
||||
* OP防火墙安全设置BUG解决。
|
||||
* redis安全强化。
|
||||
* 添加php命令行设置。
|
||||
* 域名绑定。
|
||||
* Gitea优化。
|
||||
* 网站统计优化。
|
||||
* centos9下php-gd安装优化。
|
||||
* php82rc7测试版。
|
||||
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
@@ -27,7 +27,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.11.1.1'
|
||||
__version = '0.11.2'
|
||||
__api_addr = 'data/api.json'
|
||||
|
||||
def __init__(self):
|
||||
@@ -89,6 +89,21 @@ class config_api:
|
||||
return mw.returnJson(True, '修改成功!')
|
||||
return mw.returnJson(False, '修改失败!')
|
||||
|
||||
def setPanelDomainApi(self):
|
||||
domain = request.form.get('domain', '')
|
||||
|
||||
cfg_domain = 'data/bind_domain.pl'
|
||||
if domain == '':
|
||||
os.remove(cfg_domain)
|
||||
return mw.returnJson(True, '清空域名成功!')
|
||||
|
||||
reg = r"^([\w\-\*]{1,100}\.){1,4}(\w{1,10}|\w{1,10}\.\w{1,10})$"
|
||||
if not re.match(reg, domain):
|
||||
return mw.returnJson(False, '主域名格式不正确')
|
||||
|
||||
mw.writeFile(cfg_domain, domain)
|
||||
return mw.returnJson(True, '设置域名成功!')
|
||||
|
||||
def syncDateApi(self):
|
||||
if mw.isAppleSystem():
|
||||
return mw.returnJson(True, '开发系统不必同步时间!')
|
||||
@@ -614,6 +629,13 @@ class config_api:
|
||||
else:
|
||||
data['basic_auth'] = ''
|
||||
|
||||
cfg_domain = 'data/bind_domain.pl'
|
||||
if os.path.exists(cfg_domain):
|
||||
domain = mw.readFile(cfg_domain)
|
||||
data['bind_domain'] = domain.strip()
|
||||
else:
|
||||
data['bind_domain'] = ''
|
||||
|
||||
api_token = self.__api_addr
|
||||
if os.path.exists(api_token):
|
||||
bac = mw.readFile(api_token)
|
||||
|
||||
@@ -890,6 +890,47 @@ def checkIp(ip):
|
||||
return False
|
||||
|
||||
|
||||
def getHost(port=False):
|
||||
from flask import request
|
||||
host_tmp = request.headers.get('host')
|
||||
if not host_tmp:
|
||||
if request.url_root:
|
||||
tmp = re.findall(r"(https|http)://([\w:\.-]+)", request.url_root)
|
||||
if tmp:
|
||||
host_tmp = tmp[0][1]
|
||||
if not host_tmp:
|
||||
host_tmp = getLocalIp() + ':' + readFile('data/port.pl').strip()
|
||||
try:
|
||||
if host_tmp.find(':') == -1:
|
||||
host_tmp += ':80'
|
||||
except:
|
||||
host_tmp = "127.0.0.1:8888"
|
||||
h = host_tmp.split(':')
|
||||
if port:
|
||||
return h[-1]
|
||||
return ':'.join(h[0:-1])
|
||||
|
||||
|
||||
def getClientIp():
|
||||
from flask import request
|
||||
return request.remote_addr.replace('::ffff:', '')
|
||||
|
||||
|
||||
def checkDomainPanel():
|
||||
tmp = getHost()
|
||||
domain = readFile('data/bind_domain.pl')
|
||||
port = readFile('data/port.pl').strip()
|
||||
if domain:
|
||||
client_ip = getClientIp()
|
||||
if client_ip in ['127.0.0.1', 'localhost', '::1']:
|
||||
return False
|
||||
if tmp.strip().lower() != domain.strip().lower():
|
||||
from flask import Flask, redirect, request, url_for
|
||||
to = "http://" + domain + ":" + port
|
||||
return redirect(to, code=302)
|
||||
return False
|
||||
|
||||
|
||||
def createLinuxUser(user, group):
|
||||
execShell("groupadd {}".format(group))
|
||||
execShell('useradd -s /sbin/nologin -g {} {}'.format(user, group))
|
||||
|
||||
+55
-2
@@ -139,6 +139,58 @@ class site_api:
|
||||
data['default_site'] = mw.readFile('data/default_site.pl')
|
||||
return mw.getJson(data)
|
||||
|
||||
def getCliPhpVersionApi(self):
|
||||
php_bin = '/usr/bin/php'
|
||||
php_versions = self.getPhpVersion()
|
||||
php_versions = php_versions[1:]
|
||||
|
||||
if len(php_versions) < 1:
|
||||
return mw.returnJson(False, '未安装PHP,无法设置')
|
||||
|
||||
if os.path.exists(php_bin) and os.path.islink(php_bin):
|
||||
link_re = os.readlink(php_bin)
|
||||
for v in php_versions:
|
||||
if link_re.find(v['version']) != -1:
|
||||
return mw.getJson({"select": v, "versions": php_versions})
|
||||
|
||||
return mw.getJson({
|
||||
"select": php_versions[0],
|
||||
"versions": php_versions})
|
||||
|
||||
def setCliPhpVersionApi(self):
|
||||
if mw.isAppleSystem():
|
||||
return mw.returnJson(False, "开发机不可设置!")
|
||||
|
||||
version = request.form.get('version', '')
|
||||
|
||||
php_bin = '/usr/bin/php'
|
||||
php_bin_src = "/www/server/php/%s/bin/php" % version
|
||||
php_ize = '/usr/bin/phpize'
|
||||
php_ize_src = "/www/server/php/%s/bin/phpize" % version
|
||||
php_fpm = '/usr/bin/php-fpm'
|
||||
php_fpm_src = "/www/server/php/%s/sbin/php-fpm" % version
|
||||
php_pecl = '/usr/bin/pecl'
|
||||
php_pecl_src = "/www/server/php/%s/bin/pecl" % version
|
||||
php_pear = '/usr/bin/pear'
|
||||
php_pear_src = "/www/server/php/%s/bin/pear" % version
|
||||
if not os.path.exists(php_bin_src):
|
||||
return mw.returnJson(False, '指定PHP版本未安装!')
|
||||
|
||||
is_chattr = mw.execShell('lsattr /usr|grep /usr/bin')[0].find('-i-')
|
||||
if is_chattr != -1:
|
||||
mw.execShell('chattr -i /usr/bin')
|
||||
mw.execShell("rm -f " + php_bin + ' ' + php_ize + ' ' +
|
||||
php_fpm + ' ' + php_pecl + ' ' + php_pear)
|
||||
mw.execShell("ln -sf %s %s" % (php_bin_src, php_bin))
|
||||
mw.execShell("ln -sf %s %s" % (php_ize_src, php_ize))
|
||||
mw.execShell("ln -sf %s %s" % (php_fpm_src, php_fpm))
|
||||
mw.execShell("ln -sf %s %s" % (php_pecl_src, php_pecl))
|
||||
mw.execShell("ln -sf %s %s" % (php_pear_src, php_pear))
|
||||
if is_chattr != -1:
|
||||
mw.execShell('chattr +i /usr/bin')
|
||||
mw.writeLog('面板设置', '设置PHP-CLI版本为: %s' % version)
|
||||
return mw.returnJson(True, '设置成功!')
|
||||
|
||||
def setPsApi(self):
|
||||
mid = request.form.get('id', '')
|
||||
ps = request.form.get('ps', '')
|
||||
@@ -266,7 +318,8 @@ class site_api:
|
||||
return mw.returnJson(True, '站点删除成功!')
|
||||
|
||||
def getPhpVersionApi(self):
|
||||
return self.getPhpVersion()
|
||||
data = self.getPhpVersion()
|
||||
return mw.getJson(data)
|
||||
|
||||
def setPhpVersionApi(self):
|
||||
siteName = request.form.get('siteName', '')
|
||||
@@ -2311,7 +2364,7 @@ location ^~ {from} {\n\
|
||||
tmp['name'] = 'PHP-' + matchVer
|
||||
data.append(tmp)
|
||||
|
||||
return mw.getJson(data)
|
||||
return data
|
||||
|
||||
# 是否跳转到https
|
||||
def isToHttps(self, siteName):
|
||||
|
||||
@@ -10,6 +10,7 @@ GIT_PROJECT_DIR="${GIT_USER_DIR}/{$PROJECT}"
|
||||
|
||||
|
||||
git config --global credential.helper store
|
||||
git config --global pull.rebase false
|
||||
|
||||
# echo $GIT_PROJECT_DIR
|
||||
if [ ! -d $GIT_PROJECT_DIR ];then
|
||||
@@ -18,6 +19,7 @@ if [ ! -d $GIT_PROJECT_DIR ];then
|
||||
fi
|
||||
|
||||
unset GIT_DIR
|
||||
|
||||
cd $GIT_PROJECT_DIR && git pull
|
||||
|
||||
# func 2
|
||||
@@ -26,9 +28,13 @@ cd $GIT_PROJECT_DIR && git pull
|
||||
|
||||
#更新的目的地址
|
||||
WEB_PATH={$WEB_ROOT}/{$USERNAME}/{$PROJECT}
|
||||
mkdir -p $WEB_PATH
|
||||
|
||||
rsync -vauP --delete --exclude=".*" $GIT_PROJECT_DIR/ $WEB_PATH
|
||||
if [ ! -d $WEB_PATH ];then
|
||||
mkdir -p $WEB_PATH
|
||||
rsync -vauP --delete --exclude=".*" $GIT_PROJECT_DIR/ $WEB_PATH
|
||||
else
|
||||
rsync -vauP --exclude=".*" $GIT_PROJECT_DIR/ $WEB_PATH
|
||||
fi
|
||||
|
||||
sysName=`uname`
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
|
||||
@@ -15,6 +15,8 @@ if [ ! -d $GIT_PROJECT_DIR ];then
|
||||
fi
|
||||
|
||||
unset GIT_DIR
|
||||
git config pull.rebase false
|
||||
|
||||
cd $GIT_PROJECT_DIR && git pull
|
||||
|
||||
# func 2
|
||||
|
||||
+24
-6
@@ -101,7 +101,7 @@ def getHomeDir():
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return '/Users/' + user
|
||||
else:
|
||||
return 'git'
|
||||
return 'www'
|
||||
|
||||
|
||||
def getRunUser():
|
||||
@@ -110,7 +110,7 @@ def getRunUser():
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return user
|
||||
else:
|
||||
return 'git'
|
||||
return 'www'
|
||||
|
||||
__SR = '''#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
@@ -135,6 +135,10 @@ def initDreplace():
|
||||
file_tpl = getInitdConfTpl()
|
||||
service_path = mw.getServerDir()
|
||||
|
||||
git_dir = mw.getServerDir() + '/git'
|
||||
if not os.path.exists(git_dir):
|
||||
mw.execShell('mkdir -p ' + git_dir)
|
||||
|
||||
initD_path = getServerDir() + '/init.d'
|
||||
if not os.path.exists(initD_path):
|
||||
os.mkdir(initD_path)
|
||||
@@ -445,7 +449,7 @@ def submitGogsConf():
|
||||
val = g + ' = ' + args[g]
|
||||
conf = re.sub(rep, val, conf)
|
||||
mw.writeFile(filename, conf)
|
||||
reload()
|
||||
restart()
|
||||
return mw.returnJson(True, '设置成功')
|
||||
|
||||
|
||||
@@ -515,7 +519,7 @@ 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'
|
||||
path_tmp = path + '/' + name + '/hooks/post-receive.d/post-receive'
|
||||
if os.path.exists(path_tmp):
|
||||
data[x]['has_hook'] = True
|
||||
else:
|
||||
@@ -593,15 +597,17 @@ def projectScriptLoad():
|
||||
|
||||
path = getRootPath() + '/' + user + '/' + name
|
||||
post_receive_tpl = getPluginDir() + '/hook/post-receive.tpl'
|
||||
post_receive = path + '/custom_hooks/post-receive'
|
||||
post_receive = path + '/hooks/post-receive.d/post-receive'
|
||||
|
||||
if not os.path.exists(path + '/custom_hooks'):
|
||||
mw.execShell('mkdir -p ' + path + '/custom_hooks')
|
||||
mw.execShell('chown -R www:www ' + 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)
|
||||
mw.execShell('chown -R www:www ' + post_receive)
|
||||
|
||||
commit_tpl = getPluginDir() + '/hook/commit.tpl'
|
||||
commit = path + '/custom_hooks/commit'
|
||||
@@ -618,6 +624,7 @@ def projectScriptLoad():
|
||||
cc_content = cc_content.replace('{$WEB_ROOT}', mw.getWwwDir())
|
||||
mw.writeFile(commit, cc_content)
|
||||
mw.execShell('chmod 777 ' + commit)
|
||||
mw.execShell('chown -R www:www ' + commit)
|
||||
|
||||
return 'ok'
|
||||
|
||||
@@ -632,7 +639,7 @@ def projectScriptUnload():
|
||||
name = args['name'] + '.git'
|
||||
|
||||
post_receive = getRootPath() + '/' + user + '/' + name + \
|
||||
'/custom_hooks/post-receive'
|
||||
'/hooks/post-receive.d/post-receive'
|
||||
mw.execShell('rm -f ' + post_receive)
|
||||
|
||||
commit = getRootPath() + '/' + user + '/' + name + \
|
||||
@@ -697,6 +704,15 @@ def getTotalStatistics():
|
||||
return mw.returnJson(False, 'fail', data)
|
||||
|
||||
|
||||
def uninstallPreInspection():
|
||||
repo_dir = getServerDir() + "/data/gitea-repositories"
|
||||
if not os.path.exists(repo_dir):
|
||||
return 'ok'
|
||||
dir_list = os.listdir(repo_dir)
|
||||
if len(dir_list) > 0:
|
||||
return "有项目数据!请手动删除Gitea<br/> rm -rf {}".format(getServerDir())
|
||||
return 'ok'
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
@@ -715,6 +731,8 @@ if __name__ == "__main__":
|
||||
print(initdInstall())
|
||||
elif func == 'initd_uninstall':
|
||||
print(initdUinstall())
|
||||
elif func == 'uninstall_pre_inspection':
|
||||
print(uninstallPreInspection())
|
||||
elif func == 'run_log':
|
||||
print(runLog())
|
||||
elif func == 'post_receive_log':
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
"title": "Gitea",
|
||||
"versions": ["1.17.2"],
|
||||
"tip": "soft",
|
||||
"install_pre_inspection":false,
|
||||
"uninstall_pre_inspection":true,
|
||||
"checks": "server/gitea",
|
||||
"path":"server/gitea",
|
||||
"author": "gitea",
|
||||
|
||||
@@ -6,12 +6,12 @@ After=network.target
|
||||
[Service]
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User=git
|
||||
Group=git
|
||||
User=www
|
||||
Group=www
|
||||
WorkingDirectory={$SERVER_PATH}/gitea
|
||||
ExecStart={$SERVER_PATH}/gitea/gitea web
|
||||
Restart=always
|
||||
Environment=USER=git HOME=/home/git GITEA_WORK_DIR={$SERVER_PATH}/gitea
|
||||
Environment=USER=www HOME=/home/www GITEA_WORK_DIR={$SERVER_PATH}/gitea
|
||||
RemainAfterExit=yes
|
||||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
|
||||
@@ -26,24 +26,39 @@ getBit(){
|
||||
echo `getconf LONG_BIT`
|
||||
}
|
||||
|
||||
Install_Rsync(){
|
||||
if [ "$OSNAME" == "debian" ] || [ "$OSNAME" == "ubuntu" ];then
|
||||
apt install -y rsync
|
||||
elif [[ "$OSNAME" == "arch" ]]; then
|
||||
echo y | pacman -Sy rsync
|
||||
elif [[ "$OSNAME" == "macos" ]]; then
|
||||
# brew install rsync
|
||||
# brew install lsyncd
|
||||
echo "ok"
|
||||
else
|
||||
yum install -y rsync
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Install_App()
|
||||
{
|
||||
Install_Rsync
|
||||
|
||||
mkdir -p $serverPath/source/gitea
|
||||
|
||||
if id git &> /dev/null ;then
|
||||
echo "git uid is `id -u git`"
|
||||
echo "git shell is `grep "^git:" /etc/passwd |cut -d':' -f7 `"
|
||||
if id www &> /dev/null ;then
|
||||
echo "www uid is `id -u www`"
|
||||
echo "www shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
|
||||
else
|
||||
groupadd git
|
||||
useradd -g git git
|
||||
groupadd www
|
||||
useradd -g www www
|
||||
fi
|
||||
|
||||
if [ "macos" != "$OSNAME" ];then
|
||||
if [ ! -d /home/git ];then
|
||||
mkdir -p /home/git
|
||||
chown -R git:git /home/git
|
||||
if [ ! -d /home/www ];then
|
||||
mkdir -p /home/www
|
||||
chown -R www:www /home/www
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -71,7 +86,7 @@ Install_App()
|
||||
mv $serverPath/source/gitea/$file $serverPath/gitea/gitea
|
||||
chmod +x $serverPath/gitea/gitea
|
||||
|
||||
chown -R git:git $serverPath/gitea
|
||||
chown -R www:www $serverPath/gitea
|
||||
fi
|
||||
|
||||
|
||||
|
||||
+65
-49
@@ -1,19 +1,9 @@
|
||||
|
||||
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));
|
||||
_args = JSON.stringify(toArrayObject(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
@@ -186,6 +176,28 @@ function giteaUserList(page, search) {
|
||||
}
|
||||
|
||||
function userProjectList(user, search){
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '用户('+user+')项目列表',
|
||||
area: '500px',
|
||||
content:"<div class='bt-form pd20 c6'>\
|
||||
<div>\
|
||||
<div id='gitea_table' class='divtable' style='margin-top:5px;'>\
|
||||
<table class='table table-hover'>\
|
||||
<thead><tr><th>项目</th><th>操作</th></tr></thead>\
|
||||
<tbody></tbody>\
|
||||
</table>\
|
||||
<div class='dataTables_paginate paging_bootstrap pagination' style='margin-top:0px;'><ul id='gitea_page' class='page'></ul></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>",
|
||||
success:function(){
|
||||
userProjectListPost(user,search);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function userProjectListPost(user, search){
|
||||
var req = {};
|
||||
if (!isNaN(user)){
|
||||
req['page'] = user;
|
||||
@@ -201,8 +213,7 @@ function userProjectList(user, search){
|
||||
if(typeof(search) != 'undefined'){
|
||||
req['search'] = search;
|
||||
}
|
||||
|
||||
$('.layui-layer-close1').click();
|
||||
|
||||
gogsPost('user_project_list', req, function(data){
|
||||
var rdata = [];
|
||||
try {
|
||||
@@ -227,24 +238,10 @@ function userProjectList(user, search){
|
||||
</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>';
|
||||
$('#gitea_table tbody').html(list);
|
||||
|
||||
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>"
|
||||
});
|
||||
var page = rdata['data']['list'];
|
||||
$('#gitea_table .gitea_page').html(page);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,23 +250,41 @@ 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>';
|
||||
html += '<button class="btn btn-default btn-sm hook_edit">手动编辑</button>';
|
||||
html += '<button class="btn btn-default btn-sm hook_log">调试日志</button>';
|
||||
html += '<button class="btn btn-default btn-sm hook_load">重新加载</button>';
|
||||
html += '<button class="btn btn-default btn-sm hook_unload">卸载脚本</button>';
|
||||
} else {
|
||||
html += '<button onclick="projectScriptLoad(\''+user+'\',\''+name+'\')" class="btn btn-default btn-sm">加载脚本</button>';
|
||||
html += '<button class="btn btn-default btn-sm hook_load">加载脚本</button>';
|
||||
}
|
||||
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '['+user+']['+name+']脚本设置',
|
||||
area: '240px',
|
||||
content:'<div class="change-default pd20">'+html+'</div>'
|
||||
content:'<div class="change-default pd20">'+html+'</div>',
|
||||
success:function(layero,index) {
|
||||
|
||||
$('.hook_edit').click(function(){
|
||||
projectScriptEdit(user,name,index);
|
||||
});
|
||||
|
||||
$('.hook_log').click(function(){
|
||||
projectScriptDebug(user,name,index);
|
||||
});
|
||||
|
||||
$('.hook_load').click(function(){
|
||||
projectScriptLoad(user,name,index);
|
||||
});
|
||||
|
||||
$('.hook_unload').click(function(){
|
||||
projectScriptUnload(user,name,index);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function projectScriptEdit(user,name){
|
||||
function projectScriptEdit(user,name,index){
|
||||
gogsPost('project_script_edit', {'user':user,'name':name}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata['status']){
|
||||
@@ -280,41 +295,42 @@ function projectScriptEdit(user,name){
|
||||
});
|
||||
}
|
||||
|
||||
function projectScriptLoad(user,name){
|
||||
function projectScriptLoad(user,name,index){
|
||||
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);
|
||||
showMsg('加载成功!',function(){
|
||||
layer.close(index);
|
||||
userProjectListPost(1);
|
||||
},{icon:1,time:2000,shade: [0.3, '#000']},2000);
|
||||
});
|
||||
}
|
||||
|
||||
function projectScriptUnload(user,name){
|
||||
function projectScriptUnload(user,name,index){
|
||||
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);
|
||||
showMsg('卸载成功!',function(){
|
||||
layer.close(index);
|
||||
userProjectListPost(1);
|
||||
},{icon:1,time:2000,shade: [0.3, '#000']},2000);
|
||||
});
|
||||
}
|
||||
|
||||
function projectScriptDebug(user,name){
|
||||
function projectScriptDebug(user,name,index){
|
||||
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']});
|
||||
showMsg(rdata.msg,function(){
|
||||
},{icon:1,time:2000,shade: [0.3, '#000']},2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -690,8 +690,8 @@ function addDatabase(type){
|
||||
<span class='tname'>数据库名</span>\
|
||||
<div class='info-r'><input name='name' class='bt-input-text mr5' placeholder='新的数据库名称' type='text' style='width:65%' value=''>\
|
||||
<select class='bt-input-text mr5 codeing_a5nGsm' name='codeing' style='width:27%'>\
|
||||
<option value='utf8'>utf-8</option>\
|
||||
<option value='utf8mb4'>utf8mb4</option>\
|
||||
<option value='utf8'>utf-8</option>\
|
||||
<option value='gbk'>gbk</option>\
|
||||
<option value='big5'>big5</option>\
|
||||
</select>\
|
||||
|
||||
@@ -690,8 +690,8 @@ function addDatabase(type){
|
||||
<span class='tname'>数据库名</span>\
|
||||
<div class='info-r'><input name='name' class='bt-input-text mr5' placeholder='新的数据库名称' type='text' style='width:65%' value=''>\
|
||||
<select class='bt-input-text mr5 codeing_a5nGsm' name='codeing' style='width:27%'>\
|
||||
<option value='utf8'>utf-8</option>\
|
||||
<option value='utf8mb4'>utf8mb4</option>\
|
||||
<option value='utf8'>utf-8</option>\
|
||||
<option value='gbk'>gbk</option>\
|
||||
<option value='big5'>big5</option>\
|
||||
</select>\
|
||||
|
||||
@@ -690,8 +690,8 @@ function addDatabase(type){
|
||||
<span class='tname'>数据库名</span>\
|
||||
<div class='info-r'><input name='name' class='bt-input-text mr5' placeholder='新的数据库名称' type='text' style='width:65%' value=''>\
|
||||
<select class='bt-input-text mr5 codeing_a5nGsm' name='codeing' style='width:27%'>\
|
||||
<option value='utf8'>utf-8</option>\
|
||||
<option value='utf8mb4'>utf8mb4</option>\
|
||||
<option value='utf8'>utf-8</option>\
|
||||
<option value='gbk'>gbk</option>\
|
||||
<option value='big5'>big5</option>\
|
||||
</select>\
|
||||
|
||||
@@ -57,6 +57,10 @@ if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
|
||||
|
||||
# 安装通用扩展
|
||||
echo "install PHP${type} extend start"
|
||||
|
||||
# cd /www/server/mdserver-web/plugins/php/versions/common && bash iconv.sh install 53
|
||||
# cd /www/server/mdserver-web/plugins/php/versions/common && bash gd.sh install 56
|
||||
# cd /www/server/mdserver-web/plugins/php/versions/common && bash openssl.sh install 56
|
||||
cd ${rootPath}/plugins/php/versions/common && bash gd.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash iconv.sh install ${type}
|
||||
cd ${rootPath}/plugins/php/versions/common && bash exif.sh install ${type}
|
||||
|
||||
@@ -16,7 +16,7 @@ function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)"
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
|
||||
version=8.2.0RC6
|
||||
version=8.2.0RC7
|
||||
PHP_VER=82
|
||||
Install_php()
|
||||
{
|
||||
|
||||
@@ -18,9 +18,16 @@ LIBNAME=gd
|
||||
LIBV=0
|
||||
|
||||
|
||||
if [ "$version" -lt "74" ];then
|
||||
bash $curPath/gd_old.sh $1 $2
|
||||
exit 0
|
||||
bash ${rootPath}/scripts/getos.sh
|
||||
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||||
OSNAME_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
|
||||
if [ "centos" == "$OSNAME" ] || [ "OSNAME_ID" != "9" ];then
|
||||
if [ "$version" -lt "74" ];then
|
||||
bash $curPath/gd_old.sh $1 $2
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -52,10 +52,11 @@ Install_lib()
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
|
||||
FIND_C99=`cat Makefile|grep c99`
|
||||
if [ "$FIND_C99" == "" ];then
|
||||
sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile
|
||||
fi
|
||||
# PHP52需要,因为52关闭。所有注释掉
|
||||
# FIND_C99=`cat Makefile|grep c99`
|
||||
# if [ "$FIND_C99" == "" ];then
|
||||
# sed -i $BAK 's/CFLAGS \=/CFLAGS \= -std=c99/g' Makefile
|
||||
# fi
|
||||
|
||||
make clean && make && make install && make clean
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Install_lib()
|
||||
fi
|
||||
|
||||
# cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh
|
||||
if [ "$version" -lt "70" ];then
|
||||
if [ "$version" -lt "81" ];then
|
||||
cd ${rootPath}/plugins/php/lib && /bin/bash openssl_10.sh
|
||||
fi
|
||||
|
||||
@@ -63,8 +63,9 @@ Install_lib()
|
||||
mv config0.m4 config.m4
|
||||
fi
|
||||
|
||||
openssl_version=`pkg-config openssl --modversion`
|
||||
if [ "$version" -lt "70" ];then
|
||||
# openssl_version=`pkg-config openssl --modversion`
|
||||
# export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig
|
||||
if [ "$version" -lt "81" ];then
|
||||
export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig
|
||||
fi
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ if [ "$version" -lt "70" ];then
|
||||
LIBV=1.2.5
|
||||
fi
|
||||
|
||||
if [ "$version" -eq "82" ];then
|
||||
echo "wait php82 release"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
LIB_PATH_NAME=lib/php
|
||||
if [ -d $serverPath/php/${version}/lib64 ];then
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
daemonize yes
|
||||
pidfile {$SERVER_PATH}/redis/redis_6379.pid
|
||||
|
||||
bind 0.0.0.0
|
||||
bind 127.0.0.1
|
||||
port 6379
|
||||
requirepass admin
|
||||
requirepass {$REDIS_PASS}
|
||||
|
||||
timeout 0
|
||||
tcp-keepalive 0
|
||||
|
||||
@@ -101,6 +101,9 @@ def initDreplace():
|
||||
if not os.path.exists(dst_conf_init):
|
||||
conf_content = mw.readFile(getConfTpl())
|
||||
conf_content = conf_content.replace('{$SERVER_PATH}', service_path)
|
||||
conf_content = conf_content.replace(
|
||||
'{$REDIS_PASS}', mw.getRandomString(10))
|
||||
|
||||
mw.writeFile(dst_conf, conf_content)
|
||||
mw.writeFile(dst_conf_init, 'ok')
|
||||
|
||||
@@ -167,11 +170,10 @@ def runInfo():
|
||||
if tmp:
|
||||
requirepass = tmp.groups()[1]
|
||||
|
||||
default_ip = '0.0.0.0'
|
||||
findDebian = mw.execShell('cat /etc/issue |grep Debian')
|
||||
if findDebian[0] != '':
|
||||
default_ip = mw.getLocalIp()
|
||||
|
||||
default_ip = '127.0.0.1'
|
||||
# findDebian = mw.execShell('cat /etc/issue |grep Debian')
|
||||
# if findDebian[0] != '':
|
||||
# default_ip = mw.getLocalIp()
|
||||
cmd = getServerDir() + "/bin/redis-cli -h " + default_ip + " info"
|
||||
if requirepass != "":
|
||||
cmd = getServerDir() + '/bin/redis-cli -h ' + default_ip + \
|
||||
|
||||
+11
-12
@@ -104,18 +104,19 @@ def loadConfigFile():
|
||||
listToLuaFile(dst_conf_lua, content)
|
||||
|
||||
|
||||
def loadConfigFileReload():
|
||||
lua_dir = getServerDir() + "/lua"
|
||||
conf_tpl = getPluginDir() + "/conf/config.json"
|
||||
# def loadConfigFileReload():
|
||||
# -- 配置生活或可使用
|
||||
# lua_dir = getServerDir() + "/lua"
|
||||
# conf_tpl = getPluginDir() + "/conf/config.json"
|
||||
|
||||
content = mw.readFile(conf_tpl)
|
||||
content = json.loads(content)
|
||||
# content = mw.readFile(conf_tpl)
|
||||
# content = json.loads(content)
|
||||
|
||||
dst_conf_json = getServerDir() + "/lua/config.json"
|
||||
mw.writeFile(dst_conf_json, json.dumps(content))
|
||||
# dst_conf_json = getServerDir() + "/lua/config.json"
|
||||
# mw.writeFile(dst_conf_json, json.dumps(content))
|
||||
|
||||
dst_conf_lua = getServerDir() + "/lua/webstats_config.lua"
|
||||
listToLuaFile(dst_conf_lua, content)
|
||||
# dst_conf_lua = getServerDir() + "/lua/webstats_config.lua"
|
||||
# listToLuaFile(dst_conf_lua, content)
|
||||
|
||||
|
||||
def loadLuaSiteFile():
|
||||
@@ -277,11 +278,9 @@ def restart():
|
||||
|
||||
def reload():
|
||||
initDreplace()
|
||||
|
||||
loadConfigFileReload()
|
||||
loadDebugLogFile()
|
||||
|
||||
mw.opWeb("reload")
|
||||
mw.opWeb("restart")
|
||||
return 'ok'
|
||||
|
||||
|
||||
|
||||
@@ -106,9 +106,8 @@ end
|
||||
|
||||
function _M.get_domain(self)
|
||||
local domain = ngx.req.get_headers()['host']
|
||||
if domain ~= nil then
|
||||
domain = ngx.re.gsub(domain, "_", ".")
|
||||
else
|
||||
-- domain = ngx.re.gsub(domain, "_", ".")
|
||||
if domain == nil then
|
||||
domain = "unknown"
|
||||
end
|
||||
return domain
|
||||
@@ -201,9 +200,11 @@ end
|
||||
|
||||
function _M.get_http_origin(self)
|
||||
local data = ""
|
||||
local headers = request_header
|
||||
local headers = ngx.req.get_headers()
|
||||
if not headers then return data end
|
||||
if method ~='GET' then
|
||||
-- API disabled in the context of log_by_lua*
|
||||
-- ngx.req.read_body()
|
||||
data = ngx.req.get_body_data()
|
||||
if not data then
|
||||
data = ngx.req.get_post_args(1000000)
|
||||
|
||||
@@ -43,7 +43,9 @@ log_by_lua_block {
|
||||
local config = require "webstats_config"
|
||||
local sites = require "webstats_sites"
|
||||
|
||||
local server_name = string.gsub(C:get_sn(ngx.var.server_name),'_','.')
|
||||
-- string.gsub(C:get_sn(ngx.var.server_name),'_','.')
|
||||
local server_name = ngx.var.server_name
|
||||
|
||||
|
||||
C:setConfData(config, sites)
|
||||
|
||||
@@ -378,6 +380,8 @@ log_by_lua_block {
|
||||
local ok, err = pcall(function() data = C:get_http_origin() end)
|
||||
if ok and not err then
|
||||
kv["request_headers"] = data
|
||||
else
|
||||
C:D("debug request_headers error:"..tostring(err))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -644,11 +648,7 @@ log_by_lua_block {
|
||||
local function run_app_ok()
|
||||
if not debug_mode then return run_app() end
|
||||
|
||||
local presult, err = pcall(
|
||||
function()
|
||||
run_app()
|
||||
end
|
||||
)
|
||||
local presult, err = pcall( function() run_app() end)
|
||||
if not presult then
|
||||
C:D("debug error on :"..tostring(err))
|
||||
return true
|
||||
|
||||
+6
-2
@@ -159,6 +159,10 @@ def requestCheck():
|
||||
or mw.md5(auth.password.strip() + salt) != app.config['BASIC_AUTH_PASSWORD']:
|
||||
return sendAuthenticated()
|
||||
|
||||
domain_check = mw.checkDomainPanel()
|
||||
if domain_check:
|
||||
return domain_check
|
||||
|
||||
|
||||
def isLogined():
|
||||
# print('isLogined', session)
|
||||
@@ -483,8 +487,8 @@ def index(reqClass=None, reqAction=None, reqData=None):
|
||||
# 登录页
|
||||
if reqClass == 'login':
|
||||
|
||||
dologin = request.args.get('dologin', '')
|
||||
if dologin == 'True':
|
||||
signout = request.args.get('signout', '')
|
||||
if signout == 'True':
|
||||
session.clear()
|
||||
session['login'] = False
|
||||
session['overdue'] = 0
|
||||
|
||||
@@ -66,6 +66,16 @@ $('input[name="backup_path"]').change(function(){
|
||||
});
|
||||
|
||||
|
||||
$('input[name="bind_domain"]').change(function(){
|
||||
var domain = $(this).val();
|
||||
console.log(domain);
|
||||
$('.btn_bind_domain').removeAttr('disabled');
|
||||
$('.btn_bind_domain').unbind().click(function(){
|
||||
$.post('/config/set_panel_domain','domain='+domain, function(rdata){
|
||||
showMsg(rdata.msg,function(){window.location.reload();},{icon:rdata.status?1:2},2000);
|
||||
},'json');
|
||||
});
|
||||
});
|
||||
|
||||
/** op **/
|
||||
|
||||
@@ -734,4 +744,3 @@ function setPanelApi(){
|
||||
} ,{icon:rdata.status?1:2}, 1000);
|
||||
},'json');
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ function openFilename(obj){
|
||||
var ext = getSuffixName(path);
|
||||
|
||||
// console.log(path,ext);
|
||||
if (inArray(ext,['html','htm','php','txt','md','js','css','scss','json','c','h','pl','py','java','log'])){
|
||||
if (inArray(ext,['html','htm','php','txt','md','js','css','scss','json','c','h','pl','py','java','log','conf'])){
|
||||
onlineEditFile(0, path);
|
||||
}
|
||||
|
||||
|
||||
@@ -736,9 +736,9 @@ $(function() {
|
||||
})
|
||||
});
|
||||
|
||||
$("#dologin").click(function() {
|
||||
$("#signout").click(function() {
|
||||
layer.confirm('您真的要退出面板吗?', {icon:3,closeBtn: 1}, function() {
|
||||
window.location.href = "/login?dologin=True"
|
||||
window.location.href = "/login?signout=True"
|
||||
});
|
||||
return false
|
||||
});
|
||||
|
||||
@@ -944,6 +944,64 @@ function getDefaultSite(){
|
||||
},'json');
|
||||
}
|
||||
|
||||
function setPHPVer(){
|
||||
$.post('/site/get_cli_php_version','',function(rdata){
|
||||
if(typeof(rdata['status'])!='undefined'){
|
||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||
return;
|
||||
}
|
||||
|
||||
var opt = '';
|
||||
var selected = '';
|
||||
for(var i=0;i<rdata.versions.length;i++){
|
||||
selected = '';
|
||||
if(rdata.select.version == rdata.versions[i].version) selected = 'selected';
|
||||
|
||||
if (rdata.versions[i].version.indexOf("yum")>-1){
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rdata.versions[i].version.indexOf("apt")>-1){
|
||||
continue;
|
||||
}
|
||||
|
||||
opt += '<option value="' + rdata.versions[i].version + '" ' + selected + '>' + rdata.versions[i].name + '</option>';
|
||||
}
|
||||
|
||||
var phpver_layer = layer.open({
|
||||
type: 1,
|
||||
area: '530px',
|
||||
title: '设置PHP-CLI(命令行)版本',
|
||||
closeBtn: 1,
|
||||
shift: 5,
|
||||
shadeClose: true,
|
||||
btn:["确定","取消"],
|
||||
content:'<div class="bt-form ptb15">\
|
||||
<p class="line">\
|
||||
<span class="tname text-right">PHP-CLI版本</span>\
|
||||
<select id="default_ver" class="bt-input-text" style="width: 300px;">'+opt+'</select>\
|
||||
</p>\
|
||||
<ul class="help-info-text c6 plr20">\
|
||||
<li>此处可设置命令行运行php时使用的PHP版本</li>\
|
||||
<li>安装新的PHP版本后此处需要重新设置</li>\
|
||||
</ul>\
|
||||
</div>',
|
||||
yes:function(layero,index){
|
||||
var version = $("#default_ver").val();
|
||||
var loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
$.post('/site/set_cli_php_version','version='+version,function(rdata){
|
||||
layer.close(loadT);
|
||||
showMsg(rdata.msg,function(){
|
||||
if (rdata.status){
|
||||
layer.close(phpver_layer);
|
||||
}
|
||||
},{icon:rdata.status?1:5},2000);
|
||||
},'json');
|
||||
},
|
||||
});
|
||||
},'json');
|
||||
}
|
||||
|
||||
function setIndexList(id){
|
||||
var Dindex = $("#Dindex").val().replace(new RegExp(/(\n)/g), ",");
|
||||
if(id == undefined ){
|
||||
|
||||
@@ -34,15 +34,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="ss-text pull-left mr50">
|
||||
<em class="btlink" style="color: #20a53a;" onclick="getPanelSSL()" title="点击自定义面板证书">面板SSL</em>
|
||||
<div class='ssh-item'>
|
||||
<input class='btswitch btswitch-ios' id='panelSSL' type='checkbox' {{data['ssl']}}>
|
||||
<label class='btswitch-btn' for='panelSSL' onclick="setPanelSSL()"></label>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="setbox bgw mtb15">
|
||||
@@ -82,14 +73,6 @@
|
||||
<span class="set-info c7">面板管理入口,设置后只能通过指定安全入口登录面板,如: /abc</span>
|
||||
</p>
|
||||
|
||||
<!--
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right">域名</span>
|
||||
<input name="domain" class="inputtxt bt-input-text" type="text" value="">
|
||||
<span class="set-info c7">为面板绑定一个访问域名;注意:一旦绑定域名,只能通过域名访问面板!</span>
|
||||
</p>
|
||||
-->
|
||||
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right" title="默认建站目录">默认建站目录</span>
|
||||
<input name="sites_path" class="inputtxt bt-input-text" type="text" value="{{data['site_path']}}">
|
||||
@@ -131,6 +114,21 @@
|
||||
|
||||
<div class="setting-con pd15">
|
||||
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right" title="绑定域名" style="float: left;">绑定域名</span>
|
||||
<input name="bind_domain" class="inputtxt bt-input-text" type="text" value="{{data['bind_domain']}}">
|
||||
<button type="button" class="btn btn-success btn-sm ml5 btn_bind_domain" disabled>保存</button>
|
||||
<span class="set-info c7">为面板绑定一个访问域名,<b style="color: red;">注意:一旦绑定域名,只能通过域名访问面板</b></span>
|
||||
</p>
|
||||
|
||||
<!-- <p class="mtb15">
|
||||
<span class="set-tit text-right" title="面板SSL" style="float: left;">面板SSL</span>
|
||||
<input id="cfg_ssl" name="bind_ssl" class="btswitch btswitch-ios" type="checkbox" {{data['ssl']}}>
|
||||
<label class="btswitch-btn ml5" for="cfg_ssl" style="float: left;margin-top:4px;" onclick="getPanelSSL()"></label>
|
||||
<button ype="button" class="btn btn-default btn-xs panel_api_btn" style="vertical-align: middle; margin-left: 10px" onclick="getPanelSSL();">面板SSL配置</button>
|
||||
<span class="set-info c7">为面板设置https协议访问,提升面板访问<b style="color: red;">安全性</b></span>
|
||||
</p> -->
|
||||
|
||||
<p class="mtb15">
|
||||
<span class="set-tit text-right" title="BasicAuth认证" style="float: left;">BasicAuth认证</span>
|
||||
<input class="btswitch btswitch-ios" id="cfg_basic_auth" type="checkbox" {{data['basic_auth']}}/>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<li id="memuAcrontab"><a class="menu_day" href="/crontab">计划任务</a></li>
|
||||
<li id="memuAsoft"><a class="menu_soft" href="/soft">软件管理</a><span class="softnum">1</span></li>
|
||||
<li id="memuAconfig"><a class="menu_set" href="/config">面板设置</a></li>
|
||||
<li><a class="menu_exit" href="javascript:;" id="dologin">退出</a></li>
|
||||
<li><a class="menu_exit" href="javascript:;" id="signout">退出</a></li>
|
||||
</ul>
|
||||
<div id="newbtpc"></div>
|
||||
<div class="btpc-plus" onclick="bindPanel(0,'b')">+</div>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<button onclick="siteDefaultPage();" class="btn btn-default btn-sm btn-title" type="button">修改默认页</button>
|
||||
<button onclick="getDefaultSite();" class="btn btn-default btn-sm btn-title" type="button">默认站点</button>
|
||||
<button onclick="setClassType();" class="btn btn-default btn-sm btn-title" type="button">分类管理</button>
|
||||
<button onclick="setPHPVer();" class="btn btn-default btn-sm btn-title" type="button">PHP命令行版本</button>
|
||||
<span>
|
||||
<button batch="true" style="float: right; margin-left: 10px;display: none;" onclick="allDeleteSite();" class="btn btn-default btn-sm">删除选中</button>
|
||||
</span>
|
||||
|
||||
+7
-1
@@ -38,4 +38,10 @@ else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
echo "$OSNAME" > /www/server/mdserver-web/data/osname.pl
|
||||
if [ -d /www/server/mdserver-web ];then
|
||||
echo "$OSNAME" > /www/server/mdserver-web/data/osname.pl
|
||||
fi
|
||||
|
||||
if [ "$OSNAME" == "macos" ];then
|
||||
echo "$OSNAME"
|
||||
fi
|
||||
@@ -110,16 +110,18 @@ yum install -y ImageMagick ImageMagick-devel
|
||||
|
||||
yum install -y libzstd-devel
|
||||
yum install -y libevent libevent-devel unzip zip
|
||||
yum install -y python-imaging libicu-devel bzip2-devel pcre pcre-devel
|
||||
# yum install -y python-imaging
|
||||
yum install -y libicu-devel bzip2-devel pcre pcre-devel
|
||||
|
||||
yum install -y gd gd-devel
|
||||
yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel
|
||||
|
||||
yum install -y net-tools
|
||||
yum install -y ncurses-devel
|
||||
yum install -y libXpm-devel
|
||||
|
||||
|
||||
for yumPack in flex file libtool libtool-libs kernel-devel patch wget glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel libcap diffutils ca-certificates net-tools psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper expat-devel readline-devel;
|
||||
for yumPack in flex file libtool libtool-libs kernel-devel patch wget glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel libcap diffutils ca-certificates net-tools psmisc git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper expat-devel readline-devel;
|
||||
do yum -y install $yumPack;done
|
||||
|
||||
|
||||
@@ -136,6 +138,7 @@ if [ "$VERSION_ID" -eq "9" ];then
|
||||
dnf --enablerepo=crb install -y mysql-devel
|
||||
|
||||
dnf --enablerepo=crb install -y libvpx-devel libXpm-devel libwebp libwebp-devel
|
||||
dnf --enablerepo=crb install -y libjpeg-devel libpng-devel
|
||||
dnf --enablerepo=crb install -y oniguruma oniguruma-devel
|
||||
dnf --enablerepo=crb install -y libzip libzip-devel
|
||||
# yum remove -y chardet
|
||||
|
||||
+6
-3
@@ -47,11 +47,14 @@ else
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
|
||||
#面板需要的库
|
||||
if [ ! -f /usr/local/bin/pip3 ];then
|
||||
# python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
||||
python3 -m pip install --upgrade pip setuptools wheel -i https://pypi.python.org/pypi
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ];then
|
||||
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
||||
else
|
||||
python3 -m pip install --upgrade pip setuptools wheel -i https://pypi.python.org/pypi
|
||||
fi
|
||||
fi
|
||||
|
||||
which pip && pip install --upgrade pip
|
||||
|
||||
Reference in New Issue
Block a user