Commit graph

2655 commits

Author SHA1 Message Date
Ashod Nakashian
158e1a125f wsd: avoid using the default port for unit-tests
Change-Id: I4d8681491b0aeedbc349c7644551f51052adf63d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-04-11 08:03:01 -04:00
Ashod Nakashian
aace69c087 wsd: check for editable session not readonly
The following commit caused a regression with
PDFs which are read-only, but may allow comments.

commit cca0a561ed
Author: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Date:   Sun Jan 15 18:29:18 2023 -0500

    wsd: never upload using a session that is read-only

Change-Id: I9bf1fde21b47a4f119b99cc58f76cd683c2152a9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-24 13:54:35 +01:00
Michael Meeks
7ba6c10e6d valgrind / massif - improve things a little.
Avoid SIGKILL'ing children when valgrinding to allow time to save
massif traces etc.

Change-Id: I255a62b6605164ac5037a06455f1adfcba05759c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-03-23 11:31:24 +00:00
Szymon Kłos
47cd213b10 export as pdf: we need to decode path
When using Nextcloud with source file with spaces in the name
eg. "file name.docx" and we tried to export as PDF
then error appeared.

In the logs we had "SaveAs produced no output in '<...>file%20name.docx', producing blank url.

We need to decode file name similar to convert-to case.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic60cefefc4e20b53feee28b86443090c147bb66e
2023-03-21 07:39:15 +01: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
Patrick Luby
7dd1e505e6 Fix issue #5841 welcome, feedback, and buy product URLs are empty on mobile
Mobile apps don't substitute these values so set them to zero length
strings.

Also, the iOS app sets the base text direction via the "dir" parameter
so add handling of that parameter in cool.html. TODO: check if the
Android and GTK apps need to implement the "dir" parameter to handle
RTL layout.

Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: Ied8268ec256011281961ef610d53baeee0efe9cd
2023-03-15 09:29:56 +01:00
Patrick Luby
17f739ca77 Fix issue #5887 by assuming that documents are writable on iOS
The iOS app saves directly to local disk so, other than for
"view file extension" document types or other cases that
I am missing, we can assume the document is writable until
a write failure occurs.

Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: Iacb1589eded18f0cb21a5dd8e4d91d295ae697fe
2023-03-15 09:29:56 +01:00
Ashod Nakashian
f91a7dd772 wsd: reduce minimum time between requests
Previously we waited at least as long as
it took to process the last request before
issuing a new one. This can be unnecessarily
long, especially when unloading. Now we half
that time.

We should consider a more sophisticated logic,
especially during unloading, where it's best
to upload quickly.

Change-Id: Id903b8a064bd8431578221dc9386ab08d46dd2dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 20:40:40 +01:00
Ashod Nakashian
a941de6fb7 wsd: mark last upload request time
This corrects the reported upload duration
at the end of uploading.

Change-Id: I9d3af4d3dce5aff0c3526ba009fc0b27150bc070
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 20:40:40 +01:00
Ashod Nakashian
9caa1f9a18 wsd: pass by reference where possible
Change-Id: Ib5501d6b766b982f34b226a20128c89f0ae7d84e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 20:40:40 +01:00
Ashod Nakashian
e6180f31f3 wsd: remove single-use getWriteableSessionId
Change-Id: I66a77be784aaef61472cd02cb49168813d75548c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 20:40:40 +01:00
Ashod Nakashian
43515fcbbf wsd: correct config default-value name for rotateOnOpen
'rotationOnOpen' -> 'rotateOnOpen'.

Change-Id: I204e1f1208cbc8089a10472fc52b4c2e83e3eaf5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 20:40:40 +01:00
Ashod Nakashian
b5de21a0ad wsd: simplify passing mobileAppDocId to getNewChild
It seems more complex to have #ifdef guarded logic
around a function call to pass or not pass an argument
when we that same argument is already defaulted in
that function.

If the difference between the two paths is primarily
the argument, then we can always pass it, making sure
that in the case that defaulting would have been used
that we pass the same default value. This is now done
with assertions.

Change-Id: I333eb3f42cb51dfab8584ae8c5aa52ee45c5a9a1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 20:40:40 +01:00
Ashod Nakashian
a532178697 wsd: better logging in autoSaveAndStop
Change-Id: Ied4e5dda4f9dfa7f5175601207dd6a2bbf136ff0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 15:46:48 +01:00
Ashod Nakashian
197315da3b wsd: correct log of time since last save response
Change-Id: If93768da07904ea683f91a0964780ca6832b52a6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 15:46:48 +01:00
Ashod Nakashian
af62f75afe wsd: only warn of live sessions on unload
We could still have session instances in the
_sessions container in DocBroker by the time
we destroy it, what counts is that they aren't
live at that point.

We could still have sessions because we may
be waiting for the kit to confirm disconnection.
But if that was the last session, the kit will
instead exit and that would trigger the
destruction as the PrisonerRequestDispatcher
will have to clean up the DocBroker instance,
hence destroying us.

Change-Id: I8ce103d38edc355d09da046e1b875f0e62768adc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 15:46:48 +01:00
Ashod Nakashian
58566083d5 wsd: do not warn of unassociated Kit after unloading
After unloading a document, the ChildProcess instance
may be destroyed by the time that we process the
internal prisoner connection. In that case, we
can't find the ChildProcess so we assume it was
a premature death and issue a warning.

By tracking whether or not a PrisonerRequestDispatcher
had an associated DocBroker, we can supress warnings.

Change-Id: I8bab882283f27f7d5f724e878aae19837445a2fe
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 15:46:48 +01:00
Ashod Nakashian
cc8769855b wsd: better logging of WOPI::PutFile
Change-Id: I9a422e87cc34ad162b710931d7c329ed85d9edd2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 15:46:48 +01:00
Ashod Nakashian
b3d5f9f9a3 wsd: logging improvements
Change-Id: Ia9959206f2748adf48dc199d2508b1c6ad38fbe9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-14 15:46:48 +01:00
Jaume Pujantell
002cf9e436 Stop erasing the whole tmp directory after a download
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: I805e27df25d3134eb12926f28b6f9ff09b4ed230
2023-03-13 16:18:08 +01:00
Ashod Nakashian
98a0f5d97a wsd: do not disconnect the last session if saving
Previously we only waited if a new auto-save has
been issued at the point of disconnecting the
last session. However, we could have a save in
progress, particularly when it's a slow one,
and we should equally wait for it before
disconnecting the last session.

Failing to do so will exit the kit right after
finishing the save and will rob us of the
ability to upload the just-saved version.

