Commit graph

919 commits

Author SHA1 Message Date
Michael Meeks
bb49e17e8f Start the admin thread even if it is disabled.
The admin thread does memory cleanup as well which is required.
This also reduces logging churn.

Change-Id: I1c6cfaf6085b685f230dc24ae1716b0256d892f8
2018-05-15 10:58:02 +01:00
Michael Meeks
41238c5d1a Restrict convert-to to known hosts - not all insert / downloads.
Change-Id: Ief26c80bf7e9e96f3c5dce0d8739a825f6fac629
2018-05-14 12:03:17 +01:00
Jan Holesovsky
88eefe75c5 Improve readability of the admin console password check.
Also disable PAM by default.

Change-Id: Id1197f0d049ce56f698952b87d2c4760412eb8ec
Reviewed-on: https://gerrit.libreoffice.org/53727
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-05-02 16:34:57 +02:00
Andras Timar
0f59930e7f do not allow empty admin console user or password
Change-Id: I3dfb74f62c53d8c7ab80094d4831203d065f0b4c
Reviewed-on: https://gerrit.libreoffice.org/53673
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-05-01 21:46:07 +02:00
Michael Meeks
b5a1af763c Share HTTP header parsing inside the StreamSocket.
Change-Id: Id98e895a939d931ac10b7cd7403da4cbe822ee82
2018-05-01 16:29:56 +01:00
YiiChang Yen
910ae806ef wsd: to filter clientAddress before POST action.
Change-Id: I293580f041bc46b36c57f63fe4a2c0131763b3c1
Reviewed-on: https://gerrit.libreoffice.org/50977
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-04-30 18:50:06 +02:00
Henry Castro
9215277576 wsd: simplify to use the DEBUG_ABSSRCDIR preprocessing symbol
Change-Id: If71f6c831064482a97069a64eb1d05d8a3c739b4
2018-04-29 21:22:53 -04:00
Marco Cecchetti
6a0fcdf15f wopi flag for hiding the change tracking controls from UI
Change-Id: I1b9aa4f8111d77ae12093022205fad1cbee850ac
Reviewed-on: https://gerrit.libreoffice.org/53335
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-04-24 18:15:44 +02:00
Michael Meeks
ce06a9ae37 Allow the Admin console to be disabled in the configuration.
Change-Id: Iacde8e891f42e9ef9399ebbebbd2b2978188d4c4
2018-04-17 20:47:17 +01:00
Miklos Vajna
cb761748ed Avoid unnecessary copy-initialization
These are copy-constructed from a const reference but are only used as
const reference; make them a const reference.

Change-Id: Id193905b65224c2db4aab88999a92e60d3af3fdf
2018-04-17 09:13:54 +02:00
Tamás Zolnai
347c0705c2 Update dumper code to handle new payload for invalidatecursor
Change-Id: Ibfe129ce4db9ff33d409fb6ebabfb3a435b64829
Reviewed-on: https://gerrit.libreoffice.org/52796
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-04-13 11:14:24 +02:00
Tamás Zolnai
5da818c033 Update documentation for invalidatecursor callback
Change-Id: I538a0894c024f6a30baa178fa81071af528f1cfb
Reviewed-on: https://gerrit.libreoffice.org/52739
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-04-11 19:27:18 +02:00
Jan Holesovsky
c8ef63253a Sanity-check the scheme and host for frame ancestor, POCO does not do that.
Change-Id: Ieea9532ccd2a11e74f370a340e68f46122469848
2018-04-04 12:50:53 +02:00
Pranav Kant
6bb38614bd Some helpful logging
Change-Id: I75e5e6cbbecf1e1af94a6710ecab4ced5637f14f
2018-03-23 16:50:28 +05:30
Michael Meeks
8f134aa1a9 Allow running without seccomp and capabilities.
There are some significant security trade-offs here which are now
at least configurable.

Change-Id: I1d879d69e91392f4ccf5db250a2277f53df60db7
2018-03-19 20:46:17 +00:00
Michael Meeks
18108dfa89 Help OSL's nlsupport with a UTF-8 locale for everyone.
Change-Id: I98557e3134b436b6360129dfd6d16bba811cd864
2018-03-15 19:19:46 +00:00
Miklos Vajna
e5c7c62713 'static const int' needs an explicit definition in C++11
core.git equivalent situation is e.g. SwXMLTableContext::MAX_WIDTH.

Change-Id: Id6f4201e875a7453ab2363161ea9560ae6e40384
2018-02-26 16:34:01 +01:00
Miklos Vajna
56fd92b4eb fix -Werror,-Wunused-function
Change-Id: Idb339471edf9f80f779b50a124098ab056d1a2fc
2018-02-26 16:17:04 +01:00
Ashod Nakashian
7c2c0062e3 wsd: always avoid saving readonly files
Otherwise saving is bound to fail, causing other
errors, which is nonsensical since there is nothing
to save to begin with.

Change-Id: Icb65a4a3b277b3175aadbe5107b294b24a399e7b
Reviewed-on: https://gerrit.libreoffice.org/50148
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-23 16:55:02 +01:00
Ashod Nakashian
5befd0803a wsd: improved wopi info parsing
Better logging during wopi info parsing,
especially upon failures.
Refactored the code from Storage.cpp into
JsonUtil.hpp.
Minor optimizations.

Add unit-tests for the parsing logic.

