diff --git a/manifest.json b/manifest.json index 5b08d9c..347fbd8 100644 --- a/manifest.json +++ b/manifest.json @@ -50,21 +50,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", - "ask": { - "en": "Do you want to check this boolean ?", - "fr": "Tu veux cocher ce booléen ?" + "name": "language", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" }, - "default": true + "choices": ["fr", "en"], + "default": "fr" } ] } diff --git a/scripts/install b/scripts/install index 3af9c08..1b92cf1 100755 --- a/scripts/install +++ b/scripts/install @@ -11,10 +11,12 @@ domain=$1 path=$2 admin=$3 is_public=$4 +language=$5 # 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 \ @@ -56,7 +58,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 "/" diff --git a/scripts/upgrade b/scripts/upgrade index e285496..62b7716 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 "/"