Commit graph

7001 commits

Author SHA1 Message Date
Ashod Nakashian
f8ec98c144 wsd: anonymize downloadas
Change-Id: I6dff7189d78d339f1f5db7afef2b62da4df23759
2018-10-16 20:12:23 -04:00
Ashod Nakashian
d748dec556 wsd: anonymize document saving
Change-Id: Ic819883e39a544ec16d6ac144a08ed9f9f568cc0
2018-10-16 20:12:23 -04:00
Ashod Nakashian
7f569a61dc wsd: anonymize jailed filename
Change-Id: I0af46ae6779caf9851e3142889940e4f774f9eb9
2018-10-16 20:12:23 -04:00
Ashod Nakashian
6c18aa7e88 kit: anonymize usernames and filenames in Kit
Change-Id: Id7928136db71ded7bf6b1a5e8e387db7251f8a35
2018-10-16 20:12:23 -04:00
Ashod Nakashian
3c73e275e4 wsd: anonymize WOPI::CheckFileInfo
Change-Id: I2c23e9f159456176ae85967cc49ec876b1e4ecf4
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f25575181c kit: parse anonymized tokens in doc options
Also optimize the parsing in general.

Change-Id: Id1f5b5c12e867c98e523d1e32397853d7d4a6ee4
2018-10-16 20:12:23 -04:00
Ashod Nakashian
0264dba09e wsd: anonymize load command sent to Kit
Change-Id: Ic509ceb5c38bc50152f1d00bd5718089fe664ac1
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f12883bc07 wsd: add anonymization helpers
Change-Id: Ic479218ab1b6e580c288a984f35795e1d0d6e8ad
2018-10-16 20:12:23 -04:00
Ashod Nakashian
267b047220 wsd: demote socket write logs to trace level
They are only informative when the actual data
is also logged, which is on the trace-level only.

Change-Id: I7e45f2a4f14638783a65cb3a4eb132438d9125b8
2018-10-16 20:12:23 -04:00
Ashod Nakashian
380c55d9eb wsd: disable tracing after initialization
The first child had tracing enabled even after
initial startup is completed. This would leak
user details when anonymization is enabled.

Change-Id: I5325e02d1a1078bff6640af85f5672b556c00aeb
2018-10-16 20:12:23 -04:00
Ashod Nakashian
95107ed926 wsd: support anonymization settings
Check and fail to start if anonymization is enabled
and trace-level logging is requested. Since trace
may include data packets, which is hard to anonymize and
is likely to impact performance if attempted, it is best
to prevent tracing altogether.

Also, sort the default settings for better readability.

Change-Id: Ic83f1f2fda15e2146a5d970f03617fa460d9cbc7
2018-10-16 20:12:23 -04:00
Ashod Nakashian
b7f37af8f6 wsd: anonymization config and settings for username/filename
Change-Id: I9d7ce87b5f7d204b503d467959de008326b3411c
2018-10-16 20:12:23 -04:00
Ashod Nakashian
f3d02cb9e2 wsd: support polling on client thread
Previously SocketPoll expected to be
running its own thread for polling.
This is unnecessary when we have a
spare thread (e.g. main) that can
(and should, for efficiency) be used
for polling rather than starting
dedicated thread.

Not starting the SocketPoll's thread
and calling SocketPoll::poll() directly
worked, the warning logs on each activity
notwithstanding.

The warnings aren't just noisy, they are
a performance drain as well, and signal
that something is wrong. The new code
now makes the API cleaner and avoids
unnecessary warning logs, while being
faster.

Change-Id: Ibf9a223c59dae6522a5fc2e5d84a8ef191b577b1
2018-10-16 20:12:23 -04:00
Ashod Nakashian
3158d4c31c wsd: always use signal-safe calls
The async-signal-safe functions to get thread-id
and thread-name, which cache the results, are
faster, cleaner, and signal-safe. No reason why
we shouldn't always use them.

Especially since it appears the logic was
inverted in Log::prefix, such that the signal
un-safe calls were made during signal-handling,
and the safe ones were called otherwise!

Instead of passing the signal-safe flag to
Log::prefix, we pass the buffer size, for
improved security.

Furthermore, reduce header dependencies
and reduce clutter.

