From 219485a1629170f7a1bd13dd076740c72e818fd7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 29 Jun 2022 01:07:32 +0200 Subject: [PATCH 1/5] Apply last example_ynh --- check_process | 5 +-- conf/app.src | 1 + conf/nginx.conf | 18 +++++----- doc/DESCRIPTION.md | 1 + doc/DISCLAIMER.md | 1 + manifest.json | 84 +++++++++++++++++++++++----------------------- scripts/_common.sh | 11 ++++++ scripts/install | 2 ++ scripts/remove | 18 +--------- scripts/restore | 16 ++++----- scripts/upgrade | 34 +++++++++---------- 11 files changed, 94 insertions(+), 97 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DISCLAIMER.md diff --git a/check_process b/check_process index 0afae3f..1318de0 100644 --- a/check_process +++ b/check_process @@ -17,11 +17,8 @@ upgrade=1 from_commit=1466ec2bc358ba4556c3b8d0725a914b3da69648 backup_restore=1 multi_instance=0 + port_already_use=0 change_url=1 ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=24d48bd0e1268cae80a496855dbd9d404cd555ca - name=Merge pull request #84 - manifest_arg=domain=DOMAIN&path=PATH&is_public=1& diff --git a/conf/app.src b/conf/app.src index ed8b2d5..055f027 100644 --- a/conf/app.src +++ b/conf/app.src @@ -4,3 +4,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true SOURCE_FILENAME=searx.tar.gz +SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 2ec6fac..6b8e61d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,15 +1,15 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - uwsgi_param SCRIPT_NAME '__PATH_NO_ROOT__'; - include uwsgi_params; - uwsgi_modifier1 30; - uwsgi_pass unix:///var/run/__NAME__/app.socket; + uwsgi_param SCRIPT_NAME '__PATH_NO_ROOT__'; + include uwsgi_params; + uwsgi_modifier1 30; + uwsgi_pass unix:///var/run/__NAME__/app.socket; - #location __PATH__/searx/static/ { - # alias __FINALPATH__/searx/static/; - #} + #location __PATH__/searx/static/ { + # alias __FINALPATH__/searx/static/; + #} - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..eb13aa3 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Privacy-respecting, hackable metasearch engine diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1 @@ + diff --git a/manifest.json b/manifest.json index 6ee2d08..e4481ed 100644 --- a/manifest.json +++ b/manifest.json @@ -1,56 +1,56 @@ { - "name": "Searx", - "id": "searx", - "packaging_format": 1, - "description": { - "en": "Privacy-respecting, hackable metasearch engine", - "fr": "Méta-moteur de recherche respectueux de la vie privée et bidouillable", - "de": "Meta-Suchmaschine, die den Privatsphäre wahrt und 'hackable' ist" - }, - "version": "1.0.0~ynh5", - "url": "https://searx.github.io/searx/", - "upstream": { + "name": "Searx", + "id": "searx", + "packaging_format": 1, + "description": { + "en": "Privacy-respecting, hackable metasearch engine", + "fr": "Méta-moteur de recherche respectueux de la vie privée et bidouillable", + "de": "Meta-Suchmaschine, die den Privatsphäre wahrt und 'hackable' ist" + }, + "version": "1.0.0~ynh6", + "url": "https://searx.github.io/searx/", + "upstream": { "license": "AGPL-3.0-or-later", "website": "https://searx.github.io/searx/", "demo": "https://demo.yunohost.org/searx/", "admindoc": "https://github.com/searx/searx/wiki", "code": "https://github.com/searx/searx" }, - "license": "AGPL-3.0-or-later", - "maintainer": { - "name": "opi", - "email": "opi@zeropi.net" - }, - "requirements": { + "license": "AGPL-3.0-or-later", + "maintainer": { + "name": "opi", + "email": "opi@zeropi.net" + }, + "requirements": { "yunohost": ">= 4.3.0" - }, - "multi_instance": false, - "services": [ - "nginx", - "uwsgi" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/searx", - "default": "/searx" - }, - { - "name": "is_public", - "type": "boolean", + }, + "multi_instance": false, + "services": [ + "nginx", + "uwsgi" + ], + "arguments": { + "install": [ + { + "name": "domain", + "type": "domain" + }, + { + "name": "path", + "type": "path", + "example": "/searx", + "default": "/searx" + }, + { + "name": "is_public", + "type": "boolean", "help": { "en": "If enabled, Searx will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Searx sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin.", "de": "Wenn aktiviert, ist Searx für Personen zugänglich, die kein Konto haben. Dies kann später über den Webadmin geändert werden" }, - "default": true - } - ] - } + "default": true + } + ] + } } diff --git a/scripts/_common.sh b/scripts/_common.sh index bd43940..0f7619a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -130,6 +130,17 @@ ynh_remove_uwsgi_service () { ynh_secure_remove --file="/var/log/uwsgi/$app" ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d" fi + if [ -e /etc/init.d/uwsgi ] + then + # Redémarre le service uwsgi si il n'est pas désinstallé. + ynh_systemd_action --service_name=uwsgi --action=start + else + if yunohost service status | grep -q uwsgi + then + ynh_print_info --message="Remove uwsgi service" + yunohost service remove uwsgi + fi + fi } diff --git a/scripts/install b/scripts/install index 940e749..b2d841c 100644 --- a/scripts/install +++ b/scripts/install @@ -138,6 +138,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=2 # 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 diff --git a/scripts/remove b/scripts/remove index 6767b2f..9aed5f8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -54,22 +54,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=3 # Remove metapackage and its dependencies ynh_remove_app_dependencies -#================================================= -# REMOVE SERVICE FROM ADMIN PANEL -#================================================= - -if [ -e /etc/init.d/uwsgi ] -then - # Redémarre le service uwsgi si il n'est pas désinstallé. - ynh_systemd_action --service_name=uwsgi --action=start -else - if yunohost service status | grep -q uwsgi - then - ynh_print_info --message="Remove uwsgi service" - yunohost service remove uwsgi - fi -fi - #================================================= # GENERIC FINALIZATION #================================================= @@ -84,4 +68,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of Searx completed" --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index ad6e4ae..a4228ae 100755 --- a/scripts/restore +++ b/scripts/restore @@ -41,13 +41,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# 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" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -77,6 +70,13 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=35 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# 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 VARIOUS FILES #================================================= @@ -109,4 +109,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for Searx" --last +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index d5c20d6..ff534a1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,21 +83,28 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Create a temporary directory - tmpdir="$(mktemp -d)" + tmpdir="$(mktemp -d)" - # Backup the config file in the temp dir - cp -a "$final_path/searx/settings.yml" "$tmpdir/settings.yml" + # Backup the config file in the temp dir + cp -a "$final_path/searx/settings.yml" "$tmpdir/settings.yml" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" - # Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/settings.yml" "$final_path/searx/settings.yml" + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/settings.yml" "$final_path/searx/settings.yml" - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=7 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # NGINX CONFIGURATION #================================================= @@ -107,13 +114,6 @@ path_no_root=${path_url%/} # Create a dedicated NGINX config ynh_add_nginx_config "path_no_root" -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=7 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # SPECIFIC UPGRADE #================================================= @@ -124,9 +124,9 @@ ynh_script_progression --message="Upgrading Searx..." --weight=7 # Clean venv if it still on python2 if [ ! -e $final_path/bin/python3 ] then - ynh_regex_secure_remove --file=$final_path/lib/ --regex='python[^/.]*' - ynh_regex_secure_remove --file=$final_path/lib64/ --regex='python[^/.]*' - ynh_regex_secure_remove --file=$final_path/share/python-wheels + ynh_regex_secure_remove --file=$final_path/lib/ --regex='python[^/.]*' + ynh_regex_secure_remove --file=$final_path/lib64/ --regex='python[^/.]*' + ynh_regex_secure_remove --file=$final_path/share/python-wheels fi ynh_regex_secure_remove --file=$final_path/lib/python3/site-packages/setuptools ynh_regex_secure_remove --file=$final_path/lib/python3/site-packages/ --regex='setuptools-[^/.]*' From 80bf5e2edc377e0713520b75fa7500b334dc2d5d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 29 Jun 2022 01:22:08 +0200 Subject: [PATCH 2/5] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0f7619a..92838dd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -132,7 +132,7 @@ ynh_remove_uwsgi_service () { fi if [ -e /etc/init.d/uwsgi ] then - # Redémarre le service uwsgi si il n'est pas désinstallé. + # Redémarre le service uwsgi si il n'est pas désinstallé. ynh_systemd_action --service_name=uwsgi --action=start else if yunohost service status | grep -q uwsgi From e78c3f8b10c527f98d04ebfd472e295e623f342a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 28 Jun 2022 23:22:18 +0000 Subject: [PATCH 3/5] Auto-update README --- README.md | 26 ++++++++++++++++---------- README_fr.md | 34 ++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 18f4739..095de1e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Searx for YunoHost -[![Integration level](https://dash.yunohost.org/integration/searx.svg)](https://dash.yunohost.org/appci/app/searx) ![](https://ci-apps.yunohost.org/ci/badges/searx.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/searx.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/searx.svg)](https://dash.yunohost.org/appci/app/searx) ![Working status](https://ci-apps.yunohost.org/ci/badges/searx.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/searx.maintain.svg) [![Install Searx with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=searx) *[Lire ce readme en français.](./README_fr.md)* @@ -17,31 +17,37 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Privacy-respecting, hackable metasearch engine -**Shipped version:** 1.0.0~ynh5 + +**Shipped version:** 1.0.0~ynh6 **Demo:** https://demo.yunohost.org/searx/ ## Screenshots -![](./doc/screenshots/Screenshot.png) +![Screenshot of Searx](./doc/screenshots/Screenshot.png) + +## Disclaimers / important information + + ## Documentation and resources -* Official app website: https://searx.github.io/searx/ -* Official admin documentation: https://github.com/searx/searx/wiki -* Upstream app code repository: https://github.com/searx/searx -* YunoHost documentation for this app: https://yunohost.org/app_searx -* Report a bug: https://github.com/YunoHost-Apps/searx_ynh/issues +* Official app website: +* 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/searx_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/searx_ynh/tree/testing --debug or sudo yunohost app upgrade searx -u https://github.com/YunoHost-Apps/searx_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 52c4697..1ade6ed 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,43 +1,53 @@ + + # Searx pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/searx.svg)](https://dash.yunohost.org/appci/app/searx) ![](https://ci-apps.yunohost.org/ci/badges/searx.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/searx.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/searx.svg)](https://dash.yunohost.org/appci/app/searx) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/searx.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/searx.maintain.svg) [![Installer Searx avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=searx) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Searx 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 -Méta-moteur de recherche respectueux de la vie privée et bidouillable +Privacy-respecting, hackable metasearch engine -**Version incluse :** 1.0.0~ynh5 + +**Version incluse :** 1.0.0~ynh6 **Démo :** https://demo.yunohost.org/searx/ ## Captures d'écran -![](./doc/screenshots/Screenshot.png) +![Capture d'écran de Searx](./doc/screenshots/Screenshot.png) + +## Avertissements / informations importantes + + ## Documentations et ressources -* Site officiel de l'app : https://searx.github.io/searx/ -* Documentation officielle de l'admin : https://github.com/searx/searx/wiki -* Dépôt de code officiel de l'app : https://github.com/searx/searx -* Documentation YunoHost pour cette app : https://yunohost.org/app_searx -* Signaler un bug : https://github.com/YunoHost-Apps/searx_ynh/issues +* 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 : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/searx_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/searx_ynh/tree/testing --debug ou sudo yunohost app upgrade searx -u https://github.com/YunoHost-Apps/searx_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 f97c40a7aac3a07716fc5591525832ad04b1e933 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 29 Jun 2022 01:23:53 +0200 Subject: [PATCH 4/5] Update check_process --- check_process | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 1318de0..94d656a 100644 --- a/check_process +++ b/check_process @@ -12,9 +12,9 @@ setup_public=1 upgrade=1 # 1.0.0~ynh1 - #upgrade=1 from_commit=24d48bd0e1268cae80a496855dbd9d404cd555ca + #upgrade=1 from_commit=24d48bd0e1268cae80a496855dbd9d404cd555ca # 1.0.0~ynh5 - upgrade=1 from_commit=1466ec2bc358ba4556c3b8d0725a914b3da69648 + upgrade=1 from_commit=38db4d43e2d5e5e8939a6a0d57dd5fe8bcb8f7a9 backup_restore=1 multi_instance=0 port_already_use=0 From 1859870f780528a9bf5bf403f88e123aa3cada1e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 12 Jul 2022 21:30:21 +0200 Subject: [PATCH 5/5] Removing maintainer --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index e4481ed..624fcf9 100644 --- a/manifest.json +++ b/manifest.json @@ -18,8 +18,8 @@ }, "license": "AGPL-3.0-or-later", "maintainer": { - "name": "opi", - "email": "opi@zeropi.net" + "name": "", + "email": "" }, "requirements": { "yunohost": ">= 4.3.0"