Change-Id: I678689a95211fa8b80bcd3e8d4537de7de5d6632
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-13 08:19:33 +00:00
Rash419
58d66fca59 admin: notify routing_rmdoc to subscribers when all views expires
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I360b90d2b93ce9e8508f16822a2654e111ba2407
2023-03-13 08:07:16 +01:00
Michael Meeks
d5e95c80ec quarantine: cleanup.
Also handle OOB values of config setting.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia0d4e2e0475bfd6d487006847ea0622b573569b7
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-03-11 17:42:30 -05:00
Michael Meeks
eb43a27396 locking: avoid spamming warnings in some circumstances.
If we have no write-able sessions, we can't lock the document -
fair enough to complain, but not every ~300ms - so defer another
lock period in this case.

Change-Id: I7beb974b3c17fd6ac01a32d8fe50261a54340665
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-03-11 17:42:30 -05:00
Gökay Şatır
7b205f8821 Rename version check to versionbar.
There was a naming conflict with infobar event.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I0b2a80bcb6f6e636980f8acff21f39fec5414174
2023-03-11 10:00:17 +03:00
Tor Lillqvist
3294030b37 Handle get-thumbnail also for graphic objects
I am a bit surprised that this seems to work. Thanks to Szymon Kłos
for pointing me in the right direction.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ie9740a7a281a2b82ac7ca9fdf5f6374a29feec5d
2023-03-10 19:41:16 +00:00
Tor Lillqvist
59051dc5f7 No need for any saveAs when doing a get-thumbnail
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I4a7887455ebb5e0c4e9c5fbaf534e5e8a57c963d
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
a8f0263d75 Use http::Response for extract-link-targets and get-thumbnail
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ife0d24f9cac487ad08ff18fd9e180222371c70fa
2023-03-10 19:41:16 +00:00
Szymon Kłos
ffb15a2dea Send BadRequest if parameters missing
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2acc4cb22d064994f3fca16b92b7d4528b403044
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
f116a8e619 Merge extract-link-targets and convert-to request handling
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I0d3787dd33c103f128f4b16bb9b4c1d1195658c0
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
5f0248ef7f wsd: not an error to not support storage locking
Change-Id: I0314a37bbda40808bd7d225540e69b93a1ab18d2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-10 07:45:12 -05: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
268aed2f73 wsd: remove always-false conditionals
Change-Id: I2b37b91dd6e5ac9517dfac8a777dc8eeec9254c9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-10 07:45:12 -05:00
Ashod Nakashian
26c27bd738 wsd: initialize ClientSession::_lastStateTime
Change-Id: I6c40e1a2464a19978d32d49cfa6fdb77294a2ddd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-10 07:45:12 -05:00
Ashod Nakashian
af504e3384 wsd: make sessions readonly on disk errors
Change-Id: I0c59c4fb3c99dee0f6e18850ca795467a9421b33
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-10 07:00:31 -05:00
Michael Meeks
4ca7070ba8 Warn and clamp unreasonable values of max_concurrency.
There are costs to many threads, and diminishing returns.

Change-Id: I4d4dc0491c48af303375d09d8eb19ffebedcad83
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-03-10 00:04:11 +01:00
Ashod Nakashian
216572e584 Revert "wsd: break cyclic setModified call"
The setModified is on an internal, AdminModel
specific, Document object. It is not the
DocumentBroker.

This reverts commit e33d6aa2ca.

Change-Id: Ib706927051678cfc19dc1246d679ef530eb8d586
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-09 12:51:23 +05:30
Ashod Nakashian
ed341a61ad wsd: better logging around new child management
Change-Id: Id108ef7a635975bb4fd30ceb509fd2d39c3456f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian
d88956ae8b wsd: minor cleanup of Storage::create logs
Change-Id: Ic0b32d9ccf67e06d5a3b8f389a7fa4e8d305edf3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian
29193de7cd wsd: improved socket creation/destruction logging
Change-Id: I3f2919b646aad4c7c8b2b464155066008fbe25ae
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian
359017ef10 wsd: log the socket FD of PrisonerRequestDispatcher
Change-Id: I6a000e53d8baca231a2fb8f6df2251a4f57d9876
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian
1dd2aba82d wsd: log the socket FD of ProtocolHandlerInterface
Change-Id: I362aca685f79868bdf685695d625a832eee02821
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Ashod Nakashian
3b3e936e4f wsd: better logging of DocBroker loading
Change-Id: I1138f42f954086cff5fc9c8465a02802235ca5dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-03-06 08:43:37 -05:00
Szymon Kłos
07cf933a8c Add Pick Link button
Button is shown when CheckFileInfo contains 'EnableRemoteLinkPicker'.
After press UI_PickLink is send via postMessage.
Action should be finished with sending Action_InsertLink to editor.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I53c61a25d1fab655771742ec6d97dc056192642a
2023-03-02 12:27:45 +01:00
Ashod Nakashian
104b354f1e wsd: handle errors from locking/unlocking a document
Change-Id: I69e2c26aaa572e5ca215fd8cf3413ed043861f0f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-23 07:58:56 -05:00
Ashod Nakashian
9ab65faee3 wsd: detect unuathorized locking/unlocking response
Change-Id: Ia46ad6859f5ce21e506d8c1f96a28430c5f70954
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-23 07:58:56 -05:00
Ashod Nakashian
2da70b1cc0 wsd: avoid function-local static configs in LockContext
The function-local static prevents tests
from changing the value of a config.

Change-Id: I5febdbf029293fab39f18afa6d905fd571d59545
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-23 07:58:56 -05:00
Ashod Nakashian
7d93076ff2 wsd: minor log improvement
Change-Id: I5a38e8b311be336cc42fab05a94236dc73be32fa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-23 07:58:56 -05:00
Patrick Luby
97b9498bdc Issues #5532 and #5831 Replace assert with a log message
Remove assert and allow delta messages to be handled even if
there is no keyframe. Although it might make sense to skip
delta messages if there is no keyframe, that causes some
content, at least in Impress documents, to not render.

Signed-off-by: Patrick Luby <patrick.luby@collabora.com>
Change-Id: I9b1cdc0812d008a6174648b9bc4854519018ffc9
2023-02-20 21:32:10 +01:00
Ashod Nakashian
5665b7d2bc wsd: .uno:Copy is allowed for internal use
When copying is disabled, we still allow
copy/pasting *within* the document. What
is disabled is exporting the copied data
to the browser.

Luckily, this code was broken, and it
wasn't really blocking .uno:Copy at all.