Change-Id: Ifebc3f6b7030a6c7b3b399786633f6b5e8737478
Reviewed-on: https://gerrit.libreoffice.org/49927
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-23 16:54:39 +01:00
Samuel Mehrbrodt
224660a0ba Add launch URIs for Calc and Impress too (for debug builds)
Change-Id: I66ea097c7f8d0ea72a74ecb62abbdf63e50f3058
Reviewed-on: https://gerrit.libreoffice.org/50190
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-02-23 09:57:59 +01:00
Samuel Mehrbrodt
cabe0a750a Only show warning if limit is exceeded
not when it is reached

Change-Id: I802f839e49f4c8ed9e423b093e7306b5480a1812
Reviewed-on: https://gerrit.libreoffice.org/50188
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-02-23 09:17:12 +01:00
Samuel Mehrbrodt
5176d9d4c0 Notify new user too about low disk / limit reached
Change-Id: I150baaa5cf2b1162505324102afc038fd19b3bb6
Reviewed-on: https://gerrit.libreoffice.org/50186
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-02-23 09:17:04 +01:00
Samuel Mehrbrodt
96292dc873 Only apply hard limit when configured with support key
In other case, show the warning to all users (instead of just the last one)
and link to our get professional help page.

Change-Id: Id443ba6427acd4c05f7e0e2ce86025acfb553265
Reviewed-on: https://gerrit.libreoffice.org/49673
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-22 11:14:34 +01:00
Andras Timar
dde84d1706 wsd: encode '#' character in file name
Change-Id: I4d10f38c9025f18a0d0f0f5599892b436b9d002c
Reviewed-on: https://gerrit.libreoffice.org/49919
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-02-19 18:15:42 +01:00
Andras Timar
6a914ecbb9 tdf#115595 open editable documents with upper case or mixed case file extensions in edit mode
Change-Id: I6ea60926ce0ec4d1323080ffec5152d2bbeefc31
Reviewed-on: https://gerrit.libreoffice.org/49867
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-02-19 18:15:01 +01:00
Andras Timar
0b382f879b Allow preload of nl dictionary by default
Change-Id: Id6410fa4febdd778f511e0bdcc4324ad0c2fdf43
2018-02-16 11:07:21 +01:00
Andras Timar
8aa4a5145c wsd: handle request for robots.txt
Change-Id: Ib82db2ee8c878e6a61b62b49ceaeb72e2d05718d
Reviewed-on: https://gerrit.libreoffice.org/49819
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-02-15 15:45:09 +01:00
Andras Timar
baa3e09bde Typo: remove -> remote
Change-Id: I6214f569d6a0302c5a5a69a18150122a371e0d03
2018-02-14 12:29:50 +01:00
Ashod Nakashian
88619a323f wsd: reduce memory load only when the footprint changes
Update the network interval when updating the memory interval,
since we currently don't support changing the network interval.
Also make the default memory and network interval twice
that of the cpu interval explicitly.

Reduce logging noise a bit without losing information.

And some const-correctness and other cleanups.

Change-Id: I313fb2882675f560091e5113dbdcbdef269828e2
Reviewed-on: https://gerrit.libreoffice.org/49571
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 22:16:50 +01:00
Ashod Nakashian
7be98efd93 ut: log timestamp to track timeouts better
And improve the logging support in unit-tests to
help troubleshoot issues faster and more accurately.
Also makes the code more readable (hopefully).

Change-Id: I4f8aafb5245e2f774b03231591a74544f9ec84aa
Reviewed-on: https://gerrit.libreoffice.org/48645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:21:15 +01:00
Michael Meeks
d2f23dd8c2 Helpful error on non-matched WOPI host.
Change-Id: Ib752148be0acbf15cd8b737b71414313d05f6aca
2018-02-10 17:12:40 +01:00
Pranav Kant
39f11ab4f7 document conflict: unit test
Change-Id: I4ea310fe5adb198bc7b5e083f6bd4b0431c0cdef
2018-02-09 00:22:57 +05:30
Pranav Kant
f246f50b9e Don't try different ports unless we are testing
Change-Id: Ideb6b6ccb64f708bf4621cfc92c5836a0fd3b511
2018-02-08 17:32:00 +05:30
Pranav Kant
ad1da235d3 IME support
Dialogs still need to be adapted to this. Only works for documents as of
now.

Change-Id: I0fb1114e279a9e563943f3f65dd5a577523e9841
2018-02-08 14:16:34 +05:30
Pranav Kant
1fabfd9fe3 Version restore states
See documentation

Change-Id: Ica3cd3744643157c5a2c6c1e42e0858ad641da16
2018-02-08 12:30:46 +05:30
Pranav Kant
d189ed90cc Document stop() vs closeDocument()
Change-Id: I52483c0300d1d4c5b1def80b71ccd0661590bfab
2018-02-08 12:30:23 +05:30
Pranav Kant
595ed1c6b1 wsd: DocumentBroker: Don't initiate the document close
Just broadcast the message and let clients deal with it. This is similar
to how we do it when we find the document conflict via CheckFileInfo

Change-Id: I52855fcb96a359b3915afe71d481321f79b4554b
2018-02-08 12:30:23 +05:30
Miklos Vajna
35ccd70681 wsd: document when to use 'auto'
Change-Id: I376c8d159bc8e087315de29fd3289b45b36d4b76
Reviewed-on: https://gerrit.libreoffice.org/49356
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-02-07 15:36:52 +01:00
Pranav Kant
bd7b2b833c wsd: Don't request closing here, just stop the broker
Asking the doc broker to close means that it will save the current
document to storage before shutting down. But we don't want that because
storing the current document to storage means overwriting the document
which has been changed underneath us.

