From 6b9ca595d29da9dc14a2fc4394f66724bc5ab1fd Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 12 Mar 2019 13:11:00 +0800 Subject: [PATCH] update --- plugins/gogs/index.py | 18 +++++++- plugins/gogs/js/gogs.js | 22 +++++++++ plugins/php/versions/53/install.sh | 6 +-- scripts/lib.sh | 72 ++++++++++++++++++++---------- 4 files changed, 90 insertions(+), 28 deletions(-) diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index b050e2665..55b3368fa 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -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: diff --git a/plugins/gogs/js/gogs.js b/plugins/gogs/js/gogs.js index 5e4e2ee93..b5123bac2 100755 --- a/plugins/gogs/js/gogs.js +++ b/plugins/gogs/js/gogs.js @@ -312,12 +312,34 @@ function projectScriptDebug(user,name){ }); } +function getRsaPublic(){ + gogsPost('get_rsa_public', {}, function(data){ + var rdata = $.parseJSON(data.data); + var con = '
\ +
\ + \ +
\ + \ +
' + layer.open({ + type: 1, + area: "600px", + title: '本机公钥', + closeBtn: 2, + shift: 5, + shadeClose: false, + content:con + }); + }); +} + function gogsRead(){ var readme = ''; $('.soft-man-con').html(readme); diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index 56bb4d749..c2750a308 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -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 \ diff --git a/scripts/lib.sh b/scripts/lib.sh index 5d995c445..abe239dca 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -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; - 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 + 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 - 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<> /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 \ No newline at end of file +Install_Libiconv +Install_Jpegsrc +Install_Freetype +Install_GD + +