Change-Id: I50a01eefbe1de3758b4451385bbc51fbde5878a8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-14 16:37:13 +01:00
Rash419
bd3dee9cbc admin: fix: monitor doesnot try connecting again after disconnecting
regression from 49bac0da174e31fcdbe5a4458f2f2100d606b6dc

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Id006db718d49da2b1f9142c4d6d5c6985b18ecc9
2023-02-14 14:55:48 +01:00
Ashod Nakashian
7bdf97b183 wsd: play media when selected by other views
This fixes an issue with video not playing back
when another view has selected it. We also move
the URL handling to graphicselection, which simplifies
and improves things, albeit at the expense of
unpacking graphicselection payload, which isn't
as clean as one hopes.

Change-Id: I64f81eabf0f0bc850db83233812eaae6d9e036da
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-14 12:56:18 +01:00
Ashod Nakashian
d8072ad178 wsd: log improvements around media handling
Change-Id: I762226f4457ec180b829d299b85c714ee92581de
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-14 12:56:18 +01:00
Tor Lillqvist
31135177e4 Fix compiler warnings when building for WASM.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0fd4fe36cece9caaeb076a0e91894890186706d0
2023-02-12 15:55:24 +01:00
Ashod Nakashian
318f3f6eb8 wsd: more accurate possible-modification flagging
This improves the flagging of possible-modification
in cases where there might be a race between the
arrival of the ModifiedStatus flag from Core
and the closing of the document. This can happen,
for example, when the user makes an edit and
immediately closes the document. In these cases
we want to be able to assume modification based
on the last activity from the user that may have
modified the document.

The issue this patch fixes is that we were too
aggressive in our assumption of modification,
because it was better to be wrong and try to
save rather than not. However, this also set
the IsModifiedByUser header to the PutFile
request when uploading the document to storage,
which was not accurate or acceptable.

Change-Id: I84228bfbb92f688d303568027171df3686d2cd2b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-07 14:36:51 +01:00
Ashod Nakashian
979f836bdb wsd: const and minor cleanup
Change-Id: I81f7c957085744ee4b80a475b524f660e4b312ea
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-07 14:36:51 +01:00
Ashod Nakashian
e33d6aa2ca wsd: break cyclic setModified call
DocBroker's setModified notifies the Admin
of modifications, there is no point in
having the Admin call back into DocBroker.

The only reason that this didn't cause
an infinite recursion is that DocBroker
calls the Admin only when the flag has
changed, and since the Admin callback
is done asynchronously, by the time
the Admin handler is called, DocBroker
had already updated its flag, so the
callback doesn't cause an infinite
recursion.

Change-Id: Ic4028d54338f8043221571c25e332b4c77f6d628
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-02-07 14:36:51 +01: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
Rash419
7e06860ddf js: get full uri from indirection server
instead of just routeToken

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I3755fc2536d4358d2c63effdc9e9f9e5da246504
2023-01-31 15:32:30 +01:00
Rash419
c5fd805619 admin: added new admin->client command
routing_rmdoc command is added specifically to notify indirection url
server about document getting removed with its wopiSrc

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic077f210d520394e3ef8ced778604b7343436328
2023-01-31 15:32:30 +01:00
Rash419
f63d07bdea wsd: store routeToken in server
- added routeToken in ClientSession::createPublicURI

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ib4a211e69d96589dd735ba8e32ddbe5f98c96509
2023-01-31 15:32:30 +01:00
Rash419
c1dbe39a29 admin: monitors configurable with remote config
- make sure online connect to unique monitors
- able to disconnect monitor if uri doesnot exist in updated
  json

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ia6cfd6c8e56416c37d211aae55828c92a4ba27e5
2023-01-31 15:32:30 +01:00
Rash419
2529fa9ee2 notify client when route tokens get updated
- once client get notification it will update the routetoken
by refetching it from indirection url endpoint
- added support to configure indirectionurl enpoint using
remote config

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Iead22af56c655bdece6b70cc4e97a1fa401b1bae
2023-01-31 15:32:30 +01:00
Rash419
b9914a3042 js: added routeToken as parameter in wopisrc
fetch route_token from indirectionurl and add them in wopisrc
parameter

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I6e724d0c59e12d4f7f6c125ec076e90d20b9b3c8
2023-01-31 15:32:30 +01:00
Ashod Nakashian
7569f2bcd2 wsd: test: wrap DocBroker destroy callback
This prepares to start the next test
when the DocBroker of the current one
is destroyed.

Change-Id: I3a9672d8d03ad497f15a9bca262dfe1d4f197e41
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-30 07:52:08 -05:00
Ashod Nakashian
afefa43a58 wsd: better storage attribute handling
Change-Id: I80ee9ddda00769c5ef34f5f3d7265fd6c5f8648e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-29 08:53:31 -05:00
Ashod Nakashian
2e48738dc8 wsd: fix always_save_on_exit
This fixes the handling of the
always_save_on_exit=true setting.

Change-Id: I6993030c2af7fa080c8421c5cb4fa7cb9ea3eb9b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-29 08:53:31 -05:00
Ashod Nakashian
dd141f0a4b wsd: merge the storage attributes after uploading
This fixes a corner-case where we modify and
save during uploading, which means that the
next save will not have any modifications,
and we will not merge the attributes until
we get new modifications.

Change-Id: I621e26e04ea3e0d04a9a3d535ff2cfc607d56fef
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-29 08:53:31 -05:00
Ashod Nakashian
cb3f2627d2 wsd: set IsExitSave attribute before uploading
Change-Id: I4828133d83e66654b4151dad896bd9d6edaa0200
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-29 08:53:31 -05:00
Ashod Nakashian
f2f6deddc5 wsd: move setForced attribute closer to usage
Change-Id: If4dc0e30e63ab5d35d5ceaad26d05fa5947d0cda
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-29 08:53:31 -05:00
Ashod Nakashian
58fe9b184a wsd: set IsExitSave header only when unloading
We now capture the flag that controls the
IsExitSave header directly via the result
of IsUnloading(). This makes passing it
via function parameters obsolete.

Change-Id: Idb4df4f96d66b4a9f92ff9a570f48be895e623be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-29 08:53:31 -05:00
Tor Lillqvist
38171388c8 Make the temporary "WASM app" work
Now I hope things are initialised in the right order and the plumbing
gets set up so that messages are passed as expected. It seems to work
most of the time.

