Commit Graph

92 Commits (c4975d01e591e51dbe2f32bb75af27a5575e1122)

Author SHA1 Message Date
Aron Budea c4975d01e5 Split config.h into separate headers to avoid extensive rebuild
Eg. if only the version was changed, config.h was updated, and
everything was recompiled.

New structure, maintain these manually:
config.h.in - for configured variables that are stable if
              configuration parameters are unchanged
config_version.h.in - for version/hash related variables

----
config_unused.h.in - still generated by autoheader with all
                     variables, don't use it

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: Id9a50a9f1e798a3b3814778d8683b7d7cb57bb29
2022-09-05 12:32:49 +01:00
Mert Tumer 08f9b72854 DeepL translation integration
this patch relies on a core change:
https://gerrit.libreoffice.org/c/core/+/137199

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ie5f5dada18539586e7c5ea41b0a296b33ae8ee2e
2022-08-25 14:28:35 +02:00
Ashod Nakashian 82a5c3173d wsd: fuzzer: fix build
Change-Id: Ib52e32de04e7af230ed21eed11e0855050e97c74
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian caacf21710 wsd: add min_time_between_upload_ms config
This introduces a new config entry to
control the minimum time between uploads
after a failed attempt. In the case of
a successful upload, the minimum time
between uploads is bounded by the
min_time_between_save_ms config.

Change-Id: Ic7e37f97a52af2c5ec82897b6e81f57211d16553
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-06 20:38:09 -04:00
Ashod Nakashian 2d695a489e wsd: add min_time_between_save_ms config
This adds a new config entry to help tune
how often to save after the last save
request. This is used regardless of
the auto-save interval.

Change-Id: I58c291e69a63a3b98e72584817b408b54d9f80f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-06 20:38:09 -04:00
Aron Budea d30b423c07 Replace #ifdef-s with #if-s, and enable -Wundef
...for variables coming from configure.ac.

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I39ebd21c4cb56d2a3bd38fdc35dc59b5f1fd4b49
2022-08-03 11:07:38 +02:00
Ashod Nakashian c2ba9c8a77 wsd: extend the fork timeout when copying systemplate
While bind-mounting is very fast, linking and copying
are both often much slower. Normally, we give extra
time to forking Kit the first time, but then we
reduce the timeout there after. Here, we take into
account whether or not bind-mounting is enabled
before we reduce the timeout to the normal level.
That is, if bind-mounting isn't enabled, we leave
the timeout to be higher-than-normal to accomodate
slow linking or copying.

The benefit of this is evident in the stability of
tests when bind-mounting is disabled (even on fast
filesystems with linking).

Change-Id: I959abf6d3253b2c91be8e0c9a59ec12511817bb9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 14:45:12 -04:00
Ashod Nakashian 5c6516e4e4 wsd: support code-coverage report via --with-coverage
This adds support for code-coverage HTML reporting.
To achieve this, we must use file-linking in jails
so that we can update the coverage data (.gcda files)
from the jails. This means that creating jails is
slower than with bind-mounting and we need to
account for that in our timeouts.

We also can't kill child processes with SIGKILL,
which is un-catchable. Instead, we use SIGTERM
and dump the profile data before exiting.

Change-Id: I16fa534f6ed42f7133014d841bb024423315e0a4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 14:45:12 -04:00
Ashod Nakashian b77dfc47d2 wsd: remove default arg from SigUtil::killChild
Explicit is always better. We also need to
terminate more gracefully when profiling.

Change-Id: I7145cb59583c5d7c6362bbf9c74e9d21799eaa33
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 07:51:52 -04:00
Ashod Nakashian 4e9b836ea6 wsd: always use Util::forcedExit to properly cleanup
We need to flush and shutdown logging before exiting,
so we can't use _exit/_Exit directly.

In addition, with profiling (e.g. code-coverage) we
must flush the profile data, lest it's all for naught.

