update
This commit is contained in:
parent
f76baf00f3
commit
6b9ca595d2
|
|
@ -90,7 +90,7 @@ def getHomeDir():
|
|||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return '/Users/' + user
|
||||
else:
|
||||
return '/home/gogs'
|
||||
return '/root'
|
||||
|
||||
|
||||
def getRunUser():
|
||||
|
|
@ -99,7 +99,7 @@ def getRunUser():
|
|||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return user
|
||||
else:
|
||||
return 'gogs'
|
||||
return 'root'
|
||||
|
||||
__SR = '''#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
|
|
@ -603,6 +603,17 @@ def gogsEdit():
|
|||
return public.getJson(data)
|
||||
|
||||
|
||||
def getRsaPublic():
|
||||
path = getHomeDir()
|
||||
path += '/.ssh/id_rsa.pub'
|
||||
|
||||
content = public.readFile(path)
|
||||
|
||||
data = {}
|
||||
data['public'] = content
|
||||
return public.getJson(data)
|
||||
|
||||
|
||||
def getTotalStatistics():
|
||||
st = status()
|
||||
data = {}
|
||||
|
|
@ -620,6 +631,7 @@ def getTotalStatistics():
|
|||
data['count'] = 0
|
||||
return public.returnJson(False, 'fail', data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
|
|
@ -664,6 +676,8 @@ if __name__ == "__main__":
|
|||
print projectScriptDebug()
|
||||
elif func == 'gogs_edit':
|
||||
print gogsEdit()
|
||||
elif func == 'get_rsa_public':
|
||||
print getRsaPublic()
|
||||
elif func == 'get_total_statistics':
|
||||
print getTotalStatistics()
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -312,12 +312,34 @@ function projectScriptDebug(user,name){
|
|||
});
|
||||
}
|
||||
|
||||
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: 230px;" class="bt-input-text">'+rdata.public+'</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);
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ if [ -f $serverPath/php/53/bin/php ];then
|
|||
return
|
||||
fi
|
||||
|
||||
#echo 'going?'
|
||||
|
||||
#
|
||||
# --without-iconv=$serverPath/lib/libiconv \
|
||||
cd $sourcePath/php/php-5.3.29 && ./configure \
|
||||
--prefix=$serverPath/php/53 \
|
||||
--exec-prefix=$serverPath/php/53 \
|
||||
|
|
@ -55,6 +55,7 @@ cd $sourcePath/php/php-5.3.29 && ./configure \
|
|||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-mysqlnd \
|
||||
--without-iconv \
|
||||
--with-gd=$serverPath/lib/libgd \
|
||||
--enable-zip \
|
||||
--enable-sockets \
|
||||
--enable-mbstring \
|
||||
|
|
@ -63,7 +64,6 @@ cd $sourcePath/php/php-5.3.29 && ./configure \
|
|||
--enable-sysvmsg \
|
||||
--enable-intl \
|
||||
--enable-exif \
|
||||
--witd-gd \
|
||||
--enable-ftp \
|
||||
--enable-wddx \
|
||||
--enable-soap \
|
||||
|
|
|
|||
|
|
@ -44,10 +44,43 @@ echo -e "Install_Libmemcached" >> ${libPath}/lib.pl
|
|||
#----------------------------- libmemcached end -------------------------#
|
||||
}
|
||||
|
||||
|
||||
Install_Jpegsrc(){
|
||||
#----------------------------- Jpegsrc start -------------------------#
|
||||
if [ ! -d ${libPath}/jpegsrc ];then
|
||||
cd ${sourcePath}
|
||||
if [ ! -f ${sourcePath}/jpegsrc.v9c.tar.gz ];then
|
||||
wget -O jpegsrc.v9c.tar.gz http://www.ijg.org/files/jpegsrc.v9c.tar.gz -T 20
|
||||
fi
|
||||
tar -zxf jpegsrc.v9c.tar.gz
|
||||
cd jpeg-9c
|
||||
./configure --prefix=${libPath}/jpegsrc && make && make install
|
||||
fi
|
||||
echo -e "Install_Jpegsrc" >> ${libPath}/lib.pl
|
||||
#----------------------------- Jpegsrc end -------------------------#
|
||||
}
|
||||
|
||||
|
||||
Install_GD(){
|
||||
#----------------------------- Jpegsrc start -------------------------#
|
||||
if [ ! -d ${libPath}/libgd ];then
|
||||
cd ${sourcePath}
|
||||
if [ ! -f ${sourcePath}/libgd-2.2.5.tar.gz ];then
|
||||
wget -O libgd-2.2.5.tar.gz https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz -T 20
|
||||
fi
|
||||
tar -zxf libgd-2.2.5.tar.gz
|
||||
cd libgd-2.2.5
|
||||
./configure --prefix=${libPath}/libgd && make && make install
|
||||
fi
|
||||
echo -e "Install_GD" >> ${libPath}/lib.pl
|
||||
#----------------------------- Jpegsrc end -------------------------#
|
||||
}
|
||||
|
||||
Install_Libiconv()
|
||||
{
|
||||
#----------------------------- libiconv end -------------------------#
|
||||
cd ${sourcePath}
|
||||
if [ ! -f ${libPath}/libiconv ];then
|
||||
if [ ! -d ${libPath}/libiconv ];then
|
||||
wget -O libiconv-1.15.tar.gz https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz -T 5
|
||||
tar zxf libiconv-1.15.tar.gz
|
||||
cd libiconv-1.15
|
||||
|
|
@ -58,6 +91,7 @@ Install_Libiconv()
|
|||
rm -f libiconv-1.15.tar.gz
|
||||
fi
|
||||
echo -e "Install_Libiconv" >> ${libPath}/lib.pl
|
||||
#----------------------------- libiconv end -------------------------#
|
||||
}
|
||||
|
||||
Install_Libmcrypt()
|
||||
|
|
@ -135,28 +169,15 @@ Install_Mhash()
|
|||
|
||||
Install_Freetype()
|
||||
{
|
||||
if [ -d /usr/local/freetype ];then
|
||||
return;
|
||||
cd ${sourcePath}
|
||||
if [ ! -d ${libPath}/freetype ];then
|
||||
wget -O freetype-2.4.12.tar.gz https://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz -T 5
|
||||
tar zxf freetype-2.4.12.tar.gz
|
||||
cd freetype-2.4.12
|
||||
./configure --prefix=${libPath}/freetype
|
||||
make && make install
|
||||
fi
|
||||
cd ${run_path}
|
||||
if [ ! -f "freetype-2.4.12.tar.gz" ];then
|
||||
wget -O freetype-2.4.12.tar.gz ${download_Url}/src/freetype-2.4.12.tar.gz -T 5
|
||||
fi
|
||||
tar zxf freetype-2.4.12.tar.gz
|
||||
cd freetype-2.4.12
|
||||
./configure --prefix=/usr/local/freetype
|
||||
make && make install
|
||||
|
||||
cat > /etc/ld.so.conf.d/freetype.conf<<EOF
|
||||
/usr/local/freetype/lib
|
||||
EOF
|
||||
ldconfig
|
||||
ln -sf /usr/local/freetype/include/freetype2 /usr/local/include
|
||||
ln -sf /usr/local/freetype/include/ft2build.h /usr/local/include
|
||||
cd ${run_path}
|
||||
rm -rf freetype-2.4.12
|
||||
rm -f freetype-2.4.12.tar.gz
|
||||
echo -e "Install_Freetype" >> /www/server/lib.pl
|
||||
echo -e "Install_Freetype" >> ${libPath}/lib.pl
|
||||
}
|
||||
|
||||
Install_Pcre()
|
||||
|
|
@ -224,4 +245,9 @@ Install_OpenSSL
|
|||
# Install_Mhash
|
||||
# Install_Libmcrypt
|
||||
# Install_Mcrypt
|
||||
Install_Libiconv
|
||||
Install_Libiconv
|
||||
Install_Jpegsrc
|
||||
Install_Freetype
|
||||
Install_GD
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue