mirror of
https://github.com/YunoHost-Apps/fider_ynh.git
synced 2024-09-03 18:36:11 +02:00
[enh] Use boolean for is_public and add a language choice argument
This commit is contained in:
parent
f34527ba01
commit
e4befaebe5
3 changed files with 13 additions and 10 deletions
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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 "/"
|
||||
|
|
|
@ -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 "/"
|
||||
|
|
Loading…
Reference in a new issue