Commit Graph

1067 Commits (master)

Author SHA1 Message Date
Jaume Pujantell aceb8912fd Handle LOK_CALLBACK_DOCUMENT_PASSWORD_RESET
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: Ibc2be5bc7676b1b67b7494c200011e4622a5b294
2023-06-23 18:17:14 +02:00
Caolán McNamara 490b0c0d0d drop non-standard width=400 height=400 tile request in unit test
there since:

commit 232499f542
Date:   Thu Apr 21 12:34:30 2016 +0300

and

commit bf66f7a908
Date:   Mon Jun 13 20:31:14 2016 -0400

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I04745be0581a697bbc3b15ba1d8bb94207320a7a
2023-06-23 16:55:25 +01:00
Caolán McNamara 2e64ad700d push unpremultiply to client
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4aef21179a4ace084762f83f5235c7022d670752
2023-06-23 14:20:42 +01:00
Caolán McNamara 962ecba493 push bgra->rgba conversion to the client
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I425655bfd5e6fd9e1e3ca0b6bcc914511ba188b3
2023-06-23 14:20:42 +01:00
Caolán McNamara 9c780bec82 double delta cache
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I4f06f9c4bd6f6fc41b6eed23eb2331daa26f0b5b
2023-06-23 14:07:31 +01:00
Michael Meeks 12e0830b1b Kill canceltiles support completely.
This stopped working well a long time ago, and is already disabled
on the coolwsd side, so dung out the rest of the code & docs on this.

Change-Id: I2e0b73fe9780e16c3cc74ae3a38ae6b04434717a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-06-22 09:35:22 +01:00
Caolán McNamara d3ecb6c95f the tile is assumed to be 256 in width
but as seen with unit-tiletest that is not always the case

==24170==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x63400001e808 at pc 0x558a6f505973 bp 0x7ffc0670e7d0 sp 0x7ffc0670e7c8
READ of size 8 at 0x63400001e808 thread T0 (kitbroker_002)
    #0 0x558a6f505972 in DeltaGenerator::DeltaBitmapRow::initRow(unsigned int const*, unsigned int) Delta.hpp:129:36
    #1 0x558a6f4fc318 in DeltaGenerator::DeltaData::DeltaData(unsigned int, unsigned char*, unsigned long, unsigned long, int, int, TileLocation const&, int, int) Delta.hpp:233:21
    #2 0x558a6f4f8a22 in DeltaGenerator::createDelta(unsigned char*, unsigned long, unsigned long, int, int, int, int, TileLocation const&, std::vector<char, std::allocator<char> >&, unsigned int, bool) Delta.hpp:574:17
    #3 0x558a6f4f2a35 in DeltaGenerator::compressOrDelta(unsigned char*, unsigned long, unsigned long, int, int, int, int, TileLocation const&, std::vector<char, std::allocator<char> >&, unsigned int, bool, bool, LibreOfficeKitTileMode) Delta.hpp:669:14
    #4 0x558a6f41f300 in RenderTiles::doRender(std::shared_ptr<lok::Document>, DeltaGenerator&, TileCombined&, ThreadPool&, bool, std::function<void (unsigned char*, int, int, unsigned long, unsigned long, int, int, LibreOfficeKitTileMode)> const&, std::function<void (char const*, unsigned long)> const&, unsigned int, int, bool)::$_0::operator()() const /home/vmiklos/git/libreoffice/online-san/./common/RenderTiles.hpp:304:38

so just use the rle cache for the first 256 pixels

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8d34ea53bd20b69184e100b56017dfc0a904eaab
2023-06-21 21:31:48 +01:00
Caolán McNamara cc809fda24 fix asan build test
../kit/Delta.hpp:96:23: runtime error: index 4 out of bounds for type 'const uint64_t[4]' (aka 'const unsigned long[4]')
    #0 0x558e8e0f800b in DeltaGenerator::DeltaBitmapRow::PixIterator::next() libreoffice/online-san/test/../kit/Delta.hpp:96:23
    #1 0x558e8e0b8304 in DeltaTests::testRleComplex() libreoffice/online-san/test/DeltaTests.cpp:317:16

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I01da1e99b5d224411344659dce8bd2f29e7d74b0
2023-06-21 17:09:24 +02:00
Michael Meeks 28808ebf6a delta: Add unit tests for RLE encoding, and debugging support.
Change-Id: Ie0b62dbad8af2ab6ff95d6279c69de083c2cd888
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-21 10:00:10 +01:00
Michael Meeks 9d8e84effb deltas: RLE compress pixel runs to save space & time.
Store a bitmap of whether a pixel is identical to the last
pixel in a set of four 64bit members. These double as a
simple CRC. Store the allocated row size too, and use the
stack as a temporary scratch-space to do the building in.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-21 10:00:10 +01:00
Michael Meeks 74a1047452 deltas: pure re-factor, store pixels in each DeltaBitmapRow.
Un-necessary allocation overhead for now, but more follows.