Change-Id: I697689b2f0a290b6d8cce4babc3ac1e576141da6
2018-10-16 20:12:23 -04:00
Ashod Nakashian
63c3fce2c6 wsd: clang-format logging macros and pass logger explicitly
Change-Id: I37e7f4b5687b64b36e0985942627a4b84a8249eb
2018-10-16 20:12:23 -04:00
Ashod Nakashian
1e51b02db5 wsd: set SSL setting in loolwsd.xml based on configure --enable-ssl
Change-Id: I18f4c0cf4f5ec02a685d0721981a98396eb834fb
2018-10-16 20:12:23 -04:00
Ashod Nakashian
a7a03c3c5d wsd: send copied text to client upon .uno:Copy
Change-Id: I39181a0e29e00a0eae389fbab6ee253cf2f23f84
2018-10-16 20:12:23 -04:00
Henry Castro
452015d977 loleaflet: mobile: do not focus the map after the menu item click
Change-Id: I796c81a5df3471ab2cb9bb36735ad05f6e8f4492
2018-10-16 20:09:03 -04:00
Henry Castro
32c98a4c88 loleaflet: mobile: fix scrolling the dialogs
Change-Id: I5279cffca4b4d66fbc35a4a8ae4b3ffdfe70a215
2018-10-16 20:08:17 -04:00
Tor Lillqvist
e15dc044d7 Handle the GTKAPP case, too, in loleaflet
In loleaflet.html.m4, define a macro MOBILEAPP as true if either
IOSAPP or GTKAPP is true.

Set a window.ThisIsAMobileApp property in either case, and
window.ThisIsTheGtkApp in the GTKAPP case.

The checks for ThisIsTheiOSApp in the JS could in fact all be changed
to check for ThisIsAMobileApp instead, as they were all equally valid
for the gtk+ testbed app. For instance, sending WebKit messages to the
app code works the same way in JavaScript both for iOS and
webkit-gtk+. Which is not surprising, I guess, as the underlying
WebKit is the same.
2018-10-17 02:10:14 +03:00
Tor Lillqvist
cc2bfc9770 Build just loleaflet in the --enable-gtkapp case, too
When I fix the gtk+ testbed app to use autofoo, that subdirectory will
be built, too.
2018-10-17 02:10:14 +03:00
Tor Lillqvist
1d495e626f Forgot to commit this file
Change-Id: I6650583931f3c09a8c3d75c38a2e0dbceae5853d
2018-10-17 02:01:16 +03:00
Tor Lillqvist
fd758496a5 Add --enable-gtkapp configury option
Change-Id: Ib805581663aeec62d713f87ca72ab3cfe95db79f
2018-10-17 01:22:24 +03:00
Tor Lillqvist
8ceb8950e8 Add handlers for messages from JS
Change-Id: Ifa3acfd09e10dbee4ecf43bec5735263e3655790
2018-10-17 01:04:05 +03:00
Tor Lillqvist
58db979291 Start on a gtk+-based workalike to the iOS app
The idea is that it would work sufficiently identically, so that even
people without a Mac and without an iOS device could participate in
development of the non-iOS-specific bits, like the JavaScript, or the
online MOBILEAPP-specific plumbing. Which would be great.

No, this doesn't do anything sane yet. It does compile the same online
C++ files as the iOS app, though. (Some minor tweaks were needed in a
couple of them to silence gcc warnings.)