Main changes are:

  - The online WASM executable is built using the -s MODULARIZE -s
    EXPORT_NAME=createOnlineModule options. This means that the WASM
    runtime is not automatically initialized and the main() function
    is not automatically started. Only when the createOnlineModule()
    function is called is that done. Calling exported C/C++ functions
    is a little bit more complicated.

  - Code to actually Base64-encode strings to be executed as
    JavaScript when expected is now present in wasmapp.cpp. (After
    being passed through the Base64ToArrayBuffer function on the JS
    side.) Whether this is actually necessary is not fully clear, but
    to keep the code similar to that in the GTK, iOS, and Android
    apps, this is kept as such for now. It would probably work fine to
    just directly create the ArrayBuffer in the C++ (using the EM_ASM
    magic).

  - The COOLWSD::run() function is now run in a separate thread so
    that main() can return.

  - The FakeWebSocket's onopen() function is now called from
    innerMain(), where the HULLO message is sent. It remains a bit
    unclear if this really is the ideal place.

    In the mobile apps the HULLO message is sent and the onopen()
    function is called in the window.socket.onopen() function in
    global.js.

    But note that despite that the WASM app and the mobile apps are
    largely quite similarly constructed and the FakeSocket and
    FakeWebSocket plumbing is the same, there is an important
    difference. In a mobile app the C++ code is what runs first, and
    that then loads the HTML page into WebKit, in which the JS
    runs. In the WASM app it is the other way around. The web page is
    naturaly the one that is loaded and the JS code then starts
    running the C++ code as WASM.

Finally, note that the whole concept that there is a separate "WASM
app" is temporary.

What we eventually want to achieve is that the COOL webpage upon
loading will connect a COOL server. As it does currently. The COOL
server runs the online and core C++ code to load a document, and
renders document tiles and sends those to the client JS code to
dispay.

The new thing will be that, if enabled, in addition to the HTML and JS
resources, the client will also download the WASM code and data
resources. Also, the document and updates to it will be downloaded
while being edited so that a copy can be kept in client memory. But
the WASM code and the downloaded document will remain unused most of
the time. Only if the connection to the COOL server breaks will the JS
start running the WASM code and the JS will talk to online code
running locally as WASM instead of to a COOL server. Obviously there
are still lots of things hanging in the air here regarding how exactly
this will work.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ib1786a0b485d51797b0f2302d4296aa1ff9df5c1
2023-01-28 22:04:39 +02:00
Ashod Nakashian
048bece8a8 wsd: retry uploading when it fails
When uploading fails, we shouldn't
rely on another save or close to
happen, we should retry as soon as
possible (right after the
min_time_between_uploads_ms elapses).

Change-Id: Ieabe7656583cf391f637986f5403acc87bdc913f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
20332f4078 wsd: only users can force uploading
Forced uploading is used to overwrite the
file in storage. This is useful when there
is a conflict. Only the user can decide to
do (or not do) that. As such, no auto-save
or any other case should force an upload.

The issue is that we can clobber a conflicted
version in storage by accident. Forced upload
was used for always_exit_on_save=true setting,
which wasn't really needed as the feature isn't
to forcefully upload, rather to just save and
upload as necessary.

Change-Id: Ie46f38f76392493fe8f8112f05953899963da99b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
cca0a561ed wsd: never upload using a session that is read-only
Change-Id: Ife0711de46d498e1a9b65c8e0ef7484b37266b32
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
5dfbac3e81 wsd: remove dead code
We never enter the condition in question
if !_documentChangedInStorage, so the
code removed could never execute.

Change-Id: Ia183b63d7a13f6316eb5f24636997b6e6e417a97
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
59172b6b6b wsd: comment typos
Change-Id: I0d75d0bd7a2057bb00d248ccd834381f0565426c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
b862bbc539 wsd: read the always_save_on_exit config once
This is necessary for multi-test scenarios
where the flag might be changed between tests.

Change-Id: I2fd9c21bc7ccdf2c9941ca3a959b578ec226facc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
11eb6885a6 wsd: whitespace formatting
Change-Id: I5d6d61e6b74aabbf8cc3ac8555f40400397b6ff6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
d585ebe02d wsd: simpler canUploadToStorage implementation
Change-Id: I445a68ef1834a7ec43e7885164b092f728607584
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Ashod Nakashian
44a27110e1 wsd: better logging
Change-Id: I98bc45d287c44beb10bfe6fbe02d208f37531515
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-27 08:44:53 -05:00
Tor Lillqvist
fce151877e I get "warning: unsupported syscall: __sys_prlimit64" in WASM so avoid that
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Iabcde9bcbfd6f1a966503822c1f72d3d3ecf3571
2023-01-27 11:01:05 +02:00
Tor Lillqvist
48c96e70ca More WASM hacking
Apparently handle_cool_message() gets called from a web worker thread
and then using emscripten_run_script() in wasmapp.cpp to run a JS
snippet that refers to the 'window' variable will not work. That
variable exists only in the main thread. So use MAIN_THREAD_EM_ASM()
instead.

Hardcode the document URL for now also in wasmapp.cpp.

Try to send the HULLO message from COOLWSD::innerMain().

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ic48042c6d0c6239a3b82e74f0565056a15f3d98d
2023-01-26 22:01:14 +02: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
Tor Lillqvist
a841686c79 Avoid misleading wording in log
If we are not caching tiles, it is misleading to log "Saved cache tile".

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I0e0ec446d5edf266ea4acb42883c49d5f7063763
2023-01-25 23:20:12 +02:00
Ashod Nakashian
b9eb4111ae wsd: http: define named HTTP status codes
This replaces the hard-coded status-code
numbers with named compile-time constants.

Change-Id: Ibe678fb2c533b29efd696e4430f5377523eeb298
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-24 07:58:07 -05:00
Ashod Nakashian
87d33d123b wsd: test: new onDocumentUploaded event
Change-Id: Ia12446f1958b6df41231f5fcca4fb3e50ab07aaf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-23 11:07:55 -04:00
Ashod Nakashian
0b70dc1abf wsd: test: break the socket flushing loop if nothing to flush
During unit-tests, it is safe to break the flushing sooner
to reduce the wait time. However, this is risky when
flushing the sockets outside of tests, because there
could still be some important processing happening.
In that case, it's best to wait for the full duration
of the flushing.

Change-Id: I4841510f4e80c3e5bd13b203647828e4c5f89d4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-01-23 11:07:55 -04:00
Andras Timar
a884a89620 typo: didnot -> did not
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I17cfeab42e91fbc302506d303a322c0a066ed140
2023-01-18 18:27:25 +01:00
Szymon Kłos
5269851595 Zotero: handle disabled state in config
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id65ec60a9832872cf24dd7f295ffb90ad9b377d3
2023-01-16 10:18:04 +01:00
Tor Lillqvist
a65b36c051 Avoid warning when ENABLE_DEBUG && MOBILEAPP
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I43a50763ce8f12a117efd421022898bee3ca7738
2023-01-11 09:27:36 +02:00
Michael Stahl
9b40d40713 WASM fix includes in C++ code
Emscripten is very opinionated about sys/poll.h so use poll.h instead.