Change-Id: I1012678daf021cf63d8fc6e52d25d2dec703c4fb
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-21 10:00:10 +01:00
Michael Meeks 675c41c644 deltas: pure re-factor: extract out diffRowTo.
Change-Id: I908a486c0c67beaee7b41a85a3bde911f9fe141a
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-21 10:00:10 +01:00
Caolán McNamara 1063fdbcba cid#318963 Uninitialized scalar field
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I459f70a41e5c1bab2e575c8d9ee699e213f2456e
2023-06-14 10:10:46 +02:00
Caolán McNamara c8c49c5b53 cid#318908 Uninitialized scalar field
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I24f1ec683651439761fda48d2db68fee19afcc62
2023-06-14 10:10:46 +02:00
Caolán McNamara 2d6b190805 cid#318977 AUTO_CAUSES_COPY
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Idea2efdb46d1b819b8210a380bd026789d666e2b
2023-06-14 10:10:46 +02:00
Tomaž Vajngerl d23ddf1342 support callback for changing the color palette
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I8d0dec4afd91bcdf66799f3afba1fd77cbc223db
2023-06-09 14:30:45 +02:00
Miklos Vajna a901db436c kit: fix missing init of _isDumpingTiles in ChildSession
This was forgotten in commit 21966e1a9c
(Fix copy command going out of bounds during delta creation,
2023-05-31).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I91ce26f46cc6cb7a2dc3ab0665dc9aeea8a5c00f
2023-06-09 01:36:58 +03:00
Marco Cecchetti d01bedc09c a11y: add config for enable/disable accessibility in general
A new section about accessibility has been appended to coolwsd.xml
config file

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I086abdf73646639283eb655ae60f200fb64e495a
2023-06-08 00:00:51 +02:00
Paris Oplopoios 21966e1a9c Fix copy command going out of bounds during delta creation
When creating a delta, the copy command could copy from rows that are
bigger than the height of the tile. This would go unnoticed on light
mode because the js side that applied the delta would apply these out of
bounds rows with a white color, but it is noticable in dark mode. Made
it so the copy command stops copying from out of bounds.

Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: I4d05cb411958d0945933edb5c812de2dfd9c1abd
2023-06-05 08:59:39 +01:00
Paris Oplopoios baaecac852 Add debug option that allows tile dumping
Added a debug option (triggerable using the about debug menu) that
allows you to dump tiles as they come in

Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: If5939b816c1e3598e50c2db4971710524f855909
2023-06-05 08:59:39 +01:00
Paris Oplopoios b6d4c88f90 Replace documentbackgroundcolor with applicationbackgroundcolor
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: I31dc013f239daec039b194a2b15365a6f3d71621
2023-06-05 08:59:39 +01:00
Marco Cecchetti b9f9cef60a a11y: populating editable area with focused paragraph
We handle notification from core about currently focused paragraph:
content, caret position, text selection start/end.
Notifications are sent on any text changes, even when the text has
been modified in another view.
Moreover we can request such info to core at any time.
That allows AT software to read focused paragraph and selected text.
All that keeping editing still working.
A set of new cypress tests for checking clipboard content has been
developed.

failing cpp unit test:
- HTTPWSTest::testInactiveClient
'unexpected message' assertion was failing since an idle client can
receive an a11yfocuschanged message when the same paragraph has focus
in both view and the active view is editing the paragraph.

failing cypress tests:
desktop
- calc/autofilter_spec.js
  - added more wait time before performing clickOnFirstCell
- impress/undo_redo_spec.js
  - Repair Document was broken
    - we need to select 'Hello world' in order to overwrite it

mobile
- impress/spellchecking_spec.js
  - Apply suggestion
    - better use selectTextOfShape instead of Ctrl-A

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I070d390543fa66fe786c4a0661fa09f891b9883e
2023-05-31 22:43:51 +02:00
Ashod Nakashian cec4cf087a wsd: test: initialize logs before unit-tests
Make sure that the logging subsystem is
already initialized before starting
unit-tests.

Change-Id: I2ce3ffdb2d3b0094ae7ed496d7cacfc02af89c21
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-31 07:40:11 -04:00
Szymon Kłos 376e8fdd97 linking-api: zoom document to avoid empty space on thumbnail
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I572dc8bd239265a9ab9311aa109e82b1d4e06efb
2023-05-17 16:43:54 +02:00
Ashod Nakashian fd87ab6b32 wsd: clang tidy fixes
Change-Id: I7b3b08c8040ba4397ce660c5eaa1d0413c3ec611
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Ashod Nakashian ff1657934a wsd: simplify log streaming
Change-Id: Id22de0bc06680f957e7475f142bcaf1131fdbdb9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-10 08:46:11 -04:00
Gökay Şatır 9d6296e4b3 Remove unused document signing code.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I30cf381d1fa282cf222ab5abc676374ab7eefb6c
2023-05-08 21:51:47 +03:00
Paris Oplopoios 26c55fc417 Handle LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR in ChildSession
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: Icef1e490e847ca21bc525dfd989190940b746b78
2023-05-05 12:38:59 +03:00
Michael Meeks f6bd976f00 Jail cleanup - include coolwsd pid + hash into a jails sub-directory.
This avoids removing the jails of other running coolwsd that share
the same jails/ directory, such as unit-tests, cypress tests etc.

Assert on fatal system error to help catch this during test builds.

Remove old unit-test specific approach, and generalize it, since
apparently we did a recursive cleanup of other people's jails anyway.

Remove over-complicated recursive approach, for a rather simpler
one-level scheme. Avoid following symlinks too for safety.

Remove obsolete lo_jail_subpath setting.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I371f8c0e22f64fb2befb4b58f72cefa39567f3b5
2023-04-25 10:41:57 +01:00
Tor Lillqvist bc6b3bbaee Fix build for iOS (and possibly for Android)
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5eb5187b896b7e80aaab5660a8f10268b565dc8f
2023-04-24 17:15:47 +03:00
Ashod Nakashian 2097e936f5 wsd: only external insertfile names
Change-Id: I76e63dcbf724249e23003353a6fdd2237570fd39
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-04-24 14:04:43 +02:00
Michael Meeks 07d1260058 Consistency checking at various points: load, save.
Check that everything is where it should be; catch and warn
about jails that are corrupted beyond our control, or perhaps
manually un-mounted etc.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ib5f7769ded119d7c6126984b040d0e5565ca8055
2023-04-21 19:20:50 -04:00
Ashod Nakashian fecad56715 wsd: shutdown the Kit socket before terminating to flush
In some rare cases we can't write to the socket
before we terminate, and the last message is
lost. This is observed in tests and especially
when we simulate socket write failure.