Change-Id: I726c5a2f4e699c17dd0d7d5b1c86d856e0118b3c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 07:51:52 -04:00
Ashod Nakashian 2044625122 wsd: improve logging when kit disconnects
Change-Id: I65d18aea265e5e68ee823676028266fa543e0667
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-29 13:59:28 -04:00
Rash419 c91b8b01b4 wsd: new config entry to add unlock_link for feature lock dialog per alias_group
- also added unlock_link option in dynamic configuration

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I075a4aed4f82059714412def965a8ed4d3581b2f
2022-07-20 17:41:19 +05:30
Rash419 9bb0b6fabd introduce new options to customize featurelock dialog
- adds two new options
1. localize the dialog
2. change upsell image shown in dialog using proxy handler
- provides all the settings using dynamic configuration

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I7e21c1b31c806c88bf54f891de40f02fa342168f
2022-07-20 17:41:19 +05:30
Pranam Lashkari e65d923e9f add server id to capability list
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I1f101d8091a5fae64f19b8d4ace7b2db7d5cf5b1
2022-07-18 13:01:36 +01:00
Ashod Nakashian 45b7eb778d wsd: reuse parsed message
Change-Id: I9d67f92ba99037954400e07a7d1101e5de3716fd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-15 11:14:14 +01:00
Henry Castro c9178b0223 Add home mode option - enabling more configurability for CODE.
Requested by several users and partners - defaults to off/un-changed.
When set it allows optional disabling of welcome/feedback when used
in a homely environment.

Also bump default max doc/conneciton limits in configure to 10k.

Change-Id: I3c917901e02445d45f6f86b554d47a60aa4e575d
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-07-14 18:24:43 +01:00
Ashod Nakashian b0d6e1b859 wsd: sig: forward USR2 to child processes
We now have USR2 signal that dumps the
stack-trace of each process. This is useful for
capturing the state of misbehaving instances.
COOLWSD forwards USR2 to forkit and the kits
so they dump their stacktraces too.

This patch does not change the behavior of USR1.
Specifically, unlike USR2, USR1 is not forwarded
from wsd to frk and the kits. Also unlike USR2,
USR1 dumps into stderr.

Change-Id: I1d82f678f30f430f627692cc42961b1928f69e11
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-12 13:43:43 +01:00
Ashod Nakashian fc3b4ab717 wsd: sig: merge setTerminationSignals with setFatalSignals
This simplifies the signal handling setup.

Change-Id: Id121a9df45fc11bfdea627f9828e0b624b1b2284
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-12 13:43:43 +01:00
Ashod Nakashian b3d298bd84 wsd: minor cleanup of addNewChild
This moves the shared_ptr copy to outside the
lock, as well as reducing logging inside it.

Change-Id: Iedde95b3fe60fc40bbd035a9d43a9b95af7efdcc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-12 13:43:43 +01:00
Ashod Nakashian 8004653c63 wsd: jail: no need to pass loSubPath between processes
Since the value of the loSubPath (i.e. the directory
name of lo within the jail) is a compile-time constant,
there is no reason to pass it around at runtime.

Change-Id: If7457ea7f3e3fe5c42215eed3ce1ce4c8f328f16
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-12 13:43:43 +01:00
Ashod Nakashian e6ca54c971 wsd: jail: move LO_JAIL_SUBPATH to JailUtil
This prepares the way to remove loSubPath
being passed around at runtime, which is
completely unnecessary.

Change-Id: I728629e3cb5eb079add4232543319b89a7dc4a2a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-12 13:43:43 +01:00
Ashod Nakashian b74666201c wsd: jail: rename jails to childroot to distinguish them
This is an internal rename of identifiers.

Child-Root is the top-level, configurable, directory
that stores the jails and related directories/files.

A Jail, by contrast, is the directory that contains
the filesyste tree of a Kit process. That is, it's
the directory that is chroot-ed.

To distinguish the two, we shall use "jail" for
the chroot-ed directory, and "child-root" for the
top-level directory.

Change-Id: Ie38b1c350234b75ddd15beb1c6bcdd2e53a82af0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-12 13:43:43 +01:00
Mert Tumer e834d65c73 added option to disable ssl verification for LanguageTool
this patch relies on core change
https://gerrit.libreoffice.org/c/core/+/136811

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Id9fa7273631f93914afa870e2c1148a9aa01c2e7
2022-07-05 22:52:55 +02:00
Henry Castro a3b4151e50 wsd: proxy: fix length static string
Change-Id: I4508fc3e32f4d13a1a8ae88c3e4b9abc6d724ac4
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-27 19:28:13 +02:00
Henry Castro 9d3ea331df wsd: proxy: ensure to forward only static files
Change-Id: I3d2333e1441b8acb63824affe8e21541afb12511
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-27 17:56:38 +02:00
Henry Castro bb77f09516 wsd: proxy: handle the proxy request
Change-Id: Icc46f286817fd6922d91e3865e0ad2808f2450e6
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-27 16:04:32 +01:00
Henry Castro 39586d1631 Revert "wsd: add fetch external method"
This reverts commit 19ed2aa2b4.