Signed-off-by: Michael Stahl <michael.stahl@allotropia.de>
Change-Id: I9691519e27a080f03a19f0cc0dd8f796fe323062
2023-01-09 22:01:47 +02: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
Henry Castro
03365b3aeb config: add REST API Protocol to LanguageTool
Change-Id: I0e05ed89d02a9b467e1707db1638fc9ee554586a
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-01-02 11:14:15 +03:00
Ashod Nakashian
b929f01a84 wsd: correctly clear the stream caches in TileCache
It seems we were inadvertently clearing copies
of the stream caches rather than the real ones.

Change-Id: I3fcce77850e0a8f082bdb926f85ab173148c15db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-22 10:10:08 +01:00
Ashod Nakashian
1b80a7b722 protocol: minor documentation fixup
Change-Id: I0f178d7753e5cc787680314c2e5ff0f50ff52b39
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-22 10:10:08 +01:00
Ashod Nakashian
629ff27992 wsd: minor log improvements
Change-Id: I6dba0540310bb9cafc31a63e92da306eeff8953d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-22 10:10:08 +01:00
Ashod Nakashian
50fe137140 wsd: log number of unremoved sessions when destroying DocBroker
Change-Id: Ib3a172915d304b529081ada35b6ced719c757147
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-22 10:10:08 +01:00
Ashod Nakashian
e99af3a932 wsd: correctly log the time since upload request
Change-Id: I66661d5cdc1cd5efcfb86732d86d2a7a6053f2ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-22 10:10:08 +01:00
Ashod Nakashian
77cf644f28 wsd: smarter warnings and errors on kit disconnection
Change-Id: I10cba42a407296a909cde1d7e091b48f124e7fdb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
a163ef6c82 wsd: do not send duplicate 'disconnect' to the Kit
ClientSession::disconnectFromKit() already sends
a 'disconnect' message to the Kit. There is no
point in sending the same message again right
after calling disconnectFromKit().

Change-Id: I03aafc33f85220b53c5ff024601f83132b7046f6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
2e01170920 wsd: request Kit termination early when unloading
DocBroker now requests the Kit process to terminate
earlier than before to give it time to disconnect
while we (DocBroker) are still around. In turn,
upon disconnection, PrisonerRequestDispatcher can
query whether we are unloading or not, to detect
unexpected disconnections.

Change-Id: Ifa102e018e32bb252a0c169b0a3df691bca4ab0c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
55ed57dce2 wsd: support flushing control in WSProcess::sendFrame
Change-Id: Iba1b3869a5c0aa816f78bdf59347b6e9408e8f97
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
ed82e1b18c wsd: do not warn of expected DocBroker disconnection
We avoid logging warnings when the Kit disconnects
from a DocBroker that is unloading.

Also, since the PrisonerRequestDispatcher is the
default WebSocketHandler, for ForKit we replace it
before it gets a DocBroker associated with it.
When replacing (which deletes the instance) we
no longer complain that we are disconnecting an
unknown DocBroker.

Change-Id: I94c3aec8578c66c50623196087c4cd157ba85c27
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
1b059bca0f wsd: better log levels
We no longer emit a fatal (FTL) log when
forced-exiting successfully.

Also, improved are some other logs to
better reflect the severity of the issue.

Change-Id: I22e79f685825f7ecd47cec76c9be9683deff2d55
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
6abd8d114a wsd: preserve close reason when disconnected from Kit
If we already have a closeReason, we should preserve
it upon disconnecting from the Kit instance. For
example when unloading, we request the disconnection
ourselves, so no need to clobber the real reason
for closing in that case.

Change-Id: Ie71faed5a4051659b426e3ba6bbf30950d21c328
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-21 19:41:38 -05:00
Ashod Nakashian
843620d4de wsd: disable editing when Storage UserCanWrite=false
This ensures that when the Storage has
UserCanWrite=false no editing can happen,
no new versions could be saved, and no
attempts to upload would happen, even
on view-only documents (by means of
allowing comments).

When the Storage has disabled writes for
the current user/document, we override
the read-only and allow-change-comments
flags.

Change-Id: Ic140fab4f76209fb143f3f5edef70bc3c80cad1b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 20:30:11 -05:00
Ashod Nakashian
2b7e2bda96 wsd: move isWritable to Session and rename
This helper is only true if editing of the document
is enabled and not whether or not the document is
writable in storage. Since it unifies isReadOnly
and isAllowChangeComments, which are in Session,
there is no advantage in having it in ClientSession.

It is now renamed to isEditable in Session.

Change-Id: Ib923b6162a8075be145049bc1442c42479c8ce4b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 20:30:11 -05:00
Ashod Nakashian
30fc5ed649 wsd: correct setting read-only and allow-comments
We should always set the read-only flag when
the storage disables writing for the doc/user.
Similarly when the user is locked.

This breaks down the logic of setting these
two flags such that it's explicit and more
readable.

Change-Id: I99ea19b85a529c08fa50b91fb73bffcfba47f996
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 20:30:11 -05:00
Ashod Nakashian
4884455f88 wsd: set _isViewFileExtension for LocalStorage
And reuse it for WopiStorage.

Change-Id: I37666300830fd872b3d38fe2d824ae3895e0d22d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 20:30:11 -05: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
Andras Timar
45196f545e Set group_download_as to true as default
... when it's not in the config file. Follow-up to 53e6bdd62a

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib6a414a3d2d8112255c329f5ef7eedae2901a68b
2022-12-14 14:07:02 +01:00
Ashod Nakashian
3f0faf7c5d wsd: clang-tidy fix of initializing a string member
Change-Id: Id7bee875d023962215049dd97199e1cb906ad89e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 04:38:26 -05:00
Ashod Nakashian
8fb40f8075 wsd: DocBroker dumps isStorageOutdated
Change-Id: Ic46cf8bf0367749b38edc46525e3e35008563f00
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 04:38:26 -05:00
Ashod Nakashian
6ba282dc97 wsd: shorter wait between cleanup checks on exit
Change-Id: Ie21a68ed87cf22e81708cb6fea970a4ee8c68258
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 04:38:26 -05:00
Ashod Nakashian
f7cac5296d wsd: flush sockets only when we have any
When finishing the DocBroker poll we also
flush the remaining sockets. This is noisy
if there are no sockets.

