mirror of
https://github.com/YunoHost/test_apps.git
synced 2024-09-03 20:06:29 +02:00
34 lines
745 B
Text
34 lines
745 B
Text
set -eux
|
|
|
|
# Source app helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
number=$YNH_APP_INSTANCE_NUMBER
|
|
|
|
# Retrieve arguments
|
|
domain=$YNH_APP_ARG_DOMAIN
|
|
path=$YNH_APP_ARG_PATH
|
|
|
|
# Check domain/path availability
|
|
ynh_webpath_register --app=$app --domain=$domain --path_url=$path
|
|
|
|
if [[ "$path" == "" ]]; then
|
|
sed -i "s@PATHTOCHANGE@/@g" ../conf/nginx.conf
|
|
else
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
fi
|
|
|
|
sed -i "s@FOLDER@$app/@g" ../conf/nginx.conf
|
|
|
|
cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
mkdir -p /var/www/$app
|
|
|
|
cp ../conf/index.html /var/www/$app
|
|
|
|
# Reload Nginx and regenerate SSOwat conf
|
|
service nginx reload
|
|
|
|
yunohost app setting $app unprotected_uris -v "/"
|
|
yunohost app ssowatconf
|