Change-Id: I8df45d2f0cf3f65936dc3030f483e52fd1703146
Reviewed-on: https://gerrit.libreoffice.org/49134
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-02-07 14:44:15 +01:00
Pranav Kant
5476774af1 wsd: Use a close request flag to break out of doc broker poll thread
... instead of directly stop()ing it. The close request approach also
makes sure that outgoing document is saved to storage.

Change-Id: I44f61db00dbd326dec80f59f4a2cbb617048aa94
Reviewed-on: https://gerrit.libreoffice.org/49122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-07 14:30:33 +01:00
Miklos Vajna
1dde430bcf wsd: spell out non-trivial autos to improve readability
Change-Id: I0e1f169fc39e5c722704e1cae487147d929f7350
2018-02-07 10:18:12 +01:00
Miklos Vajna
46c0873c29 wsd: can avoid copying these in AdminModel
Change-Id: Id092585e93cca3bd4d52531cf628c1f205fcfe8b
2018-02-06 16:06:24 +01:00
Miklos Vajna
0a2df21501 wsd: remove unused using declarations in LOOLWSD
Change-Id: I6b656a1446b015430068e4b172cf98fe746f26d1
2018-02-05 17:11:58 +01:00
Pranav Kant
5bd124499c wsd: Bin superfluous public method
Passing the reason to stop() method also does the same thing.

Change-Id: I16b648495382c14f31839acca815835df76d8dca
2018-02-02 03:16:30 +05:30
Pranav Kant
28ea409a45 wsd: Don't save if document is unmodified
This also prevents saving the document back to storage.

Without this patch, in case of document conflict (when the document is
changed behind our back in the storage), the unmodified document end up
being saved to storage, hence overwriting the document which was changed
behind our back.

Change-Id: Ie027f5b49c37e7df3f36499e0fef3eca78173969
Reviewed-on: https://gerrit.libreoffice.org/49114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-01 19:47:08 +01:00
Jan Holesovsky
b76b6a9861 Document the conflict handling.
Change-Id: I2291e4b085fcb6cac3280fdd2139afb909ada748
2018-02-01 14:17:07 +01:00
Miklos Vajna
692d24213b wsd: can avoid copying here FileServer
Change-Id: If194705eae76e81141df9c4e86f7e7bc94b250b6
2018-01-31 09:38:05 +01:00
Michael Meeks
d3c17510ed Implement an improved fork/exec wrapper.
* logs helpful messages for various error corner-cases.
* optimized file descriptor closing for large fd counts.

Change-Id: I8cba9ecb3d71ddc6e22e20d89368d8c6b9b5097f
2018-01-29 15:20:10 +00:00
Jan Holesovsky
ba7825e63b wsd: Support for configuration of the allowed languages.
Change-Id: I233619b89ac61aeaab4ba96f1f52773802cfd7ae
2018-01-26 20:57:54 +01:00
Pranav Kant
9ea81e7921 wsd: Update client port number if default is unavailable
And print that on the console so that user knows what port the current
wsd instance is using.

Change-Id: I68fb7d23f46df4ad56ba444735b2888c410f7bd5
2018-01-26 20:10:36 +05:30
Aron Budea
8f2477816b wsd: increase preinit timeout 5-fold
Change-Id: I08ab74498ef9396edba5311a7e31b75c5932bbd6
Reviewed-on: https://gerrit.libreoffice.org/44495
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Aron Budea <aron.budea@collabora.com>
2018-01-25 06:22:49 +01:00
Andras Timar
a2e25cc7d3 Add PAM support
Possibilities are endless. With a simple /etc/pam.d/loolwsd config below,
the user which runs loolwsd ('lool' in production environment) can login
to admin console with normal linux password.

    auth       required     pam_unix.so
    account    required     pam_unix.so

Change-Id: I354a7e9b4705e8fe346d17d6b6041d1406198b37
Reviewed-on: https://gerrit.libreoffice.org/48307
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-01-23 11:03:45 +01:00
Pranav Kant
0547507b67 wsd: Fix incorrect file size reported
Close/flush the file after copying into it so that we can calculate the exact
filesize later on.

Change-Id: I30aca9d0ac3702394a4465c30c61954a726eec39
2018-01-19 12:58:58 +05:30
Ashod Nakashian
c06376cc1d wsd: cleanup logging and remove unused helpers
Now all logging is done after checking if the
level in question is enabled or not (thanks to
the macros LOG_XXX), which saves unnecessary
conversions and stringification when said level
is disabled.

Change-Id: Icde31e067f60269563896f04f8b0d65643720766
Reviewed-on: https://gerrit.libreoffice.org/47885
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-19 00:33:40 +01:00
Andras Timar
4ec7fdb17e These params are unsigned, Poco takes it seriously ([ERRFMT] was sent instead of number)
Change-Id: Ie0bbf5c5f5fb96231baa5425b6a38dcbb614f61e
Reviewed-on: https://gerrit.libreoffice.org/48060
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-01-17 20:51:17 +01:00
Ashod Nakashian
f7fc3f494c wsd: save before stopping
We don't force saving unconditionally now. Only
when the doc is reasonably expected to be modified
do we force saving (to circumvent the minimum duration
between auto-saves).

We invoke auto-saving before stopping the DocBroker
polling loop, whether due to idleness or server recycling.

