mirror of
https://github.com/YunoHost-Apps/ttrss_ynh.git
synced 2024-10-01 13:34:46 +02:00
commit
f053fd82a7
16 changed files with 170 additions and 109 deletions
|
@ -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: <http://tt-rss.org>
|
||||
* Official admin documentation: <https://git.tt-rss.org/git/tt-rss/wiki>
|
||||
* Official app website: <https://tt-rss.org>
|
||||
* Official admin documentation: <https://tt-rss.org/wiki.php>
|
||||
* Upstream app code repository: <https://git-gitea.tt-rss.org/fox/tt-rss>
|
||||
* YunoHost documentation for this app: <https://yunohost.org/app_ttrss>
|
||||
* Report a bug: <https://github.com/YunoHost-Apps/ttrss_ynh/issues>
|
||||
|
|
20
README_fr.md
20
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 : <http://tt-rss.org>
|
||||
* Documentation officielle de l'admin : <https://git.tt-rss.org/git/tt-rss/wiki>
|
||||
* Site officiel de l'app : <https://tt-rss.org>
|
||||
* 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>
|
||||
* Documentation YunoHost pour cette app : <https://yunohost.org/app_ttrss>
|
||||
* Signaler un bug : <https://github.com/YunoHost-Apps/ttrss_ynh/issues>
|
||||
|
|
|
@ -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&
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
location __PATH__/ {
|
||||
|
||||
# Path to source
|
||||
alias __FINALPATH__/ ;
|
||||
alias __FINALPATH__/;
|
||||
|
||||
index index.php;
|
||||
|
||||
|
|
|
@ -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
4
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
### Default login credentials
|
||||
|
||||
- Username: `admin`
|
||||
- password: `password`
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue