Commit graph

714 commits

Author SHA1 Message Date
Dennis Francis
edee504da5 kit: prefer char literal instead of string
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I636092327e5d656d2bf4df207c99e712bd773ac5
2022-01-12 12:05:10 +03:00
Dennis Francis
0f3850fb6c calcRTL: include sheet RTL info in status message
Also parse and use these in js side.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Iff86d994002ddf9f59a814eca77a288186f401d8
2022-01-11 21:21:27 +01:00
Ashod Nakashian
0a5df03387 wsd: improved logging around session add/remove
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit c8acc9d080b73099f8c51a554c0af22d7b8a6fe0)

Change-Id: Iea545095c1276ce5830a9af038322ecb2c78a9d2
2022-01-11 09:28:03 +01:00
Ashod Nakashian
c93d0688b3 wsd: handle the modified status for inactive views
The modified status is normally broadcast to all
views. This works fine, except with async disonnection.

With two views, one inactive, if we disconnect both,
we cannot know which disconnection will be processed
first. Depending on the order, the second one
will be used for saving. If it is the inactive user,
we will never see that the document has been saved
successfully, because we would have the modified
flag set to true and the message that updates
it to false (after saving) will be dropped.

This scenario was reproducible fairly reliably
in HTTPWSTest::testSaveOnDisconnect.

Here we make sure that we pass-through the
ModifiedStatus for inactive users as well,
since this flag is used for housekeeping.

Change-Id: Iac9ac5ee5f4bc4035587c8e34a756cddb5bddb9f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ff32851738d4412e4a6e2de5380c17647b1a6fcc)
2022-01-11 09:28:03 +01:00
Michael Meeks
15dc307107 signal activity: add some more helpful call sites.
Based on previous crashes, it is useful to have more granularity
on what happened last.

Change-Id: If18a3a4d7817be23a6f8aadd301827a8e1bc007e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-10 13:03:37 +00:00
Michael Meeks
9354fc829d signal activity dumping; overdue cleanup / re-factor.
Change-Id: I7cb3047488f6daffbb5de285dfc5631c4dd89c8e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-01-10 13:03:37 +00:00
Gleb Popov
c2364222c2 Do not enter capabilities mode on FreeBSD in the forkit process.
This is too restrictive security measure, so turn it off for now.

Signed-off-by: Gleb Popov <6yearold@gmail.com>
Change-Id: I6f158ed4ed77f6508c9effbad5307d43e9e5461b
2022-01-03 15:59:39 +01:00
Tomaž Vajngerl
b9545f932c support for a custom path to NSS certdb files for sign/encrypt
The path of the NSS certdb is defined in the coolwsd.xml config
file and if the config file is set and contains the certdb files,
then the db files are copied to the jail into /tmp/certdb folder.
Also the /tmp/certdb path is set to LO_CERTIFICATE_DATABASE_PATH
env. var, which is then used as the default certdb in LibreOffice
when LOKit starts up.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I72e8f28f27a0306fef9319bc6212cd99cb3f8212
2021-12-15 06:00:55 -05:00
Mert Tumer
5d7cfcd861 check if we save-as successfully before proceed with downloadas
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I77c76f424a5767a19be812f35dfadf9e56cbfb20
2021-12-14 18:57:13 +03:00
Mert Tumer
a809df68b0 fix double encoding url on convert-to
Problem is, all save-as requests received urlencoded
but when it is a wopi request we change the url bit of the message
with correct path jail filename parts. At that stage it becomes decoded
already. saveAs in the core also decodes the url and thats why we should
re-encode it. But unless it is a wopi request it should be already
encoded and we should not re-encode it again.

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I08b3a1cff6c3aa9271222c255f4a35aa5b984819
2021-12-08 10:40:26 -05:00
Mert Tumer
688b65a390 fix saveAs for files with encoding characters
Appearently core expects encoded path for filenames on saveas
and decodes it at the end.

