From 81d1f5dc1a42305d8cf3a6264176838d0164bfdb Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Mon, 13 Jun 2022 09:59:04 -0400 Subject: [PATCH 1/5] Update to version 5.7 (#16) --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 6 +++--- manifest.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1c291e3..423a0eb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview LanguageTool is a multilingual grammar, style, and spell checker. This package provides the API server for use by other programs, like the LanguageTool extensions for browsers and word processors. -**Shipped version:** 5.6 +**Shipped version:** 5.7 ## Screenshots diff --git a/README_fr.md b/README_fr.md index f778f00..813ac9b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble LanguageTool est un correcteur d'orthographe, de grammaire et de style multilingue. Ce paquet fournit le serveur API pour utilisation depuis d'autres programmes, comme les extensions LangageTool pour navigateurs et logiciels de bureautique. -**Version incluse :** 5.6 +**Version incluse :** 5.7 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index f50cf94..e4d9a10 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://languagetool.org/download/LanguageTool-5.6.zip -SOURCE_SUM=6cabbf546cf7fab2f4b8493827657d528a78add565b219cb2e27001612925b7e +SOURCE_URL=https://languagetool.org/download/LanguageTool-5.7.zip +SOURCE_SUM=0c7ca3f7fa94d298c4ffb9d342b33e31cf6e93015602227b94924e3237b5ce79 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=LanguageTool-5.6.zip +SOURCE_FILENAME=LanguageTool-5.7.zip SOURCE_EXTRACT=true diff --git a/manifest.json b/manifest.json index 8902e10..a7821e9 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Multilingual grammar, style, and spell checker (API)", "fr": "Correcteur d'orthographe, de grammaire et de style multilingue (API)" }, - "version": "5.6~ynh1", + "version": "5.7~ynh1", "url": "https://languagetool.org", "license": "LGPL-2.1-only", "maintainer": { From ac90e1438b8b845bffbe12bf62039e6ad5a024db Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Jul 2022 02:09:46 +0200 Subject: [PATCH 2/5] Apply example_ynh --- check_process | 13 +-- conf/app.src | 2 +- doc/.gitkeep | 0 doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 1 + doc/DISCLAIMER.md | 3 + doc/DISCLAIMER_fr.md | 3 + doc/screenshots/.gitkeep | 0 .../screenshots/screenshot.png | Bin .../screenshots/screenshot_fr.png | Bin manifest.json | 16 ++-- scripts/backup | 18 ++-- scripts/change_url | 28 +++++- scripts/install | 55 ++++++------ scripts/remove | 21 +++-- scripts/restore | 65 +++++++------- scripts/upgrade | 84 ++++++++++-------- sources/extra_files/app/.gitignore | 2 - sources/patches/.gitignore | 2 - 19 files changed, 174 insertions(+), 140 deletions(-) create mode 100644 doc/.gitkeep create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/DISCLAIMER_fr.md create mode 100644 doc/screenshots/.gitkeep rename screenshot.png => doc/screenshots/screenshot.png (100%) rename screenshot_fr.png => doc/screenshots/screenshot_fr.png (100%) delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore diff --git a/check_process b/check_process index 08dd561..69826b3 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,3 @@ -# 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 domain="domain.tld" (DOMAIN) @@ -17,7 +12,8 @@ setup_private=0 setup_public=1 upgrade=1 - upgrade=0 from_commit=CommitHash + # 5.7~ynh1 + upgrade=1 from_commit=81d1f5dc1a42305d8cf3a6264176838d0164bfdb backup_restore=1 multi_instance=1 port_already_use=0 @@ -25,8 +21,3 @@ ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN& - diff --git a/conf/app.src b/conf/app.src index e4d9a10..d93e58f 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,5 +3,5 @@ SOURCE_SUM=0c7ca3f7fa94d298c4ffb9d342b33e31cf6e93015602227b94924e3237b5ce79 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=LanguageTool-5.7.zip +SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..4d0506b --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +LanguageTool is a multilingual grammar, style, and spell checker. This package provides the API server for use by other programs, like the LanguageTool extensions for browsers and word processors. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..1649db2 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +LanguageTool est un correcteur d'orthographe, de grammaire et de style multilingue. Ce paquet fournit le serveur API pour utilisation depuis d'autres programmes, comme les extensions LangageTool pour navigateurs et logiciels de bureautique. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..9e4f8bc --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,3 @@ +## Configuration + +There is a configuration file at `/opt/yunohost/languagetool/languagetool.conf` (for the first install). diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..4708023 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,3 @@ +## Configuration + +Il y a un fichier de configuration à `/opt/yunohost/languagetool/languagetool.conf` (pour la première installation). diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/screenshot.png b/doc/screenshots/screenshot.png similarity index 100% rename from screenshot.png rename to doc/screenshots/screenshot.png diff --git a/screenshot_fr.png b/doc/screenshots/screenshot_fr.png similarity index 100% rename from screenshot_fr.png rename to doc/screenshots/screenshot_fr.png diff --git a/manifest.json b/manifest.json index a7821e9..6d62c0b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,15 +6,22 @@ "en": "Multilingual grammar, style, and spell checker (API)", "fr": "Correcteur d'orthographe, de grammaire et de style multilingue (API)" }, - "version": "5.7~ynh1", + "version": "5.7~ynh2", "url": "https://languagetool.org", + "upstream": { + "license": "LGPL-2.1-only", + "website": "https://languagetool.org", + "demo": "https://api.languagetool.org/", + "admindoc": "https://dev.languagetool.org/", + "code": "https://github.com/languagetool-org/languagetool" + }, "license": "LGPL-2.1-only", "maintainer": { "name": "Jules Bertholet", "email": "jules.bertholet@gmail.com" }, "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -24,8 +31,7 @@ "install": [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "use_ngram", @@ -122,4 +128,4 @@ } ] } -} \ No newline at end of file +} diff --git a/scripts/backup b/scripts/backup index 579b668..ec09318 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup() { +ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script @@ -28,8 +28,8 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) -data_path=$(ynh_app_setting_get --app=$app --key=data_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +data_path=$(ynh_app_setting_get --app=$app --key=data_path) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -42,6 +42,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" +#================================================= +# BACKUP THE APP DATA DIR +#================================================= + +ynh_backup --src_path="$data_path" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= @@ -63,13 +69,7 @@ ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= -# BACKUP THE APP DATA DIR -#================================================= - -ynh_backup --src_path="$data_path" --is_big - -#================================================= -# BACKUP LOG FILES +# BACKUP VARIOUS FILES #================================================= ynh_backup --src_path="/var/log/$app" diff --git a/scripts/change_url b/scripts/change_url index 1ca03be..0b1a438 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,13 +29,14 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 load_installation_settings #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade -ynh_clean_setup() { +ynh_clean_setup () { + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" @@ -50,10 +51,16 @@ ynh_abort_if_errors #================================================= change_domain=0 -if [ "$old_domain" != "$new_domain" ]; then +if [ "$old_domain" != "$new_domain" ] +then change_domain=1 fi + change_path=0 +if [ "$old_path" != "$new_path" ] +then + change_path=1 +fi #================================================= # STANDARD MODIFICATIONS @@ -71,8 +78,21 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf +# Change the path in the NGINX config file +if [ $change_path -eq 1 ] +then + # Make a backup of the original NGINX config file if modified + ynh_backup_if_checksum_is_different --file="$nginx_conf_path" + # Set global variables for NGINX helper + domain="$old_domain" + path_url="$new_path" + # Create a dedicated NGINX config + ynh_add_nginx_config +fi + # Change the domain for NGINX -if [ $change_domain -eq 1 ]; then +if [ $change_domain -eq 1 ] +then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file="$nginx_conf_path" mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf diff --git a/scripts/install b/scripts/install index 2bb3d0b..e6e95d5 100755 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -25,7 +25,6 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url='/' -is_public=1 use_ngram=$YNH_APP_ARG_USE_NGRAM use_untested_ngram=$YNH_APP_ARG_USE_UNTESTED_NGRAM use_word2vec=$YNH_APP_ARG_USE_WORD2VEC @@ -33,6 +32,7 @@ use_fasttext=$YNH_APP_ARG_USE_FASTTEXT use_compressed_fasttext=$YNH_APP_ARG_USE_COMPRESSED_FASTTEXT use_beolingus=$YNH_APP_ARG_USE_BEOLINGUS grammalecte_server=$YNH_APP_ARG_GRAMMALECTE_SERVER + app=$YNH_APP_INSTANCE_NAME #================================================= @@ -81,6 +81,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# 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 #================================================= @@ -102,12 +110,19 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 ynh_add_nginx_config #================================================= -# CREATE DEDICATED USER +# SPECIFIC SETUP #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." -# Create a system user -ynh_system_user_create --username=$app +add_languagetool_config + +#================================================= +# COMPILE FASTTEXT +#================================================= + +compile_fasttext #================================================= # SETUP SYSTEMD @@ -117,22 +132,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# ADD A CONFIGURATION -#================================================= - -add_languagetool_config - -#================================================= -# SPECIFIC SETUP -#================================================= -# COMPILE FASTTEXT -#================================================= - -compile_fasttext - -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -143,6 +142,8 @@ chmod -R g=u,g-w,o-rwx $final_path chown -R root:$app $data_path chmod -R g=u,g-w,o-rwx $data_path +#================================================= +# GENERIC FINALIZATION #================================================= # SETUP LOGROTATE #================================================= @@ -171,13 +172,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" -fi +# Everyone can access the app. +# The "main" permission is automatically created before the install script. +ynh_permission_update --permission="main" --add="visitors" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index 5f15d06..5174c14 100755 --- a/scripts/remove +++ b/scripts/remove @@ -14,6 +14,8 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 +app=$YNH_APP_INSTANCE_NAME + load_installation_settings #================================================= @@ -23,7 +25,8 @@ load_installation_settings #================================================= # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null; then +if ynh_exec_warn_less yunohost service status $app >/dev/null +then ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove $app fi @@ -37,12 +40,12 @@ ynh_script_progression --message="Stopping and removing the systemd service..." ynh_remove_systemd_config #================================================= -# REMOVE DEPENDENCIES +# REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 -# Remove metapackage and its dependencies -ynh_remove_app_dependencies +# Remove the app-specific logrotate config +ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR @@ -69,12 +72,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- ynh_remove_nginx_config #================================================= -# REMOVE LOGROTATE CONFIGURATION +# REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=1 -# Remove the app-specific logrotate config -ynh_remove_logrotate +# Remove metapackage and its dependencies +ynh_remove_app_dependencies #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index b0f44de..c4d3ec9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,8 +14,8 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup() { - true +ynh_clean_setup () { + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -25,6 +25,8 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 +app=$YNH_APP_INSTANCE_NAME + load_installation_settings #================================================= @@ -32,20 +34,22 @@ load_installation_settings #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url || - ynh_die --message="Path not available: ${domain}${path_url}" -test ! -d $final_path || - ynh_die --message="There is already a directory: $final_path " -test ! -d $data_path || - ynh_die --message="There is already a directory: $data_path " +ynh_webpath_available --domain=$domain --path_url=$path_url \ + || ynh_die --message="Path not available: ${domain}${path_url}" +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " +test ! -d $data_path \ + || ynh_die --message="There is already a directory: $data_path " #================================================= # STANDARD RESTORATION STEPS #================================================= -# RESTORE THE NGINX CONFIGURATION +# RECREATE THE DEDICATED USER #================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR @@ -65,14 +69,6 @@ if [ ! -d "$data_path" ]; then add_languagetool_config fi -#================================================= -# 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 - #================================================= # RESTORE USER RIGHTS #================================================= @@ -90,6 +86,20 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + +#================================================= +# RESTORE VARIOUS FILES +#================================================= +ynh_script_progression --message="Restoring various files..." + +ynh_restore_file --origin_path="/var/log/$app" + #================================================= # RESTORE SYSTEMD #================================================= @@ -98,6 +108,13 @@ 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..." + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -105,12 +122,6 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Multilingual grammar, style, and spell checker" --log="/var/log/$app/$app.log" -#================================================= -# RESTORE LOG FILES -#================================================= - -ynh_restore_file --origin_path="/var/log/$app" - #================================================= # START SYSTEMD SERVICE #================================================= @@ -118,12 +129,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2caad71..7e2fb30 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -14,19 +14,14 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Loading installation settings..." --weight=1 -load_installation_settings +app=$YNH_APP_INSTANCE_NAME -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -if [ -z "$use_beolingus" ]; then - use_beolingus=0 - ynh_app_setting_set --app=$app --key=use_beolingus --value=$use_beolingus -fi +load_installation_settings #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -37,7 +32,8 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade -ynh_clean_setup() { +ynh_clean_setup () { + ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -53,11 +49,30 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +if [ -z "$use_beolingus" ]; then + use_beolingus=0 + ynh_app_setting_set --app=$app --key=use_beolingus --value=$use_beolingus +fi + +#================================================= +# 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 #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ]; then +if [ "$upgrade_type" == "UPGRADE_APP" ] +then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src @@ -66,6 +81,13 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then download_data fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # NGINX CONFIGURATION #================================================= @@ -74,21 +96,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# 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 - #================================================= # SPECIFIC UPGRADE #================================================= @@ -97,6 +104,20 @@ ynh_system_user_create --username=$app compile_fasttext +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." + +add_languagetool_config + +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions on app files +set_permissions + #================================================= # SETUP SYSTEMD #================================================= @@ -105,21 +126,8 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# UPDATE A CONFIG FILE -#================================================= - -add_languagetool_config - #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions on app files -set_permissions - #================================================= # SETUP LOGROTATE #================================================= diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] From 5c99213fddb8b2e23b5e0d1577bdb2309cea19be Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Jul 2022 16:28:00 +0200 Subject: [PATCH 3/5] Charset --- doc/DISCLAIMER_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 4708023..8baeae4 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -1,3 +1,3 @@ ## Configuration -Il y a un fichier de configuration à `/opt/yunohost/languagetool/languagetool.conf` (pour la première installation). +Il y a un fichier de configuration à `/opt/yunohost/languagetool/languagetool.conf` (pour la première installation). From fe9becc2a0515e848f18c237c813525ec3db9b6d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 16 Jul 2022 14:28:05 +0000 Subject: [PATCH 4/5] Auto-update README --- README.md | 56 ++++++++++++++++++++++------------------------ README_fr.md | 63 ++++++++++++++++++++++++---------------------------- 2 files changed, 55 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 2ec440c..08b950e 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,56 @@ + + # LanguageTool server for YunoHost -[![Integration level](https://dash.yunohost.org/integration/languagetool.svg)](https://dash.yunohost.org/appci/app/languagetool) ![](https://ci-apps.yunohost.org/ci/badges/languagetool.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/languagetool.maintain.svg) -[![Install languagetool with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=languagetool) +[![Integration level](https://dash.yunohost.org/integration/languagetool.svg)](https://dash.yunohost.org/appci/app/languagetool) ![Working status](https://ci-apps.yunohost.org/ci/badges/languagetool.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/languagetool.maintain.svg) +[![Install LanguageTool server with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=languagetool) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install LanguageTool quickly and simply on a YunoHost server. +> *This package allows you to install LanguageTool server quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview + LanguageTool is a multilingual grammar, style, and spell checker. This package provides the API server for use by other programs, like the LanguageTool extensions for browsers and word processors. -**Shipped version:** 5.7 + +**Shipped version:** 5.7~ynh2 + +**Demo:** https://api.languagetool.org/ ## Screenshots -![](https://github.com/YunoHost-Apps/languagetool_ynh/raw/master/screenshot.png) +![Screenshot of LanguageTool server](./doc/screenshots/screenshot_fr.png) +![Screenshot of LanguageTool server](./doc/screenshots/screenshot.png) -## Demo - -* [Official demo](https://api.languagetool.org/) +## Disclaimers / important information ## Configuration There is a configuration file at `/opt/yunohost/languagetool/languagetool.conf` (for the first install). -## Documentation - * Official documentation: https://dev.languagetool.org/ +## Documentation and resources -#### Multi-user support - -* Are LDAP and HTTP auth supported? **N/A** -* Can the app be used by multiple users? **N/A** - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/languagetool%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/languagetool/) -* ARMv8-A - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/languagetool_ynh/issues - * App website: https://languagetool.org/ - * Upstream app repository: https://github.com/languagetool-org/languagetool - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/languagetool_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/languagetool_ynh/tree/testing --debug or sudo yunohost app upgrade languagetool -u https://github.com/YunoHost-Apps/languagetool_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index ee732ad..8bfd2eb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,61 +1,56 @@ -# Serveur LanguageTool pour YunoHost + -[![Niveau d'intégration](https://dash.yunohost.org/integration/languagetool.svg)](https://dash.yunohost.org/appci/app/languagetool) ![](https://ci-apps.yunohost.org/ci/badges/languagetool.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/languagetool.maintain.svg) -[![Installer languagetool avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=languagetool) +# LanguageTool server pour YunoHost -*[Read this readme in english.](./README.md)* +[![Niveau d'intégration](https://dash.yunohost.org/integration/languagetool.svg)](https://dash.yunohost.org/appci/app/languagetool) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/languagetool.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/languagetool.maintain.svg) +[![Installer LanguageTool server avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=languagetool) -> *Ce package vous permet d'installer LanguageTool rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer LanguageTool server rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble + LanguageTool est un correcteur d'orthographe, de grammaire et de style multilingue. Ce paquet fournit le serveur API pour utilisation depuis d'autres programmes, comme les extensions LangageTool pour navigateurs et logiciels de bureautique. -**Version incluse :** 5.7 + +**Version incluse :** 5.7~ynh2 + +**Démo :** https://api.languagetool.org/ ## Captures d'écran -![](https://github.com/YunoHost-Apps/languagetool_ynh/raw/master/screenshot_fr.png) +![Capture d'écran de LanguageTool server](./doc/screenshots/screenshot_fr.png) +![Capture d'écran de LanguageTool server](./doc/screenshots/screenshot.png) -## Démo - -* [Démo officielle](https://api.languagetool.org/) +## Avertissements / informations importantes ## Configuration Il y a un fichier de configuration à `/opt/yunohost/languagetool/languagetool.conf` (pour la première installation). -## Documentation +## Documentations et ressources - * Documentation officielle : https://dev.languagetool.org/ - -#### Support multi-utilisateur - -* L'authentification LDAP et HTTP est-elle prise en charge ? **S/O** -* L'application peut-elle être utilisée par plusieurs utilisateurs ? **S/O** - -#### Architectures supportées - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/languagetool%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/languagetool/) -* ARMv8-A - -## Liens - - * Signaler un bug : https://github.com/YunoHost-Apps/languagetool_ynh/issues - * Site de l'application : https://languagetool.org/fr/ - * Dépôt de l'application principale : https://github.com/languagetool-org/languagetool - * Site web YunoHost : https://yunohost.org/ - ---- +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs -**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/languagetool_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/languagetool_ynh/tree/testing --debug ou sudo yunohost app upgrade languagetool -u https://github.com/YunoHost-Apps/languagetool_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** From e4aa784ad8193fdfc7d6b8fe9c379ef8a11de372 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 Jul 2022 16:29:30 +0200 Subject: [PATCH 5/5] Remove ynh_webpath_available --- scripts/restore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index c4d3ec9..ef324cf 100755 --- a/scripts/restore +++ b/scripts/restore @@ -34,8 +34,6 @@ load_installation_settings #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " test ! -d $data_path \