Commit graph

212 commits

Author SHA1 Message Date
Ashod Nakashian
226c2fe71c wsd: unify anonymization flags under one
This simplifies the anonymization configuration
as virtually always they are all either enabled
together, or not at all.

Change-Id: I6fe60f5287fc5d71cd7a6ac3268eac67e5e6e9fb
Reviewed-on: https://gerrit.libreoffice.org/70033
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71090
2019-08-17 03:42:19 +02:00
Tor Lillqvist
a158686422 The SavedClipboards stuff presumably makes no sense for MOBILEAPP
It seems to be strongly related to HTTP things at least in error
handling. So bypass as cleanly as possible in the MOBILEAPP case for
now.

Change-Id: If9540f166293635513a3ab06371f01ad381a8cb2
2019-08-12 13:20:52 +03:00
Miklos Vajna
1263694944 common: wrap ShutdownRequestFlag in a getter function to avoid ODR violation
Otherwise both loolwsd and unit-copy-paste.so would have a
ShutdownRequestFlag:

==13663==ERROR: AddressSanitizer: odr-violation (0x00000208f860):
  [1] size=1 'ShutdownRequestFlag' ../common/SigUtil.cpp:60:19
  [2] size=1 'ShutdownRequestFlag' common/SigUtil.cpp:60:19
These globals were registered at these points:
  [1]:
    #0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f9b903f1d0b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ad0b)

  [2]:
    #0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2b9fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b9fe)

Change-Id: I247760325f804813249e814dbb4576493619dee7
2019-08-12 09:03:42 +02:00
Tor Lillqvist
c1ebc62c3a Fix build for MOBILEAPP
The iOS app does not work any longer, though. Hits an assertion failure.

Change-Id: Ia135c12a79427e5c2b6c3c98adef4c354d1ceb68
2019-08-07 14:41:37 +03:00
Michael Meeks
617a5d69b0 Account for a state change race.
We can have un-processed incoming mesages in transit after a local
transition to WAIT_DISCONNECT including some that change state.

Change-Id: I577aebbc0a6ecca695f4bc35b4d226e1a465817d
2019-08-06 14:50:52 -04:00
Michael Meeks
80fb9ac96f clipboard: unit tests need clipboard tags during init.
Ensure we always have a valid clipboard key at start.

Change-Id: Ia2d37e038d8baa877d147f507a5ff4c867f55813
2019-08-06 14:50:52 -04:00
Ashod Nakashian
d12227c839 wsd: send clipboard key on loading
While we don't send the clipboard key
to the client during the construction
of ClientSession, we do so upon handshake
(loolclient message), and by then our state
is no longer DETACHED, rather it is LOADING.

This restores copy/paste across documents.

Change-Id: I0db50210f232afa05b1273edeb2cc163fd07c504
2019-08-05 22:21:54 -04:00
Michael Meeks
9e791fb0d4 clipboard: persist selections for a while after a view closes.
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.

Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87
2019-08-05 22:21:54 -04:00
Ashod Nakashian
2492faf225 wsd: add 'meta origin' to clipboardcontent payloads too
Change-Id: I61233fd9b2559a28a0da67dd0a869e97c8b34da7
2019-08-05 21:58:10 -04:00
Michael Meeks
eeff5ee173 clipboard: include /lool/ into the clipboard base URL.
Helps older load-balancers.

Change-Id: Ibc1529a5784bb7fe6e11f914f4ee01cd1bae52a2
2019-08-05 21:46:39 -04:00
Michael Meeks
fbd021958b clipboard: de-combine whole clipboard fetch from just text/html.
Now we can copy/paste smileys internally again.

Change-Id: Ibc6c77ccb9c501230947a7172cf591b2e12531b3
2019-08-05 21:44:29 -04:00
Szymon Kłos
18305c8a44 Request text/html in get clipboard
Change-Id: I9096fb2470da0255722f58bdeaeba87fcae3511d
2019-08-05 21:38:01 -04:00
Michael Meeks
b3415abea0 clipboard: test two separate views' clipboards.
Change-Id: Ie6f2eeb1f1dd3c762cca847f4c77a5cd7d39f70a
2019-08-05 21:36:49 -04:00
Szymon Kłos
3fab8a9937 Fix crash: Send bad request when no data
Change-Id: I705c47925b1e44bf7b112325f06c915e841dab2a
2019-08-05 21:28:09 -04:00
Michael Meeks
3c42f3525a Rename to clipboardkey.
Change-Id: Idba1d839e75a5525a8b0e71b9aecff17b8aa05e9
2019-08-05 21:21:45 -04:00
Michael Meeks
13469e8b00 clipboard - set it with a post now.
Change-Id: I6b9234988185984335408da502f479ccda8a95a7
2019-08-05 21:18:44 -04:00
Michael Meeks
9726ce6f77 Various copy/paste fixes, unit test passing, parsing of result.
Change-Id: I9168853dd011e86896c3bd474a4d05ee82c0e336
2019-08-05 21:18:12 -04:00
Michael Meeks
c7956349f6 More work getting the unit test closer to passing.
Change-Id: If2ec0d5465a84e11dec1f5c5b9839a369b393784
2019-08-05 21:16:37 -04:00
Michael Meeks
245e509413 clipboard: start of rotating clipboard key management.
Change-Id: I8caab267ec5391e2cd7cb20907fa080111cc70dd
2019-08-05 21:16:37 -04:00
Ashod Nakashian
da455c486a Serve a decidedly unpretty clipboard download page
The initial bits to serving some page with provision
to ingest the different formats into a table.

