diff --git a/scripts/install b/scripts/install index 21b482f..d1fff37 100755 --- a/scripts/install +++ b/scripts/install @@ -61,6 +61,14 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=2 + +# Create a system user +ynh_system_user_create --username=$app + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -88,14 +96,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config "public_path" -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=2 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -110,9 +110,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Installing Lychee with Composer..." --weight=15 -# Install composer -#ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_args="--no-dev" - ynh_install_composer --install_args="--ignore-platform-reqs" #================================================= @@ -134,13 +131,6 @@ popd # Setup custom user.css file cp ../conf/user.css.example $final_path/public/dist/user.css -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum "$final_path/.env" - #================================================= # SECURE FILES AND DIRECTORIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4df8ffb..05b0392 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,6 +95,9 @@ then # Backup the config file in the temp dir cp -a "$final_path/public/dist/user.css" "$tmpdir/user.css" + # Move media to new path + cp -a "$final_path/public/uploads/*" "$public_path/uploads/" + # Remove the app directory securely ynh_secure_remove --file="$final_path"