Commit graph

819 commits

Author SHA1 Message Date
Ashod Nakashian
0f9dc9460b wsd: support per-user timezone
Change-Id: I5e2318a34cb39d8d56ec3cf4977ebd75588a7627
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-31 15:38:08 +01:00
Ashod Nakashian
ecc8bc5bbc wsd: exit code 0 for the exit command to kit
No reason to consider the 'exit' command
unexpected or a cause for error, so the
process exit code needs not be anything
but 0.

Change-Id: I352f706c6f174b66e9a4814fc35bb95b1a3bf3d6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Szymon Kłos
b0dd943089 Add export as pdf
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I61853fb2213e57acd02d7a3eee53e86f43cb36b5
2023-01-26 13:06:57 +00:00
Michael Meeks
bc3684026e kit: default timeout to ~5 seconds when we get a negative wait.
I can only assume that recent LOK's often don't have any lingering
timeouts for cursor blinking or whatever, such that we get an
infinite wait passed as a negative microseconds-count.

Best not to interpret that as a zero wait to avoid a busy loop.

Change-Id: If79228af969f4598f07681deb355c72f72602d19
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-01-15 06:22:24 -05:00
Szymon Kłos
85ada3b6f8 Add UserPrivateInfo
it will be used to store user data which shouldn't
be shared between views

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I58b7f22e4364ce9e07bb6cc74e8431363912a872
2023-01-06 10:36:43 +01:00
Szymon Kłos
924a2cea9c Handle exported pdf correctly
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib3adbaeed30227fcb108fdb6c2e1188fd1bc0320
2022-12-14 15:56:07 +01:00
NickWingate
cc508630e5 Add callback logic for LOK_CALLBACK_EXPORT_FILE
Signed-off-by: NickWingate <nick.wingate@collabora.com>
Change-Id: I3ca6be3ff26c5f847abc64f1c38b67d131191143
2022-12-14 15:56:07 +01:00
Andras Timar
a077c4288b Put all Zotero logic to browser
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib1b071b96322511b7f319ff6b851e902b3556fbb
2022-12-12 13:35:29 +01:00
Pranam Lashkari
2cfae369af initial zotero skeleton
add zotero UI only if user is logged in
when zotero citation edit button is clicked,
fetch the library with zotero API.
Let user select what to insert

at this stage its not a complete solution but just first stage

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Id67d8409bcd6416994713acd9ace495b24823fb0
2022-11-30 20:37:48 +01:00
Michael Meeks
dadfbf0579 allow more verbose log-level during startup to be configured.
Previously this defaulted to 'trace' - now it can be configured, but
still defaults to 'trace'.

Change-Id: I0ecf2f0b991cd8cc29dbde866dd4589be4ca7957
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-21 21:44:05 +01:00
Michael Meeks
8ebdde2cb8 zstd: tune for speed, and compress deltas.
Small deltas were not compressed at all, now they are.

Change-Id: I0543a488723816b4140b27c5690f657aea26226e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-21 11:53:59 +01:00
Ashod Nakashian
145f490e76 wsd: when loading fails exit Kit
In rare cases when we have a corrupted document, or
we run out of memory while loading, we end up with
a Kit that has no document and would not be reused.

If we exit the Kit, we immediately cleanup DocBroker
on the WSD side and allow for retrying.

Change-Id: I3e811a066365e94f0606b9458be1272607cc45cf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Szymon Kłos
0c63531319 masterpage: remove old hack for invalidation
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic2ad091f522e93e669ec021361ef8779cbab55d5
2022-11-17 11:42:24 +01:00
Szymon Kłos
01530c32d5 masterpage: use mode for tile rendering
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I0180e051237043f391ba01128ccfb00fe54cb539
2022-11-17 11:42:24 +01:00
Ashod Nakashian
956f37c7a7 wsd: test: merge the results of all tests
Since we can have multiple tests in a single
unit-test .so, we need to merge the results
of each test into a single result that is
used when we exit the process and flag for
failure or success.

Change-Id: Ia49f5542efd6dd998b61c17965fd3fe3245159ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-15 07:04:58 -05:00
Ashod Nakashian
cc222a708c wsd: test: make dlhandle static and properly cleanup
We now properly cleanup unit-tests .so libs.

This helps having multiple tests by making
the dlhandle an independent variable of
all the tests.

Change-Id: Ifc8db400aebfe8ea41dcc4df2d11856c25b36074
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-15 07:04:58 -05:00
Szymon Kłos
eb4743a648 Introduce getDataArea in Calc
It will share information about real size of a data inside
spreadsheet so we can easily check where data ends.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I67137a4471f7eb4faaeeb680977872ccda8e9411
2022-11-10 12:12:10 +03:00
Tor Lillqvist
e2cda4f15a Fix crash for LOK_CALLBACK_FONTS_MISSING in the mobile apps
We should just ignore that callback in the mobile apps for now.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ic1e2f79b23d75433a1f4c491bc31e43d4ebbe3c2
2022-11-07 14:29:22 +02:00
Michael Meeks
19dff9f281 zstd: decompress blobs for testing using zstd not inflate.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I8c2ea8b9cc3561485ec93428c1fe95a20be913fb
2022-11-02 12:09:53 +01:00
Michael Meeks
abc469466a Clarify delta count updating.
Change-Id: Ie6d507d9aff80b90c97338ce1526a87ae0688394
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-02 12:09:53 +01:00
Michael Meeks
b57689a2e8 in-line ZSTD_minCLevel() call as a constant.
Change-Id: Ie0877b4c3cdc3111d3a35f9ed622d8903675b96a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-02 12:09:53 +01:00
Michael Meeks
2def6dc3d5 Switch to zstd image compression.
zstd provides for much faster compression server-side, as well
as better decompression.

