Commit graph

5677 commits

Author SHA1 Message Date
Marco Cecchetti
afe8e9d245 loleaflet: broken shortcut for comments
Change-Id: I08eae6a1ba5c22f863f73a2625803f1b38e6e415
Reviewed-on: https://gerrit.libreoffice.org/37713
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-05-17 16:23:55 +02:00
Pranav Kant
1717bfbc0b Silence -Werror=unused-parameter in non-debug builds
Change-Id: Ib4c91e52d4ac78b3bafe3d078e41c79b50ca87a8
2017-05-17 16:43:31 +05:30
Pranav Kant
8a02e7a8fa wsd: Debugging environment vars to debug storages
Also, extend the LOOLProtocol::tokenize to accept a custom delimeter.

Change-Id: I7f789e703c5c8d2ad325b3dd149ba888c722f5f3
2017-05-17 16:30:33 +05:30
Pranav Kant
1449d81671 wsd: Don't filter out 'save' command
Fallback from 1cb75cbcb8

Change-Id: I47c8a470e5f4ab4d48859365d4435ae79c5fa82d
2017-05-17 10:29:53 +05:30
Ashod Nakashian
ec2fd0844f wsd: use WOPI host instance ID to support hostname aliases
The docKey creation moved to Storage where we first
invoke WOPI (if/when it's a WOPI-hosted doc and WOPI enabled)
and see if the user has access to the document at all.
If they do, we expect the server to give us a
unique ID to use for identifying the host regardless
of hostname aliases.

If a unique ID is not returned (i.e. empty or missing)
we use the hostname and port in its place as fallback.
This will break hostname aliases, but it will still work.

Change-Id: I407b0087395f9df6ad9cc6e037570487999be4a4
Reviewed-on: https://gerrit.libreoffice.org/37697
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-17 04:18:31 +02:00
Aditya Dewan
f94b42d9a8 tdf#107762 admin-console: memory graph in 'Analytics' tab now working
Change-Id: I6a0ee82e813e80344eaf6ddb7d46eebed98ca5bb
Reviewed-on: https://gerrit.libreoffice.org/37672
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-16 17:52:53 +02:00
Marco Cecchetti
2b8fc61dde loleaflet: impress: comments that are being modified are shown twice
Reworked handling of annotation layout. Now it behaves more like
writer annotations.

Now scrolling up annotations leads to scrolling the current slide too
when it is required in order to show not visible annotations.

Moreover the top visible annotation is now remembered for each slide,
and when the top annotation is not the first one, a bit of the bottom
of the previous annotation is showed so that the user gets aware that
there are more annotations above.

Change-Id: I3d087a8db35143a5e3abcd3e95e5e612d7638891
Reviewed-on: https://gerrit.libreoffice.org/37628
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-05-16 16:12:54 +02:00
Marco Cecchetti
ef5376197e Loleaflet: Fix for row/col headers and annotation marks on tab switching
Change-Id: Id0f52603af7eaa49979f68d222c9c94e79cf65b1
Reviewed-on: https://gerrit.libreoffice.org/37251
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-16 13:21:22 +02:00
Marco Cecchetti
647556b442 loleaflet: misplaced comment mark on inserting/deleting/resizing row/col
Change-Id: Ib95870905d1bfc613ba454c7126501b3533e4ba5
Reviewed-on: https://gerrit.libreoffice.org/36982
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-16 13:20:47 +02:00
Pranav Kant
1cb75cbcb8 wsd: Save wrapper over .uno:Save
Document broker needs to know when the save request is sent and when the
save finished. It uses these parameters to avoid shutting down document,
in the document broker main polling loop, if save is already going on.
But direct .uno:Save commands issued from
loleaflet precludes document broker to keep track of it - in this case a
.uno:Save command issued from loleaflet followed by closing the
session will prevent saving the document to storage, if document is huge
enough and LO core takes a bit of time to save it. A save wrapper
command, 'save', ensures that document broker is aware of all such save
requests (_saveRequestTime member variable) and doesn't close the
document until we completely save it (to storage and other cleanups).

Change-Id: I5ec73d45adff23b2e7543e93dfd0624a5e5af46d
2017-05-15 11:41:52 +05:30
Ashod Nakashian
47c01440ba wsd: logs
Change-Id: I286c4c7415b114f51f3258bd6d50f8e103ea6c75
Reviewed-on: https://gerrit.libreoffice.org/37611
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:14:55 +02:00
Ashod Nakashian
6e63c80763 wsd: handle WOPI access failure
Show the user that authorization failed.

Change-Id: Iad63c11ac2033eee80062ecd43dff76f776924c3
Reviewed-on: https://gerrit.libreoffice.org/37610
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:14:30 +02:00
Ashod Nakashian
484fcd63a5 wsd: corrections to replace and unittests
Change-Id: I0e03deaa710ba722a97c9f857b514f8ecb0e1682
Reviewed-on: https://gerrit.libreoffice.org/37609
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:13:21 +02:00
Ashod Nakashian
7cff4fb08a wsd: fix server shutdown
Thread-affinity checks must be inhibited
not just on Socket, but on the SocketPoll as well,
before destroying DocumentBroker instances.

Also, properly initialize the inhibit statics.

Change-Id: I2ced1554d477f0c3faf09bda74034cbae99e4ce1
Reviewed-on: https://gerrit.libreoffice.org/37608
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:10:31 +02:00
Ashod Nakashian
d267b86bbd wsd: include version in http agent strings
And move the WOPI agent string to Common.hpp.

Change-Id: Ife679705bcd6914ddd45ad50446e690fb22dd317
Reviewed-on: https://gerrit.libreoffice.org/37607
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:10:06 +02:00
Jan Holesovsky
95e892168c wsd: When connecting new sessions, always use the original URI...
...but in combination with the appropriate session's access_token to always
authenticate against the same instance of the WOPI host.

Change-Id: Ic94dfa8fcb226a2d134272b22edc1f8f76c24e34
2017-05-12 18:07:23 +02:00
Ashod Nakashian
a15e32137f extend discovery.xml with pdf and image formats
Change-Id: I201eb276b4de29239c7dd99954abcc39e6027aff
Reviewed-on: https://gerrit.libreoffice.org/37430
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-12 06:49:33 +02:00
Michael Meeks
473c511cc0 DumpState: include SSL & termination settings.
Change-Id: I14d1d79d5ab1650661c493d8965cf41ac84c17c1
2017-05-12 03:06:49 +01:00
Michael Meeks
29b92444b1 Stream dumpHex output to an output stream.
Also output debug directly to stderr to avoid std::cerr re-direction.

Change-Id: Ib2a0eaa3514ef88d7fe8d8fbb3706925aabf3346
2017-05-12 03:06:49 +01:00
Marco Cecchetti
024e786e85 calc: added an address input field
Change-Id: Ic030724e392693847a195b5e53866b40ebad7435
Reviewed-on: https://gerrit.libreoffice.org/37359
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 17:55:23 +02:00
Ashod Nakashian
954a37a06c Configurable timeouts
Timeouts to dimming the doc in the browser
are now configurable from WSD and is relayed
to loleflet as expected.

Out of focus timeout is now 60 seconds.

Change-Id: I8452e30976f6a81b0c3bb3ba5774daa244c1640c
Reviewed-on: https://gerrit.libreoffice.org/37489
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 08:01:30 +02:00
Pranav Kant
e8ff268992 wsd: Use hostname and port in doc key too
... to avoid different WOPI hosts using same loolwsd instance sharing a
file because the path of the file (file id etc.) is same in both of
WOPI hosts.

Though, having hosts + port in doc key engenders the possibility of
opening the same file as two if the WOPI host is accessed using
different aliases but that is much less of a concern than security bug
mentioned in previous paragraph.

Change-Id: Iaa2f880edce952925a85e56ed8eba99514e19751
Reviewed-on: https://gerrit.libreoffice.org/37400
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-10 17:02:47 +02:00
Jan Holesovsky
25224666a7 Revert "Implement File -> Download As -> Plain text (.txt)."
Actually it is enough to do Ctrl-a Ctrl-c, no need to have a special Download
As -> Plain text.

This reverts commit 1c13d5523f.
2017-05-10 15:01:01 +02:00
Jan Holesovsky
6d8aa453ab wsd: Handle a non-empty, but broken frame ancestor with 'deny' too.
Change-Id: I61b6e5c7cbe7f36ecd780865a613b7a240cf7b99
2017-05-10 14:46:21 +02:00
Michael Meeks
495d6da532 Reset ownership before executing the socket move.
Change-Id: I98532e59ef9c78a6cc1eb25a5a8535c4e2d9b15d
2017-05-09 13:02:23 +01:00
Pranav Kant
4e8a8d6aad loleaflet: Stop ignoring on scrollEnd only; call map.scrollTop to sync
Change-Id: Ic126b60a121cc6959b31ef5533a85e902d58c141
2017-05-09 15:35:50 +05:30
Michael Meeks
1fc176fb05 Restore some clean exists during requests - avoiding exceptions.
Change-Id: I89bb82f85341fcd87daf34d19f30031d1c6d1366
2017-05-08 13:15:44 +01:00
Pranav Kant
624fc5c5de wsd: Use HTTP Referer and then WOPISrc for frame ancestor
This is required in those setup where the document is not served from
the same host user is currently connected to. Use the Referer[sic]
header to set the frame ancestors and if they are absent, fallback to
WOPISrc value provided by the WOPI host.

Change-Id: Ia63a213d10aca2df56a2884e07322c1cd8056ff8
2017-05-08 15:32:43 +05:30
Michael Meeks
0088c14850 Allow env-var to affect serving from the FS only in debug mode.
Change-Id: I5e5d176295807af4de3e802ca02a0e1a1c17646e
2017-05-08 09:51:28 +01:00
Ashod Nakashian
3aec6e1227 wsd: build fix due to merge error
Change-Id: Ib1d7ce1b880c71b0b2fd8262a92e7e965211653e
Reviewed-on: https://gerrit.libreoffice.org/37375
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 05:23:46 +02:00
Ashod Nakashian
7d823787bb wsd: configurable idle document timeout
When a document is idle (no activity from
any views) for this timeout duration, the
document is saved and unloaded to minimize
resource consumption.

Change-Id: If6f09136ae40c7e84180fc8c8adbf6db8396d292
Reviewed-on: https://gerrit.libreoffice.org/37374
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 05:00:56 +02:00
Ashod Nakashian
f9ee1c6150 loleaflet: configurable dimming timeout and fire event
Two timeout are now configurable.
idleTimeoutSecs, which controls when to dim because
of user inactivity, even if the tab is in focus.
outOfFocusTimeoutSecs, which controls when to dim
when the tab loses focus.

Currently they are set to 15 minutes and 30 seconds
respectively by default.

User_Idle event is now fired on dimming.

Change-Id: I894f6df44825b6814872f1c4986fab8dcd4d6cef
Reviewed-on: https://gerrit.libreoffice.org/37373
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 04:59:52 +02:00
Ashod Nakashian
9798eafb8c wsd: random jail paths instead of pid
Jail paths are now generate from a PRNG
instead of using the PID of the kit process.

The PRN is converted to base-64 and used
as the directory name where a given
kit is jailed.

Change-Id: I8e4bc35d9ccdfdae0e542ab707c417cd29ad52f3
Reviewed-on: https://gerrit.libreoffice.org/37372
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 04:59:12 +02:00
Ashod Nakashian
7633525904 wsd: correct the name of testDisconnectMultiView in output
Change-Id: Ibfcee83825bf8f48e635d93061bf4fd1306a95fc
Reviewed-on: https://gerrit.libreoffice.org/37371
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 04:52:39 +02:00
Ashod Nakashian
f062b2058e wsd: use fast tokenizer
Change-Id: I477bac24a5e944ce3d747db6e694f2766b44c7f3
Reviewed-on: https://gerrit.libreoffice.org/37370
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-08 04:52:23 +02:00
Michael Meeks
c04e4ffa16 loolnb - kill obsolete test app.
Change-Id: I5943cc0752f16d62d6eedf96351bb6f71a2311e6
2017-05-05 18:53:00 +01:00
Michael Meeks
9e45fb30d7 SocketDisposition: push it down the stack, and cleanup around that.
Dung out overlapping return enumerations. Move more work into 'move'
callbacks at a safer time, etc.

Change-Id: I62ba5a35f12073b7b9c8de4674be9dae519a8aca
2017-05-05 18:37:26 +01:00
Jan Holesovsky
1c13d5523f Implement File -> Download As -> Plain text (.txt).
Change-Id: I446f73a3110312cbaab1ce1053aee854b421e71c
2017-05-05 18:24:23 +02:00
Pranav Kant
052dec41be wsd: New environment variable to not serve from memory
Its quite time consuming having to restart loolwsd everytime you make
changes in loleaflet.

Change-Id: I5cc8c5af96e758309d21598c0f23fad9082130bd
2017-05-05 15:24:21 +05:30
Jan Holesovsky
21192c4306 Generate the l10n json files only when the appropriate po's change.
Change-Id: I17c0f022775ec631e6493ba81fa41752f6841188
2017-05-05 11:28:26 +02:00
Andras Timar
7c637d9b8a add loolwsd documentation to distribution
Change-Id: I18ebfff9eb4a87abd311086d6780514293ce6c7a
2017-05-04 11:54:33 +02:00
Pranav Kant
e032cb72fa tdf#106447: Support checked items in menubar
Bin the internal command state recorder to Menubar and use the global
state recorder available in the map.

Change-Id: I32e81700e38c2d544b2d874e6a30fbe58e8d43bd
2017-05-03 21:21:28 +05:30
Pranav Kant
ffaf424103 loleaflet: Store state change handlers in new stateChangeHandler class
... instead of having this logic in our toolbar. All the elements like
menubar or toolbar can then use the map store to see the value of last
state change event for any particular uno command. We will be using it
when menubar starts using this store.

The frivolous logic in toolbar of reading the value of last uno command
should be removed. We don't expect loleaflet to change the permission
dynamically after loading the document anymore. But for now, just change
it accordingly and defer the task of removing it when we refactor
loleaflet codebase to trim our permission model (remove the 'view'
mode).

Change-Id: I1be54a62e96179b7db3f61470a92e3ddc745f52d
2017-05-03 21:21:22 +05:30
Andras Timar
2de986cdcc typo: loowsd -> loolwsd
Change-Id: Ia9febfbceae101f24c41ef8921b7cf41f02dfce3
Reviewed-on: https://gerrit.libreoffice.org/37187
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-05-03 10:20:26 +02:00
Jan Holesovsky
2a2d863321 Fix build with older kernel versions.
Change-Id: I28fc6687a42ac428413d644e9fd55870cd5936fa
2017-05-02 17:24:44 +02:00
Pranav Kant
163e04af0b Make admin l10n work again
The localization.json file contains path like 'l10n/lang.json' which
means path relative the html file being accessed. This works when we
access .../loleaflet.html but not so when we access .../admin/admin.html because
then it tries to access .../admin/l10n/lang.json while it should look for
this file one directory up. One could think to change the paths in
localization.json file to something like '/loleaflet/dist/l10n/lang.json' so
that same path is accessed always for loleaflet UI as well as admin, but
it has repercussions that we access l10n data always using 'dist' prefix
and not using git hash, so browser caching the l10n data across multiple
versions.

Ideal would be to split the admin localization completely from the
loleaflet-ui localization. No point in fetching whole of the loleaflet
localizations strings when we are only accessing the admin console. This
would also solve problem mentioned previously.

For now, just split the admin localization file only while still
allowing admin console to fetch the same l10n files.

Change-Id: I0824fb05b9b4123b58d6fd8edafb374ee7128229
2017-05-02 19:52:47 +05:30
Marco Cecchetti
7aeb66be88 loleaflet: Calc, Impress: should not show Reply entry in annotation menu
There is no `reply` support in Desktop for Calc and Impress comments.

Change-Id: I827ae99148cf8f65446e23e13e2588ce0ced788e
Reviewed-on: https://gerrit.libreoffice.org/36979
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-02 15:03:48 +02:00
Pranav Kant
e713b843a0 lolefalet: Animate all annotation elements, not just selected
Change-Id: I5b597b057e5f26e79b4db7aa3b4b5733c34914cf
2017-05-02 14:17:18 +05:30
Ashod Nakashian
6d80d669c6 wsd: unittest to reproduce rendering issue in Calc
The following scenario causes rendering failure
where blank tiles are returned in CP-5.3.

1. Load doc where the cursor is saved to a top cell.
2. Page down to grow the document rows.
3. Render tile at last row.
4. Load a new view to the same doc (do nothing else).
5. Render same last-row tile, now it's transparent.

Change-Id: I8f7caf61a7d221d1ccf56762b1e609de987976c5
Reviewed-on: https://gerrit.libreoffice.org/37132
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-02 06:14:33 +02:00
Ashod Nakashian
7b9e949adc wsd: add test helper to get server version
Change-Id: I14ce574d4593d845f6621b447a678f2c4bbe29ac
Reviewed-on: https://gerrit.libreoffice.org/37131
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-02 06:13:08 +02:00