Change-Id: I9fb298edfe53de3c7ea0c2f31c02ba370167f96e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-04-14 11:30:14 +01:00
Michael Meeks 7444decf9f trim memory when user is inactive.
Builds on a new LOK API to do the same in the core.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4443cd2ffbb6c7af0726162aec2ba78fc354d901
2023-03-23 11:31:24 +00:00
Paris Oplopoios 8ade29f112 Handle LOK_CALLBACK_VIEW_RENDER_STATE in the Kit
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: Ie4d03a3600cb9ebdf9b76ee4779d62da30ad3eb6
2023-03-17 17:34:05 +00:00
Paris Oplopoios ab176b13a8 Move canonicalId creation to the Kit
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: I943bfa0436487e517b25d3fce19157ebd576604f
2023-03-17 17:34:05 +00:00
Paris Oplopoios d26c425dae Move _canonicalViewId out of Session
Signed-off-by: Paris Oplopoios <paris.oplopoios@collabora.com>
Change-Id: I9c06440ed47eb217e973d2f530f2c3646d55d85b
2023-03-17 17:34:05 +00:00
Tor Lillqvist 43a8ed3f1c Rename variables to match meaning and add a few comments
It is misleading to use the word "pixel" in a variable name when the
variable specifies a size in twips.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Idc59c3dafd63a9ae73601f9c367b37c495e1593a
2023-03-13 12:33:49 +01:00
Tor Lillqvist 12c22706f9 We aparently want thumbnails to be of size 1200x630 pixels
Tweak the "zoom" variabe to be 1 so that with this thumbnail size, for
a typical document we get more of it into the thumbnail.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I419afccbf57eae23062ab4c849dd41293f068f00
2023-03-13 12:33:49 +01:00
Tor Lillqvist b72edec3b5 There is no separate paintThumbnail() API in LibreOfficeKit any longer
It was just a thin wrapper around paintTile() anyway.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I7cca1b05b1ded754ae1f50a0e9d434b505247e70
2023-03-10 19:41:16 +00:00
Szymon Kłos 7cb8005df9 Send thumbnail in binary format
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iad5aec0cfa699f7e38a28c3c6812426ea345bafb
2023-03-10 19:41:16 +00:00
Szymon Kłos 50b5c06ad7 Scroll to target
using URL parameter we setup documents position on load.
example: ...&target=image6.png|graphic

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I855bdb148819966e0d51dde217a94474003a6437
2023-03-10 19:41:16 +00:00
Szymon Kłos e82aa05293 Handle target in get-thumbnail
Using target parameter we move cursor to the desired position.
Thumbnail then is created and sent to the client.
Example target: "image7.png|graphic"

Original author was Mert Tümer.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I170f6af6fd29c420565feca69b8bef034fd91a66
2023-03-10 19:41:16 +00:00
Szymon Kłos 3bec642b02 Add get-thumbnail endpoint
Which generates PNG of selected link target in the document

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Icfdca2f0b58ea370ca0125c188759e942aacc2e0
2023-03-10 19:41:16 +00:00
Szymon Kłos 18e304e87c Add extract-link-targets endpoint
Original author was Mert Tümer.

Example output for: POST http://localhost:9980/cool/extract-link-targets/

{
    "Targets": {
        "Tables": {
            "Table1": "Table1|table"
        },
        "Frames": {},
        "Images": {
            "image7.png": "image7.png|graphic"
        },
        "OLE objects": {},
        "Sections": {
            "Table of Contents1": "Table of Contents1|region"
        },
        "Headings": {},
        "Bookmarks": {
            "_lh2zfxamp5al": "_lh2zfxamp5al"
        },
        "Drawing objects": {}
    }
}

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iab55ec631d78dbe25b2800ed9296bc0cb8997e97
2023-03-10 19:41:16 +00:00
Ashod Nakashian 9c39ebad1f wsd: string::empty() is clearer than size() == 0
Change-Id: If2e25d344b5718c35cb9ae7b7519010ee88f0f60
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-10 07:45:12 -05:00
Ashod Nakashian 74d6739f0d wsd: time the duration of fork
Change-Id: I92f624139f274df95a47f430802a29d33d587689
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian 3fda293103 wsd: name fields in logs and standardize bracketing
Change-Id: I3fe0acf47ebdb0b2551ad20299fe7d720872cbb2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
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
Ashod Nakashian 2c66099518 wsd: uninitialized locals
Without initialization, gcc12 complains
that these values may be uninitialized at the
usage site (in the Kit API).

Change-Id: I06df9d69977b1f89bfa2e0a3ca7404c026b570ed
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-09 21:10:03 -04:00
Rash419 cb080f561e writer: fix: cannot add picture using picture contentcontrol
use sendContentControlEvent to set picture instead of InsertGraphic uno command
since InsertGraphic is not allowed for a protected content control (like picture),
only sendContentControlEvent();

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I5f70919d995c51456056a8be2aa1e596df7bedc2
2022-07-06 14:57:30 +05:30
Miklos Vajna b5af14b302 TileLocation::hash(): shift when the input size_t already
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If4b18b96f3188489f1e5a027e08523722a2d85dc
2022-06-30 15:49:17 +01:00
Michael Meeks 91b20f6448 delta: include canonical-view-id into the TileLocation.
This avoids problems with watermarking cross-talking betwene view.

Change-Id: Ifecf098423451bf7de3827dfdf9fdc078a06c5c9
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-22 09:16:45 +01:00
Michael Meeks 88f84a6e2d re-factor TileLocation into its own struct.
Change-Id: Iaef52359114c14dbfbca683393ea91d09635be72
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-22 09:16:45 +01:00
Michael Meeks 04a8462043 deltas: debug dump the state.
Change-Id: Id35f68a108c151de5d2c27800510d17de60faa4c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-16 10:48:55 +01:00
Michael Meeks bef4b1ec5a delta: have own delta cache mutex, and size cache for session count.
Change-Id: I1f970a5f9045df11444f6fec8ce7e8eeb0a71bf5
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-16 10:48:55 +01:00
Michael Meeks 935715309a deltas: switch cache to unordered_set and manage size & lifecycle.
We should have a larger delta-cache with more users eg.

Change-Id: Idc3075636df2e7705950fcf6762e40546792a285
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-16 10:48:55 +01:00
Michael Meeks 4478d2b083 Delta: add checks for bad memory usage across threads.
Change-Id: I09f5ad5b0af44399f92ccc0b62056172f1a0b220
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-06-10 10:10:05 +01:00
Ashod Nakashian 64db149382 wsd: consistent logging of session name
Change-Id: I1f41fb33d5f550da52d43267a8387577acaeaa59
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-06-07 09:09:00 +01:00
Ashod Nakashian 562cfcae01 wsd: cosmetics and assertion
Change-Id: Ib89d1cb684250e0ebc3455423cbd991d8eecef56
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-06-07 09:09:00 +01:00
Luboš Luňák f84e758ebc use the more efficient getSelectionTypeAndText()
Otherwise calling getSelectionType() first and then getTextSelection()
creates the XTransferable2 twice, and then possibly converts it
to the text format twice, which may be expensive.