zstd allows us to de-compress a keyframe and several deltas in a
single call in JS, so it is necessar to add a terminator to the
delta stream so that we can detect when to flush the buffer we
are working on - so the next delta applies to the correct data.

Change-Id: I0e292e3a697b4902d6488b7c04deaba2d1485e94
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-02 12:09:53 +01:00
Szymon Kłos
e1ab6ec1b0 Fix typo
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I5c87f9da2f2fb33a78db784e64143b9d5b4df6d1
2022-10-28 07:28:06 +02:00
Szymon Kłos
c441669d20 masterpage: correctly parse invalidatetiles message with mode
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I80b89629c3930d91a940438c82739c8a145e0024
2022-10-27 13:58:26 +03:00
Ashod Nakashian
fc0b163732 wsd: move svg processing to ClientSession
This helps generate the public URL
easily and unifies the processing
of embedded video.

Change-Id: I07ef7f7722f368957a85e41493fe175de38464f7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-26 16:26:15 +02:00
Ashod Nakashian
76ac5d09c2 wsd: support embedded media
Change-Id: I28c1a813bad22c49ae759b89ad90e377890acddb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-25 09:16:36 +02:00
Tor Lillqvist
0a0f309228 Add alternative ways to handle "missing fonts": log, report, or ignore
The default is to log to the coolwsd log file.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I894f8c4b19ee96f7323512e63c8c66372d8516d9
2022-10-13 17:02:08 +03:00
Tor Lillqvist
48eaa195b7 Handle the callback for missing fonts properly
For now, just display it using an infobar. UI experts, feel free to
change it to something more appropriate.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0b6e592a51441299cc08d0e42ba3b5c5087b30db
2022-10-13 17:02:08 +03:00
Ashod Nakashian
19c70b89f4 wsd: re-create the jail directory when mounting fails
This guarantees that the jail directory is always
created, especially in case mounting fails and
we cleanup and fallback.

Also, move the directory creation and setting
the perms into a helper, and reuse.

Change-Id: If6e9ef86afa5107638aa27050554e94c0af22b6e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-09-23 16:39:56 +01:00
Szymon Kłos
7043365475 masterpage: get & set optional mode parameter for tiles (server side)
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I756e3d515c86a635cfa9db81106848ee3dcf684a
2022-09-19 15:18:23 +02:00
Tor Lillqvist
5f7ae4f5a4 Add a dummy handler (for now) for LOK_CALLBACK_FONTS_MISSING
Avoids logging an ERR.

Proper handling of that functionality is still a work in progress.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Id6bd985ee62e6cb76641d6f866f6318868b9b2b3
2022-09-19 12:17:30 +02:00
Ashod Nakashian
0c6413bf87 wsd: fix multi-part logging
This was a regression introduced in
14d96957cd.

The result was that multi-part logs were
not flushed and therefore not written to
the output.

Change-Id: Ib22a1da83209b00872d91ca05a940226cbb4552d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-09-13 09:45:43 +02:00
Andras Timar
b755a175df Embed images to exported HTML
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I0e42bf2efcc2aa6ecf3f6705aab621cc1ea18774
2022-09-08 16:21:22 +02:00
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
Andras Timar
cf6e22c22c Fix typos in comments
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I813f652b516c79f350b46317e589b91e0ef39a1a
2022-08-23 18:37:44 +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
NickWingate
3747f47aa3 Remove residual callback code
'callback except-' is unused anywhere anymore.
Implemented in 68e597b
Removed in 986bcce

Signed-off-by: NickWingate <nicholas.wingate03@gmail.com>
Change-Id: Ib620e6a33639f510c8f2415cf009e4d183a353fd
2022-08-05 01:06:13 +05:30
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
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
b3540550e8 wsd: mark copied jails early
This avoids the case where we fail to
create the jail completely, get killed,
or crash. All of which might leave the
jail unremoved.

Change-Id: I4c6b6a038110186af7be9f358a42902b224188e0
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
Michael Meeks
04ee3b9fae Add the ability to dump internal LOK core state / details.
Requires an updated core.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie000e86851d7dfbc1e70a3f1631d427a3d18188f
2022-07-29 01:43:03 +03:00
Michael Meeks
8ca42a5d5a delta: fix delta cache sizing.
Change-Id: Ia6ed98534f87006ba5ffcffc8b928f16cfc892cd
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-28 15:22:58 +01:00
Michael Meeks
b2788bf702 tracing: re-work code, improve thread safety.
We shouldn't write to the socket outside the main thread ever or
we'll get memory corruption; cf. a number of suspicious traces
around this code.

Change-Id: Ibeb36fffbecce960012a55b3ab4fd40c9996ae68
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-19 20:01:08 +01:00
Ashod Nakashian
e3deda303b wsd: fix warnings on GCC 12
Change-Id: Ia61f45d83223a65d1f7c444250230006a4ac098f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-13 09:37:07 +01:00
Ashod Nakashian
3109b99d49 wsd: sig: dump backtrace with USR2
SIGUSR2 can now be used to dump the
stacktrace of coolwsd, forkit, and the
kit processes.

Also, support writing signalLog to files.
Although we write to stderr, we normalize
the interface used for signal logging and
allow for writing to any file descriptor.

Change-Id: If6366bb6ddbd9f8863baca52e4f65ebb468dc1f1
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
0d4c58fe36 wsd: jail: add Poco namespace where missing in LinkOrCopy
Change-Id: I9490ff29b48763130e5477525a96b987a4b79cf7
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