Change-Id: I257d55f190d3df6a3ba82f2666c7602da0581d0c
Reviewed-on: https://gerrit.libreoffice.org/47887
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:04:14 +01:00
Ashod Nakashian
b5baf3672f wsd: stop DocBroker using only stop() member
Now always given a proper reason too.

Also, stop polling thread and cleanup when
failing to acquire/spawn a child process.

Change-Id: I7ddee01dd47b8ee72f2d9134c0f1b264634d8611
Reviewed-on: https://gerrit.libreoffice.org/47886
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:03:21 +01:00
Ashod Nakashian
8ad29ee050 wsd: separate lastSaveTime from lastSaveResponseTime
Previously we assumed we are saving based on
lastSaveTime, which is incorrect because it
is set only upon successful saving and storing,
which might fail.

Now lastSaveResponseTime is used to track whether
there are saving requests in flight. And lastSaveTime
is only used when we do store the document in storage.

Change-Id: I73e5c04432981d0cca11b8cf854414738bd894de
Reviewed-on: https://gerrit.libreoffice.org/47884
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:02:40 +01:00
Ashod Nakashian
a3a8551f2d wsd: remove lastEditableSession flag
Maintaining a flag is problematic, at least the way
it was reset on adding new sessions. Luckily there
should be no reason for having it, since we should
check it only when removing sessions. Also, we
need to check for every case of removal, and not, as
was, just on disconnection, which is incomplete.

Change-Id: I878766701228c41fc93eeaff21852fa887de9eff
Reviewed-on: https://gerrit.libreoffice.org/47883
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:02:27 +01:00
Miklos Vajna
3a427d6249 wsd: static next to const int is not necessary
cost int is already compile-time.
2018-01-15 12:09:44 +01:00
Ashod Nakashian
d53ce5511d wsd: const and cosmetics
Non-functional changes.

Change-Id: I7c52386e2f870d29fd62c6dae6f37f4a58c2396b
Reviewed-on: https://gerrit.libreoffice.org/47882
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-15 08:06:56 +01:00
Michael Meeks
9335f6ff12 Warn if we exit with a modified document around.
Change-Id: Ie38ab49c66358f674e14820a6ffa993c25aa9e92
2018-01-12 16:17:12 +00:00
Ashod Nakashian
5f175c5120 wsd: save documents before recycling
Change-Id: I24afc5c1bceca272f23a129609f73fc5a8d3caf2
Reviewed-on: https://gerrit.libreoffice.org/47739
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-11 08:13:16 +01:00
Ashod Nakashian
59398af621 wsd: simpler and more efficient OOM killing
Change-Id: I118abdffba4e7ab57fe6a29a3a9fc420d871bdc0
Reviewed-on: https://gerrit.libreoffice.org/47738
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-11 08:12:09 +01:00
Ashod Nakashian
0d7e153643 wsd: limit how frequently we collect admin stats
These stats aren't free and here is little point
in either being hyper accurate in the timing nor
to allow admins to set nonsensical values (such
as a few milliseconds of interval).

We cap the interval to a sensible 50ms and reduce
some of the logging as well.

Change-Id: I66b4be99cf27d135ca267cb497a7a7d07ff437b6
Reviewed-on: https://gerrit.libreoffice.org/47737
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-11 08:08:30 +01:00
Tor Lillqvist
217636ed44 Drop meaningless "loolnb" word from a comment, drop two related #if 0 blocks
"loolnb" used to mean the concept of using non-blocking sockets back
when that was experimental proof-of-concept work in progress, but that
work has been merged in long ago and there is no neeed for the term
any longer.

Change-Id: I4c49b625fe8be8892b82115eaaa47bcba0f29500
Reviewed-on: https://gerrit.libreoffice.org/47699
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-10 13:01:26 +01:00
Michael Meeks
a1ee97c222 Add IPv6 support, and configuration option.
Default to listening on both IPv44 and IPv6 for public interfaces.

Change-Id: Ib04e3bf65e7dcf2a798d381297b15ee9c56e9259
2018-01-09 22:03:17 +00:00
Ashod Nakashian
b0fa4c33cd wsd: pass lambda args by value
These callbacks are executed on a different thread
and passing by ref is clearly invalid (and unintentional).

Change-Id: I02e5359594f912baf67028202e6262d74b5769eb
Reviewed-on: https://gerrit.libreoffice.org/47624
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-09 04:13:31 +01:00
Ashod Nakashian
94781ec6d9 wsd: log at trace level until first child is forked
Change-Id: I1b995b4714738f3bffd6dac58cf90ee6f1a32898
Reviewed-on: https://gerrit.libreoffice.org/47565
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-08 05:52:39 +01:00
Ashod Nakashian
040a211d60 wsd: set modified flag on the storage when set on the DocumentBroker
Change-Id: Ieb4eb02f68f2d02ad88d6f59ad61de8f1e309670
Reviewed-on: https://gerrit.libreoffice.org/47365
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-06 22:14:23 +01:00
Ashod Nakashian
57d535b15b wsd: lambda cleanup and better readability
Change-Id: Iabb850be7a7c162847514ee0fb600297accfcffb
Reviewed-on: https://gerrit.libreoffice.org/47364
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-06 22:13:50 +01:00
Ashod Nakashian
fb92fdb142 wsd: properly initialize members
Change-Id: I4cf10b57ab37a88383e9d2cc6408427df9acfb38
Reviewed-on: https://gerrit.libreoffice.org/47363
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-06 22:12:42 +01:00
Ashod Nakashian
37593072eb wsd: log some config values for reference
Change-Id: I5d3ea06de3253e5bfec3f9e6fed749f441f1a979
Reviewed-on: https://gerrit.libreoffice.org/47362
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-06 22:11:57 +01:00
Ashod Nakashian
d96cb94d02 wsd: set modified flag on the storage when set on the DocumentBroker
Reviewed-on: https://gerrit.libreoffice.org/47367
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 752e3b7002f2199438aa81d5b660088da3faac44)