Also some cypress tests use selectEntireSheet() and then check
the clipboard contents, which with the switch to 16k columns in Calc
may be slow enough in debug builds when done twice to time out
the test, and this helps a bit there.

Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>
Change-Id: If166f67c216281d32dbb1d3e10b51177b42a9668
2022-06-02 15:44:19 +02:00
Rash419 0e12c85fc9 browser: contentcontrol: added dropdown type
- added a new menu button 'form' in classic and tab button in notebookbar for content control

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ibe06667de39199fd2541fa70ced3ff879274366d
2022-06-01 15:33:47 +03:00
Michael Meeks 3e32d3d4d2 perf: better identical run copying while un-pre-multiplying.
Change-Id: I8958e9a072026e8c06c820dc1ab74b44bf12d87b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks ec6431b088 deltas: 64bit copy & CRC for twice the construction speed.
Change-Id: I568abed80c1e571e7a65370b7b4b1049f52ab0b4
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks 647d2fd708 deltas: allocate a single chunk of pixels, instead of lots of rows.
Avoid std::vector and its peculiarities, also store the crc so
that we get the perf. win from it.

Change-Id: If39ab01b5b987d707d1712076ae9a5beb32b36c2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks f2df5d5ff0 deltas: re-factor deltaToDataDelta into DeltaData constructor.
cleanup accessor too.

Change-Id: I7db28780cc3394bc74f9967a1e2c2bbe0e01089c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-31 19:06:28 +01:00
Michael Meeks e71e78a479 perf: deflate optimize for speed not size for full tiles.
We have many fewer full tiles to compress - so we can
trade a bit of space for some speed. Really should use zstd.

Change-Id: I7c310608173c924f175154bf6f7abb43d5e6f08d
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-30 12:32:14 +01:00
Michael Meeks 6483e1500a Enable deltas by default.
Cleanup some debugging, distinguish wsd/viewport delta fetches from
client-side tilecombines.

Update tests for deltas where they are expected.

Change-Id: I3dca09e4ceb094abf03db2aed2618f19351f3e28
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-25 20:31:06 +01:00
Michael Meeks c130231379 deltas: track, transmit and cache deltas (disabled for now)
Squashed from feature/deltas-expanded.

TileCache changes:
    + add montonic sequence (wid) numbers to TileData
    + account for sizes of TileData with multiple blobs
    + simplify saving and notifying of tiles

Sends updates (via appendChanges) based on the sequence the
right mix of keyframes and/or deltas required as a single
message, and parse and apply those on the JS side.

We continue to use PNG for slide previews and dialogs,
but remove PngCache - used by document tiles only.

Annotates delta: properly as a binary package for the websocket.

Distinguishes between deltas and keyframes we get from
the Kit based on an initial un-compressed prefix
character which we then discard.

kit can be forced to render a keyframe by oldWid=0

Track invalidity on tiles themselves - to keep the keyframe around.

    We need to be able to track that a tile is invalid, and so subscribe
    to the updated version as/when it is ready - but we also want to
    store the keyframe underneath any deltas.

force rendering of a keyframe for an empty slot in the TileCache.

force tile sequence to be zero for combinedtiles - so the client can
always request standalone tiles with explicit combinedtiles, or tile
requests.

move Blob to Common.hpp

use zero size for un-changed tiles.

remove obsolete render-id, and color deltas in debug mode.

cleanup unit tests for non-png tile results.

Change-Id: I987f84ac4e58004758a243c233b19a6f0d60f8c2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-24 22:16:58 +01:00
Dennis Francis ebf970fc4f calc: new callback LOK_CALLBACK_PRINT_RANGES
Signed-off-by: Dennis Francis <dennisfrancis.in@gmail.com>
Change-Id: Ia136c0675dbba51a53424916910219e8330764ac
(cherry picked from commit 817a4cd3f1)
2022-05-20 13:00:39 +03:00
Rash419 c9b9a6589e introduce content control in online
added unocommand to enter rich text in classic, NB and mobile
created a new section to draw rich text rectangles
handle the callback for content control

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: If9912b3598729c26014519c4e1c3c65000b973a4
2022-05-13 17:57:53 +03:00
Michael Meeks 7b595366f3 deltas: promote width before multiplication.
Change-Id: Iddbb2b29bb39f091d891faf02642953da563e31a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 11:48:33 +01:00
Henry Castro 9e885e025b delta: add return image size
It will be used to instrument the return output size

Change-Id: I9f779ff5532d2181da6d6c98060859842e145c0b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-05-10 11:48:33 +01:00
Henry Castro 94c42ae43b kit: simplify initialization delta data
Change-Id: Icd7e8d2614eb97790f6e2533db3cd7eec5511a4d
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-05-10 11:48:33 +01:00
Michael Meeks fb0819191c delta: optimize un-premultiplying identical runs.
Change-Id: I67baab6c6378385da65cac0090923d6abbb44382
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 09:35:47 +01:00
Michael Meeks b6445a9692 Un-pre-multiply pixels in deltas and BGRA -> RGBA swap.
Change-Id: I31eaf0580cfb9d43df3e85a5f15ae0443b6941f0
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 09:35:47 +01:00
Michael Meeks f76522c86a Compress raw images too directly with zlib.
Change-Id: Idb54db1c3a3d6970db0782b2a7a2eebbad27f153
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 09:35:47 +01:00
Michael Meeks 0df3e41879 deltas: make delta creation & caching thread-safe.
Change-Id: If134ac6212850beadb262a4b8f4c084c78d8a44e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 09:35:47 +01:00
Michael Meeks 099ebaa089 deltas: add delta deflate compression.
Includes a horrible inlining of minified zlib de-compression (MIT)

Change-Id: Iaf5f9f5e1215458836e26d45e48e436ee52c48ef
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 09:35:47 +01:00
Michael Meeks bfc4699ffb deltas: enable monotonic wid incrementing, build deltas based on pos.
We want to always generate a delta vs. the last state we have so we
move linearly forward into the future.

Change-Id: I730d1dfb125a19e2c48b8f84ad5563664d196ab0
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 09:35:47 +01:00
Michael Meeks 0fd95cc2ac deltas: add comments to classes.
Change-Id: I49a714ab79b37b77455a9d31b6a3e74fd43973b1
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-09 16:40:57 +01:00
Michael Meeks 8aff82aca7 Cleanup and fix issues in delta creation.
Change-Id: I05ac31d2b968821909e975622a0f52a7f6189369
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-09 16:40:57 +01:00
Henry Castro a56cefc56f common: move "hashSubBuffer" function
Change-Id: If171b7cf4e636e24cb7f757d893136927e8373aa
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-05-09 16:40:57 +01:00
Ashod Nakashian 757529aad2 wsd: cosmetics
Change-Id: I85773b4c06c051ee8c52c353e26dd6149c7843de
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-05-06 14:45:34 +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
Ashod Nakashian 4c1a168757 wsd: remove argument default-value
Single-use default argument.