So if the file name is something like a%20b
and it becomes a b in the storage.

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ib200c92859b4ab3f262cfe88747563c42e2c6a5c
2021-12-03 09:26:36 +03:00
Pranam Lashkari
63608ba358 kit: removed back compatibility of textinput message
removed support for parameter "type" which is no longer sent with textinput

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I97bb7e80fe9cc3bb0768fd37b0c15983310a538c
2021-11-30 19:44:25 +05:30
Szymon Kłos
41122e0e5f notebookbar: activate in core when default ui mode
Core needs "notebookbar" ui mode string to activate
notebookbar widgets. If we pass "default" notebookbar
is not activated and style previews widget doesn't work.

followup for b4f588ea3c

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I758dee279c6da8b3fd41e5121f2eb2336539f327
2021-11-23 19:47:25 +01:00
Ashod Nakashian
242e226a5f wsd: fix 'potentially uninitialized' variables
With --with-sanitizer=address, a number of variables
get flagged as 'potentially uninitialized.

There are only a handful of these, so fixed.

Change-Id: I7ffc78b8cfd152a56ed81d97b5cd3660ce5b16b6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-23 09:31:46 +01:00
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Andras Timar
9a88a95097 --disable-lool-user-checking was renamed to --disable-cool-user-checking at some places, now replace it everywhere
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I881f8b7adfbb396da8beb07c4d0300a153ecd304
2021-11-17 09:56:09 +01:00
Henry Castro
23afa3843c kit: rename 'lool' -> 'cool'
Change-Id: I4198570d9940a028f1b4d84666a80516174c2f7a
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-17 09:18:38 +01:00
Henry Castro
c07928bf40 misc: more renames 'lool' -> 'cool'
Change-Id: I2d392eef3dff23f2f8737e57bb977fa060ab8ea5
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-17 09:17:50 +01:00
Mert Tumer
81f61c8073 rename: loolforkit -> coolforkit
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I1de688dce4b068bff35451604486b72ecc8c91d4
2021-11-16 21:02:24 +01:00
Henry Castro
d399b46dc1 kit: update comments
Change-Id: Iad4844effdb6b984fe33a08d15dc837d6ff3f364
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-10 17:18:56 +01:00
Pranam Lashkari
fac6e261fd jails: kit: name temporary directory with jail is instead random name
jail-id is already used a sub-directory of each tmp dir,
so there is no more "information leak" in making the tmp directory name itself match the jail-id

further naming it with jail id helps in referencing that directory for hard linking when quarantining a file

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iaa635f44d1cd99571a9571113ce1cc92e203fddb
2021-10-22 09:00:04 -04:00
Hugo Peixoto
b2abb5e4aa Use tokens.equals() instead of tokens[] ==
This prevents additional strings from being allocated.

Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: I84b1e5cf4d11bf8512febe068b3097770b63dc5c
2021-10-21 13:36:57 +02:00
Pranam Lashkari
f88a38a4e7 LOK: unifying the Freemium and uno command hiding APIs part 2
* replace vector with unordered_set
* avoid sending multiple blocking messages

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I2f714e4f2797ade4ac9d5b4f824855bba31031c4
2021-10-21 12:28:13 +03:00
Pranam Lashkari
0afaefc85c LOK: unifying the Freemium and uno command hiding APIs
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I39637abef246ffdc02ef653a0de9001cc03cdaa0
2021-10-21 12:28:13 +03:00
Pranam Lashkari
88601440d0 introduce way to hide/restrict uno commands
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I1225190a67f726832e5b38a7c3f690b51c1385f3
2021-10-21 12:28:13 +03:00
Pranam Lashkari
f02a0a1447 freemium: renamed Freemium namespace to CommandControl
also renamed freemium files accordingly

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Id33b8a1d1a2a8725bfa6e7b7c562430ea126993c
2021-10-21 12:28:13 +03:00
Hugo Peixoto
7bf0ead625 Optimize startsWith calls on StringVector elements
There was a pattern of calling Util::startsWith on StringVector
elements:

- Util::startsWith(tokens[0], "boo")
- Util::startsWith(tokens.getParam(token), "boo")

