Commit graph

1023 commits

Author SHA1 Message Date
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
Jan Holesovsky
efe291c320 Notify about the editing context.
And also:

* Hint the compiler to warn about the missing callbacks.
* Add few missing ones.
* Update the bundled headers.

Change-Id: I8d31363eaaea289e8a517c0b9b1142b33ce3027e
2018-11-12 18:10:57 +01:00
Miklos Vajna
a514abff88 document signing: fix disabled case for Calc/Impress
If the document-container has an explicit style attribute, then this
breaks Calc (only Writer was tested before). This restores the correct
Writer/Calc/Impress behavior when the setting is false and keeps correct
behavior with Writer when the setting is true.

Change-Id: I310660e88af4407e521529ec41b5dcb604108bd9
2018-11-12 11:53:42 +01:00
Miklos Vajna
c74c9e39c8 Disable document signing via config setting
It's not too easy to customize CSS, so move the top position of the
document container to loleaflet.html, where it's convenient to handle
this.

JS can dynamically query if the menu item should be there, similar to
the about dialog.

Change-Id: I4b2799a41f8ad31e3a9b4983fd1947d2e0363a2b
2018-11-09 13:56:02 +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
Michael Meeks
9f31063bd6 Don't sniff the inside of SSL sockets for SSL headers.
We might find a websocket we don't like.

Change-Id: Id13628252e01501d6cc209f4d572d8da16a7a658
2018-11-08 02:12:02 +00:00
Michael Meeks
fa74404019 Add a time limit for badly behaved / huge document load / conversions.
Also improve debug printing of load times in dumpstate.

Change-Id: Ib3fd70dffb57588cd90bd928c4be9890cee8bc65
2018-11-08 01:27:40 +00:00
Tor Lillqvist
802cb3bd24 Move initailisation of 'now' variable back after the poll where it should be
Was moved before the poll in my
75438baa70.

Change-Id: I0ec99c0c1433d2e5d631720f003905cbd18206aa
Reviewed-on: https://gerrit.libreoffice.org/63052
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-11-07 23:16:49 +01:00
Andras Timar
a9cf1ab45f Convert wsd/reference.txt to Markdown format
Change-Id: I93b36c7136a9ea77ecf381fb1c57913c283821b6
2018-11-07 21:22:33 +01:00
Michael Meeks
738abc1de7 Respond to SSL/TLS over http - when we don't expect it.
Change-Id: I48c7607cd4e1416fb4ac28c552c2cd96b51d60a6
2018-11-07 17:36:18 +00:00
Tor Lillqvist
34eb014e2b Drop the spaces from "Local Host #0" xauthor parameter
That "name" will be passed as the xauthor parameter in a message like:

child-01b9 load url=file:///.../x.odt?permission=edit jail=file:///.../x.odt xjail=file:///.../x.odt authorid=localhost1 xauthorid=localhost1 author=Local%20Host%20#1 xauthor=Local Host #1 readonly=0 lang=en-US

and that is parsed into space-separated tokens. Which leads to warning
messages like:

