2014-08-07 02:57:24 +02:00
|
|
|
# Retrieve arguments
|
|
|
|
domain=$1
|
|
|
|
path=$2
|
2014-08-07 04:42:27 +02:00
|
|
|
final_path=/var/www/seafile
|
|
|
|
seafile_version=3.1.1
|
2014-08-07 02:57:24 +02:00
|
|
|
|
|
|
|
# Check domain/path availability
|
|
|
|
sudo yunohost app checkurl $domain$path -a seafile
|
|
|
|
if [[ ! $? -eq 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check dependencies
|
2014-08-07 05:12:54 +02:00
|
|
|
sudo apt-get install -y python2.7 python-setuptools python-simplejson python-imaging python-mysqldb
|
2014-08-07 02:57:24 +02:00
|
|
|
|
|
|
|
# Copy files to the right place
|
|
|
|
sudo mkdir -p $final_path
|
2014-08-07 05:12:54 +02:00
|
|
|
sudo mkdir -p $final_path/installed
|
|
|
|
sudo mkdir -p $final_path/seafile-data
|
|
|
|
sudo mkdir -p $final_path/seafile-server-$seafile_version
|
|
|
|
sudo tar xvzf ../sources/'seafile-server_'$seafile_version'_x86-64.tar'
|
|
|
|
sudo mv ../sources/seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version
|
|
|
|
sudo mv ../sources/'seafile-server_'$seafile_version'_x86-64.tar' $final_path/installed
|
2014-08-07 04:42:27 +02:00
|
|
|
|
|
|
|
# Set permissions to seafile directory
|
2014-08-07 05:12:54 +02:00
|
|
|
sudo chown -R www-data: $final_path
|
|
|
|
|
|
|
|
# Run install script
|
|
|
|
|
|
|
|
|
|
|
|
# Start Seafile Server
|
2014-08-07 04:42:27 +02:00
|
|
|
|
2014-08-07 02:57:24 +02:00
|
|
|
|
2014-08-07 04:42:27 +02:00
|
|
|
# Add Seafile Server to startup
|
|
|
|
# TODO
|
2014-08-07 02:57:24 +02:00
|
|
|
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
|
|
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
|
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/seafile.conf
|
|
|
|
|
|
|
|
|
|
|
|
# Reload Nginx and regenerate SSOwat conf
|
|
|
|
sudo service nginx reload
|
|
|
|
sudo yunohost app ssowatconf
|