Merge branch 'testing' into envvar

This commit is contained in:
Jérôme Lebleu
2016-04-26 16:13:03 +02:00
7 changed files with 26 additions and 22 deletions

View File

@@ -5,10 +5,9 @@ set -e
app=$YNH_APP_INSTANCE_NAME
# The parameter $1 is the backup directory location
# which will be compressed afterward
backup_dir=$1/apps/$app
sudo mkdir -p $backup_dir
# The first argument is the backup directory location for the app
# from where the script is executed and which will be compressed afterward
backup_dir=$1
# Backup sources & data
sudo cp -a /var/www/$app/. $backup_dir/sources

View File

@@ -20,10 +20,12 @@ domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
# Save app settings
sudo yunohost app setting $app admin -v "$admin"
sudo yunohost app setting $app is_public -v "$is_public"
sudo yunohost app setting $app language -v "$language"
# Check domain/path availability
sudo yunohost app checkurl $domain$path -a $app \
@@ -65,7 +67,7 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
#sudo chmod 644 $finalphpconf
# If app is public, add url to SSOWat conf as skipped_uris
if [ "$is_public" = "Yes" ];
if [[ $is_public -eq 1 ]];
then
# unprotected_uris allows SSO credentials to be passed anyway.
sudo yunohost app setting $app unprotected_uris -v "/"
@@ -78,4 +80,3 @@ fi
# Restart services
sudo service nginx reload
sudo yunohost app ssowatconf

View File

@@ -1,5 +1,7 @@
#!/bin/bash
app=ynhexample
# The last argument is the app instance name
app=${!#}
# Retrieve arguments
domain=$(sudo yunohost app setting $app domain)
@@ -24,4 +26,3 @@ sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
# Restart services
sudo service nginx reload
sudo yunohost app ssowatconf

View File

@@ -5,11 +5,13 @@ set -e
app=$YNH_APP_INSTANCE_NAME
# The parameter $1 is the uncompressed restore directory location
backup_dir=$1/apps/$app
# The first argument is the backup directory location of the app
# from where the script is executed
backup_dir=$1
# Restore sources & data
sudo cp -a $backup_dir/sources/. /var/www/$app
final_path=/var/www/$app
sudo cp -a $backup_dir/sources/. $final_path
# Restore permissions to app files
# you may need to make some file and/or directory writeable by www-data (nginx user)

View File

@@ -11,6 +11,7 @@ domain=$(sudo yunohost app setting $app domain)
path=$(sudo yunohost app setting $app path)
admin=$(sudo yunohost app setting $app admin)
is_public=$(sudo yunohost app setting $app is_public)
language=$(sudo yunohost app setting $app language)
# Remove trailing "/" for next commands
path=${path%/}
@@ -43,7 +44,7 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
#sudo chmod 644 $finalphpconf
# If app is public, add url to SSOWat conf as skipped_uris
if [ "$is_public" = "Yes" ];
if [[ $is_public -eq 1 ]];
then
# See install script
sudo yunohost app setting $app unprotected_uris -v "/"
@@ -57,5 +58,3 @@ fi
# Restart services
sudo service nginx reload
sudo yunohost app ssowatconf