From 789b4ce7e701dcda60fa8caa5940097050f33037 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 9 Feb 2023 10:04:01 +0100 Subject: [PATCH 1/4] Fix installation of version (for check_process) --- scripts/install | 8 +++++--- scripts/upgrade | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index c50a19b..4895382 100644 --- a/scripts/install +++ b/scripts/install @@ -86,9 +86,11 @@ ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -git clone $REPOSITORY $final_path --quiet + +install -d -o $app -g $app -m 0750 $final_path +ynh_exec_as $app git clone $REPOSITORY $final_path --quiet pushd "$final_path" - git checkout $COMMIT --quiet + ynh_exec_as $app git checkout $COMMIT --quiet popd chmod 750 "$final_path" @@ -111,7 +113,7 @@ ynh_add_nginx_config ynh_script_progression --message="Building..." pushd "$final_path" - git submodule update --init --recursive + ynh_exec_as $app git submodule update --init --recursive ynh_use_nodejs yarn install --pure-lockfile mkdir "$final_path/dist" diff --git a/scripts/upgrade b/scripts/upgrade index 1ce4c5b..098b184 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,9 +81,9 @@ then # Download, check integrity, uncompress and patch the source from app.src pushd "$final_path" - git checkout master - git pull --quiet - git checkout $COMMIT --quiet + ynh_exec_as $app git checkout master + ynh_exec_as $app git pull --quiet + ynh_exec_as $app git checkout $COMMIT --quiet popd fi @@ -119,7 +119,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Building..." pushd "$final_path" - git submodule update --init --recursive + ynh_exec_as $app git submodule update --init --recursive ynh_use_nodejs yarn install --pure-lockfile $ynh_npm run build From 1884cd0f90c8c291e59616c5727c81c024338706 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 8 Aug 2023 22:31:05 +0200 Subject: [PATCH 2/4] Fix upgrade from 0.0.1.2022.06.03~ynh1 --- scripts/install | 6 +++--- scripts/upgrade | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 4895382..f81fb89 100644 --- a/scripts/install +++ b/scripts/install @@ -115,9 +115,9 @@ ynh_script_progression --message="Building..." pushd "$final_path" ynh_exec_as $app git submodule update --init --recursive ynh_use_nodejs - yarn install --pure-lockfile - mkdir "$final_path/dist" - $ynh_npm run build + ynh_exec_as $app env $ynh_node_load_PATH yarn install --pure-lockfile + ynh_exec_as $app mkdir -p "$final_path/dist" + ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 098b184..bd5dd2f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,6 +63,11 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# Fix upgrade from 0.0.1.2022.06.03~ynh1 +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:$app "$final_path" + #================================================= # CREATE DEDICATED USER #================================================= @@ -121,8 +126,9 @@ ynh_script_progression --message="Building..." pushd "$final_path" ynh_exec_as $app git submodule update --init --recursive ynh_use_nodejs - yarn install --pure-lockfile - $ynh_npm run build + ynh_exec_as $app env $ynh_node_load_PATH yarn install --pure-lockfile + ynh_exec_as $app mkdir -p "$final_path/dist" + ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd #================================================= From d22e9577013a50c30cd743017fa74ab8acf2852a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 8 Aug 2023 22:53:42 +0200 Subject: [PATCH 3/4] Upgrade to 0.0.1.2023.08.08~ynh1 --- conf/app.src | 4 +-- conf/default.yaml | 63 +++++++++++++++++++++++++++++++++++++++++++--- conf/nginx.conf | 2 +- manifest.json | 2 +- scripts/_common.sh | 2 +- 5 files changed, 65 insertions(+), 8 deletions(-) diff --git a/conf/app.src b/conf/app.src index 769239b..4b32973 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://framagit.org/framasoft/peertube/search-index/-/archive/b44e850fa1604cebac19eb822e9d555f673085b0/search-index-b44e850fa1604cebac19eb822e9d555f673085b0.tar.gz -SOURCE_SUM=7a68fd70aeaac05d06fbbb3c8cf7a375e9d2e112235e4af6857630380e114b18 +SOURCE_URL=https://framagit.org/framasoft/peertube/search-index/-/archive/36a36379b469982e6b2fc219825283e2470135e7/search-index-36a36379b469982e6b2fc219825283e2470135e7.tar.gz +SOURCE_SUM=d5f92138c38642cb1cf559f2260652203aa38cfd03c5811c49e9299d1cdfe3ef SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/default.yaml b/conf/default.yaml index cdc652e..6b3525c 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -8,11 +8,20 @@ webserver: port: __PORT__ elastic-search: + # https or http + http: 'http' + auth: + username: null + password: null + ssl: + # Specificy a custom CA + ca: null hostname: 'localhost' port: 9200 indexes: videos: 'peertube-index-videos' channels: 'peertube-index-channels' + playlists: 'peertube-index-playlists' log: level: 'debug' # debug/info/warning/error @@ -50,34 +59,82 @@ videos-search: boost-languages: enabled: true - # Add ability to change videos search fields boost value + # Add ability to change videos search fields boost and match value # See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html for more information + # # If boost == 0, the field will not be part of the search + # + # match_type could be 'default' or 'phrase' + # * default: use default Elastic Search match query, including fuzziness + # * phrase: use Elastic Search phrase match query search-fields: + uuid: + boost: 100 + match_type: 'default' + short-uuid: + boost: 100 + match_type: 'default' name: boost: 5 + match_type: 'default' description: boost: 1 + match_type: 'phrase' tags: - boost: 3 + boost: 2 + match_type: 'default' account-display-name: boost: 2 + match_type: 'default' channel-display-name: boost: 2 + match_type: 'default' channels-search: - # Add ability to change channels search fields boost value + # Add ability to change channels search fields boost and match value # See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html for more information + # # If boost == 0, the field will not be part of the search + # + # match_type could be 'default' or 'phrase' + # * default: use default Elastic Search match query, including fuzziness + # * phrase: use Elastic Search phrase match query search-fields: name: boost: 5 + match_type: 'default' description: boost: 1 + match_type: 'phrase' display-name: boost: 3 + match_type: 'default' account-display-name: boost: 2 + match_type: 'default' + +playlists-search: + # Add ability to change playlists search fields boost and match value + # See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html for more information + # + # If boost == 0, the field will not be part of the search + # + # match_type could be 'default' or 'phrase' + # * default: use default Elastic Search match query, including fuzziness + # * phrase: use Elastic Search phrase match query + search-fields: + uuid: + boost: 100 + match_type: 'default' + short-uuid: + boost: 100 + match_type: 'default' + display-name: + boost: 5 + match_type: 'default' + description: + boost: 1 + match_type: 'phrase' api: # Blacklist hosts that will not be returned by the search API diff --git a/conf/nginx.conf b/conf/nginx.conf index 6dcc899..41bddd1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/ ; + alias __FINALPATH__/; proxy_pass http://localhost:__PORT__; proxy_set_header X-Real-IP $remote_addr; diff --git a/manifest.json b/manifest.json index 82a822e..c63fb46 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Search engine for PeerTube videos and channels", "fr": "Moteur de recherche de vidéos et chaînes PeerTube" }, - "version": "0.0.1.2022.06.03~ynh1", + "version": "0.0.1.2023.08.08~ynh1", "url": "https://search.joinpeertube.org/", "upstream": { "license": "AGPL-3.0-only", diff --git a/scripts/_common.sh b/scripts/_common.sh index 7656999..3075898 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="git" extra_pkg_dependencies="elasticsearch-oss" -NODEJS_VERSION=14 +NODEJS_VERSION=16 REPOSITORY="https://framagit.org/framasoft/peertube/search-index" From 69bf49ebfe80abf23499f4edcadade846e48b289 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 9 Aug 2023 19:20:12 +0000 Subject: [PATCH 4/4] Auto-update README --- README.md | 5 +++-- README_fr.md | 23 ++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cb15866..f0eba29 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # PeerTube search-index for YunoHost -[![Integration level](https://dash.yunohost.org/integration/peertube-search-index.svg)](https://dash.yunohost.org/appci/app/peertube-search-index) ![Working status](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/peertube-search-index.svg)](https://dash.yunohost.org/appci/app/peertube-search-index) ![Working status](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.maintain.svg) + [![Install PeerTube search-index with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=peertube-search-index) *[Lire ce readme en français.](./README_fr.md)* @@ -18,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in A search engine for [PeerTube](https://joinpeertube.org/) videos and channels, developed by Framasoft. -**Shipped version:** 0.0.1.2022.06.03~ynh1 +**Shipped version:** 0.0.1.2023.08.08~ynh1 **Demo:** https://search.joinpeertube.org/ diff --git a/README_fr.md b/README_fr.md index 3a6c005..12c5edc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,26 +5,27 @@ It shall NOT be edited by hand. # PeerTube search-index pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/peertube-search-index.svg)](https://dash.yunohost.org/appci/app/peertube-search-index) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/peertube-search-index.svg)](https://dash.yunohost.org/appci/app/peertube-search-index) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/peertube-search-index.maintain.svg) + [![Installer PeerTube search-index avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=peertube-search-index) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer PeerTube search-index 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.* +> *Ce package vous permet d’installer PeerTube search-index 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 +## Vue d’ensemble A search engine for [PeerTube](https://joinpeertube.org/) videos and channels, developed by Framasoft. -**Version incluse :** 0.0.1.2022.06.03~ynh1 +**Version incluse :** 0.0.1.2023.08.08~ynh1 **Démo :** https://search.joinpeertube.org/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de PeerTube search-index](./doc/screenshots/sepia-search-screenshot.png) +![Capture d’écran de PeerTube search-index](./doc/screenshots/sepia-search-screenshot.png) ## Avertissements / informations importantes @@ -38,9 +39,9 @@ To configure this app: modify the file `/var/www/peertube-search-index/config/pr ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* 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 : @@ -56,4 +57,4 @@ ou sudo yunohost app upgrade peertube-search-index -u https://github.com/YunoHost-Apps/peertube-search-index_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file