There is a plain Makefile, but I should change to using autofoo, too.
Eventually, this will need to be built in a separate tree from a
normal online, just like when using the --enable-iosapp configure
switch. (But for now, doesn't matter.)

Change-Id: I13e4d921acb99d802d2f9da4b0df4a237ca60ad6
2018-10-17 00:45:35 +03:00
Tor Lillqvist
e9d0b38103 Add some includes that are missing if compiling this on Linux
Change-Id: Iffe3481e56842f29f0e7838ca024b28e1f7187f3
2018-10-16 23:56:46 +03:00
Tor Lillqvist
3feae5ccda Don't talk about any 'ports' in the logging in the mobile app 2018-10-16 23:11:45 +03:00
Tor Lillqvist
6316aaf0f5 Initialise also _threadFinished and _stop in SocketPoll::startThread()
I am trying to get a SocketPoll object to be "restartable".

Also make the lambda expression in joinThread multiple lines, so that
one can set a breakpoint in it.
2018-10-16 23:06:05 +03:00
Tor Lillqvist
c617a8c73f Improve a comment 2018-10-16 23:05:59 +03:00
Tor Lillqvist
64c06b1f88 Give a name also to the main thread 2018-10-16 23:05:50 +03:00
Tor Lillqvist
434a62335b Give a name to the thread that forwards (fake) WebSocket messages to the JavaScript 2018-10-16 23:05:39 +03:00
Tor Lillqvist
b6f931db51 Maybe I now have some idea what I am doing 2018-10-16 23:05:33 +03:00
Tor Lillqvist
157273dc5b Give also the thread running lokit_main() (in the mobile app) a name 2018-10-16 23:05:05 +03:00
Tor Lillqvist
42948f6d75 On iOS, Util::getThreadId() just wraps std::this_thread::get_id() 2018-10-16 23:04:33 +03:00
Tor Lillqvist
223cc97175 Log each line separately in fakeSocketDumpState() instead of with embedded newlines 2018-10-16 23:04:24 +03:00
Tor Lillqvist
e3d0d601f3 Bin superfluous LOG_TRC()
We log the same information (and one more thing) immediately below.
2018-10-16 23:03:31 +03:00
Miklos Vajna
a959056967 wsd: unnecesary value parameter in LOOLWSD 2018-10-16 09:14:13 +02:00
Tor Lillqvist
c701e875f6 iOS app work in progress on closing and re-opening a document 2018-10-16 02:00:47 +03:00
Tor Lillqvist
859d799f5c Do run some cleanups on return from LOOLWSD::innerMain() in the mobile app case
Also, re-initialise the lovely TerminationFlag to false in
LOOLWSD::main().

Change-Id: I8f53e8c809583f931435e6f80324d4438cca4b2a
2018-10-16 01:49:46 +03:00
Tor Lillqvist
25e3092a48 Bin pointless #ifdef MOBILEAPP block
BUILDING_TESTS is not true for the mobile app either.

Change-Id: I54de357c25b7349aaa9c06f054cd8fbfddfb7a37
2018-10-16 01:40:52 +03:00
Tor Lillqvist
8f86e63563 Call fakeSocketDumpState() when LOOLWSD::main() is about to return 2018-10-16 01:36:01 +03:00
Tor Lillqvist
cab2f9b6bb Add fakeSocketDumpState() 2018-10-16 01:11:20 +03:00
Tor Lillqvist
ef3e09728f Revert "Drop one use of TerminationFlag"
Turns out not to be useful for the iOS app after all.

This reverts commit bff5c17693.

Change-Id: I93367e9de1b6e66b1cbb7587259f1136564e53a4
2018-10-16 01:03:47 +03:00
Tor Lillqvist
843e74e533 Log what TerminationFlag is after the loop in innerMain()
Change-Id: Ib53dc7d760a89a72b47f575ba2787d08cdcd29ec
2018-10-16 01:02:00 +03:00
Tor Lillqvist
a6e0d407d5 Bin unused function handleShutdownRequest()
Change-Id: I1be1fdba9623e7d2c5ee0a43c976a5d3ccf9fd28
2018-10-16 00:46:47 +03:00
Tor Lillqvist
c2b8b1c090 Bin unused variable ShutdownFlag
Change-Id: I19c91cbf82beda4498b37d29fbca3c603974f46a
2018-10-16 00:40:35 +03:00
Tor Lillqvist
405982716e Bin unused function 2018-10-16 00:37:42 +03:00
Tor Lillqvist
1ce8c94022 Don't hide check for TerminationFlag behind a pointless local abstraction layer
It is useful to find all uses of TerminationFlag directly with git
grep without having to look through abstractions.

Change-Id: I8bc999bd36d06c805c2a6331dba739b41239ddec
2018-10-16 00:22:35 +03:00
Tor Lillqvist
c05079d6d5 Mention TerminationFlag in a couple more log lines
Why log something vague like "Stop flagged" when we can log what we
actually do?

Also, the log lines already include the name of the thread, so no need
to prefix with "Kit:".

Change-Id: I5a05492aa4e8a26714889cc6341a26862c80e4d0
2018-10-16 00:08:44 +03:00
Henry Castro
f94c5e25f6 loleaflet: mobile: fix scrolling the menu bar
Change-Id: Ic0bdbfb825507ab3b09f56627e0218a40fd95172
2018-10-15 12:20:36 -04:00