Change-Id: I13e25b2edff33d6fd9999dec5eb34d7847fbbd2e
Reviewed-on: https://gerrit.libreoffice.org/47400
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit e9ce36f26ea3f007e00efbf9012bbbe8f93ccc9d)
2018-01-05 14:38:34 +01:00
Pranav Kant
9cbef14160 loplugin:nullptr
Change-Id: I5f0dc970e8522b63570faa0ba05ab19dd0f45d5a
2017-12-20 22:36:41 +05:30
Pranav Kant
f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Pranav Kant
0d4bc145ba Explicit is better than implicit; avoid invalid mem access
The form.get function is something like this:

const std::string& get(const std::string& abc) { return abc; }

passing a string literal implicitly gets converted to temporary
std::string whose reference is then returned and used. This causes
crash, atleast for me, on building online with GCC 7

Change-Id: I09d0aeea57a3dbeeefd1bb28ff645723714aa6b4
Reviewed-on: https://gerrit.libreoffice.org/46727
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 75c2147b7f774afccf55bb93f7fae79efb615361)
Reviewed-on: https://gerrit.libreoffice.org/46730
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-12-18 16:25:57 +01:00
Pranav Kant
53fc694a3c lokdialog: Use dialog close LOK API when user clicks 'X'
Change-Id: I3a90eb8b83688eed7db8228763633e31f82e58d1
2017-12-05 00:41:19 +05:30
Pranav Kant
849eb0d500 lokdialog: Adapt to LOK dialog API changes
Change-Id: I653304e71573eb253e09a72bc87d54b8554ba7ff
2017-12-04 22:13:50 +05:30
Marco Cecchetti
29a233e5a9 calc: set outline state
use a specific message from the client for set the visibility state of
a group instead of hijacking the update row/column header message

Change-Id: I69d66b30db0b4d8a0082cbd2524120491d4f97cb
Reviewed-on: https://gerrit.libreoffice.org/45446
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-12-01 01:10:43 +01:00
Jan Holesovsky
5032529cb9 Don't crash when ssl.cipher_list is not present in loolwsd.xml.
Change-Id: I3834550328ebd8627fc130c6ac2d0fccd2505311
Reviewed-on: https://gerrit.libreoffice.org/45525
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-11-29 20:07:40 +01:00
Pranav Kant
a19121bbbc Adapt to dialog API changes in LOK
... and bypass some unncessary DocumentBroker handling of dialog
messages.

Change-Id: I378dff7a9786479baaa43f5fde9d30f35bc7f948
2017-11-28 22:18:21 +05:30
Michael Meeks
92379ffbf2 Make the WSD SSL cipher list configurable.
Change-Id: If79b9efc9438cf0a2345b8e81385adafef63ce22
2017-11-22 15:55:03 +00:00
Michael Meeks
78398d4482 Move the Delta generator out into its own file.
Change-Id: I7f7553c292970b1a52879b6d6c14e67172022310
2017-11-22 15:55:03 +00:00
Tor Lillqvist
269ee2f0f5 Most distros should provide usable Poco packages by now surely
Drop the mention of /opt/poco as the place where to put a self-built
Poco as that seems to make some people think /opt would be a
recommended place to do a clone of the LibreOffice repository, too.
Which is a weird place for it.

Change-Id: I17543a915a7f9ea4716379283b0a51723d39b376
2017-11-20 18:32:07 +02:00
Jan Holesovsky
fc1680a253 Document UserExtraInfo.
Change-Id: Ibf73b20c4ec7271579d203564fc8f4594eb6e73b
2017-11-15 13:16:08 +01:00
Tor Lillqvist
0df65d2110 Bin accidental debugging printout leftover
Change-Id: I06f21d3facc39fcbf35a3516bb48136f8660a10f
2017-11-13 23:50:29 +02:00
Tor Lillqvist
7c77a6c3a3 Add handling of "prefilter" plug-ins
When the name of a document to be edited ends with an extension
matching that mentioned in a prefilter plug-in's configuration file,
the command specified is run and it is the output file that is
actually edited.
2017-11-13 16:27:53 +02:00
Tor Lillqvist
0831a94299 Add a "plug-in" mechanism
Look in the directory LOOLWSD_CONFIGDIR/conf.d (or pathname passed
with --config-dir option) for extra .xml files containing a Poco
configuration tree. These are not merged with the actual configuration
but kept separate. This commit does not yet actually use them for
anything.
2017-11-13 16:23:52 +02:00
Jan Holesovsky
61ce9c38e6 Save: Inform the user when saving has failed in LOK.
Change-Id: Ie3bcdf9f6ca898b2763c31e6eb05c3a20be5859f
Reviewed-on: https://gerrit.libreoffice.org/44399
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-10 11:08:53 +01:00
Jan Holesovsky
b20faa8bdc Save As: Advertise the correct size when uploading the new file.
Change-Id: I9b20c4bdb7ddc848437edceae1a77ddb49d55133
Reviewed-on: https://gerrit.libreoffice.org/44357
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-11-10 11:08:53 +01:00
Jan Holesovsky
513ffe36c1 Save As: UI for changing the document name.
Change-Id: I23aba95ff0f8d867b021ba3cf0a6bc5eb4754f9d
Reviewed-on: https://gerrit.libreoffice.org/44282
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-11-10 11:08:53 +01:00
Miklos Vajna
8568f47667 wsd: fix -Werror,-Wunused-private-field
Change-Id: I4522caa338d874628509f4382914b39406797da5
2017-11-10 09:45:03 +01:00
Pranav Kant
768b0c0404 Bin some duplicate 404 handling
Change-Id: Ibf3ed6c5558492b122662f25f31d321a6bbc151c
2017-11-10 12:35:45 +05:30
Pranav Kant
f1d78c7e62 lokdialog: send invalidate rectangle in dialog command
Change-Id: Iae00498a0ead1ee65dfce0332721e0d0fd2202fb
Reviewed-on: https://gerrit.libreoffice.org/44518
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-09 04:24:24 +01:00
Tor Lillqvist
4ab070ec38 Sort #include and using lines for consistency
... but did not have the time or energy to do it in all files.