WRN  Unexpected doc options token [Host]. Skipping.| common/Session.cpp:94
WRN  Unexpected doc options token [#1]. Skipping.| common/Session.cpp:94

So use "LocalHost#0" etc instead.

Change-Id: I01ce8c4fb8309a7a9d3395e4fd874e469475d44c
2018-11-06 23:16:43 +02:00
Miklos Vajna
0fb89bc4d0 wsd: remove the last nested #ifndef
Found by the new readability-redundant-pp tool from dev-tools.git.
2018-11-06 09:09:35 +01:00
Tor Lillqvist
4a24055a74 Bin one case of nested #ifndef MOBILEAPP
(Might be more. Is there some tool to automatically detect this?)
2018-11-02 12:39:11 +02:00
Michael Meeks
698b806e23 gtk: compile fixes for socket latency and version display.
Change-Id: I4ff4bcb54d8c1227feeb19b281c38e1769ed83e7
2018-11-01 21:23:15 +00:00
Andras Timar
f575f7611c --numprespawns switch has been deprecated since 2016
Change-Id: I94a24cfd06382ac15ef2aa5c6f6f26944767bc63
Reviewed-on: https://gerrit.libreoffice.org/62731
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-11-01 12:22:06 +01:00
Henry Castro
665863b50a wsd: wopi: introduce a "EnableShare" entry in the CheckFileInfo
Change-Id: Ia47d7e8f5c8cd8ae1eb314467c664b27b50e7fd3
2018-10-31 18:12:07 +01:00
Henry Castro
8643128180 wsd: wopi: introduce a "EnableInsertRemoteImage" entry in the CheckFileInfo
Change-Id: I66e5f12fbd49509ce8e82ea07ae7a2cc75ddc665
2018-10-31 18:12:07 +01:00
Jan Holesovsky
8c9e126a23 Insert graphic: Pass the remote url to the core for download & insertion.
Change-Id: I871de173c255dcb7b184582e486328d7f66a2fae
2018-10-31 18:12:07 +01:00
Tor Lillqvist
dd3d50c1b3 Reduce MOBILEAPP ifdef clutter a little bit
This means some no-op UnitWSD functions will get called, but so what.

Change-Id: Ibdce82d9933699fe15947daea221ad67148dfddd
2018-10-30 22:09:52 +02:00
Tor Lillqvist
ffe66b3efc Avoid 'Unused variable' warnings in the MOBILEAPP casse
Change-Id: I30d631559379da4baa5a73712f002435b1a36360
2018-10-30 22:03:04 +02:00
Tor Lillqvist
f29be2442d In ChildProcess::isAlive(), check _pid also in the MOBILEAPP case
... instead of returing always true.

The close() member function sets _pid to -1. We should just trust
that.

This helps a bit in making the app reach the the fully idle state
faster after closing a document. Tbere were two clear pointless delays
visible in log output: A long one followed by a shorter one. This gets
rif of the latter delay. Still need to find the root cause for the
former one.

Change-Id: I6d890e9eb59d076fde5aa93c55c44acc452b8124
2018-10-30 19:34:04 +02:00
Tor Lillqvist
141f0a15fd Don't use 1 as a fake pid, as real pid 1 is special
Change-Id: I8f2031c462734372a01884a6b30de67964854d1e
2018-10-30 19:20:00 +02:00
Miklos Vajna
d1e183f20d SocketPoll: make members private
All these protected members are unused by child classes, except read
access to a single member.
2018-10-29 09:06:33 +01:00
Tamás Zolnai
bf2dcdc01f Have a better log for convert-to denial
Change-Id: I5c8d367b3f82d47a45df8c298e39515bc89f7b0d
2018-10-25 22:25:34 +02:00
Tor Lillqvist
8bc97c0f9e Adapt after 4724aa0cf7 2018-10-25 21:33:57 +03:00
Miklos Vajna
4724aa0cf7 Socket: do what the TODO says
Drop the list of friends and just add getters for the relevant
members.
2018-10-25 16:39:02 +02:00
Tamás Zolnai
b4b0e9c6d4 Handle X-Forwarded-For with more secure
Check all pariticipating IPs to be allowed to use convert-to
functionality. In a simple use case it means the reverse-proxy's
and the actual client's IP.

Change-Id: I4ef9cb14a1c3003cba6c66f6e99d5b54b2c3b2b8
2018-10-25 10:48:52 +02:00
Tamás Zolnai
18eb134384 Need to use clientHost here
Change-Id: I170e1d24e1a71749c3262c01a83251c6c157f6eb
2018-10-24 13:09:11 +02:00
Tamás Zolnai
318f0629bb Handle X-Forwarded-For header for convert-to feature
Extract the client IP from the X-Forwarded-For value
and use that one to allow / deny the usage of convert-to
feature.

Change-Id: I363c0931df5a0538236cae12f943fffd65086ee6
2018-10-24 12:50:03 +02: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
Tamás Zolnai
bb50c9e0cd Enable convert-to features for wopi hosts
Change-Id: I994be7087247215b09d117df18b661906d941266
2018-10-20 13:26:38 +02:00
Tamás Zolnai
ec65ecd0f1 Revert "Revert "Enable convert-to features for wopi hosts""
This reverts commit 343ba48d27.
2018-10-20 12:57:53 +02:00
Tamás Zolnai
343ba48d27 Revert "Enable convert-to features for wopi hosts"
This reverts commit 8dd28ed664.
2018-10-20 12:55:55 +02:00
Tamás Zolnai
8dd28ed664 Enable convert-to features for wopi hosts
Change-Id: I8aa37c61f3df5356fb7a14d93cda6279e7ec3cf1
2018-10-19 18:15:22 +02:00
Tamás Zolnai
0bb8b7c7a8 Add /hosting/capabilities endpoint to advertise online features
Add an entry to discovery.xml with the urlsrc where capabilities end
point can be found. Use json format to send back the feature list.

Change-Id: I390a53d956d53ca79e5a8090aead7f4131ec4ca0
2018-10-19 18:15:22 +02:00
Tor Lillqvist
452a0a46c2 More work on the GTK+ testbed app
Add plumbing to send messages from the Online code to the JavaScript
code, and vice versa. Similar to what is done for iOS.

Sadly, it crashes. Multi-thread issues. Not surprisingly, it crashes
when I call webkit_web_view_run_javascript() in another thread than
the one where the GTK+ and other Webkit calls were done. I need to
come up with some clever way to do everything from the same thread.

(On iOS, I use dispatch_async(dispatch_get_main_queue(),...) to
schedule a block (i.e., a lambda expression) to be run in the main
thread.)
2018-10-17 22:48:14 +03:00
Tor Lillqvist
9e8a2d3c7e Bin a couple of less useful LOG_INFs inside #ifndef MOBILEAPP
Always good to get rid of ifdefs.
2018-10-17 17:09:04 +03:00
Tor Lillqvist
f122e92977 Build the GTK+ testbed app using autofoo
Rename the gtk/gtk.h file to gtk/gtk.hpp to not have it confused with
the actual GTK+ <gtk/gtk.h>.
2018-10-17 11:00:28 +03:00
Ashod Nakashian
df08d6688f wsd: disable anonymization when allow_logging_pii=true
Anonymizing is useless with trace anyway, since no
trace log entry anonymizes, it's more useful to
disable anonymization to help troubleshoot (which is
the reason for enabling tracing in the first place).

Change-Id: I437207e7a798c2288a5d5eb33446cb16491bfbf6
Reviewed-on: https://gerrit.libreoffice.org/59534
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit a2809fd27277fd01d0dafdc0c4f0435fdf85db36)
2018-10-16 20:12:23 -04:00
Jan Holesovsky
3eb1051777 wsd: Don't try to anonymize the /contents at the end.
Change-Id: Ib3737f4afc6d708b7d06acb36f4044df9f5fbe84
Reviewed-on: https://gerrit.libreoffice.org/57586
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit 9bab03070140227f850112716277c82f2fc41424)
(cherry picked from commit d2f7adca4a8d528e1cac33d877de906d28d34d65)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
0fa7ad50d9 wsd: warn when allow_logging_pii forces trace with anonymization
Also move anonymization initialization after logging is initialized.

Change-Id: I5c3753f0b11ae9c3376235e22af204eb3a57f5c8
(cherry picked from commit 02076bdb9128ffe7c26d8bcf420b659ec1d68280)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
a80c5e70c4 wsd: minor cleanup of CheckFileInfo logging
Change-Id: I45a7d281a640cbadfd42f1411f53946ae0142653
(cherry picked from commit 9a35fcd269877f3b42bb34c0d1b3bd6e98450d7d)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
9bfe8b70e2 wsd: don't warn on missing json
Change-Id: I28086152fbf9fc82ddead1a2feb80f21ffdcd208
(cherry picked from commit 7b48be5a9dde4fcec01b8804559ffa4f9c19d53c)
2018-10-16 20:12:23 -04:00
Ashod Nakashian
4e186aca18 wsd: fixed remaining anonymization issues
(cherry picked from commit b7f5809a792e2a0b816d3cfd96511cdd93582d15)

Change-Id: I756ccd4b810fdc4dd62a83c1704c59c6a947e615
2018-10-16 20:12:23 -04:00
Ashod Nakashian
5d6a228a8b wsd: don't anonymize 'contents' URI
Reviewed-on: https://gerrit.libreoffice.org/57707
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 7cadf9da49c2b804f30f1e8c2d2998c768b9d365)

Change-Id: Ia66729453a1f7db6105a0332de0f8bad3835f3f5
2018-10-16 20:12:23 -04:00
Ashod Nakashian
b6333ada8d wsd: anonymization improvements and unittests
Also support anonymization of downloadas documents
and renaming of documents.

Reviewed-on: https://gerrit.libreoffice.org/57541
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 78248a542c9ca31bf9ad4cad9b55d78690384395)

Change-Id: I81a80e6290217659987d73f625e5f0fb81cb7ef2
2018-10-16 20:12:23 -04:00
Ashod Nakashian
00a44d6e81 wsd: flush logs before existing
This is important for when we abort with some explanation.
Often said explanation doesn't show up anywhere to be useful.

Also, issue fatal logs for abnormal exist and use SFL to log errno.

Reviewed-on: https://gerrit.libreoffice.org/57540
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit ad7964393eadb68873b820e0a620fb40f1e1b06a)

Change-Id: Ic67064ef40ef6e93d26e5847ecd32bdd49c3cc8b
2018-10-16 20:12:23 -04:00
Ashod Nakashian
053161b3f5 wsd: move string utilities into Util
Reviewed-on: https://gerrit.libreoffice.org/57539
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit fb2671c4145edd4d4e359f0dcf5cc84835487cd4)

Change-Id: Idc578dff4e8ee5e48c1b7780d3feb2d21c6a9b13
2018-10-16 20:12:23 -04:00