Also improves the logs around this logic.

Change-Id: Ife768dbd9db2e201702dcb6d89180fafff5dc16c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 04:38:26 -05:00
Ashod Nakashian
fe145d7c04 wsd: use ClientSession in refreshLock
Change-Id: I72bf706076489c957184ce48df0ff736d422c363
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-14 04:38:26 -05:00
Szymon Kłos
0ba87d1de8 Remove unused zotero variable
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7755122da3f1a1f62ece19fb2248e76c707ca6e4
2022-12-12 13:35:29 +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
Ashod Nakashian
fb4ba26ccd wsd: mark save results early and log duration
Capture the save result early and log how
long it took to save, for informational
reasons.

Change-Id: I0ca04a5b62a2dda38a058f8fa5ca62df33cc0555
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 17:33:11 +03:00
Ashod Nakashian
b2aff3e817 wsd: pass ClientSession to forwardToChild
Change-Id: I2d78687adf9e5a64b75f586b53bf983f3c8d8119
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 07:53:09 -05:00
Ashod Nakashian
98687db97e wsd: pass ClientSession to sendUnoSave and simplify
Change-Id: I155c896a3f5520a31ce5f413e0c59c2e93701ad1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 07:53:09 -05:00
Ashod Nakashian
44aeb9e705 wsd: pass ClientSession to uploadAsToStorage
And move the validation of rename sessionId
where it belongs.

Change-Id: I3fb16ff7b648accaa20b041bf3fd6b82f516cb9b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 07:53:09 -05:00
Ashod Nakashian
f9e52bfe72 wsd: do not upload with expired authorization
We mark expired/invalid/rejected authorization
tokens and skip them in the future.

Change-Id: Iec89942198d566901cc2944f22ef86fcb4d6a820
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 15:42:04 +03:00
Ashod Nakashian
54eedce089 wsd: support invalidating Authorization objects
Change-Id: Ia2327157cdbc27ac545f8137a41dbf75897b22a1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-12-07 15:42:04 +03:00
Andras Timar
777c7edf96 add hasZoteroSupport to /hosting/capabilities
The idea is that the integration should look for hasZoteroSupport capability,
and if it's missing or false, then it should not enable setting of the Zotero
API key. Instead, it could write "This instance does not support Zotero, because
the feature is missing." or " ... because the feature is disabled in configuration."

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ibff9cb61ada062f59e8b2b63ddcdb7a9cf899b82
2022-12-05 14:33:01 +01:00
Pranam Lashkari
135880dd9a added zotero style selection dialog
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ib761bce24ca7401285fe423b21434243a8f83dee
2022-11-30 20:37:48 +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
Ashod Nakashian
eb2728cd0f wsd: move idleSaveInterval in SaveManager
This fixes a regression where the
per_document.idlesave_duration_secs setting
wasn't effective.

Idle save also takes into account the time
uploading finished, or if we had a recent
save issued. This is particularly helpful
for large documents and/or slow networks
where uploading takes dozens of seconds.
In that case, we don't idle-save too
frequently.

Change-Id: I76ee1869003073b5cf9bd420f610bd8a12ff71b3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-30 08:59:34 -04:00
Ashod Nakashian
e5c939a31a wsd: autosave -> autoSave for readability and consistency
Change-Id: I9568993a8f7ff7dac43f3f48264952f8259846d7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-30 08:59:34 -04:00
Ashod Nakashian
b507d5bb08 wsd: pass ClientSession to checkAndUploadToStorage
And to handleSaveResponse.

Change-Id: I01d7bc0424df7f1b4998d9698cdfcadbaaabc704
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-30 05:14:28 -05:00
Ashod Nakashian
68beb87b7b wsd: pass ClientSession to disconnectSessionInternal
And simplify the logic.

Change-Id: I71dfc447f2ee35b7ab54e23a9ab6db4faa463444
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-30 05:14:28 -05:00
Ashod Nakashian
57b0a50d18 wsd: pass ClientSession to finalRemoveSession
Change-Id: I31e34c004dd54ab8f5f942a03bdd23be88e43335
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-30 05:14:28 -05:00
Ashod Nakashian
6547138660 wsd: pass ClientSession to uploadAfterLoadingTemplate
Avoid looking up _sessions.

Change-Id: I685e9843b75ed26dd0ef78aad9a46790561f45ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 12:50:36 +01:00
Ashod Nakashian
20a8b8a62f wsd: pass ClientSession to uploadToStorage
Avoid looking up _session.

Change-Id: Ie0cec1802db729ead09a6da71712242fdb28bc07
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 12:50:36 +01:00
Ashod Nakashian
b708dc5ee8 wsd: pass ClientSession to removeSession
This avoids an unnecessary lookup in
_sessions, as we already have the
ClientSession instance.

Change-Id: I3dfdfd322fb907f916235a5ccc5f3b76e0eb4855
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 12:50:36 +01:00
Ashod Nakashian
46f9e8de29 wsd: use client_from_this
Change-Id: I45bcb010ec6f1d091c04d2a8b2f49a6da57f8e4e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 12:50:36 +01:00
Ashod Nakashian
2262da355f wsd: breakup getWritableSessionId and getWritableSession
Change-Id: If08a9984c75a84d85b5f3c37e6780cc0b99a1800
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 12:50:36 +01:00
Ashod Nakashian
c41c8d8f53 wsd: faster forwardToChild
The 'load' command is special-cased in the
forwardToChild function. To that end, we
had to parse the message in full, which
is very costly. This patch optimizes
this special casing logic.

Change-Id: I54ff8899b8d250ce996ddabf873a45d92e0f59b1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 06:41:04 -05:00
Ashod Nakashian
21dd54086c wsd: improve DocBroker state dumping logic
We dump the state of a DocBroker when we
detect data-loss, or when running a
unit-test that failed.

This simplifies the logic and improves it
by avoiding duplicate dumps and unnecessary
dumps.

Change-Id: I1cf2199d35073a762937ce2cf2377061e40b06b5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 06:41:04 -05:00
Ashod Nakashian
19b6633625 wsd: more flexible 'save' command parsing
We expected the arguments passed to the save
command to be in a specific order, which is
restritive.

Here we allow for any argument(s) in any order
and omitting any/all of them is acceptable.

