Make the legacy app installable as private

This commit is contained in:
Alexandre Aubin 2019-10-09 23:59:08 +02:00
parent 4a46e66320
commit 14b48e90f2
2 changed files with 10 additions and 1 deletions

View file

@ -30,6 +30,14 @@
},
"example": "/legacy",
"default": "/legacy"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?"
},
"default": true
}
]
}

View file

@ -5,6 +5,7 @@ app=$YNH_APP_INSTANCE_NAME
number=$YNH_APP_INSTANCE_NUMBER
domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
# Check domain/path availability
sudo yunohost app checkurl $domain/$path -a $app
@ -34,7 +35,7 @@ sudo yunohost app setting $app mysqlpwd -v $db_pwd
sudo cp ../sources/importantfile /etc/
# Set the app as public
sudo yunohost app setting $app unprotected_uris -v "/"
[ $is_public -eq 0 ] || sudo yunohost app setting $app unprotected_uris -v "/"
# Reload Nginx and regenerate SSOwat conf
sudo service nginx reload