Change-Id: I1085465c0dbdf6cbda934277feca61781b67f45c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-20 08:34:59 -04: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
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
Mert Tumer 5b869ec8fb Fix views after the first one change spellOnline status
the state is explicitly set by the first view but on makeRenderParams
function we dont check if the spellonline is empty or not, if empty
we should not change the state. It is only empty for views after the
first one

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ief5754bdae2eb952c2df9485fa323fc957da40a6
2022-04-05 11:20:05 +02:00
Michael Meeks db63703d0c Validate as utf-8 all Websocket text messages in debug mode.
Ensure that rendersearchresult: is terminated, and identified as binary.

Change-Id: I84e83c63351cd0aac0923bf7c833b14c1be2c051
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-04-04 20:46:11 +01:00
Tor Lillqvist ed8c10dfb1 nftw() does not set errno on failure
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I7e768416b5113d71330148227aeceb941013c578
2022-03-25 21:29:53 +01:00
Ashod Nakashian 97a6d1cd98 wsd: support experimental features
This adds a new config option to enable/disable
experimental features and behavior. The default
value can be controlled at build time by
--enable-experimental.

Change-Id: Iffcb4c71d9e0933a646251b63033b6dadcd3b809
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-17 18:46:46 -04:00
Dennis Francis f12a6dd370 kit: restore curly braces
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I78b181dacc09dbfc47e3702db8ca9b0083d135e4
2022-03-17 18:31:41 +05:30
Dennis Francis 8af039251d kit: can't open password-protected files
Reproduction:
Opening a password protected document gives an error corresponding to
'faileddocloading' and then a blank file is displayed.

Fix:
Since 0b76383346, when Document::load()
fails without any exception, onLoad() sends

"error: cmd=load kind=faileddocloading"

to the client. This is a problem when load() fails just because the
client did not provide password for a password protected document.
Besides for all "exception free cases" load() already sends the correct
error message(s) to the client. So this patch also avoids sending
duplicate error messages.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I422740ab8855ed772461c23f42a5443afb729bb5
2022-03-14 12:56:20 +00:00
Ashod Nakashian 4322f87d92 wsd: improved forkit logs
And avoid pid of 0 in getKitPids().

Change-Id: I68743a55aed080ed54d7d8576f269974c644e1b2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Kristopher Maxwell cb6a5fd4ad Remove unused parameters in ChildSession
The buffer and length parameters were unused in methods in ChildSession.

Signed-off-by: Kristopher Maxwell <kristophermaxwellc@gmail.com>
Change-Id: I6aff3c92a5d787db84bbe64aa13f2f0160340f7f
2022-02-28 07:13:11 -05:00
Ashod Nakashian 6c28ddb07c wsd: exit the kit when we fail to connect to wsd
This prevents the kit from becoming a zombie
when it has an early failure to connect to WSD.

Change-Id: I4e8203b2cc3d80822308236e5b47be0c0c96e9ae
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-24 07:38:13 -05:00
Ashod Nakashian 15e600ed9d wsd: exit forkit when WSD dies
This may happen due to various reasons and
is most commonly observed during heavy testing.

We now detect when our parent has exited and
we exit forkit as well, since otherwise it
would be a zombie consuming resources.

Change-Id: I71de0315fe7bee419a9e7d0b564630ff75ae15eb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-24 07:38:13 -05:00
Michael Meeks 0b76383346 Send error on failed load and/or exception during document load
This avoids an endless spinner for the loading mobile app in this case.

Change-Id: I047797cbdb066a236afc40337d2eba08f9c0c84b
2022-02-19 22:15:46 +00:00
Ashod Nakashian f8b05a0f83 wsd: support unattended runs
With --unattended, do not wait for a debugger
upon seg-faulting. This avoids the unnecessary wait
that prolongs failed unit-tests in automated runs.
Now run_unit.sh and Cypress Makefile set this flag.

Note that the wait only happens when in debug
builds, or when envar COOL_DEBUG is set. This
prevents us from waiting when running a debug
build where we can't see the output, or indeed
the run is on a CI build machine.

This flag can also be used by devs when reproducing
failures where there is no interest in attaching
a debugger. The logs are shorter and more
readable, too. At least in trace level.

Change-Id: Ice15482c6724abc47f5955402295198eb7f671ee
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Pranam Lashkari 7e22a01d4d refactored feature disabling bits
now it is known as feature locking

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I2935edbfe1eb8dcc194641afa2461cf77b2b29d3
2022-02-11 17:00:11 +00:00
Ashod Nakashian 2444e28059 wsd: reduce noisy logs
This reduces some logs from debug to trace,
especially in Socket where the amount of
activity is high, but the logs in question
don't add value in debug level.

Also supressed an error when superfluous.

This makes debug-level logs much more readable
and relevant to the main events.

Change-Id: Ie2698b56f320d15a09060cf2877477d9da0e1582
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Pranam Lashkari d4c7aaa4c4 fixed master slide previews not being updated
after switching to master view previews would remain unchanged
this patch will invalidate tiles for all the previews

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ie7320d625bd95fe80fc76a459b576d6148b39276
2022-02-04 01:16:13 +05:30
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 c8acc9d080)

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 ff32851738)
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 d4aa0a0f73)
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 5a1c42c4e6)
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 bfed92dffe)
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
Gopi Krishna Menon de403fc12e Improve logging Information
Improve logging information in setdocumentPassword for better clarity :)

Signed-off-by: Gopi Krishna Menon <gopi.menon@collabora.com>
Change-Id: I292991cbee2cf0cf1430ba4c5626b6e08ccbc0f5
2021-07-02 17:17:02 +03:00
Mike Kaganski 4751ff3e2b Initialize the vectors instead of reserving
The vectors are accessing the elements without pushing to the back.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: Ia01b54f80b70173b994e776e05710e92248f0e23
2021-07-01 18:18:00 +00:00
Mike Kaganski 1d7e8539bb Hardcode some trigonometry, and move some FP math out from loop
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I753d1f44e176d4033ead57c6ffdb0f8c8369cfc2
2021-07-01 18:17:25 +00:00
Michael Meeks e289597315 Add a processtoidle event implementation.
This can be used to accelerate unit tests by allowing us to ensure
that all pending work is done between a 'processtoidle' message being
sent and an 'idle' being returned. This can be much faster than waiting
a defined length of time.

