1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00
* Apply example_ynh

* Fix #49

* Fix #75

* Auto-update README

* Update check_process

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
yalh76 2022-07-06 06:41:20 +02:00 committed by GitHub
parent f3f2e9dd58
commit 8038889f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 161 additions and 101 deletions

View file

@ -27,6 +27,7 @@ Tiny Tiny RSS is a free and open source web-based news feed (RSS/Atom) reader an
- podcasts, - podcasts,
- flexible article filtering - flexible article filtering
**Shipped version:** 20220626~ynh1 **Shipped version:** 20220626~ynh1
**Demo:** https://srv.tt-rss.org/tt-rss/ **Demo:** https://srv.tt-rss.org/tt-rss/
@ -43,8 +44,8 @@ Tiny Tiny RSS is a free and open source web-based news feed (RSS/Atom) reader an
- password: `password` - password: `password`
## Documentation and resources ## Documentation and resources
* Official app website: <http://tt-rss.org> * Official app website: <https://tt-rss.org>
* Official admin documentation: <https://git.tt-rss.org/git/tt-rss/wiki> * Official admin documentation: <https://tt-rss.org/wiki.php>
* Upstream app code repository: <https://git-gitea.tt-rss.org/fox/tt-rss> * Upstream app code repository: <https://git-gitea.tt-rss.org/fox/tt-rss>
* YunoHost documentation for this app: <https://yunohost.org/app_ttrss> * YunoHost documentation for this app: <https://yunohost.org/app_ttrss>
* Report a bug: <https://github.com/YunoHost-Apps/ttrss_ynh/issues> * Report a bug: <https://github.com/YunoHost-Apps/ttrss_ynh/issues>

View file

@ -15,7 +15,17 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble ## 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 :** 20220626~ynh1 **Version incluse :** 20220626~ynh1
@ -34,8 +44,8 @@ Tiny Tiny RSS est un lecteur et agrégateur de flux d'actualités (RSS/Atom) en
- password: `password` - password: `password`
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : <http://tt-rss.org> * Site officiel de l'app : <https://tt-rss.org>
* Documentation officielle de l'admin : <https://git.tt-rss.org/git/tt-rss/wiki> * Documentation officielle de l'admin : <https://tt-rss.org/wiki.php>
* Dépôt de code officiel de l'app : <https://git-gitea.tt-rss.org/fox/tt-rss> * Dépôt de code officiel de l'app : <https://git-gitea.tt-rss.org/fox/tt-rss>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_ttrss> * Documentation YunoHost pour cette app : <https://yunohost.org/app_ttrss>
* Signaler un bug : <https://github.com/YunoHost-Apps/ttrss_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/ttrss_ynh/issues>

View file

@ -11,15 +11,13 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 20200916~ynh5
#upgrade=1 from_commit=20435c4d005d7abffc45db4eac3d3e9492302c21 #upgrade=1 from_commit=20435c4d005d7abffc45db4eac3d3e9492302c21
# 20220606~ynh1
upgrade=1 from_commit=009f956487d1580b71a2bd250418854d8e094185
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none 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&

View file

@ -2,7 +2,7 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/ ; alias __FINALPATH__/;
index index.php; index index.php;

View file

@ -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

4
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,4 @@
### Default login credentials
- Username: `admin`
- password: `password`

View file

@ -10,9 +10,9 @@
"url": "http://tt-rss.org", "url": "http://tt-rss.org",
"upstream": { "upstream": {
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"website": "http://tt-rss.org", "website": "https://tt-rss.org",
"demo": "https://srv.tt-rss.org/tt-rss/", "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" "code": "https://git-gitea.tt-rss.org/fox/tt-rss"
}, },
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
@ -30,7 +30,7 @@
"mysql" "mysql"
], ],
"arguments": { "arguments": {
"install" : [ "install": [
{ {
"name": "domain", "name": "domain",
"type": "domain" "type": "domain"

View file

@ -6,10 +6,17 @@
YNH_PHP_VERSION="8.0" 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 \ # dependencies used by the app
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" 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 # EXPERIMENTAL HELPERS
#================================================= #=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -26,19 +26,23 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1 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) 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_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) 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 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 # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { 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. # 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" ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
@ -66,6 +70,13 @@ fi
#================================================= #=================================================
# STANDARD MODIFICATIONS # 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 # MODIFY URL IN NGINX CONF
#================================================= #=================================================
@ -98,7 +109,9 @@ fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # 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_path="https://${new_domain}${new_path}"
domain="$new_domain" domain="$new_domain"
@ -108,7 +121,15 @@ chmod 400 "$final_path/config.php"
chown $app "$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 # RELOAD NGINX
#================================================= #=================================================

View file

@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -23,7 +26,6 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
phpversion=$YNH_PHP_VERSION
app=$YNH_APP_INSTANCE_NAME 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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
@ -53,15 +57,13 @@ ynh_script_progression --message="Installing dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#=================================================
# STANDARD MODIFICATIONS
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." --weight=2 ynh_script_progression --message="Configuring system user..." --weight=2
# Create a system user # 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 # CREATE A MYSQL DATABASE
@ -81,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 ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
echo "$(ynh_app_upstream_version)" > "$final_path/version_static.txt"
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$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 # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -103,6 +98,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) 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 # SPECIFIC SETUP
#================================================= #=================================================
@ -133,7 +136,7 @@ ynh_script_progression --message="Initializing database..." --weight=6
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \
< "$final_path/schema/ttrss_schema_mysql.sql" < "$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 # GENERIC FINALIZATION
@ -157,11 +160,15 @@ ynh_systemd_action --service_name=$app --action="start"
#================================================= #=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1 ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
fi 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" ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
#================================================= #=================================================

View file

@ -53,7 +53,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#================================================= #=================================================
# REMOVE APP MAIN DIR # 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 # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
@ -82,14 +82,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_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 # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -14,13 +14,16 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME 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 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 # 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 # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 ynh_script_progression --message="Recreating the dedicated system user..." --weight=3
# Create the dedicated user (if not existing) # 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 # 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_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 # RESTORE THE MYSQL DATABASE

View file

@ -27,18 +27,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # 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 # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
# restore it if the upgrade fails ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -79,7 +81,12 @@ fi
# Create a permission if needed # Create a permission if needed
if ! ynh_permission_exists --permission="api"; then 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 fi
# Do not remove the file before the backup, to not fail the backup. # 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 ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing) # 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -104,6 +111,7 @@ then
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
echo "$(ynh_app_upstream_version)" > "$final_path/version_static.txt"
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"
@ -147,7 +155,7 @@ then
ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php"
ynh_script_progression --message="Upgrading ttrss database..." --weight=2 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 fi
chmod 400 "$final_path/config.php" chmod 400 "$final_path/config.php"