Doesn't yet link with the actual document, but it's
a start.

The link will have some unique id(s) in it to
reference the document in question, which will
be some hash (possibly changing with some logic for
security reasons). This hash will have to be
something valid that WSD will use to locate
the DocBroker in question, connect to it and
fetch the formats supported and generate unique
links for each. When the user clicks on a link,
the contents will be downloaded in the given
format and copied to the user's clipboard.

The clipboard.html template is based on loleaflet.html
as we're very likely to use the same customization,
branding, localization, and javascript bits.

We would probably want to add a brandable title
with logo etc. and possibly some more reasable
background (ideally, an image enlarged and blured
to give the page some semblance of having content).

Change-Id: If0550184d4423bef1e98fecbb072bdf8df07701b
2019-08-05 20:26:13 -04:00
Michael Meeks
c36da1cd97 Implement getClipboard and start of a unit test.
includes Change-Id: I47d38f9285c855dcc6fbeeb73d35f22a46a30c05

Change-Id: I60b84bef1cf832ec5c191d664afd90a080b7ffbc
2019-08-05 20:25:49 -04:00
Michael Meeks
52e477e57e Switch to text/html for paste where we can.
Build special URLs to detect the same host being in-use, and much more.

Change-Id: I0ca639ea416cb78bf5e5274eac4400542b6b2cda
2019-08-05 15:47:47 -04:00
Henry Castro
760864870f wsd: introduce "TemplateSource" WOPI property
Change-Id: I9df1d5d0d4be7fe10ee15c40c36195c86ccf857e
Reviewed-on: https://gerrit.libreoffice.org/76190
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-07-24 12:10:15 +02:00
Eduard Ardeleanu
5663817bab detecting password protected files on convertTo
Fail-fast when a file cannot be converted, using convertTo REST API, if the file is password protected and the password wasn't received.

Change-Id: I32d807bcecbbe72a38a70fec74caf13638803e1d
Reviewed-on: https://gerrit.libreoffice.org/72891
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-05-30 13:49:40 +02:00
Michael Meeks
bf88897c47 Make renamefile more careful.
Change-Id: If39353fc01ea48d8e0077b228a6281839dde5c87
2019-05-23 17:55:38 +01:00
Michael Meeks
24b9d6008d Don't allow readonly views to removesession on editors.
Change-Id: I5c00b83d5a3a5fc59f7c722b9ed7f9753b2b0dc8
2019-05-23 12:13:11 +01:00
Michael Meeks
8be093ed67 Tolerate empty first lines.
Change-Id: Ib9aaf82560fc3f5adaa97f40a3de5f3946c6f65d
2019-05-17 14:27:47 +01:00
Michael Meeks
289894c66c debug: show WebSocketURI & a unique host id in help -> about.
Rather useful for debugging clustering issues.

Change-Id: I6d5f224bf8a3e4034c419137c8ad2b17fdf265ed
2019-05-17 13:24:32 +01:00
merttumer
0dbf9bcf27 Added RenameFile Support for WOPI
This patch concerns rename file operation when the integration
supports it
Signed-off-by: merttumer <mert.tumer@collabora.com>

Change-Id: Ibb4f615b91dda2491bfcd4d4738198d69eca4e6f
Reviewed-on: https://gerrit.libreoffice.org/71587
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Signed-off-by: merttumer <mert.tumer@collabora.com>
2019-05-13 22:29:40 +03:00
Tomaž Vajngerl
02a07d62a5 tdf#124146 touch gesture support, send pan gesture in dialogs
Pan gesture should work for comboboxes, for which panning is
implemented in core.

Change-Id: I0a7e49e9335159a302716f666e2334a9d532c115
Reviewed-on: https://gerrit.libreoffice.org/69720
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-26 10:48:17 +01:00
Jan Holesovsky
c8285addec Kill some extra whitespace.
Change-Id: If0899266ab0ca0d3717fce6eff3a8fca0b4f90ea
2019-03-20 08:50:14 +01:00
Eduard Ardeleanu
d87146d3fa fix: saveAs breaks when '%' character is used within the filename
Change-Id: I2df059abd67be88acae8bd44ae2c74be7778a595
Reviewed-on: https://gerrit.libreoffice.org/69424
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-03-19 18:31:15 +01:00
Michael Meeks
5627c767ab Anonymization: don't log when it is disabled.
Also fix unexpected concatenation error in Poco::URI::encode generating
eg. authorid=localhost0 xauthorid=localhost0localhost0 in the output.