These two expressions would cause a new string to be allocated and
immediately released. To optimize this, a StringVector::startsWith
method is introduced.

This method works by calling compare directly on the underlying
StringVector string, avoiding creating a temporary string.

Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: I6f27d5bb13783f39c7d4ce0644a11e57b0071244
2021-10-15 13:58:26 +02:00
Mike Kaganski
d1bc6911b5 Escape strings in JSON
This should take care e.g. for SharePoint user IDs, which have the
form of "domain\username", and the backslash must be escaped.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I75936070ad1661dc9b03e05a19b64159b0758018
2021-10-13 16:29:50 +01:00
Henry Castro
8b87f63325 kit: fix status indicator finish
Unfortunately the sequence message sent
from LO core is important, and the status
indicator finish should arrive to client side
before any dialog interactivity (i.e. Macros Warning Dialog).

However the LO core sends like 3 times status
finish for now we cannot duplicate them.

Change-Id: Ieee2ee93555b50b0e67507aae36096e10728a038
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-10-04 10:08:58 +02:00
Ashod Nakashian
ff1ff12663 wsd: each view handles its own url params
Change-Id: I0c6b9b86c970b1f45e7fa34d030f08c6f256d082
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit d4aa0a0f73eef5a90a14a2297f3050c1dba95a2d)
2021-09-26 17:02:01 -04:00
Tomaž Vajngerl
b31eb2ab92 New POST service to render a search result + unit and integ. tests
This adds a new service render-search-result, which renders an
image of the position where, the search fund a hit. The search
result contains the information in which object or paragraph,
which is just the node id and node type from the document model.

The service takes the document and the search result (xml file)
as the input and returns a PNG image as the output.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>

Change-Id: Iffc158c5b0a3c9a63f8d05830314c9bc1616b3b1
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
2021-09-13 10:36:15 +02:00
Dennis Francis
5efa765a7c fix build: add missing break -Werror=implicit-fallthrough
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I12660822829c874179ccffd84dcdd33f5dde27e3
(cherry picked from commit 5a1c42c4e610a9265dfe3527c964413f029060ae)
2021-09-07 10:40:15 +05:30
Dennis Francis
94cadbe033 calc: use document bg color from core to paint canvas bg
Conflicts:
	loleaflet/src/layer/tile/TileLayer.js

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ief814741df4818000cef7499a8b1c9c1ce1f4371
(cherry picked from commit bfed92dffecc3b574f24920733c74565fb1ae29c)
2021-09-07 10:40:15 +05:30
Miklos Vajna
8ba165d5e9 kit: fix build
When building against core.git master:

kit/ChildSession.cpp:2668:13: error: enumeration value 'LOK_CALLBACK_SC_FOLLOW_JUMP' not handled in switch [-Werror,-Wswitch]

It's not clear how we want to handle this in Online, so have a default
label in debug builds as well.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ia0b1cef33e8a5a7fbc1518586ea1e3bb13aa5f22
2021-09-06 09:15:08 +02:00
Tor Lillqvist
6d2a6e110c Remove leftover tiles in the iOS app already when the document is closed
Normally (ideally), tiles (.bmp files) are removed as soon as the JS
has displayed them. But occasionally something goes wrong and they are
left behind. (For instance, it seems to happen if the user closes the
document immediately when it shows up.)

Do not leave them on disk until the app starts the next time.

Change-Id: I0c764280a69a16ad3b7b67c329832fd5331c2e1e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-09-01 13:32:23 +03:00
Tor Lillqvist
65b8001d73 Remove more leftover files taking space in the iOS app
Remove the app's copy of the document after core has saved it and we
have stored the edited version at its real location.

