From 30c4b3d1f90d74ebcb77c62ee2bfca61d7bd58d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:22:12 +0200 Subject: [PATCH 01/12] v2 --- conf/amd64.src | 6 ----- conf/arm64.src | 6 ----- conf/elasticsearch.yml | 2 +- conf/systemd.service | 8 +++---- manifest.toml | 47 +++++++++++++++++++++++++++++++++++++++ scripts/backup | 16 +++++++------- scripts/install | 50 +++++++++++++++++++++--------------------- scripts/remove | 20 ++++++++--------- scripts/restore | 42 +++++++++++++++++------------------ scripts/upgrade | 44 ++++++++++++++++++------------------- 10 files changed, 138 insertions(+), 103 deletions(-) delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src create mode 100644 manifest.toml diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 06ee3a2..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-x86_64.tar.gz -SOURCE_SUM=00ba66d1b67226ed87ff1c27815bb5961e352177709dd8794ef9a77b4e90a394 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 6043db3..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-aarch64.tar.gz -SOURCE_SUM=ca965cccaabbdcb67f13a7e7b166bd7c51004c9ca55ec0ba004c475ca0024bef -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/elasticsearch.yml b/conf/elasticsearch.yml index 3b12e62..7eabe4e 100644 --- a/conf/elasticsearch.yml +++ b/conf/elasticsearch.yml @@ -11,7 +11,7 @@ http.port: __PORT__ # # Path to directory where to store the data (separate multiple locations by comma): # -path.data: __DATADIR__ +path.data: __DATA_DIR__ # # Unless you have already configured a cluster, you should set diff --git a/conf/systemd.service b/conf/systemd.service index b2fc349..d48a0c1 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,12 +8,12 @@ Type=simple User=__APP__ Group=__APP__ RuntimeDirectory=__APP__ -Environment="ES_JAVA_HOME=__FINALPATH__/jdk" -Environment="ES_PATH_CONF=__FINALPATH__/config" +Environment="ES_JAVA_HOME=__INSTALL_DIR__/jdk" +Environment="ES_PATH_CONF=__INSTALL_DIR__/config" Environment="PID_DIR=/run/__APP__" Environment="ES_SD_NOTIFY=true" -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/bin/elasticsearch -p ${PID_DIR}/__APP__.pid --quiet +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/bin/elasticsearch -p ${PID_DIR}/__APP__.pid --quiet StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..2762d74 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,47 @@ +packaging_format = 2 + +id = "elasticsearch8" +name = "ElasticSearch 8" +description.en = "Distributed and RESTful search engine." +description.fr = "Moteur de recherche RESTful." + +version = "8.10.3~ynh1" + +maintainers = ["fflorent"] + +[upstream] +license = "SSPL-1.0" +website = "https://elastic.co" +demo = "https://www.elastic.co/demos" +admindoc = "https://www.elastic.co/guide/en/elasticsearch/reference/8.10/elasticsearch-intro.html" +code = "https://github.com/elastic/elasticsearch" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.0" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + +[resources] + [resources.sources.main] + arm64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-aarch64.tar.gz" + arm64.sha256 = "ca965cccaabbdcb67f13a7e7b166bd7c51004c9ca55ec0ba004c475ca0024bef" + amd64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-x86_64.tar.gz" + amd64.sha256 = "00ba66d1b67226ed87ff1c27815bb5961e352177709dd8794ef9a77b4e90a394" + + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] diff --git a/scripts/backup b/scripts/backup index 99ef323..663ad13 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,22 +14,22 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -40,13 +40,13 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" --is_big +ynh_backup --src_path="$data_dir" --is_big #================================================= # SPECIFIC BACKUP diff --git a/scripts/install b/scripts/install index 1e9f7d5..dc453d3 100755 --- a/scripts/install +++ b/scripts/install @@ -14,32 +14,32 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/opt/yunohost/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/opt/yunohost/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=9200) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=9200) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # DEFAULT VALUES FOR CONFIGURATION @@ -54,37 +54,37 @@ ynh_app_setting_set --app=$app --key=xmx --value=$xmx #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=15 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # CREATE DATA DIRECTORY #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir +#REMOVEME? data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= @@ -92,11 +92,11 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Adding the configuration files..." --weight=1 -ynh_add_config --template="elasticsearch.yml" --destination="$final_path/config/elasticsearch.yml" -ynh_add_config --template="jvm.options" --destination="$final_path/config/jvm.options.d/yunohost.options" +ynh_add_config --template="elasticsearch.yml" --destination="$install_dir/config/elasticsearch.yml" +ynh_add_config --template="jvm.options" --destination="$install_dir/config/jvm.options.d/yunohost.options" -chmod 400 "$final_path/config/elasticsearch.yml" "$final_path/config/jvm.options.d/yunohost.options" -chown $app:$app "$final_path/config/elasticsearch.yml" "$final_path/config/jvm.options.d/yunohost.options" +chmod 400 "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options" +chown $app:$app "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options" #================================================= diff --git a/scripts/remove b/scripts/remove index 1f06e84..96aca76 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -port=$(ynh_app_setting_get --app=$app --key=port) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # STANDARD REMOVE @@ -52,10 +52,10 @@ ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -65,7 +65,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." --weight=1 - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -83,10 +83,10 @@ fi #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index 6183965..07bd7f6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,65 +14,65 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -port=$(ynh_find_port --port=9200) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? port=$(ynh_find_port --port=9200) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= ynh_script_progression --message="Restoring the data directory..." --weight=1 -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 0e6c27e..7b339ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -port=$(ynh_app_setting_get --app=$app --key=port) -xms=$(ynh_app_setting_get --app=$app --key=xms) -xmx=$(ynh_app_setting_get --app=$app --key=xmx) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? xms=$(ynh_app_setting_get --app=$app --key=xms) +#REMOVEME? xmx=$(ynh_app_setting_get --app=$app --key=xmx) #================================================= # CHECK VERSION @@ -31,16 +31,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -59,10 +59,10 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -73,23 +73,23 @@ then ynh_script_progression --message="Upgrading source files..." --weight=20 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" --keep="config/elasticsearch.yml config/jvm.options.d/yunohost.conf" + ynh_setup_source --dest_dir="$install_dir" --keep="config/elasticsearch.yml config/jvm.options.d/yunohost.conf" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # UPDATE A CONFIG FILE #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -ynh_add_config --template="elasticsearch.yml" --destination="$final_path/config/elasticsearch.yml" -ynh_add_config --template="jvm.options" --destination="$final_path/config/jvm.options.d/yunohost.options" +ynh_add_config --template="elasticsearch.yml" --destination="$install_dir/config/elasticsearch.yml" +ynh_add_config --template="jvm.options" --destination="$install_dir/config/jvm.options.d/yunohost.options" -chmod 400 "$final_path/config/elasticsearch.yml" "$final_path/config/jvm.options.d/yunohost.options" -chown $app:$app "$final_path/config/elasticsearch.yml" "$final_path/config/jvm.options.d/yunohost.options" +chmod 400 "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options" +chown $app:$app "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options" #================================================= # INCREASE MAX_MAP_COUNT From b526ec0e5a6fa8bb69dca2053c4c5fdc7bf2a214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:31:05 +0200 Subject: [PATCH 02/12] fix --- .github/workflows/updater.sh | 115 -------------------------------- .github/workflows/updater.yml | 49 -------------- check_process | 22 ------ conf/systemd.service | 2 +- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/DESCRIPTION_fr.md | 2 + manifest.json | 31 --------- manifest.toml | 24 +++---- scripts/backup | 21 ------ scripts/install | 78 +--------------------- scripts/remove | 67 ------------------- scripts/restore | 57 +--------------- scripts/upgrade | 50 +------------- 13 files changed, 20 insertions(+), 498 deletions(-) delete mode 100755 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml delete mode 100644 check_process rename doc/{DISCLAIMER.md => ADMIN.md} (100%) create mode 100644 doc/DESCRIPTION_fr.md delete mode 100644 manifest.json diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100755 index 847022f..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true) | .tag_name | select( startswith("v8") )' | sort -V | tail -1) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "1 available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -for arch in "x86_64" "aarch64"; do -asset_url="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$version-linux-$arch.tar.gz" -echo "Handling asset at $asset_url" - -# Assign the asset to a source file in conf/ directory -# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) -# Leave $src empty to ignore the asset -case $arch in - "x86_64") - src="amd64" - ;; - "aarch64") - src="arm64" - ;; -esac - -# Create the temporary directory -tempdir="$(mktemp -d)" - -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - -# Delete temporary directory -rm -rf $tempdir - -extension=tar.gz - -# Rewrite source file -cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -EOT -echo "... conf/$src.src updated" - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -admindoc="https://www.elastic.co/guide/en/elasticsearch/reference/$(echo $version | grep -Po "^\d+\.\d+")/elasticsearch-intro.html" -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\" | .upstream.admindoc = \"$admindoc\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index a56d7cb..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it every day at 6:00 UTC - schedule: - - cron: '0 6 * * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - draft: false diff --git a/check_process b/check_process deleted file mode 100644 index b27ef58..0000000 --- a/check_process +++ /dev/null @@ -1,22 +0,0 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - -;; Test complet - ; Manifest - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=0 - setup_nourl=1 - setup_private=0 - setup_public=0 - upgrade=1 - backup_restore=1 - multi_instance=1 - port_already_use=1 - change_url=0 -;;; Options -Email= -Notification=none diff --git a/conf/systemd.service b/conf/systemd.service index d48a0c1..750834f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=ElasticSearch - Distributed and RESTful search engine +Description=ElasticSearch: Distributed and RESTful search engine Documentation=https://elastic.co After=network.target diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..2d78f25 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,2 @@ +Elasticsearch est le moteur de recherche et d'analyse distribué et RESTful au cœur de la [Elastic Stack](https://www.elastic.co/products). Vous pouvez utiliser Elasticsearch pour stocker, rechercher et gérer des données pour les journaux, les métriques, le backend de recherche, la surveillance des applications et la sécurité des points de terminaison. +Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, consultez la [page produit](https://www.elastic.co/products/elasticsearch). \ No newline at end of file diff --git a/manifest.json b/manifest.json deleted file mode 100644 index cd6fa6c..0000000 --- a/manifest.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "ElasticSearch 8", - "id": "elasticsearch8", - "packaging_format": 1, - "description": { - "en": "Distributed and RESTful search engine.", - "fr": "Moteur de recherche RESTful." - }, - "version": "8.10.3~ynh1", - "url": "https://github.com/elastic/elasticsearch", - "upstream": { - "license": "SSPL-1.0", - "website": "https://elastic.co", - "demo": "https://www.elastic.co/demos", - "admindoc": "https://www.elastic.co/guide/en/elasticsearch/reference/8.10/elasticsearch-intro.html", - "code": "https://github.com/elastic/elasticsearch" - }, - "license": "SSPL-1.0", - "maintainer": { - "name": "fflorent", - "email": "florent.git@zeteo.me" - }, - "requirements": { - "yunohost": ">= 11.0.0" - }, - "services": [], - "multi_instance": true, - "arguments": { - "install": [] - } -} diff --git a/manifest.toml b/manifest.toml index 2762d74..68ffeeb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,8 +2,8 @@ packaging_format = 2 id = "elasticsearch8" name = "ElasticSearch 8" -description.en = "Distributed and RESTful search engine." -description.fr = "Moteur de recherche RESTful." +description.en = "Distributed and RESTful search engine" +description.fr = "Moteur de recherche RESTful" version = "8.10.3~ynh1" @@ -15,18 +15,16 @@ website = "https://elastic.co" demo = "https://www.elastic.co/demos" admindoc = "https://www.elastic.co/guide/en/elasticsearch/reference/8.10/elasticsearch-intro.html" code = "https://github.com/elastic/elasticsearch" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.0" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.2" +architectures = ["amd64", "arm64"] multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] @@ -37,7 +35,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen amd64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-x86_64.tar.gz" amd64.sha256 = "00ba66d1b67226ed87ff1c27815bb5961e352177709dd8794ef9a77b4e90a394" - [resources.system_user] [resources.install_dir] @@ -45,3 +42,6 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.data_dir] [resources.permissions] + + [resources.ports] + main.default = 9200 diff --git a/scripts/backup b/scripts/backup index 663ad13..c6be9d6 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,27 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index dc453d3..add0f20 100755 --- a/scripts/install +++ b/scripts/install @@ -9,84 +9,27 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/opt/yunohost/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=9200) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - #================================================= # DEFAULT VALUES FOR CONFIGURATION #================================================= xms=256m -ynh_app_setting_set --app=$app --key=xms --value=$xms - xmx=1g + +ynh_app_setting_set --app=$app --key=xms --value=$xms ynh_app_setting_set --app=$app --key=xmx --value=$xmx -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=15 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" - - #================================================= # ADD CONFIGURATIONS #================================================= @@ -98,7 +41,6 @@ ynh_add_config --template="jvm.options" --destination="$install_dir/config/jvm.o chmod 400 "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options" chown $app:$app "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options" - #================================================= # INCREASE MAX_MAP_COUNT #================================================= @@ -112,7 +54,6 @@ then sysctl -p /etc/sysctl.d/90-max_map_count-elasticsearch.conf fi - #================================================= # SETUP SYSTEMD #================================================= @@ -121,23 +62,10 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="ElasticSearch - Distributed and RESTful search engine" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Distributed and RESTful search engine" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index 96aca76..c028c2d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -33,68 +22,12 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." - if [ -e "/etc/sysctl.d/90-max_map_count-elasticsearch.conf" ]; then ynh_secure_remove --file="/etc/sysctl.d/90-max_map_count-elasticsearch.conf" # Reload the kernel configuration. diff --git a/scripts/restore b/scripts/restore index 07bd7f6..af3a2ef 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,46 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? port=$(ynh_find_port --port=9200) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -57,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -68,10 +27,6 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" #================================================= @@ -95,19 +50,9 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="ElasticSearch - Distributed and RESTful search engine" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Distributed and RESTful search engine" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 7b339ab..b383445 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,39 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? xms=$(ynh_app_setting_get --app=$app --key=xms) -#REMOVEME? xmx=$(ynh_app_setting_get --app=$app --key=xmx) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -56,14 +29,6 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -76,7 +41,6 @@ then ynh_setup_source --dest_dir="$install_dir" --keep="config/elasticsearch.yml config/jvm.options.d/yunohost.conf" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -112,22 +76,10 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="ElasticSearch - Distributed and RESTful search engine" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Distributed and RESTful search engine" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From 497739d4fff2a6a58a2db7772a44413a02581f72 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 14 Oct 2023 12:31:10 +0000 Subject: [PATCH 03/12] Auto-update README --- README.md | 8 -------- README_fr.md | 13 ++----------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index edf6966..a6cdb1d 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,6 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc **Shipped version:** 8.10.3~ynh1 **Demo:** https://www.elastic.co/demos -## Disclaimers / important information - -### Limitations - - **Not totally free**: Licensed under SSPL, see for more information: - - Currently the security is disabled - - Therefore, the package is configured to remain not public for now (i.e. not accessible through the web, the apps depending on it should be installed on the same server) - - Not scalable for now - ## :red_circle: Antifeatures - **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. diff --git a/README_fr.md b/README_fr.md index f827c29..abb8c41 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,21 +16,12 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Elasticsearch is the distributed, RESTful search and analytics engine at the heart of the [Elastic Stack](https://www.elastic.co/products). You can use Elasticsearch to store, search, and manage data for logs, metrics, search backend, application monitoring, Endpoint security. -To learn more about Elasticsearch’s features and capabilities, see the [product page](https://www.elastic.co/products/elasticsearch). - +Elasticsearch est le moteur de recherche et d'analyse distribué et RESTful au cœur de la [Elastic Stack](https://www.elastic.co/products). Vous pouvez utiliser Elasticsearch pour stocker, rechercher et gérer des données pour les journaux, les métriques, le backend de recherche, la surveillance des applications et la sécurité des points de terminaison. +Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, consultez la [page produit](https://www.elastic.co/products/elasticsearch). **Version incluse :** 8.10.3~ynh1 **Démo :** https://www.elastic.co/demos -## Avertissements / informations importantes - -### Limitations - - **Not totally free**: Licensed under SSPL, see for more information: - - Currently the security is disabled - - Therefore, the package is configured to remain not public for now (i.e. not accessible through the web, the apps depending on it should be installed on the same server) - - Not scalable for now - ## :red_circle: Fonctions indésirables - **Not totally free upstream**: The packaged app is under an overall free licence, but with clauses that restrict its use. From 5913ca4917e7243bee5069841bb7a940515c9571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:31:39 +0200 Subject: [PATCH 04/12] Create tests.toml --- tests.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests.toml diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From 78043188d1a4a95bb86402f0aa1ec9da555f4167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:54:27 +0200 Subject: [PATCH 05/12] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index af3a2ef..f262a1e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -34,7 +34,7 @@ chown -R $app:www-data "$data_dir" #================================================= # RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring various files..." +ynh_script_progression --message="Restoring various files..." --weight=1 ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-elasticsearch.conf" if ! [ "${container:-}" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. From 707c4a7c38fa2df99a269389d11aa2c544041722 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Nov 2023 07:24:11 +0000 Subject: [PATCH 06/12] Auto-update README --- README.md | 4 ++-- README_fr.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b28a374..a594600 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Elasticsearch is the distributed, RESTful search and analytics engine at the hea To learn more about Elasticsearch’s features and capabilities, see the [product page](https://www.elastic.co/products/elasticsearch). -**Shipped version:** 8.11.1~ynh1 +**Shipped version:** 8.10.3~ynh1 **Demo:** https://www.elastic.co/demos ## :red_circle: Antifeatures @@ -30,7 +30,7 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc ## Documentation and resources * Official app website: -* Official admin documentation: +* Official admin documentation: * Upstream app code repository: * YunoHost Store: * Report a bug: diff --git a/README_fr.md b/README_fr.md index e6b6949..ebdbd3c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Elasticsearch est le moteur de recherche et d'analyse distribué et RESTful au cœur de la [Elastic Stack](https://www.elastic.co/products). Vous pouvez utiliser Elasticsearch pour stocker, rechercher et gérer des données pour les journaux, les métriques, le backend de recherche, la surveillance des applications et la sécurité des points de terminaison. Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, consultez la [page produit](https://www.elastic.co/products/elasticsearch). -**Version incluse :** 8.11.1~ynh1 +**Version incluse :** 8.10.3~ynh1 **Démo :** https://www.elastic.co/demos ## :red_circle: Fonctions indésirables @@ -29,7 +29,7 @@ Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, cons ## Documentations et ressources * Site officiel de l’app : -* Documentation officielle de l’admin : +* Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * YunoHost Store: * Signaler un bug : From b95fe56995db43a16024d89b42a35dd6a329079c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:27:02 +0100 Subject: [PATCH 07/12] Update manifest.toml --- manifest.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/manifest.toml b/manifest.toml index 68ffeeb..67cb523 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "ElasticSearch 8" description.en = "Distributed and RESTful search engine" description.fr = "Moteur de recherche RESTful" -version = "8.10.3~ynh1" +version = "8.11.1~ynh1" maintainers = ["fflorent"] @@ -20,8 +20,11 @@ code = "https://github.com/elastic/elasticsearch" yunohost = ">= 11.2" architectures = ["amd64", "arm64"] multi_instance = true + ldap = "not_relevant" + sso = "not_relevant" + disk = "50M" ram.build = "50M" ram.runtime = "50M" @@ -30,10 +33,11 @@ ram.runtime = "50M" [resources] [resources.sources.main] - arm64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-aarch64.tar.gz" - arm64.sha256 = "ca965cccaabbdcb67f13a7e7b166bd7c51004c9ca55ec0ba004c475ca0024bef" - amd64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.10.3-linux-x86_64.tar.gz" - amd64.sha256 = "00ba66d1b67226ed87ff1c27815bb5961e352177709dd8794ef9a77b4e90a394" + arm64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.11.1-linux-aarch64.tar.gz" + arm64.sha256 = "1728d26f398b58156411f80b871a2d5a0825ae446a8bec70a01a952fe7c707cb" + amd64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.11.1-linux-x86_64.tar.gz" + amd64.sha256 = "dd8572e4f50ffbe4079cce315b17c25e3cebaa02fd7eb134d2aa222703459780" + autoupdate.strategy = "latest_github_tag" [resources.system_user] From 209b3d64ca0260bbc1af3ca94bb55169bbc70c08 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Nov 2023 07:27:12 +0000 Subject: [PATCH 08/12] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a594600..561a41a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Elasticsearch is the distributed, RESTful search and analytics engine at the hea To learn more about Elasticsearch’s features and capabilities, see the [product page](https://www.elastic.co/products/elasticsearch). -**Shipped version:** 8.10.3~ynh1 +**Shipped version:** 8.11.1~ynh1 **Demo:** https://www.elastic.co/demos ## :red_circle: Antifeatures diff --git a/README_fr.md b/README_fr.md index ebdbd3c..0bae788 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Elasticsearch est le moteur de recherche et d'analyse distribué et RESTful au cœur de la [Elastic Stack](https://www.elastic.co/products). Vous pouvez utiliser Elasticsearch pour stocker, rechercher et gérer des données pour les journaux, les métriques, le backend de recherche, la surveillance des applications et la sécurité des points de terminaison. Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, consultez la [page produit](https://www.elastic.co/products/elasticsearch). -**Version incluse :** 8.10.3~ynh1 +**Version incluse :** 8.11.1~ynh1 **Démo :** https://www.elastic.co/demos ## :red_circle: Fonctions indésirables From eb7845b5ed1aa0d2ec346b27c85e539787b2e28b Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 14 Nov 2023 09:03:27 +0100 Subject: [PATCH 09/12] Fix version in documentation URL --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 67cb523..560e543 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,7 +13,7 @@ maintainers = ["fflorent"] license = "SSPL-1.0" website = "https://elastic.co" demo = "https://www.elastic.co/demos" -admindoc = "https://www.elastic.co/guide/en/elasticsearch/reference/8.10/elasticsearch-intro.html" +admindoc = "https://www.elastic.co/guide/en/elasticsearch/reference/8.11/elasticsearch-intro.html" code = "https://github.com/elastic/elasticsearch" [integration] From 24d01beb0e123ab3eb5f09943b0806277cff3208 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Nov 2023 08:03:43 +0000 Subject: [PATCH 10/12] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 561a41a..b28a374 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc ## Documentation and resources * Official app website: -* Official admin documentation: +* Official admin documentation: * Upstream app code repository: * YunoHost Store: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 0bae788..e6b6949 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,7 +29,7 @@ Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, cons ## Documentations et ressources * Site officiel de l’app : -* Documentation officielle de l’admin : +* Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * YunoHost Store: * Signaler un bug : From 70794d3a9f31ac881a8f7988f0ca2241c7ed842a Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 14 Nov 2023 09:04:17 +0100 Subject: [PATCH 11/12] Bump version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 560e543..921f646 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "ElasticSearch 8" description.en = "Distributed and RESTful search engine" description.fr = "Moteur de recherche RESTful" -version = "8.11.1~ynh1" +version = "8.11.1~ynh2" maintainers = ["fflorent"] From b15dd3416af7e662169cbc328b9eb0175227ce5b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Nov 2023 08:04:44 +0000 Subject: [PATCH 12/12] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b28a374..ebd0e44 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Elasticsearch is the distributed, RESTful search and analytics engine at the hea To learn more about Elasticsearch’s features and capabilities, see the [product page](https://www.elastic.co/products/elasticsearch). -**Shipped version:** 8.11.1~ynh1 +**Shipped version:** 8.11.1~ynh2 **Demo:** https://www.elastic.co/demos ## :red_circle: Antifeatures diff --git a/README_fr.md b/README_fr.md index e6b6949..6b3ab02 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Elasticsearch est le moteur de recherche et d'analyse distribué et RESTful au cœur de la [Elastic Stack](https://www.elastic.co/products). Vous pouvez utiliser Elasticsearch pour stocker, rechercher et gérer des données pour les journaux, les métriques, le backend de recherche, la surveillance des applications et la sécurité des points de terminaison. Pour en savoir plus sur les fonctionnalités et capacités d'Elasticsearch, consultez la [page produit](https://www.elastic.co/products/elasticsearch). -**Version incluse :** 8.11.1~ynh1 +**Version incluse :** 8.11.1~ynh2 **Démo :** https://www.elastic.co/demos ## :red_circle: Fonctions indésirables