Change-Id: Ia582f0ac113b3d987c085d3a7975d1b3054ff889
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-28 06:41:04 -05:00
Tor Lillqvist
459bba8dc2 Make the gtk app build again
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I000fdcc059c39cf3c0c4a9ec066f4039c653cb70
2022-11-24 15:02:10 +02:00
Rash419
7e2360bc2a remoteconfig: enabling the locked_hosts supported from both remote json and coolwsd.xml
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I17da8e0486124bf161c5f97781d69edab37efde6
2022-11-24 00:33:25 +05:30
Rash419
e20ace9f34 wsd:fix: memory leak properly
introduced in e0752419575f09fef3d770f8cccf78c92a2d8612 commit, update AppConfigMap instead of creating
new one on each of remote_config poll

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: If11bd6e4b3a0a9f4ee32ae9bb43b076479e9bd84
2022-11-24 00:33:25 +05:30
Gökay Şatır
75958ec5b2 _userCanWrite variable is set to false when the host is read-only.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I485c5254a534365cd9defb726ed0eb705977361e
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
2022-11-23 16:29:10 +03:00
Szymon Kłos
35f38a1eaa Log warning about deprecated config option reuse_cookies
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I93f42623be2edba3cb3877e17f6d39c2827e931e
2022-11-22 08:48:49 -05: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
Ashod Nakashian
7fa1cff0af wsd: improve various logs
Change-Id: Ib4c0792eeba4da76c800f6afe4737f91c4d319f7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-21 08:45:34 -05:00
Ashod Nakashian
4123a88b24 wsd: correct logged upload duration
Change-Id: Ic9fd69cabb782cd1a5662db1cf47fd87be6cf6b3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-21 08:45:34 -05:00
Ashod Nakashian
0069a41dbb wsd: test: capture the UnitWSD instance per DocBroker
Each test loads one or more document. At the end
of the test we may load a new test (a new
UnitWSD/Kit instance). However, because of the
static interface that the tests have, there
could be only one instance at a time. This
means that when we switch the current test
instance, an existing DocBroker might fire
events into the wrong (new) test, making it
fail.

By capturing the current test, we make sure
that DocBroker can never run against different
tests.

Change-Id: I161ec3c9ce1617f41d03b53d2d5fb19682930b78
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-21 08:45:17 -05:00
Ashod Nakashian
a124356031 wsd: test: fail -> onDataLoss
The event we trigger when we detect data-loss
is best named to reflect that fact.
And since we can override the behavior,
for example if the test expected to trigger
the data-loss detection, then we can signal
the non-failure by the return value.

Change-Id: I67ca69ae783c956cfdd14d54dab5efb7cc3d258c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-21 08:45:17 -05:00
Ashod Nakashian
f3b8ac088f wsd: test: stop DocBroker when unit-test finishes
Change-Id: Ia23cc2e9e3ff503681600a9ab8536c50fafe4db7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-21 08:45:17 -05:00
Ashod Nakashian
432424c2c2 wsd: log save failures more visibly
Change-Id: If32b27ece8bfbdc89f600f85c9ac1af5c449135b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Ashod Nakashian
261031c2ef wsd: reuse local variable
Change-Id: I621db21e4065e333e77453cecf174d04963c769e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Ashod Nakashian
ac52505640 wsd: getServerURL is debug/test only
Change-Id: Ic4c2fe3b467fee475cdc7c0b91b1df77f441c0aa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Ashod Nakashian
5542a6a253 wsd: correctly set the Content-Type
Change-Id: I4f121cb15e97dec0f366a9aaab4e8e5cc80df611
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Ashod Nakashian
d3ab5adfcd wsd: kill poco
Change-Id: I694ad44539f87b0d7127ee64e71768bf408447ec
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Ashod Nakashian
c8aaa2e3c8 wsd: notify the client when the doc URI is invalid
Change-Id: I39a4c8d3dd9ca2899a9a8eacdb865a7121b75d3e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-20 07:50:12 -05:00
Rash419
937d471d1f wsd: fix: wopi.host not working when alias_groups are not defined
regression from commit 3aa3334a7b

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I601ea3bde0419129e39c1a1454c22c676d4870bd
2022-11-17 13:51:00 +01:00
Miklos Vajna
bbb8d98ae9 admin: drop conditional that is now redundant with clamping
Follow-up to
<https://github.com/CollaboraOnline/online/pull/5421#pullrequestreview-1179138409>.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ie293218e504808d317436181639d9189eb6fb05c
2022-11-17 08:21:12 +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
Pranam Lashkari
8a04942023 segregate edit/read only permissions better
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I85861352929d150aaf93da5570bda960b1ad46f0
2022-11-15 09:17:19 +03:00
Ashod Nakashian
83a7797967 wsd: log edit and comment ext in discovery.xml
It's useful to know which extensions are editable
and which are commentable when loading discovery.xml.

Change-Id: Icb06a62eba14240e1d86c4b3cd641531c4fa8e37
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-14 18:16:02 -05:00
Ashod Nakashian
c4346a62eb wsd: log the session in question
It's not very helpful to log that some
session is set to this or that without
knowing *which* session the log refers
to. There are many sessions and in a
busy log, it's not always possible to
confidently figure out the answer.

Also log the document loading time and
saving timeout at debug level.

Change-Id: I81fe5e4460f0610a5b941209bc51e4657025c4c2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-14 18:16:02 -05:00
Ashod Nakashian
a56721f9cf wsd: remove default parameters in Session
And make arguments explicit for a setReadOnly
and setAllowChangeComment.

Default parameters are useful for backward
compatibility, when changing an API. But
they provide no benefit when the function
in question is new and is called a couple
times anyway. Code is harder to read with
default parameters because one has to
either guess (bad) or check (wasteful).

Change-Id: I105df928f4fb73e7c341218af11903bf1ee33943
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-14 18:16:02 -05:00
Rash419
3aa3334a7b fix: memory leak with remote config
when eTag header is not passed from remote server it keeps on parsing the new settings without clearing old ones

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Iaad9fb6c0e7fd45be3e121b0c0bebaba17d90aab
2022-11-13 17:52:31 +01:00
Ashod Nakashian
2ad1b5f83e wsd: unlock the document only after uploading
Since uploading has become asynchronous, it
might not have finished by the time we
unlock the document. This race can result
in the upload to fail, if the document
is no longer locked.

Now, we ensure that the lock is released
only after uploading, when we remove the
session. With test.

Change-Id: Ic9ba3290dfbfde0eb4af7a70bb5b56ff28711f5c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-12 19:42:30 -05:00
Ashod Nakashian
cd4b8f13aa wsd: log the socket FD used to listen to client connections
Change-Id: I8499c707b0f9eafdd1b4715d38e222d83437aa37
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-12 18:45:35 -05:00
Thomas Lehmann
b2267f6280 wsd: fix malformed img-src field
The generated field is

   img-src 'self' data: https://www.collaboraoffice.com/https://*:* ...;