Remove possible leftover tile bitmaps when the app starts.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ibc41be38c2cfb689c532640d148116bc06a248ab
2021-08-24 18:02:40 +03:00
Miklos Vajna
4cfbd6b65c kit: improve StringVector usage in ChildSession::getClipboard()
It returns a temporary.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I5a9df90a4e7dda05cc387e5dc11842ea8e237504
2021-08-04 17:02:16 +01:00
Tor Lillqvist
4f926a450e Print a header in front of the list of last UNO commands
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I1f7194edb833d8569ca7bd87cadd903deb84ef0e
2021-07-26 09:36:58 +03:00
Gökay ŞATIR
01505278a6 KitHelper: Get page rectangles with status message.
Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: I6a6140d46c16c5ebd9ae1c80a441a7129ad1ada5
2021-07-25 11:58:34 +03:00
Gopi Krishna Menon
b3d5a2563c Add profilezone around kitPoll function and SocketPoll constructor
Add profile zone around kitPoll function and SocketPoll constructor to
improve trace event generation

Signed-off-by: Gopi Krishna Menon <krishnagopi487.github@outlook.com>
Change-Id: Ia46e9add59a57935997649fe39861a8d851e1ff0
2021-07-21 15:00:31 +03:00
Tor Lillqvist
d9fc146605 Bypass updateFreemiumStatus unless ENABLE_FREEMIUM
Fixes build of iOS app.

Change-Id: Icf4e49c7d4d8f77a37557e1990f37673e1b9c91d
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-07-20 14:41:18 +05:30
Pranam Lashkari
e02e1df76d Introduce Freemium options
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ib6b68ff74839cf84f2d8c8cfb7d380be9209f923
2021-07-20 14:41:18 +05:30
Ashod Nakashian
9c50fdc155 wsd: better logging of the document activity
Change-Id: I89e673ffa819600bd227fab291a46d9108ed5cca
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-17 22:58:23 -04:00
Szymon Kłos
d7c985e9b5 jsdialog: handle exception on bad id
issue wrt busypopup sending string id for dialogEvent
was already fixed on JS side.

remove unnecessary comment from commit 48f7449
Ignore conversion error from std::stoull for "busypopup"

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7640b4f693d9d018ae17acb3a9eb292a2423bb68
2021-07-17 16:35:27 +02:00
Henry Castro
f43c4b32e5 kit: add payload to 'statusindicatorstart'
Change-Id: I3145c6c622204e4c4898c8490176baff39b07636
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-07-15 15:21:24 +02:00
Michael Meeks
823c30b39b Ensure that we get the file-name right before sending the save result.
We cannot rely on wsd being slower than the kit. The rename
has to happen before wsd / DocumentBroker gets to trying to access
the filename. fixes #2874.

Change-Id: Ie1e67cd059fb6a663048967c47759238c067172d
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-07-15 09:08:06 +01:00
Gopi Krishna Menon
9d86193972 Log Last Uno 4 Commands During a Fatal Crash
Records the uno commands from different instances of ChildSession and
dumps the last 4 uno commands into the crashlog during a fatal crash

Signed-off-by: Gopi Krishna Menon <krishnagopi487.github@outlook.com>
Change-Id: I838f71769dc08df7076c040f3d72c15f7607e9d3
2021-07-13 19:48:21 +03:00
Tor Lillqvist
bd0c225c9f Revert "Make it possible to generate Trace Events already when loading the document"
Makes unit-rendering-options fail reliably.

This reverts commit 175c9c5b2a.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Id05c911991baaae0dbc52678a192fc01639352e0
2021-07-07 12:38:11 +03:00
Tor Lillqvist
175c9c5b2a Make it possible to generate Trace Events already when loading the document
By passing a traceevent=yes query parameter in the URL. Note that if
Trace Event generation is not enabled in loolwsd.xml this will have no
effect.

It is a bit silly to notice this query parameter only in loleaflet and
then send the information back to the server. Would be better if the
server noticed it itself before sending the URL to loleaflet.

While at it, let's not bother ever enabling Trace Event generation in
the WSD process. That is not what we are interested in.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I985bfd1e2dbd14aa5a55b386b4762fb64bcb4008
2021-07-07 09:28:02 +03:00
Tor Lillqvist
48f7449d24 Ignore conversion error from std::stoull for "busypopup"
Avoids logging an ERR message about it.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: If9e9627b3a10362e415edf2bfa6abf1f37c0b650
2021-07-05 22:35:55 +03:00