languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.2k stars 1.38k forks source link

Idea: always use server for LibreOffice add-on? #1929

Closed danielnaber closed 4 years ago

danielnaber commented 5 years ago

Now that access to an HTTP server has been added (#971, thanks to @FredKruse), I wonder: would it maybe simplify our code if the server would be used all the time? The user wouldn't have to notice, it could be started in the background. What do you think, @FredKruse?

TiagoSantos81 commented 5 years ago

Apart from opening ports when they are not needed nor wanted, is there any extra objection?

danielnaber commented 5 years ago

The server is attaching itself to 127.0.0.1 only by default, so it cannot be accessed from elsewhere.

TiagoSantos81 commented 5 years ago

By principle, Internet code should not run in intended offline instances. Everything works as intended until it doesn't. It is a very slippery slope. As is, having the option to use with the server appeases the specific requests that have appeared, like the self hosted language-server, without damaging too much the remaining group. Typical LibreOffice users do not usually want the server side, since that will only work for corporate users, that already have IT personnel to handle the server configuration. I see no other use case scenario.

danielnaber commented 5 years ago

I see no other use case scenario.

That's why I asked @FredKruse: "would it maybe simplify our code if the server would be used all the time?". This is not about a new use case. It's about whether our LibreOffice code, which is really complex, would benefit from using a server in terms of complexity.

TiagoSantos81 commented 5 years ago

Good code is complex, because it is a cumulative construction, as you know. Simplification can not be above reliability and security, especially when this creates issues where they do not exist. Most distro do not integrate LanguagTool because of the Java prerequisites, but recently a few have started to integrate standalone and LibreOffice extension, since they are decently isolated offline modules. This change will create further (and I would add reasonable) doubts about its inclusion.

TiagoSantos81 commented 5 years ago

Hearbleed comes to my mind on this. It was just a simplification: https://www.csoonline.com/article/3223203/what-is-the-heartbleed-bug-how-does-it-work-and-how-was-it-fixed.html

danielnaber commented 5 years ago

Thanks @TiagoSantos81, let's wait for Fred to answer my original question.

FredKruse commented 5 years ago

I think, it wouldn't be a simplification of code. The office extension use the same engine as the server. So there is no duplication of code. If we implement a server, a office user has to install more applications and it will be more complicate. Another point is, that the implementation of the current code needs the whole engine in the background. It controls the requests to the server. The idea was to add a remote access, to give user a chance to reduce local CPU load and to use ngram and word2vec on a remote server without installing the big amount of data local. Also, the remote access is still experimental, it is not finished today.

yakovru commented 5 years ago

I think it's better to create two extensions for LibreOffice: with network support and without network support.

Some users of LanguageTool are very wary that data may be transmitted over the network.

TiagoSantos81 commented 5 years ago

Some companies are very wary that data may be transmitted over the network.

https://www.theguardian.com/business/2015/apr/30/airbus-could-sue-following-allegations-germany-spied-on-them-for-the-us

http://blog.inventus.com/blog/5-most-famous-cases-of-industrial-espionage https://www.wrc.noaa.gov/wrso/security_guide/industry.htm https://www.therichest.com/rich-list/10-of-the-most-infamous-cases-of-industrial-espionage/ https://www.bloomberg.com/news/photo-essays/2011-09-20/famous-cases-of-corporate-espionage

ghost commented 4 years ago

I know of some organizations that (almost) completely isolate themselves from all public networks.

FredKruse commented 4 years ago

I like the idea of create to versions of LO extension with and without network support.

As I described above the installation and handling of the internal checker is much easier without introducing a local server. On the other hand a network support can give benefits to the user. An idea for future development of the network version could be to add the possibility of premium support (running on the remote server) (@danielnaber what do you think about this idea).

There is to do some work to split the internal check from the remote check. I am working on this. Today I took a big step in this direction. But the existing installation is still a work around. Some components of the remote check needs still the internal checker.

FredKruse commented 4 years ago

Sorry I mean "create two versions of LO extension"

danielnaber commented 4 years ago

create two versions of LO extension

I see two issues: 1. does it really help to have two extensions, compared to one version with a configuration option (from the user's point of view)? 2. How can we communicate to the user they are using the non-local version? depending on what server they use, this has privacy implications (localhost vs languagetool.org vs. some company-internal server)

FredKruse commented 4 years ago
  1. I'm not really sure. The remote installation could be smaller, because the rules etc. haven't to be stored. Also, a hint of the risks of using the remote version could be set on the download side. On the other hand a switch to a local/internal check when connection fails (like it is installed now) isn't possible anymore. I think, we should leave it, as it is.
  2. A pop-up window could be installed, that informs the user of the risks of a remote check analog to the installation e.g. in firefox. It should popup when the remote option is chosen. Is there a text which I could use (in different languages at best)?
danielnaber commented 4 years ago

This is what the browser add-on shows: "This extension will check your text by sending it to LanguageTool.org over an encrypted connection. Your text will not be stored.". We have that for severla (though probably not all languages). Anyway, could we also maybe show an item in the context menu, reminding users they are in "remote server mode"? People tend to agree to this kind of stuff and then later forget about it.

FredKruse commented 4 years ago

The pop up window is installed. @danielnaber : The extension as it is, gives the user the most freedom of choice. I think, we should close this issue.

phirestalker commented 2 years ago

I know I'm late to the party, but does this mean there is no way to enter a server address into the LibreOffice plugin? I am running a LanguageTool server on my local network that has all the big files. I have all the browser extensions pointed to it.

If there is a way, can someone point me in the right direction?

KnowZero commented 2 years ago

@phirestalker This is an old thread, you can use a server just fine in LibreOffice. Just open a document and go to Tools->LanguageTool->Options...->General->Technical Settings and select Use remote server to check text, then select Use Server and put the local network server url in there.