Merge pull request #34 from fflorent/fix-0.0.1.2022.06.03

[NEW BRANCH fix-0.0.1.2023.08.08] Fix installation of version (for check_process)
This commit is contained in:
yalh76 2023-08-09 21:20:08 +02:00 committed by GitHub
commit 0fdeeb8dc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 85 additions and 20 deletions

View file

@ -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

View file

@ -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

View file

@ -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",

View file

@ -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"

View file

@ -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,11 +113,11 @@ 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"
$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
#=================================================

View file

@ -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
#=================================================
@ -81,9 +86,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,10 +124,11 @@ 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
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
#=================================================