diff --git a/README.md b/README.md index 167fecd..2a26c50 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,10 @@ Tiny Tiny RSS is a free and open source web-based news feed (RSS/Atom) reader an - podcasts, - flexible article filtering -**Shipped version:** 20220606~ynh1 -**Demo:** https://demo.yunohost.org/ttrss/ +**Shipped version:** 20220626~ynh1 + +**Demo:** https://srv.tt-rss.org/tt-rss/ ## Screenshots @@ -43,8 +44,8 @@ Tiny Tiny RSS is a free and open source web-based news feed (RSS/Atom) reader an - password: `password` ## Documentation and resources -* Official app website: -* Official admin documentation: +* Official app website: +* Official admin documentation: * Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 78beebe..e26f134 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,12 +15,22 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -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 -**Version incluse :** 20220606~ynh1 +**Version incluse :** 20220626~ynh1 -**Démo :** https://demo.yunohost.org/ttrss/ +**Démo :** https://srv.tt-rss.org/tt-rss/ ## Captures d'écran @@ -34,8 +44,8 @@ Tiny Tiny RSS est un lecteur et agrégateur de flux d'actualités (RSS/Atom) en - password: `password` ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : +* Site officiel de l'app : +* Documentation officielle de l'admin : * Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug : diff --git a/check_process b/check_process index e6be363..a441c45 100644 --- a/check_process +++ b/check_process @@ -11,15 +11,13 @@ setup_private=1 setup_public=1 upgrade=1 + # 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/app.src b/conf/app.src index 20a0e38..7c3cd18 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://git-gitea.tt-rss.org/fox/tt-rss/archive/8ef816d8f8ee964d5ce54e28e1f2686caf9176fd.tar.gz -SOURCE_SUM=1e33e78d2ed58259b34fd7eb8d97d803a3e57aeecd3504d635af96a600b77296 +SOURCE_URL=https://git-gitea.tt-rss.org/fox/tt-rss/archive/b148d2f5153f9711120b3a3ac50ee84509c9cdfb.tar.gz +SOURCE_SUM=09bbaf3164d86b888bd9a206fb3f678718f855dd38d134f22db11c05b0669d5f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/config.php b/conf/config.php index 59b766f..a3c291b 100644 --- a/conf/config.php +++ b/conf/config.php @@ -11,7 +11,7 @@ putenv('TTRSS_DB_PASS=__DB_PWD__'); putenv('TTRSS_DB_PORT=3306'); // usually 5432 for PostgreSQL, 3306 for MySQL - putenv('TTRSS_MYSQL_CHARSET=UTF8'); + putenv('TTRSS_MYSQL_CHARSET=UTF8MB4'); // Connection charset for MySQL. If you have a legacy database and/or experience // garbage unicode characters with this option, try setting it to a blank string. @@ -43,7 +43,7 @@ // *** Files and directories *** // ***************************** - putenv('TTRSS_PHP_EXECUTABLE=/usr/bin/php'); + putenv('TTRSS_PHP_EXECUTABLE=/usr/bin/php__PHPVERSION__'); // Path to PHP *COMMAND LINE* executable, used for various command-line tt-rss // programs and update daemon. Do not try to use CGI binary here, it won't work. // If you see HTTP headers being displayed while running tt-rss scripts, 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 e419830..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": "20220606~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", - "demo": "https://demo.yunohost.org/ttrss/", - "admindoc": "https://git.tt-rss.org/git/tt-rss/wiki", + "website": "https://tt-rss.org", + "demo": "https://srv.tt-rss.org/tt-rss/", + "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 d07cfde..75cd3f5 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 @@ -45,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 #================================================= @@ -52,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 @@ -80,19 +83,12 @@ ynh_script_progression --message="Setting up source files..." --weight=7 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +echo "$(ynh_app_upstream_version)" > "$final_path/version_static.txt" 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 #================================================= @@ -102,6 +98,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 #================================================= @@ -132,7 +136,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 @@ -156,11 +160,15 @@ 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 +ynh_permission_create --permission="public" --url="/public.php" --allowed="visitors" --show_tile="false" --protected="true" ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" #================================================= diff --git a/scripts/remove b/scripts/remove index 986e6dc..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_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..30c77c5 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 @@ -79,7 +81,12 @@ fi # Create a permission if needed if ! ynh_permission_exists --permission="api"; then - ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" + ynh_permission_create --permission="api" --url="/public.php" --allowed="visitors" --show_tile="false" --protected="true" +fi + +# Create a permission if needed +if ! ynh_permission_exists --permission="public"; then + ynh_permission_create --permission="public" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" fi # Do not remove the file before the backup, to not fail the backup. @@ -92,7 +99,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 @@ -104,6 +111,7 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + echo "$(ynh_app_upstream_version)" > "$final_path/version_static.txt" fi chmod 750 "$final_path" @@ -147,7 +155,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"