while a space was expected before the "https://*:*"

This was introduced with

   7e94149ec476445a445ffcd0922d83b1c60c5c64

   wsd: Only add one img-src rule to the CSP header

Signed-off-by: Thomas Lehmann <t.lehmann@strato-rz.de>
Change-Id: Ia900bb2508e7f04b111160001c6602e87eae2023
2022-11-11 19:59:56 +01:00
Miklos Vajna
b7f5f94527 wsd: invoke onDocBrokerRemoveSession() before dispose
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id270c57864878bdcea8ca243b955a1d9069629e0
2022-11-11 11:45:24 +01:00
Tor Lillqvist
b65c82031a RequestDetails::_isMobile is unused
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ib2a6bb69b09776dbaf48216330f1c260299d9cac
2022-11-09 09:09:55 +01:00
Ashod Nakashian
9022c1059b wsd: improved UnitWOPILock to avoid race-condition
Change-Id: Ib91f53f4ebbfef8d93cebe24d48fea26df479dfa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-03 05:17:05 -04:00
Gökay Şatır
cf1074b640 Hide "Translate" menu button if deepL is not configured
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I52a02ab8380468b5dc56cb90a4d8edf2fab56c06
2022-11-02 08:56:25 +03:00
Miklos Vajna
034b37a4a9 wsd: limit memToFreeKb in Admin::triggerMemoryCleanup()
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Idfe4ee00be9f805f5e12c7ece4f890aa2b9d08ed
2022-10-28 11:20:51 +01:00
Ashod Nakashian
10aa79f220 wsd: handle embedded video without extension
Change-Id: I4e05dfdbb78744c8d28404b5000fbc701d71ecbd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-27 16:23:27 +02: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
7f5d77f1ff wsd: move mediashape handling to ClientSession
And reuse the public URI helper.

Change-Id: I9d56e91c2df571609c575b401c6a4eea958d710a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-26 16:26:15 +02:00
Ashod Nakashian
0124b42077 wsd: reuse getClipboardURI generically
This extracts the sub-path and the tag
as parameters, leaving the rest of the
logic intact.

Change-Id: I4e08537658e14412a1e56b55508ccb9529b00053
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-26 16:26:15 +02:00
Ashod Nakashian
06d7fd1753 wsd: extract URI encoding in a helper
This is compatible with the JavaScript
encodeURIComponent(), which supports
XML embedding.

Change-Id: I38bb64af67789bd5eea3f8f8bdb7f80e313599fb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-26 16:26:15 +02:00
Miklos Vajna
4278b601f6 wsd: fix missing tile cache check in ClientSession::getCommandValues()
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I59d0c4863493a02df7a05b98648eb235840f8060
2022-10-25 16:55:19 +01:00
Szymon Kłos
353e269c55 wsd: support embedded video - relative link
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I4351bc801914583ab589b424059748858d7937d4
2022-10-25 13:20:47 +01:00
Ashod Nakashian
f81a1d1c01 wsd: support embedded video in slideshow
Change-Id: I2f7621fceb6c9f267bcf86da358b6eb07d55c9f3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-25 09:16:36 +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
Szymon Kłos
c50b2682a4 embedded video: show inside selection marker
Draft showing example video preview when activating any shape...

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I37ab8335a3448283abd3c978eb8c62722fd8c7bb
2022-10-25 09:16:36 +02:00
Gabriel Masei
cd106b9976 wsd: add lang param to conversion
This is needed, for example, for date type cells
for which the format language is set to default.
In this case the load language is used and it
determines the display/output format.

Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I49ec4940377b261971224d37ea5fbe8ed7006157
2022-10-20 11:08:42 +01:00
Jan Holesovsky
7f96d9276c Implement HideRepairOption in CheckFileInfo
When present and equal to 'true', the 'Repair' button and/or menu entry
is hidden in the UI.

Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: If8075be479551e0d1a5fa03014aa5e4412578c31
2022-10-18 13:02:11 +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
8bd276976e Downloaded fonts don't need to be visible to Kit processes any longer
After recent changes in core, it is only the ForKit process that opens
such files.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I69ce1c4caf229b34e42799c525a1f1461a1841e0
2022-10-13 17:02:08 +03:00
Rash419
0fdab6e99e wsd: added allow key to locked_hosts section of json to
define whether locked_host is allowed or not from json
only without the need coolwsd.xml value

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I4c20a56afae3b90c29badc1ecbaec5aa37d07cbd
2022-10-12 10:59:19 +02:00
Rash419
fa70614464 wsd: added additional safety checks in fetch methods of remote config poll
updated the log messages

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic9caaed6111adeee6b05e3240afcbef1e919285d
2022-10-12 10:59:19 +02:00
Rash419
4544428aeb wsd: removed fetchWopiHostPatterns
fetchWopiHostPatterns was used to override old <host></host> which is deprecated and replaced
by alias_groups

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic16facffdb40eaca504c47a17024cff6ff241950
2022-10-12 10:59:19 +02:00
Rash419
6cc2dc2c98 overriding checkfileinfo using hidden input field
wopi host can add following input field to their html to override checkfileinfo, right now only
DownloadAsPostMessage is supported
<input name="checkfileinfo_override" value="DownloadAsPostMessage=true" type="hidden"/>
This can be usefull when same html is used to load collabora online in both desktop browser and mobile webview

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8ff122f2824694d451724a832d992e08161fb448
2022-10-11 11:34:29 +02:00
Ashod Nakashian
237bb46eff wsd: simplify infobar fetching
Since the request is really synchronous,
there is no benefit in firing up a thread
and doing an asynchronous request when
we will block until the result is in.

Luckily, we have a much simpler sync-
request API that avoids threads and
callbacks.

Also, avoid failure logs when no
infobar URL is provided.

Change-Id: I06a2f7fb042c8e8d5599bb06ecee5b1afa51911a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-10-07 11:19:20 +03:00
Gabriel Masei
3aa81e8ba1 add 'Connection: close' header to http responses.
If the connection is closed right after the response was sent
then it's wise to add 'Connection: close' header to the response
so that the client optimizes its behaviour: e.g. does not reuse
the socket for further http requests. Normally  a client should
retry a request if the reuse of an old socket fails and that
should solve the problem but still this is an overhead.

Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I29f1498610c567024def3beb1ad7014f2c15a232
2022-10-04 13:45:58 +02:00