1
0
Fork 0
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:
Kayou 2019-01-29 02:10:27 +01:00
parent a78f9eee63
commit 169909fe2e
No known key found for this signature in database
GPG key ID: 823A2CBE071D3126
2 changed files with 16 additions and 16 deletions

View file

@ -42,7 +42,7 @@
"name": "password",
"type": "password",
"ask": {
"en": "Choose a dotclear password for this user, at least 6 characters"
"en": "Choose a dotclear password for this user"
}
},
{

View file

@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_setup() {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
@ -31,7 +31,6 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD
#=================================================
# 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
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'`
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'`
timezone=`cat /etc/timezone | tr -d '\n'`
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')
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')
timezone=$(cat /etc/timezone | tr -d '\n')
sudo cp $php_config.in $php_config
@ -127,21 +126,22 @@ yunohost app ssowatconf
systemctl reload nginx
# 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 [ $is_public -eq 0 ]
then
ynh_app_setting_delete $app skipped_uris
if [ "$path_url" = "/" ]; then
installUrl="admin/install/index.php" # Fix if app is in the root domain
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
#=================================================
# Make app public if necessary
if [ $is_public -eq 1 ]
then
if [ $is_public -eq 1 ]; then
# unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set $app unprotected_uris "/"
fi
@ -150,4 +150,4 @@ fi
# RELOAD NGINX
#=================================================
systemctl reload nginx
systemctl reload nginx