mirror of
https://github.com/YunoHost-Apps/dotclear2_ynh.git
synced 2024-09-03 18:26:29 +02:00
Fix if root domain
This commit is contained in:
parent
a78f9eee63
commit
169909fe2e
2 changed files with 16 additions and 16 deletions
|
@ -42,7 +42,7 @@
|
||||||
"name": "password",
|
"name": "password",
|
||||||
"type": "password",
|
"type": "password",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a dotclear password for this user, at least 6 characters"
|
"en": "Choose a dotclear password for this user"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup() {
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
### Remove this function if there's nothing to clean before calling the remove script.
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
password=$YNH_APP_ARG_PASSWORD
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -98,11 +97,11 @@ ynh_add_fpm_config
|
||||||
|
|
||||||
php_config=$final_path/inc/config.php
|
php_config=$final_path/inc/config.php
|
||||||
|
|
||||||
master_key=`dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p'`
|
master_key=$(dd if=/dev/urandom bs=1 count=200 2>/dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||||
firstname=`sudo yunohost user info $admin | grep firstname: | cut -d' ' -f2 | tr -d '\n'`
|
firstname=$(sudo yunohost user info $admin | grep firstname: | cut -d' ' -f2 | tr -d '\n')
|
||||||
lastname=`sudo yunohost user info $admin | grep lastname: | cut -d' ' -f2 | tr -d '\n'`
|
lastname=$(sudo yunohost user info $admin | grep lastname: | cut -d' ' -f2 | tr -d '\n')
|
||||||
email=`sudo yunohost user info $admin | grep mail: | cut -d' ' -f2 | tr -d '\n'`
|
email=$(sudo yunohost user info $admin | grep mail: | cut -d' ' -f2 | tr -d '\n')
|
||||||
timezone=`cat /etc/timezone | tr -d '\n'`
|
timezone=$(cat /etc/timezone | tr -d '\n')
|
||||||
|
|
||||||
sudo cp $php_config.in $php_config
|
sudo cp $php_config.in $php_config
|
||||||
|
|
||||||
|
@ -127,21 +126,22 @@ yunohost app ssowatconf
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
# Installation with curl
|
# Installation with curl
|
||||||
ynh_local_curl "/admin/install/index.php" "u_email=$email" "u_firstname=$firstname" "u_name=$lastname" "u_login=$admin" "u_pwd=$password" "u_pwd2=$password"
|
installUrl="/admin/install/index.php"
|
||||||
|
|
||||||
# Remove the public access
|
if [ "$path_url" = "/" ]; then
|
||||||
if [ $is_public -eq 0 ]
|
installUrl="admin/install/index.php" # Fix if app is in the root domain
|
||||||
then
|
|
||||||
ynh_app_setting_delete $app skipped_uris
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ynh_local_curl $installUrl "u_email=$email" "u_firstname=$firstname" "u_name=$lastname" "u_login=$admin" "u_pwd=$password" "u_pwd2=$password"
|
||||||
|
|
||||||
|
ynh_app_setting_delete $app skipped_uris
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]; then
|
||||||
then
|
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
# unprotected_uris allows SSO credentials to be passed anyway.
|
||||||
ynh_app_setting_set $app unprotected_uris "/"
|
ynh_app_setting_set $app unprotected_uris "/"
|
||||||
fi
|
fi
|
||||||
|
@ -150,4 +150,4 @@ fi
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
Loading…
Add table
Reference in a new issue