Change-Id: I560e47e31884eeb1c662f468436ed7541cfb082d
2019-03-15 11:27:38 +01:00
Michael Meeks
6634d3b3e9 TileCache: key almost everything on TileDesc instead of string names.
Saves lots of string construction and storage, simplifies lots of code.

Store the more exotic font-caching bits etc. in a separate store: we
should also pre-render these really and share them.

Change-Id: Icaeff8fd72f52d7215c06a687b1e39cfb7631503
2019-03-05 06:58:50 +01:00
Michael Meeks
829e94b779 TileCache: remove redundant, expensive tracking in ClientSession.
No need for all these call outs. removeOutdatedTileSubscriptions can't,

Expect it is quicker now and more reliable to trace the tiles being
rendered and count the waiters.

Change-Id: I9724c7f38cf888b35c628857c0f11b51e74613ca
2019-03-02 21:42:34 +01:00
Michael Meeks
2d473222e4 tdf#123482 - cleanup convert-to folder more reliably.
Change-Id: I029bb4136984e05485e462c92da80b92b00fdebc
2019-03-01 22:34:29 +01:00
Michael Meeks
36e9d5b376 TileCache: re-factor API to work in terms of vectors, not file references.
Change-Id: Ia9d48773121ab965b79ddb16b55b5d3fdcd7fd5c
2019-02-14 21:46:39 +01:00
Michael Meeks
af31537a2a Expose tile-id generation to unit tests.
Change-Id: Ie56967c82192f3983ac13d53fd73346f25e6c840
2019-02-13 18:24:36 +01:00
Jan Holesovsky
f76b36193d android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
2019-02-12 12:20:11 +01:00
Tomaž Vajngerl
7137c953d8 add export, sign and upload as one function for PDF signing
PDF export, signing and upload needs to be done in one operation
as PDF doesn't change the current document. The workflow is just
a bit different to the ODF / OOXML that it needs a change in
behaviour.

Change-Id: I752b293494a2d677fa7f12f2317954cfcf47859b
2019-01-13 23:50:18 +01:00
Szymon Kłos
d68d6cda4a WOPI: Action_RemoveView
Change-Id: Ie8160b70b94c5cb9012560fde64e7e4e9eb079cf
2018-12-07 12:39:28 +01:00
Tamás Zolnai
31f99bf9f5 Introduce client-server message for requesting the selected shape as SVG
It works for Impress only now.

Change-Id: I130707d8e96e0c633f2531b1cb81ce74dc6ec6e1
2018-12-07 12:39:27 +01:00
Ashod Nakashian
d7758373fe wsd: always encode anonymized author and authorid
Because when anonymization is not enabled, we might
have spaces and other special characters that break
the message. Also, Kit expects encoded strings anyway.

Change-Id: Id23c4ec39f35e1a0df462cb8cbc736aa33f0f6c2
2018-12-07 12:39:27 +01:00
Tomaž Vajngerl
5b22fac214 Upload document to Vereign
Save document to a input format (either PDF, ODT, DOCX) and send
the document to Vereign using WOPI protocol.

Change-Id: If9a7d88e91d07c7f1f831c01793f0f73d7a98131
Reviewed-on: https://gerrit.libreoffice.org/63839
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-29 21:49:51 +01:00
Miklos Vajna
2751f2aeba WopiStorage::WOPIFileInfo: make members private
Change-Id: I62b709acf856b86a8880a517f45152abfa6e32b2
2018-11-21 09:08:00 +01:00
Miklos Vajna
63bf882f73 Rectangle: make members private 2018-11-14 09:07:54 +01:00
Miklos Vajna
cd08cbf385 Session: make members private 2018-11-13 09:04:19 +01:00
Tomaž Vajngerl
852ed5d981 handle signature status and prepare document signing in WSD
This adds handling of signature status (manually request for the
status or as a callback) in WSD.

In addition prepare support for signing of document, but don't yet
trigger the actual LOKit function (needs the JS building blocks
set up first to know how to handle the payload - certificate and
private key)

Change-Id: Ic76baa5847bb52adde616338187d5979e0093c6d
Reviewed-on: https://gerrit.libreoffice.org/62533
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-09 09:06:02 +01:00
Michael Meeks
a0f83bd9b9 Convert-to - cleanup after ourselves.
Change-Id: I85de9721ac1b33d053b59fc36fc7c307206a0888
2018-11-08 02:36:08 +00:00
Miklos Vajna
22fac18fcd WebSocket: make members private
All of them were protected, but only _socket was used actually. Add a
protected setter/getter for that field.
2018-10-24 09:36:13 +02:00