diff --git a/scripts/backup b/scripts/backup index 010f6c5..84a71f7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,11 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fills the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls take basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -39,21 +34,6 @@ ynh_backup --src_path="$data_dir" --is_big ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" - -#================================================= -# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= @@ -66,24 +46,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/etc/cron.d/$app" - -ynh_backup --src_path="/etc/$app/" - -#================================================= -# BACKUP THE MYSQL DATABASE -#================================================= -ynh_print_info --message="Backing up the MySQL database..." - -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) - -ynh_mysql_dump_db --database="$db_name" > db.sql - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index f0964a6..ae914ad 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -25,12 +25,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= - #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/install b/scripts/install index ab37828..804b330 100755 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,8 @@ ynh_use_logrotate --logfile="$log_file" --specific_user=$app #================================================= ynh_script_progression --message="Create and setup Python virtualenv..." --weight=45 -cp ../conf/requirements.txt "$data_dir/requirements.txt" +ynh_add_config --template="requirements.txt" --destination="$data_dir/requirements.txt" + myynh_setup_python_venv #================================================= @@ -84,17 +85,7 @@ ynh_script_progression --message="Configuring NGINX web server..." ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring systemd service '$app'..." --weight=5 - -ynh_add_systemd_config --service=$app --template="systemd.service" - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_add_systemd_config yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index 4cd01e1..75d26e9 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,19 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -# Settings are automatically loaded as bash variables -# in every app script context, therefore typically these will exist: -# - $domain -# - $path -# - $language -# - $install_dir -# - $port -# ... - -# For remove operations : -# - the core will deprovision every resource defined in the manifest **after** this script is ran -# this includes removing the install directory, and data directory (if --purge was used) - #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= @@ -44,10 +31,6 @@ ynh_remove_nginx_config ynh_remove_logrotate -# Remove other various files specific to the app... such as : -# /home/yunohost.app/$app/ -ynh_secure_remove --file="$data_dir" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index e60cb7a..afe4dec 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,9 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -# $install_dir will automatically be initialized with some decent -# permissions by default ... however, you may need to recursively reapply -# ownership to all files such as after the ynh_setup_source step chown -R $app:www-data "$install_dir" #================================================= @@ -32,13 +29,6 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory # (Same as for install dir) chown -R $app:www-data "$data_dir" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -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 - #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= @@ -46,10 +36,6 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 -# This should be a symetric version of what happens in the install script - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" @@ -59,15 +45,6 @@ yunohost service add $app --description="A short description of the app" --log=" ynh_restore_file --origin_path="/etc/logrotate.d/$app" -ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -ynh_systemd_action --action=restart --service_name=fail2ban - -# Other various files... - -ynh_restore_file --origin_path="/etc/cron.d/$app" -ynh_restore_file --origin_path="/etc/$app/" - #================================================= # GENERIC FINALIZATION #================================================= @@ -77,7 +54,6 @@ ynh_script_progression --message="Reloading NGINX web server and $app's service. # Typically you only have either $app or php-fpm but not both at the same time... ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 6dcf901..ce47a5e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,12 +50,12 @@ yunohost service add $app --description="A short description of the app" --log=" #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +#ynh_script_progression --message="Updating a configuration file..." --weight=1 -ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file" +#ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file" -chmod 400 "$install_dir/some_config_file" -chown $app:$app "$install_dir/some_config_file" +#chmod 400 "$install_dir/some_config_file" +#chown $app:$app "$install_dir/some_config_file" #================================================= # START SYSTEMD SERVICE