Change-Id: I92ea101cae1ad7be0fd2f31ce5a8d4b4149332c9
2017-11-08 10:34:37 +02:00
Miklos Vajna
bb7ac21d44 Make sure that loop index type is never narrower than the length type
Change-Id: I19aac80850c0371085ca6364412d5ac9207220d0
2017-11-06 09:14:38 +01:00
Miklos Vajna
a3d6dee503 Remove unused strings
Change-Id: I621c462bca38222dcf26dfa1e414cf27e1a3e088
2017-11-03 15:25:09 +01:00
Tor Lillqvist
12aaff7d1a Bin some superfluous vertical whitespace
Change-Id: I770342c34c87e38597d5eb3695c432af69273ce1
2017-10-31 12:09:52 +02:00
Jan Holesovsky
bf1aa3326f Fix convert-to after the Save As work.
Change-Id: I1871dd8331367798ee42b2ca35505847b43b639d
Reviewed-on: https://gerrit.libreoffice.org/43881
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-10-26 17:52:55 +02:00
Jan Holesovsky
343c5bc690 tdf#99744 SaveAs: Extend test to check that the Save As result was sent.
Change-Id: I3788b87d2599c01000af97f496ee2b840c0cae3e
2017-10-26 11:11:38 +02:00
Jan Holesovsky
6745464c70 tdf#99744 SaveAs: Report back to loleaflet that the saveas succeeded.
Change-Id: I670c8b4503c1a4c0a88001a1343f6dec2974e044
2017-10-26 11:11:38 +02:00
Jan Holesovsky
6fe4484395 tdf#99744 SaveAs: Use X-WOPI-SuggestedTarget instead of X-WOPI-RelativeTarget.
And the correct encoding - UTF-7 (huh).

Change-Id: I6634fedb598c620128cc25a3e8fdc46e4096a756
2017-10-26 11:11:38 +02:00
Jan Holesovsky
7ff432a370 tdf#99744 SaveAs: Reimplementation of the PutRelativeFile going through Kit.
This is necessary so that changing of the file type works.

Includes a unit test.

Change-Id: Id01d44e555b6bac1002ff950de461fd330602f63
2017-10-26 11:11:38 +02:00
Jan Holesovsky
f4198526ca tdf#99744 SaveAs: Reverts parts of the previous Save As work.
It is necessary to go through the Kit when performing the Save As, so that we
can change the file type, sync with loading the file, etc.
2017-10-26 11:11:38 +02:00
Pranav Kant
6e86fefc4e tdf#99744: Check if params exist before accessing them
Change-Id: I5a36281f281b5d1fa4a8b7a3551ce1d49c2efaad
2017-10-25 13:22:02 -07:00
Pranav Kant
e9e162b35e lokdialog: Mouse/key events, canvas use & child window impl.
Change-Id: If8ae5c284e7166d4a01bd664644134f11197f988
2017-10-25 00:39:03 -07:00
Pranav Kant
de780f8253 lokdialog: wsd: first cut at lok dialog rendering api
Change-Id: Id522e0796428ed0a15ea3496e6726f51ed232e75
2017-10-25 00:37:41 -07:00
Miklos Vajna
7ab856b196 common, wsd: clean up redundant casts
Change-Id: Iad7e2417c6b1a154f6ad21839b841ca452e835c5
2017-10-24 09:23:54 +02:00
Jan Holesovsky
557479e288 More information about the support key state.
Change-Id: I0fb7792df3c0ba97497b7d9f5281640c40eb49a4
Reviewed-on: https://gerrit.libreoffice.org/43112
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-10-06 11:38:14 +02:00
Jan Holesovsky
783e3552c0 Support key logic in loolws + improvements in loolconfig.
To be able to set the support key directly from the command line, and to show
the option, etc.

Change-Id: Iac93bc47a6f4b9d5a5ad0ac8b06bda978e01b760
Reviewed-on: https://gerrit.libreoffice.org/43098
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-10-06 11:37:18 +02:00
Jan Holesovsky
c0fcd071d7 rlimits: Let's default to 0 when there's nothing in the config file too.
Change-Id: Ib99939a11d1e7cef112bf352b7c1dc6ac2d045c4
Reviewed-on: https://gerrit.libreoffice.org/43170
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 2d2398aa06c66d0a79178becf90b28fdcc20bdfd)
Reviewed-on: https://gerrit.libreoffice.org/43171
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-10-05 16:21:14 +02:00
Pranav Kant
6a73c19d16 Show save-as option based on CheckFileInfo params
If UserCanNotWriteRelative is mentioned in the CheckFileInfo response.

