add possibility to install zotero without SSL

add CACert root certificate when needed

add option to either generate or use custom SSL certificates

patch AWS-SDK to use custom S3 servers
master
Patrick Höhn 2015-03-14 14:17:23 +01:00
parent 6b3d67b731
commit ba05694f4d
1 changed files with 59 additions and 24 deletions

View File

@ -65,13 +65,13 @@ echo "remove composer"
rm composer.phar rm composer.phar
echo "install add_user script" echo "install add_user script"
cp /root/add_user /srv/zotero/dataserver/admin cp $cur_dir/add_user /srv/zotero/dataserver/admin
echo "install change_password script" echo "install change_password script"
cp /root/change_password /srv/zotero/dataserver/admin cp $cur_dir/change_password /srv/zotero/dataserver/admin
echo "patch master.sql" echo "patch master.sql"
cp /root/master.sql /srv/zotero/dataserver/misc cp $cur_dir/master.sql /srv/zotero/dataserver/misc
echo "prepare directory rights" echo "prepare directory rights"
chown www-data:www-data /srv/zotero/dataserver/tmp chown www-data:www-data /srv/zotero/dataserver/tmp
@ -81,34 +81,69 @@ cd /srv/zotero/dataserver/include
rm -r Zend rm -r Zend
ln -s /usr/share/php/Zend/ ln -s /usr/share/php/Zend/
echo "generate SSL key and cert" read -p "Do you want to use SSL certificates for Zotero server? (y/n)" SSL
certtool -p --sec-param high --outfile /etc/apache2/zotero.key if [[ $SSL = y ]] ;
certtool -s --load-privkey /etc/apache2/zotero.key --outfile /etc/apache2/zotero.cert then
read -p "Do you want to generate SSL certificates now? (y/n)" gen_SSL
if [[ $gen_SSL = y ]];
then
echo "generate SSL key and cert"
certtool -p --sec-param high --outfile /etc/apache2/zotero.key
certtool -s --load-privkey /etc/apache2/zotero.key --outfile /etc/apache2/zotero.cert
else
cp $cur_dir/zotero.key /etc/apache2/zotero.key
cp $cur_dir/zotero.cert /etc/apache2/zotero.cert
fi
fi
echo "enable ssl support for apache2 server" read -p "Do you want to use SSL certificates for LibreS3? (y/n)" SSL_LibreS3
a2enmod ssl if [[ $SSL_LibreS3 = y ]] ;
then
cat $cur_dir/sx.cert >> /srv/zotero/dataserver/vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem
fi
echo "enable rewrite support for apache2 server" echo "enable rewrite support for apache2 server"
a2enmod rewrite a2enmod rewrite
echo "create available site for zotero" if [[ $SSL = y ]] ;
echo "<VirtualHost *:443> then
DocumentRoot /srv/zotero/dataserver/htdocs echo "enable ssl support for apache2 server"
SSLEngine on a2enmod ssl
SSLCertificateFile /etc/apache2/zotero.cert
SSLCertificateKeyFile /etc/apache2/zotero.key
<Directory "/srv/zotero/dataserver/htdocs/"> echo "create available site for zotero"
Options FollowSymLinks MultiViews echo "<VirtualHost *:443>
AllowOverride All DocumentRoot /srv/zotero/dataserver/htdocs
Order allow,deny SSLEngine on
Allow from all SSLCertificateFile /etc/apache2/zotero.cert
</Directory> SSLCertificateKeyFile /etc/apache2/zotero.key
ErrorLog /srv/zotero/error.log <Directory "/srv/zotero/dataserver/htdocs/">
CustomLog /srv/zotero/access.log common Options FollowSymLinks MultiViews
</VirtualHost>" > /etc/apache2/sites-available/zotero AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog /srv/zotero/error.log
CustomLog /srv/zotero/access.log common
</VirtualHost>" > /etc/apache2/sites-available/zotero
else
echo "create available site for zotero"
echo "<VirtualHost *:80>
DocumentRoot /srv/zotero/dataserver/htdocs
<Directory "/srv/zotero/dataserver/htdocs/">
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog /srv/zotero/error.log
CustomLog /srv/zotero/access.log common
</VirtualHost>" > /etc/apache2/sites-available/zotero
fi
echo "activate site for zotero" echo "activate site for zotero"
a2ensite zotero a2ensite zotero
@ -265,7 +300,7 @@ echo "#####################################"
echo "patch AWS-SDK to use custom S3 server" echo "patch AWS-SDK to use custom S3 server"
echo "#####################################" echo "#####################################"
sed -i "s,{service}.{region}.amazonaws.com,s3.drossenhausen.de.vu" /srv/zotero/dataserver/vendor/ sed -i "s,{service}.{region}.amazonaws.com,s3.drossenhausen.de.vu" /srv/zotero/dataserver/vendor/aws/aws-sdk-php/src/Aws/Common/Resources/public-endpoints.php
echo "###############" echo "###############"
echo "Configure runit" echo "Configure runit"