1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/friendica_ynh.git synced 2024-09-03 18:36:14 +02:00

some cleanup

This commit is contained in:
OniriCorpe 2024-02-11 21:27:41 +01:00
parent a579c20bfe
commit 87ca90e94d
4 changed files with 19 additions and 19 deletions

View file

@ -15,9 +15,9 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_print_info --message="Declaring files to be backed up..." ynh_print_info --message="Declaring files to be backed up..."
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console.php maintenance 1) (cd "$install_dir" && ynh_exec_as "$app" "php$phpversion" bin/console.php maintenance 1)
trap "(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console.php maintenance 0)" EXIT trap '(cd $install_dir && ynh_exec_as $app php$phpversion bin/console.php maintenance 0)' EXIT
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR

View file

@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
email=$(ynh_user_get_info --username=$admin --key=mail) email=$(ynh_user_get_info --username="$admin" --key=mail)
timezone=$(cat /etc/timezone) timezone=$(cat /etc/timezone)
#================================================= #=================================================
@ -21,7 +21,7 @@ timezone=$(cat /etc/timezone)
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=email --value=$email ynh_app_setting_set --app="$app" --key=email --value="$email"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -36,7 +36,7 @@ mkdir -p "$install_dir/view/smarty3"
chmod -R 775 "$install_dir/view/smarty3" chmod -R 775 "$install_dir/view/smarty3"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
@ -49,7 +49,7 @@ ynh_add_fpm_config
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app" chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app"
@ -65,7 +65,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
ynh_script_progression --message="Adding the LDAP Auth addon configuration file..." --weight=1 ynh_script_progression --message="Adding the LDAP Auth addon configuration file..." --weight=1
# LDAP addon config # LDAP addon config
ynh_add_config --template="../conf/addon.config.php" --destination="$install_dir/config/addon.config.php" ynh_add_config --template="addon.config.php" --destination="$install_dir/config/addon.config.php"
#================================================= #=================================================
# INSTALL FRIENDICA # INSTALL FRIENDICA
@ -74,15 +74,15 @@ ynh_script_progression --message="Install Friendica..." --weight=1
pushd "$install_dir" pushd "$install_dir"
# Import Composer dependencies # Import Composer dependencies
ynh_exec_as "$app" php$phpversion bin/composer.phar install --no-dev --quiet ynh_exec_as "$app" "php$phpversion" bin/composer.phar install --no-dev --quiet
# Install application # Install application
ynh_exec_as "$app" php$phpversion bin/console.php autoinstall\ ynh_exec_as "$app" "php$phpversion" bin/console.php autoinstall\
--dbhost "localhost" --dbdata "$db_name" --dbuser "$db_user" --dbpass "$db_pwd"\ --dbhost "localhost" --dbdata "$db_name" --dbuser "$db_user" --dbpass "$db_pwd"\
--admin "$email" --tz "$timezone" --lang "$language" --url "https://$domain$path" --admin "$email" --tz "$timezone" --lang "$language" --url "https://$domain$path"
# Enable LDAP Auth addon # Enable LDAP Auth addon
ynh_exec_as "$app" php$phpversion bin/console.php addon enable ldapauth ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth
popd popd

View file

@ -17,7 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
chmod -R 775 "$install_dir/view/smarty3" chmod -R 775 "$install_dir/view/smarty3"
#================================================= #=================================================
@ -25,7 +25,7 @@ chmod -R 775 "$install_dir/view/smarty3"
#================================================= #=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=1 ynh_script_progression --message="Restoring the MySQL database..." --weight=1
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
@ -53,7 +53,7 @@ ynh_restore_file --origin_path="/etc/cron.d/$app"
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -62,7 +62,7 @@ ynh_systemd_action --service_name=nginx --action=reload
#============== #==============
# exit maintenance mode since the app was backed up while in maintenance mode # exit maintenance mode since the app was backed up while in maintenance mode
(cd $install_dir && ynh_exec_as "$app" php$phpversion bin/console.php maintenance 0) (cd "$install_dir" && ynh_exec_as "$app" "php$phpversion" bin/console.php maintenance 0)
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -20,7 +20,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -36,7 +36,7 @@ then
fi fi
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
@ -51,7 +51,7 @@ ynh_add_fpm_config
ynh_use_logrotate --non-append ynh_use_logrotate --non-append
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" ynh_add_config --template="cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app" chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app"
@ -64,8 +64,8 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
# Run Composer # Run Composer
pushd "$install_dir" pushd "$install_dir"
ynh_exec_as "$app" php$phpversion bin/composer.phar install --no-dev --quiet ynh_exec_as "$app" "php$phpversion" bin/composer.phar install --no-dev --quiet
ynh_exec_as "$app" php$phpversion bin/console.php dbstructure update ynh_exec_as "$app" "php$phpversion" bin/console.php dbstructure update
popd popd
#================================================= #=================================================