diff --git a/README.md b/README.md index 7a7de28..2f51dd0 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:** 7.17.8~ynh6 **Demo:** -## 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 license, but with clauses that may restrict its use. diff --git a/README_es.md b/README_es.md index a2b023c..88c5b19 100644 --- a/README_es.md +++ b/README_es.md @@ -23,14 +23,6 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc **Versión actual:** 7.17.8~ynh6 **Demo:** -## informaciones 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: funcionalidades no deseadas - **Not totally free upstream**: The packaged app is under an overall free license, but with clauses that may restrict its use. diff --git a/README_eu.md b/README_eu.md index ac97409..afc4340 100644 --- a/README_eu.md +++ b/README_eu.md @@ -23,14 +23,6 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc **Paketatutako bertsioa:** 7.17.8~ynh6 **Demoa:** -## Ezespena / informazio garrantzitsua - -### 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: Ezaugarri zalantzagarriak - **Jatorrizkoa ez da erabat librea**: Aplikazioak lizentzia librea du orokorrean, baina bere erabilera mugatzen duten klausulekin. diff --git a/README_fr.md b/README_fr.md index ae53bd7..ad611be 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,21 +16,12 @@ Il NE doit PAS être modifié à la main. ## 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 :** 7.17.8~ynh6 **Démo :** -## 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: Anti-fonctionnalités - **Application sous licence libre restreinte **: L'application packagée est sous une licence globalement libre, mais avec des clauses qui pourraient restreindre son utilisation. diff --git a/README_gl.md b/README_gl.md index 49b3f8f..8b33818 100644 --- a/README_gl.md +++ b/README_gl.md @@ -23,14 +23,6 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc **Versión proporcionada:** 7.17.8~ynh6 **Demo:** -## Avisos / información importante - -### 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: Debes considerar - **Not totally free upstream**: The packaged app is under an overall free license, but with clauses that may restrict its use. diff --git a/README_it.md b/README_it.md index 0ef2cb3..9ff6ec1 100644 --- a/README_it.md +++ b/README_it.md @@ -3,15 +3,15 @@ N.B.: Questo README è stato automaticamente generato da -# ElasticSearch 7 per YunoHost +# ElasticSearch 8 per YunoHost -[![Livello di integrazione](https://dash.yunohost.org/integration/elasticsearch7.svg)](https://dash.yunohost.org/appci/app/elasticsearch7) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/elasticsearch7.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/elasticsearch7.maintain.svg) +[![Livello di integrazione](https://dash.yunohost.org/integration/elasticsearch8.svg)](https://dash.yunohost.org/appci/app/elasticsearch8) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/elasticsearch8.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/elasticsearch8.maintain.svg) -[![Installa ElasticSearch 7 con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=elasticsearch7) +[![Installa ElasticSearch 8 con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=elasticsearch8) *[Leggi questo README in altre lingue.](./ALL_README.md)* -> *Questo pacchetto ti permette di installare ElasticSearch 7 su un server YunoHost in modo semplice e veloce.* +> *Questo pacchetto ti permette di installare ElasticSearch 8 su un server YunoHost in modo semplice e veloce.* > *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.* ## Panoramica @@ -20,17 +20,9 @@ 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). -**Versione pubblicata:** 7.17.8~ynh6 +**Versione pubblicata:** 8.11.1~ynh3 **Prova:** -## Attenzione/informazioni importanti - -### 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: Anti-funzionalità - **Applicazione con licenza parzialmente libera**: Quest’applicazione è protetta da licenza generalmente libera, ma con delle clausole che potrebbero limitare il suo utilizzo. @@ -38,21 +30,21 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc ## Documentazione e risorse - Sito web ufficiale dell’app: -- Documentazione ufficiale per gli amministratori: +- Documentazione ufficiale per gli amministratori: - Repository upstream del codice dell’app: -- Store di YunoHost: -- Segnala un problema: +- Store di YunoHost: +- Segnala un problema: ## Informazioni per sviluppatori -Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/elasticsearch7_ynh/tree/testing). +Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/elasticsearch8_ynh/tree/testing). Per provare la branch di `testing`, si prega di procedere in questo modo: ```bash -sudo yunohost app install https://github.com/YunoHost-Apps/elasticsearch7_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/elasticsearch8_ynh/tree/testing --debug o -sudo yunohost app upgrade elasticsearch7 -u https://github.com/YunoHost-Apps/elasticsearch7_ynh/tree/testing --debug +sudo yunohost app upgrade elasticsearch8 -u https://github.com/YunoHost-Apps/elasticsearch8_ynh/tree/testing --debug ``` **Maggiori informazioni riguardo il pacchetto di quest’app:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 8b1fab9..dc77888 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -23,14 +23,6 @@ To learn more about Elasticsearch’s features and capabilities, see the [produc **分发版本:** 7.17.8~ynh6 **演示:** -## 免责声明 / 重要信息 - -### 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: 负面特征 - **Not totally free upstream**: The packaged app is under an overall free license, but with clauses that may restrict its use. 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/amd64.src b/conf/amd64.src deleted file mode 100644 index 5789f94..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.8-linux-x86_64.tar.gz -SOURCE_SUM=1c40ba4e0912da1432cb85c0d246f68e14a7da249feea91752c8eaeb28adf0ac -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 0f6a89d..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.8-linux-aarch64.tar.gz -SOURCE_SUM=47d6532a16e02b92208a0d71289a6fb021542c925ed868e49237032bc3ab5c6a -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..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 @@ -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/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.toml b/manifest.toml new file mode 100644 index 0000000..f3152e7 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,57 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +packaging_format = 2 + +id = "elasticsearch7" +name = "ElasticSearch 7" +description.en = "Distributed and RESTful search engine" +description.fr = "Moteur de recherche RESTful" + +version = "7.17.8~ynh7" + +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/7.17/elasticsearch-intro.html" +code = "https://github.com/elastic/elasticsearch" + +[integration] +yunohost = ">= 11.2" +architectures = ["amd64", "arm64"] +multi_instance = true + +ldap = "not_relevant" + +sso = "not_relevant" + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" + +[install] + +[resources] + [resources.sources.main] + arm64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.8-linux-aarch64.tar.gz" + arm64.sha256 = "47d6532a16e02b92208a0d71289a6fb021542c925ed868e49237032bc3ab5c6a" + amd64.url = "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.8-linux-x86_64.tar.gz" + amd64.sha256 = "1c40ba4e0912da1432cb85c0d246f68e14a7da249feea91752c8eaeb28adf0ac" + + # This is only for notification purposes! Generated PRs will be invalid. + autoupdate.strategy = "latest_github_release" + autoupdate.asset.amd64 = "tarball" + autoupdate.asset.arm64 = "tarball" + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + + [resources.ports] + main.default = 9200 diff --git a/scripts/backup b/scripts/backup index 99ef323..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 -#================================================= - -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 - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -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) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -40,13 +19,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..add0f20 100755 --- a/scripts/install +++ b/scripts/install @@ -9,95 +9,37 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -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" - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -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 - #================================================= # 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 -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # 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 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" - -#================================================= -# 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 - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +ynh_setup_source --dest_dir="$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # ADD CONFIGURATIONS #================================================= 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" - -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" +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 "$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 1f06e84..c028c2d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -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) - #================================================= # 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 -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# 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 - ynh_secure_remove --file="$datadir" -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 -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -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 6183965..f262a1e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,76 +10,31 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -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 - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -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) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -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" - #================================================= # 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 -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 - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chown -R $app:www-data "$data_dir" #================================================= # SPECIFIC RESTORATION #================================================= # 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. @@ -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 0e6c27e..ccc78e5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,39 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -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) - #================================================= # CHECK VERSION #================================================= 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 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -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 -#================================================= -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" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -73,23 +38,24 @@ 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" + # The keep option prevents this warning: + # "File .... has been manually modified since the installation or last upgrade." + ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config/elasticsearch.yml" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +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 @@ -112,22 +78,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 diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..953b195 --- /dev/null +++ b/tests.toml @@ -0,0 +1,9 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------