Change-Id: I33d2e21159b3e18ae88fd72f404f2d1d1d9b64e5
2017-10-03 20:58:36 +05:30
Jan Holesovsky
7f49b1eba6 PutFile ext: X-LOOL-WOPI-IsAutosave header to indicate autosave + unit test.
Change-Id: I65ed711dae5100467fe6ed9902bd7bad8c7f8d68
Reviewed-on: https://gerrit.libreoffice.org/43074
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-10-03 12:04:18 +02:00
Pranav Kant
3008342c57 Don't kill the process when debugging
Assume that when SLEEPFORDEBUGGER or SLEEPKITFORDEBUGGER is mentioned,
loolwsd is being debugged. In that case, don't set any timeout to exit
before first child is forked.

Change-Id: I2527f02187d8452ef6bebb70e1d750b5e796c4b6
2017-10-03 13:47:39 +05:30
Jan Holesovsky
f658067eaa Don't crash when the parameters are missing.
Change-Id: I96ace7ad7757e7e0c74dd9f361c78ecff6171a96
Reviewed-on: https://gerrit.libreoffice.org/42854
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-09-27 16:36:13 +02:00
Jan Holesovsky
5c604e9f78 PutFile ext: X-LOOL-WOPI-IsModifiedByUser header to indicate modifications.
Change-Id: I5d69903211045969d678df695717eae7452e7f04
Reviewed-on: https://gerrit.libreoffice.org/42852
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-09-27 16:36:02 +02:00
Marco Cecchetti
ee6e64528d wsd: support for FSIZE and NOFILE system limits
The routine for handling the configuration for the max file size
limit, was wrongly using NOFILE. Now we handle both limits correctly.

Change-Id: Ie8b63617286f66af6d4eb1b35b9e4f4b28f3c2a6
Reviewed-on: https://gerrit.libreoffice.org/42803
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/42811
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-09-26 17:40:31 +02:00
Jan Holesovsky
b57e38766a Document the 'access_header' WOPI extension.
Change-Id: Ie77501144344fc0503faf100b614e181cf722685
2017-09-20 14:17:33 +02:00
Michael Meeks
2c1508c309 Implement more reliable in-process short-cuts.
Change-Id: Icdfa71affad147c29df175ae687cbecc3f1f171b
2017-09-19 21:17:13 +01:00
Pranav Kant
7b4f734b32 Broadcast closing documents in same thread
... instead of handing it over the Document broker polling thread which
can lead to race conditions, and hence not giving desired behavior when
document is changed externally.

Change-Id: Ib0821d4ae931c357bc4d4c526865eefc090ddc23
2017-09-18 23:02:07 +05:30
Henry Castro
bccdd8d4d7 wsd: notify when the document is disconnected
Change-Id: I36e6df3c576ff0f02d3b059c2f1db4226d527b49
2017-09-17 10:37:48 -04:00
Henry Castro
2556c2b441 wsd: debug: log when the wsd is ready to accept connections
Change-Id: I56ea17af47bc85f30e74f5e93b94e0f3f3d95be4
2017-09-13 17:02:26 -04:00
Miklos Vajna
bcb5b744b8 net, wsd: fix -Werror,-Wdelete-non-virtual-dtor warnings
Two problem types:

- non-final class has virtual functions but no virtual dtor -> mark the
  class final
- abstract class has no virtual dtor -> add a virtual dtor

Change-Id: Iae208b65c774e6da7a3dda5e725fe07d4d589e4f
2017-09-12 10:03:32 +02:00
Michael Meeks
5c879a17b2 Count key-strokes, and report per session.
Change-Id: Id661fc15d4a75e322024ce62d24b2d7dae8f256a
2017-09-11 19:00:10 +01:00
Marco Cecchetti
dee39a562c support for rendering a watermark on each tile
Change-Id: I3edccac49a3bcd3d2493d8d7ef3a1ae29307e727
Reviewed-on: https://gerrit.libreoffice.org/41898
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-09-07 17:28:44 +02:00
Jan Holesovsky
f7c199684c WOPI extension: DisableInactiveMessages to avoid showing message when dimmed.
Change-Id: I925602295dde95611ab1a6565dd7266460769a50
Reviewed-on: https://gerrit.libreoffice.org/41709
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-08-29 19:44:33 +02:00
Pranav Kant
29db4b447f admin protocol: 'total_mem' -> 'mem_consumed'
total_mem can be confused with total system memory or total memory
availabe to loolwsd process. Change the API to say what it actually
returns.

Change-Id: I55c246b8a1d0c5c52767520150e55616266a6d4f
2017-08-29 12:12:13 +05:30
Pranav Kant
65e3f7c7df admin: expose total available memory to admin clients
Take into reckoning the memproportion config value for total available
memory to us.

Change-Id: Ib93c88d746268f3e9f566beed7df77357d530eba
2017-08-29 12:12:08 +05:30
Pranav Kant
ad211ef51b wsd: Configurable autosave and idlesave durations
But these save conditions are checked every 30 seconds only, so setting
them to less than 30 seconds wouldn't mean that save will be triggered
anytime sooner.

