diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f144f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +*.sw[op] +.DS_Store diff --git a/README.md b/README.md index 0a33a6b..5276360 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ It shall NOT be edited by hand. Minimalist and opinionated RSS feed reader. -**Shipped version:** 2.2.0~ynh1 +**Shipped version:** 2.2.0~ynh2 ## Screenshots diff --git a/README_es.md b/README_es.md index feea424..28da70f 100644 --- a/README_es.md +++ b/README_es.md @@ -18,7 +18,7 @@ No se debe editar a mano. Minimalist and opinionated RSS feed reader. -**Versión actual:** 2.2.0~ynh1 +**Versión actual:** 2.2.0~ynh2 ## Capturas diff --git a/README_eu.md b/README_eu.md index 4cadd95..e643a34 100644 --- a/README_eu.md +++ b/README_eu.md @@ -18,7 +18,7 @@ EZ editatu eskuz. Minimalist and opinionated RSS feed reader. -**Paketatutako bertsioa:** 2.2.0~ynh1 +**Paketatutako bertsioa:** 2.2.0~ynh2 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index 0fcd239..39b9184 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. Lecteur de flux RSS minimaliste. -**Version incluse :** 2.2.0~ynh1 +**Version incluse :** 2.2.0~ynh2 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 510e09a..730932f 100644 --- a/README_gl.md +++ b/README_gl.md @@ -18,7 +18,7 @@ NON debe editarse manualmente. Minimalist and opinionated RSS feed reader. -**Versión proporcionada:** 2.2.0~ynh1 +**Versión proporcionada:** 2.2.0~ynh2 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md index e90f9da..f097828 100644 --- a/README_id.md +++ b/README_id.md @@ -18,7 +18,7 @@ Ini TIDAK boleh diedit dengan tangan. Minimalist and opinionated RSS feed reader. -**Versi terkirim:** 2.2.0~ynh1 +**Versi terkirim:** 2.2.0~ynh2 ## Tangkapan Layar diff --git a/README_ru.md b/README_ru.md index 95b34fc..398aa05 100644 --- a/README_ru.md +++ b/README_ru.md @@ -18,7 +18,7 @@ Minimalist and opinionated RSS feed reader. -**Поставляемая версия:** 2.2.0~ynh1 +**Поставляемая версия:** 2.2.0~ynh2 ## Снимки экрана diff --git a/README_zh_Hans.md b/README_zh_Hans.md index c3b40a9..ac65d17 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -18,7 +18,7 @@ Minimalist and opinionated RSS feed reader. -**分发版本:** 2.2.0~ynh1 +**分发版本:** 2.2.0~ynh2 ## 截图 diff --git a/manifest.toml b/manifest.toml index c12d5f5..c1a3c48 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Miniflux" description.en = "Minimalist and opinionated RSS feed reader" description.fr = "Agrégateur de flux RSS minimaliste" -version = "2.2.0~ynh1" +version = "2.2.0~ynh2" maintainers = [] @@ -16,7 +16,8 @@ admindoc = "https://miniflux.app/docs/index.html" code = "https://github.com/miniflux/v2" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.27" +helpers_version = "2.1" architectures = ["amd64", "armhf", "arm64"] multi_instance = true diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..3d7f008 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,17 +1,5 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 31000af..dd1b9e1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,52 +1,35 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP SYSTEMD -#================================================= +ynh_backup "/etc/systemd/system/$app.service" -ynh_backup --src_path="/etc/systemd/system/$app.service" - -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Backing up the PostgreSQL database..." +ynh_print_info "Backing up the PostgreSQL database..." -ynh_psql_dump_db --database="$db_name" > db.sql +ynh_psql_dump_db > db.sql #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 1328083..39a5d1c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,53 +1,43 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action=stop #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." domain="$new_domain" path="$new_path" -ynh_add_config --template="../conf/miniflux.conf" --destination="$install_dir/$app.conf" +ynh_config_add --template="miniflux.conf" --destination="$install_dir/$app.conf" chmod 600 "$install_dir/$app.conf" -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemctl --service=$app --action=start --log_path=systemd #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 60df0a9..602468c 100644 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -14,32 +8,30 @@ source /usr/share/yunohost/helpers #================================================= password=$YNH_APP_ARG_PASSWORD -ynh_app_setting_set --app=$app --key=password --value=$password +ynh_app_setting_set --key=password --value=$password #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 +ynh_script_progression "Creating a PostgreSQL database..." -ynh_psql_execute_as_root --sql="CREATE EXTENSION hstore;" --database=$db_name +ynh_psql_db_shell <<< "CREATE EXTENSION hstore;" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_script_progression "Setting up source files..." ynh_setup_source --dest_dir="$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" chmod +x "$install_dir/miniflux" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." -ynh_add_config --template="miniflux.conf" --destination="$install_dir/$app.conf" +ynh_config_add --template="miniflux.conf" --destination="$install_dir/$app.conf" chmod 600 "$install_dir/$app.conf" chown $app "$install_dir/$app.conf" @@ -47,25 +39,25 @@ chown $app "$install_dir/$app.conf" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_systemd_config +ynh_config_add_systemd -ynh_use_logrotate +ynh_config_add_logrotate yunohost service add $app --description="Minimalist feed reader" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemctl --service=$app --action=start --log_path=systemd #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index a959a08..e470210 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,35 +1,29 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SYSTEMD SERVICE +# REMOVE SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." -if ynh_exec_warn_less yunohost service status $app >/dev/null +if ynh_hide_warnings yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service..." --weight=1 + ynh_script_progression "Removing $app service..." yunohost service remove $app fi -ynh_remove_systemd_config +ynh_config_remove_systemd -ynh_remove_nginx_config +ynh_config_remove_nginx -ynh_remove_logrotate +ynh_config_remove_logrotate #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 67f302a..f08382a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,59 +1,51 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring $app main directory..." --weight=4 +ynh_script_progression "Restoring $app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" -chmod -R o-rwx "$install_dir" chmod +x "$install_dir/miniflux" -chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 +ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name +ynh_psql_db_shell < "./db.sql" #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -ynh_restore_file --origin_path="/etc/logrotate.d/$app" +ynh_restore "/etc/logrotate.d/$app" yunohost service add $app --description="Minimalist feed reader" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemctl --service=$app --action=start --log_path=systemd -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index fc4d97e..bc76738 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,66 +1,46 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action=stop --log_path=systemd +ynh_systemctl --service=$app --action=stop --log_path=systemd #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=5 +ynh_setup_source --dest_dir=$install_dir --keep="$app.conf" - ynh_setup_source --dest_dir=$install_dir --keep="$app.conf" -fi - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" chmod +x "$install_dir/miniflux" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_systemd_config +ynh_config_add_systemd -ynh_use_logrotate --non-append +ynh_config_add_logrotate yunohost service add $app --description="Minimalist feed reader" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemctl --service=$app --action=start --log_path=systemd #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed"