diff --git a/README.md b/README.md index cb3d8d7..3cc0974 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # LanguageTool server for YunoHost -[![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) +[![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)* @@ -18,8 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in 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.8~ynh1 - +**Shipped version:** 6.0~ynh1 **Demo:** https://api.languagetool.org/ @@ -32,7 +32,7 @@ LanguageTool is a multilingual grammar, style, and spell checker. This package p ## Configuration -There is a configuration file at `/opt/yunohost/languagetool/languagetool.conf` (for the first install). +There is a configuration file at `/var/www/languagetool/languagetool.conf` (for the first install). ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 90dd996..f501789 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,40 +5,40 @@ It shall NOT be edited by hand. # LanguageTool server pour YunoHost -[![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) +[![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) *[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.* +> *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 +## 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.8~ynh1 - +**Version incluse :** 6.0~ynh1 **Démo :** https://api.languagetool.org/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de LanguageTool server](./doc/screenshots/screenshot_fr.png) -![Capture d'écran de LanguageTool server](./doc/screenshots/screenshot.png) +![Capture d’écran de LanguageTool server](./doc/screenshots/screenshot_fr.png) +![Capture d’écran de LanguageTool server](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes ## 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 à `/var/www/languagetool/languagetool.conf` (pour la première installation). ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* 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 : @@ -54,4 +54,4 @@ 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 :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/check_process b/check_process index 69826b3..e165908 100644 --- a/check_process +++ b/check_process @@ -2,7 +2,6 @@ ; Manifest domain="domain.tld" (DOMAIN) use_ngram=0 (USE_NGRAM) - use_word2vec=1 (USE_WORD2VEC) use_beolingus=1 (USE_BEOLINGUS) ; Checks pkg_linter=1 diff --git a/conf/app.src b/conf/app.src index 38c61d7..b6b0885 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://languagetool.org/download/LanguageTool-5.8.zip -SOURCE_SUM=20913a50eb4568fdc727066eee8aab833f52b626710fc9e0213c3f1098bfdee3 +SOURCE_URL=https://languagetool.org/download/LanguageTool-6.0.zip +SOURCE_SUM=d1a2ab7f59606003db139c65dd76d347d27d298cc465132a970fd167fdacde4f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/languagetool.conf b/conf/languagetool.conf index 380daf6..cc6be59 100644 --- a/conf/languagetool.conf +++ b/conf/languagetool.conf @@ -1,5 +1,4 @@ __LANGUAGE_MODEL_CONFIG_LINE__ -__WORD2VEC_MODEL_CONFIG_LINE__ __FASTTEXT_MODEL_CONFIG_LINE__ __FASTTEXT_BINARY_CONFIG_LINE__ __BEOLINGUS_FILE_CONFIG_LINE__ diff --git a/conf/systemd.service b/conf/systemd.service index 64cb653..427f691 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -11,5 +11,39 @@ ExecStart=java -cp languagetool-server.jar org.languagetool.server.HTTPServer -- StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit +# Sandboxing options to harden security +# Depending on specificities of your service/app, you may need to tweak these +# .. but this should be a good baseline +# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectClock=yes +ProtectHostname=yes +ProtectProc=invisible +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallArchitectures=native +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged + +# Denying access to capabilities that should not be relevant for webapps +# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html +CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE +CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE +CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG + [Install] WantedBy=multi-user.target diff --git a/conf/word2vec-de.src b/conf/word2vec-de.src deleted file mode 100644 index 59dc13c..0000000 --- a/conf/word2vec-de.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://languagetool.org/download/word2vec/de.zip -SOURCE_SUM=c2ba1dc410e5314f1a2cefbde9fe7d28ea1597825321faef0dfe947e4117d6a7 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=de.zip -SOURCE_EXTRACT=true diff --git a/conf/word2vec-en.src b/conf/word2vec-en.src deleted file mode 100644 index 08f1d17..0000000 --- a/conf/word2vec-en.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://languagetool.org/download/word2vec/en.zip -SOURCE_SUM=3750e860d0fcee8e96d5116f222fb61ee7e010568f48ae8b79193b48394fd31c -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=en.zip -SOURCE_EXTRACT=true diff --git a/conf/word2vec-pt.src b/conf/word2vec-pt.src deleted file mode 100644 index 9932df5..0000000 --- a/conf/word2vec-pt.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://languagetool.org/download/word2vec/pt.zip -SOURCE_SUM=5b564442f6553ed838c05971bd8f79e2831287ee8c52e1a8c494894894b6f46e -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pt.zip -SOURCE_EXTRACT=true diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 9e4f8bc..b453e51 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,3 +1,3 @@ ## Configuration -There is a configuration file at `/opt/yunohost/languagetool/languagetool.conf` (for the first install). +There is a configuration file at `/var/www/languagetool/languagetool.conf` (for the first install). diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 8baeae4..63b3130 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 à `/var/www/languagetool/languagetool.conf` (pour la première installation). diff --git a/manifest.json b/manifest.json index 8b087b7..a99e693 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.8~ynh1", + "version": "6.0~ynh1", "url": "https://languagetool.org", "upstream": { "license": "LGPL-2.1-only", @@ -59,19 +59,6 @@ }, "default": false }, - { - "name": "use_word2vec", - "type": "boolean", - "ask": { - "en": "Use word2vec data (de, en, pt)?", - "fr": "Utilizer donnés word2vec (de, en, pt) ?" - }, - "help": { - "en": "~100 MB download", - "fr": "Téléchargement de ~100 Mo" - }, - "default": false - }, { "name": "use_fasttext", "type": "boolean", @@ -128,4 +115,4 @@ } ] } -} +} \ No newline at end of file diff --git a/scripts/_common.sh b/scripts/_common.sh index 4cd40b6..bea3b28 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -27,12 +27,6 @@ function download_data { fi fi - if [ $use_word2vec -eq 1 ]; then - ynh_setup_source --dest_dir="$data_path/word2vec/de" --source_id="word2vec-de" - ynh_setup_source --dest_dir="$data_path/word2vec/en" --source_id="word2vec-en" - ynh_setup_source --dest_dir="$data_path/word2vec/pt" --source_id="word2vec-pt" - fi - if [ $use_fasttext -eq 1 ]; then if [ $use_compressed_fasttext -eq 1 ]; then ynh_setup_source --dest_dir="$data_path/fasttext" --source_id="fasttext-model-compressed" @@ -54,12 +48,6 @@ function add_languagetool_config { language_model_config_line="" fi - if [ $use_word2vec -eq 1 ]; then - word2vec_model_config_line="word2vecModel=$data_path/word2vec" - else - word2vec_model_config_line="" - fi - if [ $use_fasttext -eq 1 ]; then if [ $use_compressed_fasttext -eq 1 ]; then fasttext_model_config_line="fasttextModel=$data_path/fasttext/lid.176.ftz" @@ -115,7 +103,6 @@ function load_installation_settings { data_path=$(ynh_app_setting_get --app=$app --key=data_path) use_ngram=$(ynh_app_setting_get --app=$app --key=use_ngram) use_untested_ngram=$(ynh_app_setting_get --app=$app --key=use_untested_ngram) - use_word2vec=$(ynh_app_setting_get --app=$app --key=use_word2vec) use_fasttext=$(ynh_app_setting_get --app=$app --key=use_fasttext) use_compressed_fasttext=$(ynh_app_setting_get --app=$app --key=use_compressed_fasttext) use_beolingus=$(ynh_app_setting_get --app=$app --key=use_beolingus) diff --git a/scripts/install b/scripts/install index e6e95d5..8be579c 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,6 @@ domain=$YNH_APP_ARG_DOMAIN path_url='/' use_ngram=$YNH_APP_ARG_USE_NGRAM use_untested_ngram=$YNH_APP_ARG_USE_UNTESTED_NGRAM -use_word2vec=$YNH_APP_ARG_USE_WORD2VEC use_fasttext=$YNH_APP_ARG_USE_FASTTEXT use_compressed_fasttext=$YNH_APP_ARG_USE_COMPRESSED_FASTTEXT use_beolingus=$YNH_APP_ARG_USE_BEOLINGUS @@ -40,7 +39,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/opt/yunohost/$app +final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" data_path=/home/yunohost.app/$app test ! -e "$data_path" || ynh_die --message="This path already contains a folder" @@ -57,7 +56,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=use_ngram --value=$use_ngram ynh_app_setting_set --app=$app --key=use_untested_ngram --value=$use_untested_ngram -ynh_app_setting_set --app=$app --key=use_word2vec --value=$use_word2vec ynh_app_setting_set --app=$app --key=use_fasttext --value=$use_fasttext ynh_app_setting_set --app=$app --key=use_compressed_fasttext --value=$use_compressed_fasttext ynh_app_setting_set --app=$app --key=use_beolingus --value=$use_beolingus