Merge branch 'testing' into envvar

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

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*~
*.sw[op]

View file

@ -53,21 +53,21 @@
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"choices": ["Yes", "No"],
"default": "Yes"
"default": true
},
{
"name": "my_boolean",
"type": "boolean",
"name": "language",
"ask": {
"en": "Do you want to check this boolean ?",
"fr": "Tu veux cocher ce booléen ?"
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"default": true
"choices": ["fr", "en"],
"default": "fr"
}
]
}

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