Change-Id: I6d96de205d1fd34a22e0ddbd2709bf806a97b33c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-29 17:12:01 +01:00
Tor Lillqvist 7d7b511b83 Guard against the config system being uninitialized
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ifcd2852433bb329c938755300b84a74dd22a8a07
2021-06-21 12:43:17 +03:00
Tor Lillqvist 4c68a97ce5 Re-factor Trace Event stuff for improved functionality and thread safety
Write to the Trace Event JSON file in just one place, protected by a
mutex.

Handle metadata events separately. We want them to propagate to the
output if Event Trace generation is just enabled, regardless whether
it has been turned on or not.

We can send the metadata for the Kit process only after we have opened
the docuemnt as sending a Trace Event to WSD uses the (singleton)
Document object in Kit.

Introduce some new functions for the above and adapt callers
appropriately.

Generate a Complete event for the handling of one image tile, from
setting the src attribute of the Image object to finishing the onload
function.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5978e0fb2495e0d2dc479bf861eb4ac7da03fa50
2021-06-21 12:43:17 +03:00
Tor Lillqvist 12c48004b9 Add a newline after the Trace Event object string here
Just for clarity, so that each object ends up on a line of its own in
the Trace Event output JSON file.

The stringified object already should contain the comma separator at
the end. Probably should change that, make it so that the comma
separators are added when emitting to the file (or sending to WSD.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ibef117afbe9f099c26b42ce32d280055df86d984
2021-06-21 12:43:17 +03:00
Tor Lillqvist 8513a25d06 Emit a Trace Event metadata event for the name of a Kit process
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5fd41d27b63fc9b16a4b06d014dbeedb673121c3
2021-06-21 12:43:17 +03:00
Tor Lillqvist d6569159b7 Output a Trace Event metadata event identifying each named thread
Move the generic dummy implementation of
TraceEvent::emitOneRecording() to a source file of its own. (That is
the one which is used in test and tool executables.)

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I81cab07e5a6852b42d278a5446c13c3825cf546e
2021-06-21 12:43:17 +03:00
Ashod Nakashian d4e60da934 wsd: support uploading after loading from a template
Templates are special because the file that gets
loaded is not in the same format as the final one.
An implicit save-as is issued in Kit for template
loads right after loading to create the final
document format. It is this file (as opposed to the
template) that needs to be uploaded, which we do
right after we get the 'status:' message in
DocBroker to actually create the first version
in storage.

Change-Id: I23cbf527f1059b0b4059f15069737ab35ac860e7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-19 17:44:59 -04:00
Ashod Nakashian f2f713cdaf wsd: rename file after saving to support async uploading
To avoid writing (saving) while reading (uploading) or
any other undesirable racse on the document file,
we atomically rename the file after saving on disk
to pass ownership.

After saving in Core, we rename the document in the
jail to .upload (by appending it). DocumentBroker
looks for the file with that extension and atomically
renames it to .uploading (by appening the 'ing' suffix).
This way, the Kit only renames from the original to
.upload and DocBroker renames only .upload to .uploading.
This guarantees that we never rename the same file
concurrently.

Uploading decision is strictly based on the modified
timestamp of the .uploading file, compared to the
timestamp of the last file we uploaded successfully.

Change-Id: I03520cd8c87605f6dad417e7a978204f76fc0c38
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-19 17:44:59 -04:00
Mike Kaganski cb917d7eae Bail out of getPixmap gracefully, when rendering failed.
And only insert the new pixmap after the check.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I310d321443152967b3aed8992ece3b55287d01cc
2021-06-16 17:42:26 +02:00
Tor Lillqvist 34f345f1ee Emit a Trace Event (when enabled and turned on) in ChildSession::_handleInput
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I8fab2f6f8e86d01fafba0f7bb799c503b5331018
2021-06-16 07:17:44 +03:00
Michael Meeks 7227c7c48a Remove dupliate forward definition.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-15 15:44:21 +01:00
Michael Meeks f8a5edb995 Transfer LOK callback processing into our main thread if necessary.
While we are processing data in the poll handler, we can have
another helpful thread from the core sending things to us:

loolforkit(Socket::assertCorrectThread(char const*, int))
loolforkit(WebSocketHandler::sendFrame(std::shared_ptr<StreamSocket> const&, char const*, unsigned long, unsigned char, bool) const)
loolforkit(WebSocketHandler::sendMessage(char const*, unsigned long, WSOpCode, bool) const)
loolforkit(Document::postMessage(char const*, int, WSOpCode) const)
loolforkit(Document::sendFrame(char const*, int, WSOpCode))
loolforkit(ChildSession::sendTextFrame(char const*, int))
loolforkit(ChildSession::loKitCallback(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))
loolforkit(Document::GlobalCallback(int, char const*, void*))
/core/instdir/program/libsofficeapp.so()
/core/instdir/program/../program/libfwklo.so()
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libexpwraplo.so()
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::xml::sax::InputSource const&, bool))
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::uno::Reference<com::sun::io::XInputStream> const&, rtl::OUString const&))
/core/instdir/program/libooxlo.so(oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&))
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libcomphelper.so(comphelper::ThreadTask::exec())
/core/instdir/program/libcomphelper.so()
/core/instdir/program/libuno_salhelpergcc3.so.3(salhelper::Thread::run())
/core/instdir/program/libuno_salhelpergcc3.so.3()
/core/instdir/program/libuno_sal.so.3()
/lib/x86_64-linux-gnu/libpthread.so.0()
/lib/x86_64-linux-gnu/libc.so.6(clone)

This is most likely from eg. threaded parsing of various file formats,
or progress messages while loading / saving, sent while the SolarMutex
is locked.

We assume that:
  + there will only ever be one thread running inside kitPoll
    this is enforced by vcl/headless.
  + and so, we can safely mutate SocketPoll and Socket buffer
    state from this thread.
  + there are only two entry points for callbacks from threads
    in core - which are both instrumented, and if necessary
    their work is shifted to this thread.

Memory corruptions matching the above trace, suggesting that
multiple writes have collided between kitPoll and an event
callback have been seen in the wild.

