1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/languagetool_ynh.git synced 2024-09-03 19:35:58 +02:00

Update to version 6.0 (#26)

* Update to version 5.8, fix mistake in URL

* Auto-update README

* Update to version 6.0

* Harden systemd config

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
Jules Bertholet 2023-02-20 21:40:31 -05:00 committed by GitHub
parent 8dd28b9cdf
commit 52444728c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 59 additions and 76 deletions

View file

@ -6,6 +6,7 @@ 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)
[![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

View file

@ -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 dinté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 dinstaller LanguageTool server rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue d'ensemble
## Vue densemble
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 : <https://languagetool.org>
* Documentation officielle de l'admin : <https://dev.languagetool.org/>
* Dépôt de code officiel de l'app : <https://github.com/languagetool-org/languagetool>
* Site officiel de lapp : <https://languagetool.org>
* Documentation officielle de ladmin : <https://dev.languagetool.org/>
* Dépôt de code officiel de lapp : <https://github.com/languagetool-org/languagetool>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_languagetool>
* Signaler un bug : <https://github.com/YunoHost-Apps/languagetool_ynh/issues>
@ -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 :** <https://yunohost.org/packaging_apps>
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,4 @@
__LANGUAGE_MODEL_CONFIG_LINE__
__WORD2VEC_MODEL_CONFIG_LINE__
__FASTTEXT_MODEL_CONFIG_LINE__
__FASTTEXT_BINARY_CONFIG_LINE__
__BEOLINGUS_FILE_CONFIG_LINE__

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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).

View file

@ -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).

View file

@ -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",

View file

@ -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)

View file

@ -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