mirror of
https://github.com/YunoHost-Apps/elasticsearch8_ynh.git
synced 2024-09-03 18:26:26 +02:00
v2
This commit is contained in:
parent
91858d3705
commit
30c4b3d1f9
10 changed files with 138 additions and 103 deletions
|
@ -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=
|
|
|
@ -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=
|
|
|
@ -11,7 +11,7 @@ http.port: __PORT__
|
||||||
#
|
#
|
||||||
# Path to directory where to store the data (separate multiple locations by comma):
|
# 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
|
# Unless you have already configured a cluster, you should set
|
||||||
|
|
|
@ -8,12 +8,12 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
RuntimeDirectory=__APP__
|
RuntimeDirectory=__APP__
|
||||||
Environment="ES_JAVA_HOME=__FINALPATH__/jdk"
|
Environment="ES_JAVA_HOME=__INSTALL_DIR__/jdk"
|
||||||
Environment="ES_PATH_CONF=__FINALPATH__/config"
|
Environment="ES_PATH_CONF=__INSTALL_DIR__/config"
|
||||||
Environment="PID_DIR=/run/__APP__"
|
Environment="PID_DIR=/run/__APP__"
|
||||||
Environment="ES_SD_NOTIFY=true"
|
Environment="ES_SD_NOTIFY=true"
|
||||||
WorkingDirectory=__FINALPATH__/
|
WorkingDirectory=__INSTALL_DIR__/
|
||||||
ExecStart=__FINALPATH__/bin/elasticsearch -p ${PID_DIR}/__APP__.pid --quiet
|
ExecStart=__INSTALL_DIR__/bin/elasticsearch -p ${PID_DIR}/__APP__.pid --quiet
|
||||||
StandardOutput=append:/var/log/__APP__/__APP__.log
|
StandardOutput=append:/var/log/__APP__/__APP__.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
||||||
|
|
47
manifest.toml
Normal file
47
manifest.toml
Normal file
|
@ -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]
|
|
@ -14,22 +14,22 @@ source /usr/share/yunohost/helpers
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
#REMOVEME? ynh_clean_setup () {
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
### Remove this function if there's nothing to clean before calling the remove script.
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
#REMOVEME? ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# 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)
|
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# 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
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE DATA DIR
|
# BACKUP THE DATA DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="$datadir" --is_big
|
ynh_backup --src_path="$data_dir" --is_big
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
|
|
|
@ -14,32 +14,32 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Exit if an error occurs during the execution of the script
|
# 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
|
# 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
|
# 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
|
#REMOVEME? install_dir=/opt/yunohost/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIND AND OPEN A PORT
|
# 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
|
# Find an available port
|
||||||
port=$(ynh_find_port --port=9200)
|
#REMOVEME? port=$(ynh_find_port --port=9200)
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DEFAULT VALUES FOR CONFIGURATION
|
# DEFAULT VALUES FOR CONFIGURATION
|
||||||
|
@ -54,37 +54,37 @@ ynh_app_setting_set --app=$app --key=xmx --value=$xmx
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# 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
|
# 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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=15
|
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
|
# 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 750 "$install_dir"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:$app "$final_path"
|
chown -R $app:$app "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DATA DIRECTORY
|
# CREATE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||||
|
|
||||||
datadir=/home/yunohost.app/$app
|
#REMOVEME? data_dir=/home/yunohost.app/$app
|
||||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir
|
||||||
|
|
||||||
mkdir -p $datadir
|
mkdir -p $data_dir
|
||||||
|
|
||||||
chmod 750 "$datadir"
|
chmod 750 "$data_dir"
|
||||||
chmod -R o-rwx "$datadir"
|
chmod -R o-rwx "$data_dir"
|
||||||
chown -R $app:www-data "$datadir"
|
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_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="elasticsearch.yml" --destination="$install_dir/config/elasticsearch.yml"
|
||||||
ynh_add_config --template="jvm.options" --destination="$final_path/config/jvm.options.d/yunohost.options"
|
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"
|
chmod 400 "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options"
|
||||||
chown $app:$app "$final_path/config/elasticsearch.yml" "$final_path/config/jvm.options.d/yunohost.options"
|
chown $app:$app "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# 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)
|
#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -52,10 +52,10 @@ ynh_remove_logrotate
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# 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
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
#REMOVEME? ynh_secure_remove --file="$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DATA DIR
|
# REMOVE DATA DIR
|
||||||
|
@ -65,7 +65,7 @@ ynh_secure_remove --file="$final_path"
|
||||||
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing app data directory..." --weight=1
|
ynh_script_progression --message="Removing app data directory..." --weight=1
|
||||||
ynh_secure_remove --file="$datadir"
|
#REMOVEME? ynh_secure_remove --file="$data_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -83,10 +83,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEDICATED USER
|
# 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
|
# Delete a system user
|
||||||
ynh_system_user_delete --username=$app
|
#REMOVEME? ynh_system_user_delete --username=$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
|
|
|
@ -14,65 +14,65 @@ source /usr/share/yunohost/helpers
|
||||||
# MANAGE SCRIPT FAILURE
|
# MANAGE SCRIPT FAILURE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
#REMOVEME? ynh_clean_setup () {
|
||||||
#### Remove this function if there's nothing to clean before calling the remove script.
|
#### Remove this function if there's nothing to clean before calling the remove script.
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
#REMOVEME? ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# 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)
|
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||||
port=$(ynh_find_port --port=9200)
|
#REMOVEME? port=$(ynh_find_port --port=9200)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# 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 \
|
#REMOVEME? test ! -d $install_dir \
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|| ynh_die --message="There is already a directory: $install_dir "
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD RESTORATION STEPS
|
# STANDARD RESTORATION STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# 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)
|
# 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
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
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 750 "$install_dir"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE DATA DIRECTORY
|
# RESTORE THE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
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 750 "$data_dir"
|
||||||
chmod -R o-rwx "$datadir"
|
chmod -R o-rwx "$data_dir"
|
||||||
chown -R $app:www-data "$datadir"
|
chown -R $app:www-data "$data_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
|
|
@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# 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)
|
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||||
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
xms=$(ynh_app_setting_get --app=$app --key=xms)
|
#REMOVEME? xms=$(ynh_app_setting_get --app=$app --key=xms)
|
||||||
xmx=$(ynh_app_setting_get --app=$app --key=xmx)
|
#REMOVEME? xmx=$(ynh_app_setting_get --app=$app --key=xmx)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -31,16 +31,16 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# 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
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
#REMOVEME? ynh_backup_before_upgrade
|
||||||
ynh_clean_setup () {
|
#REMOVEME? ynh_clean_setup () {
|
||||||
# Restore it if the upgrade fails
|
# Restore it if the upgrade fails
|
||||||
ynh_restore_upgradebackup
|
#REMOVEME? ynh_restore_upgradebackup
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
#REMOVEME? ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
|
@ -59,10 +59,10 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# 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)
|
# 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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -73,23 +73,23 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=20
|
ynh_script_progression --message="Upgrading source files..." --weight=20
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# 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
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$install_dir"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:$app "$final_path"
|
chown -R $app:$app "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
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="elasticsearch.yml" --destination="$install_dir/config/elasticsearch.yml"
|
||||||
ynh_add_config --template="jvm.options" --destination="$final_path/config/jvm.options.d/yunohost.options"
|
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"
|
chmod 400 "$install_dir/config/elasticsearch.yml" "$install_dir/config/jvm.options.d/yunohost.options"
|
||||||
chown $app:$app "$final_path/config/elasticsearch.yml" "$final_path/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
|
# INCREASE MAX_MAP_COUNT
|
||||||
|
|
Loading…
Reference in a new issue