Change-Id: I5b084cbfec1ea326b6e17c9e5590a8c8e35b3854
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-14 09:31:26 +01:00
Dennis Francis 98c78caa4d fix: watermark not present in fully transparent tiles
Calc has transparent tiles due to client side grid/bg rendering, so do
alpha blending in calc for transparent pixels. As before do alpha
blending for the font rendering phase, no change there.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I30ab21475b6654a9375574be825e01edbdabf82a
(cherry picked from commit 7b7a73c17d)
2021-06-14 13:33:13 +05:30
Michael Meeks 655493a7bc Transfer LOK callback processing into our main thread if necessary.
While we are processing data in the poll handler, we can have
another helpful thread from the core sending things to us:

loolforkit(Socket::assertCorrectThread(char const*, int))
loolforkit(WebSocketHandler::sendFrame(std::shared_ptr<StreamSocket> const&, char const*, unsigned long, unsigned char, bool) const)
loolforkit(WebSocketHandler::sendMessage(char const*, unsigned long, WSOpCode, bool) const)
loolforkit(Document::postMessage(char const*, int, WSOpCode) const)
loolforkit(Document::sendFrame(char const*, int, WSOpCode))
loolforkit(ChildSession::sendTextFrame(char const*, int))
loolforkit(ChildSession::loKitCallback(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))
loolforkit(Document::GlobalCallback(int, char const*, void*))
/core/instdir/program/libsofficeapp.so()
/core/instdir/program/../program/libfwklo.so()
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libexpwraplo.so()
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::xml::sax::InputSource const&, bool))
/core/instdir/program/libooxlo.so(oox::core::FastParser::parseStream(com::sun::uno::Reference<com::sun::io::XInputStream> const&, rtl::OUString const&))
/core/instdir/program/libooxlo.so(oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&))
/core/instdir/program/libscfiltlo.so()
/core/instdir/program/libcomphelper.so(comphelper::ThreadTask::exec())
/core/instdir/program/libcomphelper.so()
/core/instdir/program/libuno_salhelpergcc3.so.3(salhelper::Thread::run())
/core/instdir/program/libuno_salhelpergcc3.so.3()
/core/instdir/program/libuno_sal.so.3()
/lib/x86_64-linux-gnu/libpthread.so.0()
/lib/x86_64-linux-gnu/libc.so.6(clone)

This is most likely from eg. threaded parsing of various file formats,
or progress messages while loading / saving, sent while the SolarMutex
is locked.

We assume that:
  + there will only ever be one thread running inside kitPoll
    this is enforced by vcl/headless.
  + and so, we can safely mutate SocketPoll and Socket buffer
    state from this thread.
  + there are only two entry points for callbacks from threads
    in core - which are both instrumented, and if necessary
    their work is shifted to this thread.

Memory corruptions matching the above trace, suggesting that
multiple writes have collided between kitPoll and an event
callback have been seen in the wild.

Change-Id: I5b084cbfec1ea326b6e17c9e5590a8c8e35b3854
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-11 14:19:55 +01:00
Tor Lillqvist 1c316bb7b8 Fix crash in iOS app
No separate Kit process in the mobile apps, and the iOS app even can
have several documents open simultaneously, so the singletonDocument
variable does not make sense.

If we at some stage want to generate Trace Event log files also in the
iOS or Android app (perhaps not likely), will have to handle it in a
different fashion. All the code runs in one process anyway in the
mobile apps, so it wouldn't make sense to "send" collected Trace
Events to the code standing in for the WSD process.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5777b48e98121c3ed55e590d5009e2658af2ef22
2021-06-11 14:07:57 +03:00
Tor Lillqvist 8cef48a0fa Introduce a generic TraceEvent class and instant events here, too
Modelled on how it is done in core. ProfileZone is derived from
NamedEvent which is derived from TraceEvent. Here we don't keep any
separate ProfileZone.hpp, though.

This was needed to introduce generation of "instant" events here, too.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I6583134e96001641c50339deb4197fca6ab7d5d5
2021-06-02 09:04:21 +03:00
Henry Castro 6c2203e747 kit: revisit log messages ChildSession.cpp
LOG_FTL = abnormal, crash, denied service
LOG_ERR = load, save, session, connection, wrong parameters
other cases LOG_WRN, LOG_INF

Change-Id: I76b4b066db59acd2e7dc45bf8606021104f79cae
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-06-01 14:14:22 -04:00
Tor Lillqvist 7785eb0481 Keep the return value from config::getBool() in static const bools
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I823cbd4ace71f9fd5a45e6c042599cdea03458c8
2021-05-31 10:56:19 +03:00
Tor Lillqvist 2ac4350e22 Don't send individual ProfileZone recordings to the WSD process, but buffer them
Change-Id: Ie3ec57ff38035d786ae081266ed81793bcf60514
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-31 10:56:19 +03:00
Tor Lillqvist 3553430a62 Try to fix iOS and Android build
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0839c589517f64d966fec9f247dda4163bdbe5fd
2021-05-31 10:56:19 +03:00
Tor Lillqvist 929e466c91 Re-work the ProfileZone implementation here
Don't bother collecting them into a vector, like in core. Instead,
just call a static member function ProfileZone::addOneRecording() for
each Event Trace object (string) to be emitted. That function then
needs to be implemented separately in each executable. In WSD it logs
the object to the Event Trace file. In Kit it sends it to WSD for
logging. In Unit tests we use a dummy implementation.

(If Event Trace logging is not enabled at all in loolwsd.xml (the
default), nothing is done, of course.)

When receiving the "traceeventrecording start" or "traceeventrecording
stop" message from the client, turn ProfileZone recoring on or off in
the WSD and Kit process. (Probably in WSD the flag should be
per-client.)

Change-Id: Ie1127d65dd44ed77e7eeab4b0f0a90cce95dc4a2
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-31 10:56:19 +03:00
Tor Lillqvist 9d45ab005c Add TODO
Change-Id: Id75eaacbdb826892bd7dbc4329852a3716e1719a
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-19 13:33:26 +03:00
Tor Lillqvist 9c6b74ad08 Use a loolwsd.xml setting instead of --enable-trace-event-logging
That is our convention, and this also avoids a global variable in the
kit process.

Change-Id: I37d2d53aa7eb24f9848fa8ef98bc57d75db90d13
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-19 13:33:26 +03:00
Gökhan Karabulut dbbf03d63b Remove unused field
Field `_lastMemStatsTime` is not used, so remove it.

Signed-off-by: Gökhan Karabulut <gokhanettin@gmail.com>
Change-Id: I4739e5f64d44b04b5c2c9c5c4081b05f2bb4e0ee
2021-05-13 09:29:35 +01:00
Gökhan Karabulut 7f736a9bc4 Improve state dump
Add `dumpState` methods to `TileQueue`, `PngCache`, `ThreadPool` classes
and call them from Document::dumpState method within kit.Kit.cpp.
Because `dumpState` method of `_websocketHandler` is protected,
currently we can't dump its internals.

