|
|
@ -10,7 +10,7 @@ if [[ ! $? -eq 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Generate random passworid
|
|
|
|
# Generate random password
|
|
|
|
db_pwd=$(head -c 8 /dev/urandom | sha1sum | cut -d " " -f1)
|
|
|
|
db_pwd=$(head -c 8 /dev/urandom | sha1sum | cut -d " " -f1)
|
|
|
|
|
|
|
|
|
|
|
|
# Use 'FSyncMS' as database name and user
|
|
|
|
# Use 'FSyncMS' as database name and user
|
|
|
@ -20,6 +20,10 @@ db_user=ffsync
|
|
|
|
sudo yunohost app initdb $db_user -p $db_pwd
|
|
|
|
sudo yunohost app initdb $db_user -p $db_pwd
|
|
|
|
sudo yunohost app setting ffsync mysqlpwd -v $db_pwd
|
|
|
|
sudo yunohost app setting ffsync mysqlpwd -v $db_pwd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Generate random password and save
|
|
|
|
|
|
|
|
secret=$(head -c 20 /dev/urandom | sha1sum | cut -d " " -f1)
|
|
|
|
|
|
|
|
sudo yunohost app setting ffsync secret -v $secret
|
|
|
|
|
|
|
|
|
|
|
|
# Check depends installation
|
|
|
|
# Check depends installation
|
|
|
|
sudo apt-get install make python-dev python-virtualenv -y
|
|
|
|
sudo apt-get install make python-dev python-virtualenv -y
|
|
|
|
|
|
|
|
|
|
|
@ -54,7 +58,6 @@ sudo chown ffsync:ffsync -R $final_path
|
|
|
|
sudo chown ffsync /var/log/ffsync.log
|
|
|
|
sudo chown ffsync /var/log/ffsync.log
|
|
|
|
|
|
|
|
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
|
|
secret=$(head -c 20 /dev/urandom | sha1sum | cut -d " " -f1)
|
|
|
|
|
|
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
|
|
sed -i "s@ALIASTOCHANGE@$final_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/ffsync.conf
|
|
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ffsync.conf
|
|
|
|