Change-Id: Id473a79af6a3170c72e372040460f2b7c15f150e
2017-08-24 16:54:15 +05:30
Pranav Kant
da4fe86b82 wsd: Do not throw when cannot save local file out of jail
Change-Id: Ie155823536694facb8bfcfe49f6386a7fc845689
2017-08-22 19:50:19 +05:30
Pranav Kant
a9522f38aa wsd: Notify forkit conditionally about rlimits
No need to notify the forkit very early when loolwsd is initializing and
forkit pipes are not set. Forkit is notified of rlimits anyway
explicitly in the URL when it is initialized; no need to try to
initialize it again.

Change-Id: I9fde13e42f6e6393da7cf245ed979538d715319a
2017-08-21 20:06:11 +05:30
Pranav Kant
b0ad8874dc wsd: don't write until forkit write pipe is ready
Change-Id: I95439e8e77dc308d993b07ccbd273228f755ce14
2017-08-21 20:06:06 +05:30
Pranav Kant
769e41dfb2 Fix build
Mismerge. There is no session->getAccessToken now

Change-Id: I4d8f2cc612cbd39b3163bcdbba5df8ea5d732774
2017-08-18 07:14:33 +05:30
Aditya Dewan
c3711a4375 Extending WOPI implementaion to introduce 'Save As' feature
Change-Id: Ic4c80f4c4b54944143682c25a5878c1336787b27
Reviewed-on: https://gerrit.libreoffice.org/40946
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-08-17 19:25:44 +02:00
Pranav Kant
10bfd18e97 Decode the headers before creating Authorization object
Change-Id: I0da0b4112ac46d2407d2cd308b21ee1dee9d68de
Reviewed-on: https://gerrit.libreoffice.org/41258
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-08-17 17:15:12 +02:00
Jan Holesovsky
a3a3d0ad6c Fix various nitpicks.
Change-Id: I41fe795bc1ea7c73527c7e1183de7098517bad7a
2017-08-17 14:05:22 +02:00
Jan Holesovsky
f8ca17278f access_header: Pass the access_header around + unit test.
Change-Id: I5d6d93e289d8faceda59deae128e8124a0193d95
Reviewed-on: https://gerrit.libreoffice.org/41243
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-08-17 13:41:07 +02:00
Jan Holesovsky
afcfac4bef access_header: Infrastructure for providing custom headers for authentication.
Change-Id: I52e61dc01dbad0d501471e663aaf364d9bc23c52
Reviewed-on: https://gerrit.libreoffice.org/41223
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-08-17 13:40:57 +02:00
Tamas Bunth
a37d5789e0 Log missing cache on standard error too 2017-08-16 12:09:09 +02:00
Pranav Kant
ef54b6ea16 wsd: Ignore useractive, userinactive when doc is not loaded
Sometimes client sends a userinactive message while the document is
already being loaded, which leads to the kit process skipping sending
the result of LOK callbacks to the client.

Handling this in child session is futile in the case when userinactive
message is sent when the document is being loaded, since kit process
handles the 'userinactive' message only after document is loaded (i.e
isLoaded() returns true). Moving this handling to DocumentBroker will
take care of both the cases - when 'userinactive' is sent before load
starts, and during load of the document.

Change-Id: I4ea3ac7b184d2ca373eb3ff4fb7b4ae394d454df
2017-08-11 23:27:17 +05:30
Jan Holesovsky
894c5f2cc2 Warn more about missing capabilities, and advise what to do on SLES11.
Change-Id: I93587db6fa32c1c505877c20857799be71ee162f
2017-08-10 11:12:24 +02:00
Jan Holesovsky
cef217ea24 wsd: Fix the OAuth unit test.
Trying to combine the Poco's http server together with our polling loop leads
only to problem; so instead let's introduce a hook where we can do the WOPI
serving directly in the unit test.

Change-Id: Id3fec6ff93c3ad652aa4e0fc6309c5b7639728cb
2017-08-09 22:27:49 +02:00
Jan Holesovsky
a59598050d convert-to: Set the mimetype in the responses.
Change-Id: Ib8dcad5f81499aec0ba147a3a4ef0b7a30995bcc
2017-08-07 11:33:08 +02:00
Jan Holesovsky
beffd4967a convert-to: New features in the convert-to functionality.
* Add possibility to omit the 'format' parameter
* Allow it even when the 'file' storage is disabled

Change-Id: Ib8dcad5f81499aec0ba147a3a4ef0b7a30995bcc
2017-08-07 11:32:10 +02:00
Henry Castro
a262b7d7ba wsd: OAuth token passing
MS-WOPI:
"The following HTTP header MUST be included in all WOPI requests."
"Authorization "Bearer" and <token>"

Change-Id: Ie5327286e93b86a49a0248ff5886bf3ea99df768
2017-08-03 17:11:00 -04:00
Andras Timar
945d74c237 wsd: fix compilation with old OpenSSL that does not have PKCS5_PBKDF2_HMAC()
Change-Id: If48641f6cbcc4d4ded78ea5cc9c9f66063a2ac0a
Reviewed-on: https://gerrit.libreoffice.org/39779
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-07-31 19:40:37 +02:00
Jan Holesovsky
92cdab8bf8 discovery: Make the unknown file extensions read-only.
Change-Id: Ie1467334868a7e4aa31aa69f67d0cd434ed18e7b
Reviewed-on: https://gerrit.libreoffice.org/40083
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-07-17 20:05:27 +02:00
Pranav Kant
160c1f555a Save unsaved documents when memory consumption is high
These saved documents are then removed to free some memory when next
memory cleanup is triggered in the admin loop.

Change-Id: Ia789a65dc204b546f1d3627a8006c4590bdca371
2017-07-11 17:51:47 +05:30