Also dump the other members of the `Document` class. Note that as
`_lastMemStatsTime` is never used, we don't dump it. It seems we could
simply delete it.

Signed-off-by: Gökhan Karabulut <gokhanettin@gmail.com>
Change-Id: Ia89b7fff41eaf475c7a09a644c0eb523b72cf97d
2021-05-13 09:29:35 +01:00
Tor Lillqvist 9da0145280 Add an --enable-trace-event-logging option to loolwsd
It enables turning Trace Event recording on (and off again). The
option is passed down to the client through loleaflet.html, and to the
KIT processes. If the option is not used, the new JS functions that
send trace events to the server turn into no-ops to avoid wasting
bandwidth.

It is always on in a "make run".

Change-Id: Iafe1919ccba7c376137d3e0568b857e20780bbc8
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-10 12:39:07 +03:00
Michael Meeks 204607ea43 Don't enable profiling yet.
Kit initialization uses 'trace' for very early start, and then
switches to the configured trace level later on, so don't use
it this early.

Change-Id: I8e0333930b46e5ad25658d7eda12d7469bdfdd1e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-05-06 20:31:55 +03:00
Michael Meeks 900bf62682 Avoid parsers believing that the body is a forward message.
We need a space after the prefix here to get past the
getForwardToken detection in the core; \n doesn't cut it.

Change-Id: I3f125d47586964ff844f0a89b04b8de866d01f8b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-05-06 20:31:55 +03:00
Tor Lillqvist eb9c580c36 Introduce ways to toggle and tweak core Trace Event recording and logging
When toggling tile debugging in the Help>About, toggle Trace Event
recordning, too. Add a comment with an example of how to turn on
SAL_LOG overriding at the same place.

The following new messages from client to server are introduced:

traceeventrecording <start/stop>

    Starts or stops comphelper::TraceEvent recording.

sallogoverride <string>

    Overrides the SAL_LOG value, or stops overriding if no parameter
    or parameter is "default".

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I8b56c28cd99d39115cd796c44e5051d934d21a1f
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-03 16:09:35 +03:00
Tor Lillqvist be476d23b3 Produce a Chrome Event Trace file
It is (for now) produced (by the ProfileZone things in core) whenever
logging level is "trace". The Event Trace file pathname can be given
in the loolesd.xml file or on the loolwsd command line.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I6d5829121e71460a4600ee94d2ebf51043c8893f
2021-05-03 16:09:35 +03:00
Miklos Vajna 656eb310bb Fix Debian 8 / gcc-4.9 warnings
net/HttpRequest.cpp:126:19: error: declaration of 'end' shadows a member of 'this' [-Werror=shadow]

kit/Kit.cpp:163:29: error: missing initializer for member 'statfs::f_bsize' [-Werror=missing-field-initializers]

kit/Kit.cpp:171:14: error: 'OVERLAYFS_SUPER_MAGIC' was not declared in this scope

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibbd35ab5af3adad403ed22a0aeb70917b9e21970
2021-04-30 10:38:09 +02:00
Pranam Lashkari a2757f3a47 loolwsd: after comment operation update status
send status after performing any comment operation,
updating status send page dimensions,
which help in canvas layer to resize actual page size
without updating page size comments may go out of view
and will also not be scrollable into view

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I489648bb5ccd7223746fea42050088e078046a1a
2021-04-09 09:56:13 +02:00
Dennis Francis 3ec3af8707 client-side-grid: disable core grid and bg
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ib8fdba0ea3f8ddca761f9e0d8c56773e86b5e2f4
2021-04-07 13:59:06 +05:30
Ashod Nakashian 029fe9275e wsd: initialize config and use it in Kit
Change-Id: I0c6047ab2083b3fbfbade89d1c1ef04eb6e3b6c1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Ashod Nakashian 08eab4bc15 wsd: more config features
Change-Id: I2fb33a2d89ab886bc454ae961dbff7b6c2c1b0ef
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Ashod Nakashian db36d079ce wsd: pass the config from loolwsd to forkit
Change-Id: If89a5021bc7d86d630511abb65839f5448f4bd3d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Ashod Nakashian e0aa90dd3a wsd: simplify lokit_main call
By defining NoCapsForKit and NoSeccomp
as const values for the KIT_IN_PROCESS
case, we have a more consistent and
simpler call-site.

Change-Id: Ife553eab9eaffd96560d4cfb4b8fdcdf26a1b9db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 12:43:39 -04:00
Pranam Lashkari b8c85e7237 impress: hide regular slides in master view
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I2b1ececba67fb8855187baafdc42cb5baa051635
2021-04-01 14:02:46 +02:00
Gleb Popov c3a3a0d7a8 Mark the argument as unused to silence compiler warning.
Signed-off-by: Gleb Popov <6yearold@gmail.com>
Change-Id: I99731e183afb7a8164f3e4d5e737e7e78f02a0a2
2021-03-27 17:59:11 -04:00
Michael Meeks c2b11b5e5b Dump versions when we have a signal.
Change-Id: I6b1f5ac1cebdd05dd9ff9541a5418059f55841ed
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-25 19:46:36 +00:00
Ashod Nakashian 1f978d9b50 wsd: cleanup Poco headers
Change-Id: I1eec2301576fc2f1cde40389b1f858f80b1204c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Michael Meeks 479447637b Optimize for overlayfs by forcing an initial copy to linkable/
built-in hard-link support performs extremely badly otherwise.

Change-Id: I26d5080590538cb6342d64e2e0a4023bbc84c427
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-15 15:47:34 +02:00
Henry Castro 1df271b363 config: add "macro_security_level" item
"Level of Macro security".

Change-Id: I491648f2a89289c7f4455dfad76d73ac8449b965
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-03-12 08:23:56 -04:00
Henry Castro 50c0fc4492 config: add "enable_macros_execution" item
"Specifies whether the macro execution is enabled in
general. This will disable Basic, Beanshell, Javascript
and Python scripts. If it is set to false, the
macro_security_level is ignored. If it is set to true,
the mentioned entry specified the level of macro security".

Change-Id: I4bc5b690268a93994d17e2b02b7b60b6398646b7
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-03-12 08:23:56 -04:00