1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00

Update, cleanup

This commit is contained in:
Salamandar 2024-03-25 23:56:10 +01:00
parent 133de8d19d
commit 386490336a

View file

@ -28,6 +28,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --source_id="main" --dest_dir="$install_dir"
chmod 750 "$install_dir"
#=================================================
# PREPARE AND INSTALL APP
#=================================================
@ -52,8 +54,7 @@ ynh_use_logrotate --logfile="$install_dir/documents/dolibarr.log"
#=================================================
# SETUP APPLICATION WITH CURL
#=================================================
# Installation with curl
ynh_script_progression --message="Configuring $app..." --weight=1
ynh_script_progression --message="Configuring $app ..." --weight=1
# Create necessary files
touch "$install_dir/htdocs/conf/conf.php"
@ -61,25 +62,20 @@ touch "$install_dir/htdocs/conf/conf.php"
# Set right permissions for curl install
chown -R "$app:" "$install_dir"
ynh_script_progression --message="Generate fileconf" --weight=1
ynh_local_curl "/install/fileconf.php" "testpost=ok"
ynh_exec_fully_quiet sleep 5
ynh_script_progression --message="installation - step 1" --weight=3
ynh_local_curl "/install/step1.php" "testpost=ok" "action=set"
ynh_exec_fully_quiet sleep 5
ynh_script_progression --message="installation - step 2 (may take a while)..." --weight=72
ynh_local_curl "/install/step2.php" "testpost=ok" "action=set"
ynh_exec_fully_quiet sleep 5
ynh_script_progression --message="installation - step 4" --weight=3
ynh_local_curl "/install/step4.php" "testpost=ok" "action=set"
ynh_exec_fully_quiet sleep 5
# Generate a random password for the admin user (will be ignored because of LDAP)
password=$(ynh_string_random 8)
ynh_script_progression --message="installation - step 5" --weight=4
ynh_local_curl "/install/step5.php" "testpost=ok" "action=set" "pass=$password" "pass_verif=$password"
ynh_exec_fully_quiet sleep 5
@ -99,6 +95,13 @@ if [ ! -f "$install_dir/documents/install.lock" ]; then
chmod 440 "$install_dir/documents/install.lock"
fi
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
mkdir -p "$install_dir/documents"
chown -R "$app:" "$install_dir/documents"
chmod go-w "$install_dir/documents"
#=================================================
# SETUP LDAP
#=================================================
@ -116,19 +119,6 @@ else
ynh_print_info --message="LDAP user update ended with error"
fi
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
mkdir -p "$install_dir/documents"
chown -R "$app:" "$install_dir/documents"
chmod go-w "$install_dir/documents"
#=================================================
# END OF SCRIPT
#=================================================