Change-Id: I6b6762c0a7bf74dd358fcb7a4239abc37c92bd18
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-27 16:04:32 +01:00
Henry Castro 96061f910d Revert "wsd: fetch external resource in debug build, but not for unit tests"
This reverts commit a1aa61b163.

Change-Id: Ica424fc8242b239c0f3ceb2dcbff695138ad2f7e
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-27 16:04:32 +01:00
Pranam Lashkari 123f9b5c41 introduce user stats
now logs can provide stats for the users each time they access a document

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I75d1637864b97c553285bc5d1850a8f75cd50d9f
2022-06-16 09:39:14 +01:00
Gökay Şatır fe8500681c wsd: add query parameter product name & version.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ia8dbc16024e8f9970d45df16550328fa8c196563
2022-06-15 11:06:40 +02:00
Mert Tumer 58ebdb5041 LanguageTool Grammar checker settings to enable it
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ifc494d5e9f17fc4459556ae809ef3ca12a6b7307
2022-06-14 17:14:26 +03:00
Andras Timar a1aa61b163 wsd: fetch external resource in debug build, but not for unit tests
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I208dce052ba02a4ccfc283fbb5ff3af8d8bf38bb
2022-06-09 20:15:34 +02:00
Henry Castro 19ed2aa2b4 wsd: add fetch external method
After file server has been initialized,
it fetches external logo image.

Change-Id: I5d47287d5fa875c3e5825567d4ff284abe2ff500
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-07 15:42:53 +01:00
Henry Castro ccd15ce9a6 wsd: add getter function to obtain the ...
Web server poller thread

Change-Id: I1b1785e41891e408eb6ebc360baf15c4fd07bf5f
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-07 15:42:53 +01:00
Henry Castro 7ed475f25c wsd: infobar: fetch and save the latest version data
Change-Id: I7988fc69d4eaa35a26463cf180c26c6fd9b083e1
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-05-12 18:25:10 +01:00
Henry Castro 59ca7a1a28 wsd: infobar: add config value "fetch_update_check"
Every number hours will fetch the latest version data.

Change-Id: I082d9ebb674058c6509dbd33537f24ec7cd9228b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-05-12 18:25:10 +01:00
Ashod Nakashian c5e533f943 wsd: forced exit after cleaning up jails
The static instances cause a lot of grief
when they aren't called in the correct order.
Worse, when we are cleaning up, we don't
even initialize some of them (Admin, for one).
This means that a normal exit will destroy
what isn't created, in some cases (Admin) it
will even force creating instances when we
are destroying others.

This avoid all this by simply exiting bluntly.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 231fae4ebd)

Change-Id: I6a9443ca5ab999ed6ca1d27314136472cfc6ddb6
2022-05-06 14:45:34 +01:00
Rash419 2163e2f043 wsd: cleanup setting firsthost code
we added AllHosts to give admin the err log that host is not in alias_groups but now as we removed the host list entries from configuration we don't need that log

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8b5e9e6b7df7df59befb496c12966c7ddc60c707
2022-05-05 11:04:22 +05:30
Miklos Vajna aeea180e7f wsd: fix log message typo in COOLWSD::innerMain()
This went wrong when the forward-port of commit
b96e8b7c77 (wsd: correct use the exit code
from UnitWSD, 2021-11-29) didn't adapt the string to the updated
filename.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ica8047dc05dedf9e075663f405dea89913cf789a
2022-05-04 09:05:48 +02:00
Jan Holesovsky 8bc02b71e8 Improve error reporting related to remote config
Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: Ie458464d60bf8e939c1408e1b0feb91090d080e4
2022-05-02 22:00:57 +02:00
Jan Holesovsky 3b6c531389 Allow specifying the remote_font_config URI in the remote_config
This way, there is only one entry point for all the remote
configuration, and the remote_font_config does not have to be specified
in coolwsd.xml, in case the remote_config JSON specifies that.

Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: I857bab3d300ddb5c0c3df0a9f62eda20f43c3ff7
2022-05-02 22:00:57 +02:00
Henry Castro 6bfe68ea93 wsd: add parameter --signal
To signal SIGUSR2 to parent to notify
that the server is ready to accept connections,
and begin the tests.

