mirror of
https://github.com/YunoHost-Apps/rainloop_ynh.git
synced 2024-09-03 20:16:18 +02:00
Update on main scripts
This commit is contained in:
parent
680a8901f8
commit
04bc67a2c8
5 changed files with 38 additions and 48 deletions
|
@ -31,7 +31,16 @@
|
|||
},
|
||||
"example": "/rainloop",
|
||||
"default": "/rainloop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"ask": {
|
||||
"en": "Is it a public application ?",
|
||||
"fr": "Est-ce une page publique ?"
|
||||
},
|
||||
"choices": ["Yes", "No"],
|
||||
"default": "Yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# The parameter $1 is the backup directory location
|
||||
# which will be compressed afterward
|
||||
backup_dir=$1/apps/rainloop
|
||||
mkdir -p $backup_dir
|
||||
|
||||
sudo cp -a /var/www/rainloop/. $backup_dir/sources
|
||||
sudo cp -a /etc/php5/fpm/pool.d/rainloop.conf $backup_dir/php-fpm.conf
|
||||
|
||||
db_pwd=$(sudo yunohost app setting rainloop mysqlpwd)
|
||||
sudo mysqldump -u rainloop -p"$db_pwd" rainloop > $backup_dir/dump.sql
|
||||
|
||||
# Copy Nginx and YunoHost parameters to make the script "standalone"
|
||||
sudo cp -a /etc/yunohost/apps/rainloop/. $backup_dir/yunohost
|
||||
domain=$(sudo yunohost app setting rainloop domain)
|
||||
sudo cp -a /etc/nginx/conf.d/$domain.d/rainloop.conf $backup_dir/nginx.conf
|
|
@ -1,8 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
app=rainloop
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$1
|
||||
path=$2
|
||||
is_public=$3
|
||||
|
||||
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain$path -a rainloop
|
||||
|
@ -11,20 +16,21 @@ if [[ ! $? -eq 0 ]]; then
|
|||
fi
|
||||
|
||||
# Generate random DES key & password
|
||||
deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||
db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||
#deskey=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||
"db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||
|
||||
# Use 'rainloop' as database name and user
|
||||
db_user=rainloop
|
||||
#db_user=rainloop
|
||||
|
||||
# Initialize database and store mysql password for upgrade
|
||||
sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e ../sources/SQL/mysql.initial.sql)
|
||||
sudo yunohost app setting rainloop mysqlpwd -v $db_pwd
|
||||
#sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e ../sources/SQL/mysql.initial.sql)
|
||||
#sudo yunohost app setting rainloop mysqlpwd -v $db_pwd
|
||||
|
||||
mysql -u $db_user -p$db_pwd $db_user < ../sources/plugins/automatic_addressbook/SQL/mysql.initial.sql
|
||||
#mysql -u $db_user -p$db_pwd $db_user < ../sources/plugins/automatic_addressbook/SQL/mysql.initial.sql
|
||||
|
||||
# Copy files to the right place
|
||||
final_path=/var/www/rainloop
|
||||
final_path=/var/www/$app
|
||||
sudo rm -rf $final_path
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/* $final_path
|
||||
|
||||
|
@ -44,7 +50,15 @@ sudo cp ../conf/php-fpm.conf $finalphpconf
|
|||
sudo chown root: $finalphpconf
|
||||
sudo chmod 644 $finalphpconf
|
||||
|
||||
# Make app public if necessary
|
||||
sudo yunohost app setting my_webapp is_public -v "$is_public"
|
||||
if [ "$is_public" = "Yes" ];
|
||||
then
|
||||
sudo yunohost app setting my_webapp skipped_uris -v "/"
|
||||
fi
|
||||
|
||||
|
||||
# Reload Nginx and regenerate SSOwat conf
|
||||
sudo service php5-fpm restart
|
||||
sudo service php5-fpm reload
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
db_user=rainloop
|
||||
db_name=rainloop
|
||||
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||
#db_user=rainloop
|
||||
#db_name=rainloop
|
||||
#root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||
domain=$(sudo yunohost app setting rainloop domain)
|
||||
|
||||
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
||||
#mysql -u root -p $root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
||||
sudo rm -rf /var/www/rainloop
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/rainloop.conf
|
||||
sudo rm -f /etc/php5/fpm/pool.d/rainloop.conf
|
||||
|
||||
sudo service php5-fpm restart
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# The parameter $1 is the uncompressed restore directory location
|
||||
backup_dir=$1/apps/rainloop
|
||||
|
||||
sudo cp -a $backup_dir/sources/. /var/www/rainloop
|
||||
sudo cp -a $backup_dir/php-fpm.conf /etc/php5/fpm/pool.d/rainloop.conf
|
||||
|
||||
db_pwd=$(sudo yunohost app setting rainloop mysqlpwd)
|
||||
sudo yunohost app initdb rainloop -p "$db_pwd" -s $backup_dir/dump.sql
|
||||
|
||||
# Copy Nginx and YunoHost parameters to make the script "standalone"
|
||||
sudo cp -a $backup_dir/yunohost/. /etc/yunohost/apps/rainloop
|
||||
domain=$(sudo yunohost app setting rainloop domain)
|
||||
sudo cp -a $backup_dir/nginx.conf /etc/nginx/conf.d/$domain.d/rainloop.conf
|
||||
|
||||
sudo service php5-fpm restart
|
||||
sudo service nginx restart
|
Loading…
Add table
Reference in a new issue