From 04c67cd403dd6891fd605a39584ccccc000e753b Mon Sep 17 00:00:00 2001 From: Binnette Date: Wed, 6 Apr 2022 22:55:26 +0200 Subject: [PATCH 01/10] move selfoss to sublocation /selfoss --- conf/nginx.conf | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f98a6c8..48a0497 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,28 +1,34 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location /selfoss { # Path to source - alias __FINALPATH__/; - - index index.php; - - try_files $uri /public/$uri /index.php; + root __FINALPATH__/; + access_log /var/log/nginx/rss.access.log; + error_log /var/log/nginx/rss.error.log; + + #index index.php; + #try_files $uri /public/$uri /index.php; location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } - location ~ ^/(favicons|thumbnails)/.*$ { - try_files $uri /data/$uri; - } + location ~ ^/selfoss/((favicons|thumbnails)/.+)$ { + try_files /selfoss/data/$1 =404; + } - location ~* ^/(data\/logs|data\/sqlite|config\.ini|\.ht) { - deny all; - } + location ~ ^/selfoss/$ { + index index.php; + } + + location ~ ^/selfoss/(.+)$ { + try_files /selfoss/public/$1 /selfoss/index.php$is_args$args; + } } From 619c43a0e55902af3af8addfabdf86a5a444596a Mon Sep 17 00:00:00 2001 From: Binnette Date: Wed, 6 Apr 2022 23:01:02 +0200 Subject: [PATCH 02/10] Add path param --- manifest.json | 6 ++++++ scripts/install | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 0cabc5e..6eccdff 100644 --- a/manifest.json +++ b/manifest.json @@ -34,6 +34,12 @@ "name": "domain", "type": "domain" }, + { + "name": "path", + "type": "path", + "example": "/selfoss", + "default": "/selfoss" + }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index 50511ab..d804d35 100755 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME From 4a82ce6369d25679c51dc7eb9f207f9069339cab Mon Sep 17 00:00:00 2001 From: Binnette Date: Wed, 6 Apr 2022 23:26:50 +0200 Subject: [PATCH 03/10] Fix Nginx conf --- conf/nginx.conf | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 48a0497..46e5e46 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,14 +1,9 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location /selfoss { +location /__PATH__ { # Path to source - root __FINALPATH__/; - access_log /var/log/nginx/rss.access.log; - error_log /var/log/nginx/rss.error.log; - - #index index.php; - #try_files $uri /public/$uri /index.php; - + alias __FINALPATH__/; + location ~ [^/]\.php(/|$) { fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; @@ -20,15 +15,15 @@ location /selfoss { fastcgi_param SCRIPT_FILENAME $request_filename; } - location ~ ^/selfoss/((favicons|thumbnails)/.+)$ { - try_files /selfoss/data/$1 =404; + location ~ ^/__PATH__/((favicons|thumbnails)/.+)$ { + try_files /__PATH__/data/$1 =404; } - location ~ ^/selfoss/$ { + location ~ ^/__PATH__/$ { index index.php; } - location ~ ^/selfoss/(.+)$ { - try_files /selfoss/public/$1 /selfoss/index.php$is_args$args; + location ~ ^/__PATH__/(.+)$ { + try_files /__PATH__/public/$1 /__PATH__/index.php$is_args$args; } } From 679a0a201dfafc93252423f6de7c2492a335e640 Mon Sep 17 00:00:00 2001 From: Binnette Date: Wed, 6 Apr 2022 23:45:40 +0200 Subject: [PATCH 04/10] Fix nginx.conf --- conf/nginx.conf | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 46e5e46..4fcabbb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,8 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location /__PATH__ { +location __PATH__ { + + root /var/www/; - # Path to source - alias __FINALPATH__/; - location ~ [^/]\.php(/|$) { fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; @@ -15,15 +14,15 @@ location /__PATH__ { fastcgi_param SCRIPT_FILENAME $request_filename; } - location ~ ^/__PATH__/((favicons|thumbnails)/.+)$ { - try_files /__PATH__/data/$1 =404; + location ~ ^__PATH__/((favicons|thumbnails)/.+)$ { + try_files __PATH__/data/$1 =404; } - location ~ ^/__PATH__/$ { + location ~ ^__PATH__/$ { index index.php; } - location ~ ^/__PATH__/(.+)$ { - try_files /__PATH__/public/$1 /__PATH__/index.php$is_args$args; + location ~ ^__PATH__/(.+)$ { + try_files __PATH__/public/$1 __PATH__/index.php$is_args$args; } } From 0f389b43a1f5fae774d83e8b46eb5c990b80ff89 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 Aug 2022 16:29:21 +0000 Subject: [PATCH 05/10] Auto-update README --- README.md | 22 +++++++++++----------- README_fr.md | 30 +++++++++++++++++------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 9958644..c139d0e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Selfoss for YunoHost -[![Integration level](https://dash.yunohost.org/integration/selfoss.svg)](https://dash.yunohost.org/appci/app/selfoss) ![](https://ci-apps.yunohost.org/ci/badges/selfoss.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/selfoss.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/selfoss.svg)](https://dash.yunohost.org/appci/app/selfoss) ![Working status](https://ci-apps.yunohost.org/ci/badges/selfoss.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/selfoss.maintain.svg) [![Install Selfoss with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=selfoss) *[Lire ce readme en français.](./README_fr.md)* @@ -21,32 +21,32 @@ Selfoss is a multipurpose RSS reader and feed aggregation web application. It al **Shipped version:** 2.18~ynh1 - ## Screenshots -![](./doc/screenshots/screenshot1.png) +![Screenshot of Selfoss](./doc/screenshots/screenshot1.png) ## Disclaimers / important information password hash for optional login. You can generate a password hash by using following page of your selfoss installation. `http://your_selfoss_url.com/password` ## Documentation and resources -* Official app website: https://selfoss.aditu.de/ -* Official user documentation: https://selfoss.aditu.de/ -* Official admin documentation: https://github.com/fossar/selfoss/wiki -* Upstream app code repository: https://github.com/fossar/selfoss -* YunoHost documentation for this app: https://yunohost.org/app_selfoss -* Report a bug: https://github.com/YunoHost-Apps/selfoss_ynh/issues +* Official app website: +* Official user documentation: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/selfoss_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/selfoss_ynh/tree/testing --debug or sudo yunohost app upgrade selfoss -u https://github.com/YunoHost-Apps/selfoss_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index a4813c0..90de271 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Selfoss pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/selfoss.svg)](https://dash.yunohost.org/appci/app/selfoss) ![](https://ci-apps.yunohost.org/ci/badges/selfoss.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/selfoss.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/selfoss.svg)](https://dash.yunohost.org/appci/app/selfoss) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/selfoss.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/selfoss.maintain.svg) [![Installer Selfoss avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=selfoss) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Selfoss 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.* @@ -14,35 +18,35 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Selfoss is a multipurpose RSS reader and feed aggregation web application. It allows you to easily follow updates from different web sites, social networks and other platforms, all in single place. It is written in PHP, allowing you to run it basically anywhere. -**Version incluse :** 2.18~ynh1 - +**Version incluse :** 2.18~ynh1 ## Captures d'écran -![](./doc/screenshots/screenshot1.png) +![Capture d'écran de Selfoss](./doc/screenshots/screenshot1.png) ## Avertissements / informations importantes password hash for optional login. You can generate a password hash by using following page of your selfoss installation. `http://your_selfoss_url.com/password` ## Documentations et ressources -* Site officiel de l'app : https://selfoss.aditu.de/ -* Documentation officielle utilisateur : https://selfoss.aditu.de/ -* Documentation officielle de l'admin : https://github.com/fossar/selfoss/wiki -* Dépôt de code officiel de l'app : https://github.com/fossar/selfoss -* Documentation YunoHost pour cette app : https://yunohost.org/app_selfoss -* Signaler un bug : https://github.com/YunoHost-Apps/selfoss_ynh/issues +* Site officiel de l'app : +* Documentation officielle utilisateur : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/selfoss_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/selfoss_ynh/tree/testing --debug ou sudo yunohost app upgrade selfoss -u https://github.com/YunoHost-Apps/selfoss_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From f38e742fcc13ca0ae87d88279bf0013c15c19fad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Aug 2022 18:29:35 +0200 Subject: [PATCH 06/10] set relative path --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 12efa7d..a55e575 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,7 +61,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/data" + ynh_setup_source --dest_dir="$final_path" --keep="data" fi chmod 750 "$final_path" From 27802b07243dfa5873d012b85d8628c1e39761fb Mon Sep 17 00:00:00 2001 From: Binnette Date: Thu, 22 Dec 2022 10:21:00 +0100 Subject: [PATCH 07/10] Use alias instead of root --- conf/nginx.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 4fcabbb..edfd863 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,10 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__ { - root /var/www/; + # Path to source + alias __FINALPATH__/; + + # ~ instruct nginx to perform a case-sensitive regular expression match location ~ [^/]\.php(/|$) { fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; From bb35617d3e831e06e36a326381a4fee1c85a9931 Mon Sep 17 00:00:00 2001 From: Binnette Date: Fri, 23 Dec 2022 10:40:59 +0100 Subject: [PATCH 08/10] Nginx: use alias instead of root --- conf/nginx.conf | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index edfd863..c3ced7e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,31 +1,36 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__ { +location __PATH__/ { # Path to source alias __FINALPATH__/; - # ~ instruct nginx to perform a case-sensitive regular expression match - - location ~ [^/]\.php(/|$) { - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } + # index.php is a router, it contains a lot of routes: + # / is serving the home page, /update is refreshing all feeds, etc. + # So we need to rewrite all URLs to give them to the router inside index.php + rewrite ^__PATH__/.*$ __PATH__/index.php?$args; + # feeds favicons and thumbnails are stored in subfolder data location ~ ^__PATH__/((favicons|thumbnails)/.+)$ { try_files __PATH__/data/$1 =404; } - location ~ ^__PATH__/$ { - index index.php; + # statics assets are stored in public folder + location ~ ^__PATH__/(.*\.(js|ico|gif|jpg|png|css|map|asc|txt|svg|xml|webmanifest)).*$ { + try_files __PATH__/public/$1 =404; } - location ~ ^__PATH__/(.+)$ { - try_files __PATH__/public/$1 __PATH__/index.php$is_args$args; + # Regex to match PHP files + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; } + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } From c954056f310e2b9ecada4e3c4c610c2863e7cedc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 23 Dec 2022 11:24:59 +0100 Subject: [PATCH 09/10] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 86d519e..a94739b 100644 --- a/check_process +++ b/check_process @@ -5,7 +5,7 @@ is_public=1 ; Checks pkg_linter=1 - setup_sub_dir=0 + setup_sub_dir=1 setup_root=1 setup_nourl=0 setup_private=1 From c896156daf988b7029b4f857cc515d64ec043925 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 23 Dec 2022 21:36:33 +0000 Subject: [PATCH 10/10] Auto-update README --- README.md | 1 - README_fr.md | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index c139d0e..07de9b4 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ Selfoss is a multipurpose RSS reader and feed aggregation web application. It al **Shipped version:** 2.18~ynh1 - ## Screenshots ![Screenshot of Selfoss](./doc/screenshots/screenshot1.png) diff --git a/README_fr.md b/README_fr.md index 90de271..b02e9eb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,8 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Selfoss is a multipurpose RSS reader and feed aggregation web application. It allows you to easily follow updates from different web sites, social networks and other platforms, all in single place. It is written in PHP, allowing you to run it basically anywhere. -**Version incluse :** 2.18~ynh1 - +**Version incluse :** 2.18~ynh1 ## Captures d'écran