1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
- Upgrade to 1.18.1
This commit is contained in:
Éric Gaspar 2021-08-15 09:22:47 +02:00 committed by GitHub
parent 20ed6f670c
commit c08e526816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 256 additions and 156 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,55 @@
---
name: Bug report
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
---
**How to post a meaningful bug report**
1. *Read this whole template first.*
2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *When in doubt, post here and we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*
---
### Describe the bug
*A clear and concise description of what the bug is.*
### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain:
- Using, or trying to install package version/branch:
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
### Steps to reproduce
- *If you performed a command from the CLI, the command itself is enough. For example:*
```sh
sudo yunohost app install the_app
```
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:*
1. *Go to '...'*
2. *Click on '...'*
3. *Scroll down to '...'*
4. *See error*
### Expected behavior
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
### Logs
*When an operation fails, YunoHost provides a simple way to share the logs.*
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
*If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,16 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished and ready to be reviewed/tested
- [ ] The fix/enhancement were manually tested (if applicable)
## Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

View file

@ -1,24 +1,31 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# FreshRSS for YunoHost
[![Integration level](https://dash.yunohost.org/integration/freshrss.svg)](https://dash.yunohost.org/appci/app/freshrss) ![](https://ci-apps.yunohost.org/ci/badges/freshrss.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/freshrss.maintain.svg)
[![Install FreshRSS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=freshrss)
> *This package allow you to install FreshRSS quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install FreshRSS quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
An efficient but powerful RSS aggregator with a nice and mobile-friendly design, as well as extension and themes support.
RSS aggregator with a nice and mobile-friendly design
**Shipped version:** 1.18.0
**Shipped version:** 1.18.1~ynh1
**Demo:** https://demo.freshrss.org
## Screenshots
![](https://freshrss.org/images/screenshot.png)
![](./doc/screenshots/screenshot.png)
## Demo
* [Official demo](https://demo.freshrss.org)
## Disclaimers / important information
## Configuration
@ -28,32 +35,24 @@ API (mini) How To:
* Check that the API is working: https://example.net/rss/api/greader.php
* Setup your client with: username: ynh user, password: the password you just setup, URL https://example.tld/rss/api/greader.php
## Documentation and resources
## Documentation
* Official documentation: https://freshrss.github.io/FreshRSS/
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/freshrss%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/freshrss/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/freshrss%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/freshrss/)
## Links
* Official app website: http://freshrss.org/
* Official user documentation: https://yunohost.org/apps
* Official admin documentation: https://freshrss.github.io/FreshRSS/
* Upstream app code repository: https://github.com/FreshRSS/FreshRSS
* YunoHost documentation for this app: https://yunohost.org/app_freshrss
* Report a bug: https://github.com/YunoHost-Apps/freshrss_ynh/issues
* App website: https://freshrss.org/
* Upstream app repository: https://github.com/FreshRSS/FreshRSS
* YunoHost website: https://yunohost.org/
---
## Developer info
## Developers info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing).
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing).
To try the testing branch, please proceed like this:
To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing --debug
or
sudo yunohost app upgrade freshrss -u https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

54
README_fr.md Normal file
View file

@ -0,0 +1,54 @@
# FreshRSS pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/freshrss.svg)](https://dash.yunohost.org/appci/app/freshrss) ![](https://ci-apps.yunohost.org/ci/badges/freshrss.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/freshrss.maintain.svg)
[![Installer FreshRSS avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=freshrss)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer FreshRSS rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
Agrégateur de flux RSS avec une interface adaptée au mobile
**Version incluse :** 1.18.1~ynh1
**Démo :** https://demo.freshrss.org
## Captures d'écran
![](./doc/screenshots/screenshot.png)
## Avertissements / informations importantes
## Configuration
API (mini) How To:
* Into your user profile: Settings > profil
* Setup an API password
* Check that the API is working: https://example.net/rss/api/greader.php
* Setup your client with: username: ynh user, password: the password you just setup, URL https://example.tld/rss/api/greader.php
## Documentations et ressources
* Site officiel de l'app : http://freshrss.org/
* Documentation officielle utilisateur : https://yunohost.org/apps
* Documentation officielle de l'admin : https://freshrss.github.io/FreshRSS/
* Dépôt de code officiel de l'app : https://github.com/FreshRSS/FreshRSS
* Documentation YunoHost pour cette app : https://yunohost.org/app_freshrss
* Signaler un bug : https://github.com/YunoHost-Apps/freshrss_ynh/issues
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing --debug
ou
sudo yunohost app upgrade freshrss -u https://github.com/YunoHost-Apps/freshrss_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,28 +1,22 @@
;; Test complet
auto_remove=1
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="homer" (USER)
domain="domain.tld"
path="/path"
admin="homer"
is_public=1
language="fr"
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=0
setup_public=0
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=0b1c3be0716e4800f2ed6f5b3065f707ed67b6bf
backup_restore=1
multi_instance=1
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1
port_already_use=0
change_url=1
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto
;;; Upgrade options
; commit=0b1c3be0716e4800f2ed6f5b3065f707ed67b6bf
name=30 août 2020. Merge pull request #103 from ericgaspar/patch-1

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.18.0.tar.gz
SOURCE_SUM=41698e8b1417a12440a8c4d7cc2c9ea40a581f2ad89475ded7d372a87b6b7120
SOURCE_URL=https://github.com/FreshRSS/FreshRSS/archive/1.18.1.tar.gz
SOURCE_SUM=162b0be7bdc0e51022061c895b46e7a8f229588d530b196f06ddd8d9aaaf248a
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

7
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,7 @@
## Configuration
API (mini) How To:
* Into your user profile: Settings > profil
* Setup an API password
* Check that the API is working: https://example.net/rss/api/greader.php
* Setup your client with: username: ynh user, password: the password you just setup, URL https://example.tld/rss/api/greader.php

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

View file

@ -6,20 +6,28 @@
"en": "RSS aggregator with a nice and mobile-friendly design",
"fr": "Agrégateur de flux RSS avec une interface adaptée au mobile"
},
"version": "1.18.0~ynh1",
"version": "1.18.1~ynh1",
"url": "http://freshrss.org/",
"upstream": {
"license": "AGPL-3.0-only",
"website": "http://freshrss.org/",
"demo": "https://demo.freshrss.org",
"admindoc": "https://freshrss.github.io/FreshRSS/",
"userdoc": "https://yunohost.org/apps",
"code": "https://github.com/FreshRSS/FreshRSS"
},
"license": "AGPL-3.0-only",
"maintainer": {
"name": "plopoyop",
"email": "plopoyop@gmail.com"
},
"requirements": {
"yunohost": ">= 3.8.1"
"yunohost": ">= 4.2.0"
},
"multi_instance": true,
"services": [
"nginx",
"php7.0-fpm",
"php7.3-fpm",
"mysql"
],
"arguments": {
@ -27,19 +35,11 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for FreshRSS",
"fr": "Choisissez un nom de domaine pour FreshRSS"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for FreshRSS",
"fr": "Choisissez un chemin pour FreshRSS"
},
"example": "/rss",
"default": "/rss"
},
@ -47,12 +47,13 @@
"name": "admin",
"type": "user",
"optional": false,
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez ladministrateur"
},
"example": "homer"
},
{
"name": "is_public",
"type": "boolean",
"default": true
},
{
"name": "language",
"type": "string",

View file

@ -1,18 +0,0 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished.
- [ ] Tested with Package_check.
- [ ] Fix or enhancement tested.
- [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested.
## Package_check results
---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/freshrss_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/freshrss_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -10,17 +10,6 @@ YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml"
#=================================================
# PERSONAL HELPERS
#=================================================
function set_permissions {
chown -R root:$app $final_path
chmod -R g=u,g-w,o-rwx $final_path
chown -R $app:$app $final_path/{data,extensions}
setfacl -n -R -m u:www-data:rx -m d:u:www-data:rx $final_path
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -45,14 +45,39 @@ if [ -z $admin ]; then
ynh_app_setting_set $app admin $admin
fi
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# 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"
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK PATHS SYNTAX
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
test -n "$old_path" || old_path="/"
test -n "$new_path" || new_path="/"
new_path=$(ynh_normalize_url_path $new_path)
old_path=$(ynh_normalize_url_path $old_path)
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# 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"
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
@ -103,7 +128,7 @@ fi
# SPECIFIC MODIFICATIONS
#=================================================
sudo -u $app $final_path/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
ynh_exec_as $app $final_path/cli/reconfigure.php --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================
# GENERIC FINALIZATION

View file

@ -23,6 +23,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
app=$YNH_APP_INSTANCE_NAME
@ -63,7 +64,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# CREATE A MYSQL DATABASE
@ -84,7 +85,9 @@ 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"
set_permissions
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
@ -108,7 +111,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
ynh_script_progression --message="FreshRSS setup script..."
sudo -u $app $final_path/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
ynh_exec_as $app $final_path/cli/do-install.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================
# CREATE DEDICATED USER
@ -118,7 +121,7 @@ ynh_script_progression --message="Creating users..."
for myuser in $(ynh_user_list)
do
user_token=$(ynh_string_random)
sudo -u $app $final_path/cli/create-user.php --user $myuser --language $language --token $user_token
ynh_exec_as $app $final_path/cli/create-user.php --user $myuser --language $language --token $user_token
done
#=================================================
@ -126,26 +129,21 @@ done
#=================================================
ynh_script_progression --message="Setting up cron..."
cron_path="/etc/cron.d/$app"
ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron"
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron"
ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file="../conf/freshrss.cron"
cp ../conf/freshrss.cron "$cron_path"
chmod 644 "$cron_path"
ynh_add_config --template="../conf/freshrss.cron" --destination="/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..."
ynh_script_progression --message="Configuring permissions..." --weight=1
#skip api directory
ynh_app_setting_set --app="$app" --key=skipped_uris --value="/api/,/scripts/api.js"
ynh_app_setting_delete --app="$app" --key=unprotected_regex
ynh_app_setting_delete --app="$app" --key=unprotected_uris
# Make app public if necessary
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================
# RELOAD NGINX
@ -159,4 +157,3 @@ ynh_systemd_action --service_name=nginx --action=reload
#=================================================
ynh_script_progression --message="Installation of $app completed" --last

View file

@ -55,7 +55,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# REINSTALL DEPENDENCIES
@ -72,7 +72,9 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
set_permissions
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION

View file

@ -57,6 +57,13 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -71,13 +78,6 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -86,12 +86,12 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
@ -102,8 +102,6 @@ ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
# into tmp dir
tmp_path=$(mktemp -d)
ynh_setup_source "$tmp_path"
#=================================================
# NGINX CONFIGURATION
@ -125,35 +123,27 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
# SPECIFIC UPGRADE
#=================================================
#old version cleanup
if [ -f $final_path/data/user.php.dist ]; then
ynh_secure_remove $final_path/data/user.php.dist
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/data/config.php $final_path/data/users/. $final_path/extensions/."
fi
#restore config
ynh_secure_remove $tmp_path/data/do-install.txt
cp $final_path/data/config.php $tmp_path/data/config.php
cp -r $final_path/data/users/. $tmp_path/data/users/
cp -r $final_path/extensions/. $tmp_path/extensions/
# Set permissions to freshrss directory
# Clean up existing files and copy new files to the right place
ynh_secure_remove "$final_path"
cp -rp "$tmp_path" "$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# CRON SETUP
#=================================================
ynh_script_progression --message="Setting up cron..."
cron_path="/etc/cron.d/$app"
ynh_replace_string --match_string="__FINALPATH__" --replace_string=$final_path --target_file="../conf/freshrss.cron"
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="../conf/freshrss.cron"
ynh_replace_string --match_string="__PHPVERSION__" --replace_string=$phpversion --target_file="../conf/freshrss.cron"
cp ../conf/freshrss.cron "$cron_path"
chmod 644 "$cron_path"
ynh_add_config --template="../conf/freshrss.cron" --destination="/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
if [ -f /tmp/FreshRSS.log ]; then
ynh_secure_remove /tmp/FreshRSS.log
@ -165,19 +155,8 @@ fi
# SECURE FILES AND DIRECTORIES
#=================================================
set_permissions
# reconfigure application with latest parameters
sudo -u $app $final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
ynh_app_setting_set --app="$app" --key=skipped_uris --value="/api/,/scripts/api.js"
ynh_app_setting_delete --app="$app" --key=unprotected_regex
ynh_app_setting_delete --app="$app" --key=unprotected_uris
ynh_exec_as $app $final_path/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path_url --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name
#=================================================
# RELOAD NGINX AND PHP-FPM
@ -185,7 +164,7 @@ ynh_app_setting_delete --app="$app" --key=unprotected_uris
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
ynh_systemd_action --service_name=nginx --action=reload
ynh_systemd_action --service_name=php$YNH_PHP_VERSION-fpm --action=reload
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
#=================================================
# END OF SCRIPT