diff --git a/check_process b/check_process index e6be363..51f94f3 100644 --- a/check_process +++ b/check_process @@ -11,15 +11,13 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=20435c4d005d7abffc45db4eac3d3e9492302c21 + # 20200916~ynh5 + upgrade=1 from_commit=20435c4d005d7abffc45db4eac3d3e9492302c21 + # 20220606~ynh1 + upgrade=1 from_commit=009f956487d1580b71a2bd250418854d8e094185 backup_restore=1 multi_instance=1 change_url=1 ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=20435c4d005d7abffc45db4eac3d3e9492302c21 - name=Testing (#105) - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& - diff --git a/conf/nginx.conf b/conf/nginx.conf index 549b52a..d9fdc4e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/ ; + alias __FINALPATH__/; index index.php; diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 096d180..f991f15 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -8,4 +8,4 @@ Tiny Tiny RSS is a free and open source web-based news feed (RSS/Atom) reader an - sharing arbitrary content through tt-rss, - Plugins and themes, - podcasts, -- flexible article filtering \ No newline at end of file +- flexible article filtering diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 71597d8..9bc5688 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1,11 @@ -Tiny Tiny RSS est un lecteur et agrégateur de flux d'actualités (RSS/Atom) en ligne gratuit et open source. +Tiny Tiny RSS est un lecteur et agrégateur de flux de nouvelles (RSS/Atom) basé sur le web, gratuit et à code source ouvert. + +## Caractéristiques + +- agrégation / syndication de flux, +- importation/exportation OPML, +- plusieurs façons de partager du contenu : exportation de flux RSS, plugins pour divers sites sociaux, partage par URL, etc, +- partage de contenu arbitraire via tt-rss, +- plugins et thèmes, +- podcasts, +- filtrage flexible des articles diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..8efb3b1 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,4 @@ +### Default login credentials + +- Username: `admin` +- password: `password` \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3f464e2..a6223d6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,51 +1,51 @@ { - "name": "Tiny Tiny RSS", - "id": "ttrss", - "packaging_format": 1, - "description": { - "en": "News feed (RSS/Atom) reader and aggregator", - "fr": "Lecteur de flux d’actualité utilisant les protocoles RSS et Atom" - }, - "version": "20220626~ynh1", - "url": "http://tt-rss.org", - "upstream": { + "name": "Tiny Tiny RSS", + "id": "ttrss", + "packaging_format": 1, + "description": { + "en": "News feed (RSS/Atom) reader and aggregator", + "fr": "Lecteur de flux d’actualité utilisant les protocoles RSS et Atom" + }, + "version": "20220626~ynh1", + "url": "http://tt-rss.org", + "upstream": { "license": "GPL-3.0-only", - "website": "http://tt-rss.org", + "website": "https://tt-rss.org", "demo": "https://srv.tt-rss.org/tt-rss/", - "admindoc": "https://git.tt-rss.org/git/tt-rss/wiki", + "admindoc": "https://tt-rss.org/wiki.php", "code": "https://git-gitea.tt-rss.org/fox/tt-rss" }, - "license": "GPL-3.0-only", - "maintainer": { - "name": "", - "email": "" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": true, - "services": [ - "nginx", - "php8.0-fpm", - "mysql" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/ttrss", - "default": "/ttrss" - }, - { - "name": "is_public", - "type": "boolean", - "default": true - } - ] - } + "license": "GPL-3.0-only", + "maintainer": { + "name": "", + "email": "" + }, + "requirements": { + "yunohost": ">= 4.3.0" + }, + "multi_instance": true, + "services": [ + "nginx", + "php8.0-fpm", + "mysql" + ], + "arguments": { + "install": [ + { + "name": "domain", + "type": "domain" + }, + { + "name": "path", + "type": "path", + "example": "/ttrss", + "default": "/ttrss" + }, + { + "name": "is_public", + "type": "boolean", + "default": true + } + ] + } } diff --git a/scripts/_common.sh b/scripts/_common.sh index 6d0ca06..9000da2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,10 +6,17 @@ YNH_PHP_VERSION="8.0" -pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-opcache \ - php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml" +# dependencies used by the app +pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml" + +#================================================= +# PERSONAL HELPERS +#================================================= #================================================= # EXPERIMENTAL HELPERS #================================================= +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/change_url b/scripts/change_url index 8412736..38b7596 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -26,19 +26,23 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 +# Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +# Add settings here as needed by your application db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" @@ -66,6 +70,13 @@ fi #================================================= # STANDARD MODIFICATIONS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." + +ynh_systemd_action --service_name=$app --action="stop" + #================================================= # MODIFY URL IN NGINX CONF #================================================= @@ -98,7 +109,9 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -ynh_script_progression --message="Configuring $app..." --weight=1 +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=1 domain_path="https://${new_domain}${new_path}" domain="$new_domain" @@ -108,7 +121,15 @@ chmod 400 "$final_path/config.php" chown $app "$final_path/config.php" #================================================= -# GENERIC FINALIZATION +# GENERIC FINALISATION +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." + +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/install b/scripts/install index a270481..f6938b3 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ynh_clean_check_starting +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -23,7 +26,6 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC -phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -46,6 +48,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url +#================================================= +# STANDARD MODIFICATIONS #================================================= # INSTALL DEPENDENCIES #================================================= @@ -53,15 +57,13 @@ ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies -#================================================= -# STANDARD MODIFICATIONS #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A MYSQL DATABASE @@ -86,14 +88,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -103,6 +97,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # SPECIFIC SETUP #================================================= @@ -133,7 +135,7 @@ ynh_script_progression --message="Initializing database..." --weight=6 ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ < "$final_path/schema/ttrss_schema_mysql.sql" -sudo -u $app php${phpversion} ${final_path}/update.php --update-schema=force-yes +ynh_exec_as $app php${phpversion} ${final_path}/update.php --update-schema=force-yes #================================================= # GENERIC FINALIZATION @@ -157,8 +159,11 @@ ynh_systemd_action --service_name=$app --action="start" #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 +# Make app public if necessary if [ $is_public -eq 1 ] then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" fi diff --git a/scripts/remove b/scripts/remove index 7767057..53b546e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -53,7 +53,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing the app main directory..." --weight=4 +ynh_script_progression --message="Removing app main directory..." --weight=4 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -82,14 +82,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - -# Remove a cron file -ynh_exec_warn_less ynh_secure_remove --file="/etc/cron.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 57eccd3..b4e26ec 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,13 +14,16 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ynh_clean_check_starting +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -36,24 +39,18 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR @@ -81,7 +78,12 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 186577f..07fa0bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,18 +27,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=7 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=7 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + ynh_clean_check_starting + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -92,7 +94,7 @@ ynh_secure_remove --file="/etc/cron.d/$app" ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -147,7 +149,7 @@ then ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" ynh_script_progression --message="Upgrading ttrss database..." --weight=2 - sudo -u $app php${phpversion} ${final_path}/update.php --update-schema=force-yes + ynh_exec_as $app php${phpversion} ${final_path}/update.php --update-schema=force-yes fi chmod 400 "$final_path/config.php"