Change-Id: Ie936217243aa7a2e836f3d45cb508ede13fae8c5
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-04-27 09:18:21 +01:00
Tor Lillqvist 8ff5f1c57c Restart ForKit when a downloaded font has been updated or removed
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I62b53bb4ff16eac3e122f9b6d702c69d2355595d
2022-04-26 17:26:20 +01:00
Ashod Nakashian 14d96957cd wsd: log macro cleanup
* Simplify log macros.
* Reduce expanded lines (faster compilation).
* Avoid flushing (since we always use ostringstream).

Change-Id: Id10c1a75b5af5d8cdba62d768192ab0a6a9e0aca
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-26 11:13:44 +03:00
Rash419 0945c4d48b config,UI: change classic -> compact and notebookbar -> tabbed
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I633a13927245ee6b4d750cd84c2b4577dca06d68
2022-04-25 13:56:10 +05:30
Tor Lillqvist 551c3d96e5 Enable avoiding use of ETag for remote font files
Change the syntax of the remote font configuration JSON file. Now for
each font we can also have a "stamp" property that can be a time stamp
or whatever other random string that gets changed (by some automated
mechanism provided by system integrators) whenever the corresponding
font file has changed. If a such is provided we don't poll the ETag of
the font file but re-download it whenever its stamp in the JSON file
has changed.

The remote font configuration file now should look like this:

{
    "kind": "fontconfiguration",
    "server": "My pretty server name for admin console",
    "fonts": [
	{
	    "uri": "http://localhost/tml/MS33558.ttf"
	},
	{
	    "uri": "http://localhost/tml/SmoochSans-VariableFont_wght.ttf",
	    "stamp": "foo0"
	},
	{
	    "uri": "http://localhost/tml/B612-Regular.ttf",
	    "stamp": "foo3"
	},
	{
	    "uri": "http://localhost/tml/xxx.ttf"
	}
    ]
}

Where the value of the "stamp" properties can be any non-empty
string. The JSON file is checked once a minute. If it has changed it
is re-downloaded, and if the stamp of some font has changed, that font
file is re-downloaded.

When a font file is re-downloaded it is stored in a new file each
time. The old file is not removed as that will cause problems in
ForKit and Kit processes.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ib04b77e0fb9e1d9c33afdc14a5fed3ad0b12a409
2022-04-21 19:10:10 +01:00
Ashod Nakashian 96adaa15d1 wsd: kill coolwsd_fuzzer
coolwsd_fuzzer predates actual fuzzing
with libfuzzer and is currently unsused.

Change-Id: Id095b165943ba14dbf525ddc607ad329f5d952d4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-20 07:12:03 -04:00
Gökay Şatır 4e42a34b96 Attempt to fix:
error: call of overloaded ‘basic_string(const Poco::Dynamic::Var&)’ is ambiguous

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ibaa77e94a8e12f1dbc38e40b14ce8184dafcd7bd
2022-04-15 17:32:41 +03:00
Tor Lillqvist f98900c73c Add a remote font download feature
The coolwsd.xml file can now contain a URI of a JSON file on some
server that contains URIs of fonts. These fonts are downloaded to the
coolwsd server. Just like the remote configuration thing, the URIs are
checked once a minute and the JSON or the fonts mentioned in it are
re-downloaded if their contents has changed.

If a font has been removed from the JSON file then the corresponding
downloaded could be removed, too. But there is no way to remove it
from core without restarting the whole COOL server, so we don't
bother.

We need to put the font in such a place so that its pathname is the
same both in the ForKit process (outside any chroot jail) and in a Kit
process (inside its own jail(), because even if it is in the ForKit
process that we call the LO core vcl API to load a "temporary" font,
code elsewhere in LO core re-opens the font file later, naturally
using the same pathname, when it is needed (see
FreetypeFontFile::Map() in vcl/unx/generic/glyphs/freetype_glyphcache.cxx).

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: If78058ddff5ed05c7a82d7ea465a7a414fd0d861
2022-04-15 17:32:41 +03:00
Ashod Nakashian 480fb7b931 wsd: move tokenizer helpers into StringVector
In an attempt to reduce the size of Util.{c,h}pp
which has grown to contain all sorts of unrelated
helpers, we move StringVector helpers into
the StringVector.{c,h}pp files.

This makes the code better organized.

Change-Id: I152f341606807ae66253415b951bc9f89b09df57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-12 07:39:07 -04:00