Commit graph

1844 commits

Author SHA1 Message Date
Ashod Nakashian
e0b14c0e22 loolwsd: give Broker the docKey, not URL
And reject connections with no doc URL.

Change-Id: I11490be6aaea6a4ca2d66d8d2c8d6b52e1e48a04
Reviewed-on: https://gerrit.libreoffice.org/23225
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:17:04 +00:00
Ashod Nakashian
c42ea2ea13 loolwsd: avoid complaining when killing exited child
Change-Id: If819cc2171d241d9e059f2b563cc8f6b8161d304
Reviewed-on: https://gerrit.libreoffice.org/23224
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:16:07 +00:00
Ashod Nakashian
f2eec85b2a loolwsd: jailId ought be random, but must be PID
Ideally, we will have a randomized path for the jails.

Unfortunately, this will make it harder to cleanup
after an ungraceful exit of a child, including recovery
of docs etc.

Having a PID for the jailId makes this issue easier by
implicitly implying the jail path for a given child.

To prevent security leaks, we should at least randomize
the doc directory within the jail, as such:

/chroot/<pid>/user/docs/<rand>/

For now we use jailId=pid=rand.

Change-Id: I948fba0aaef725c9c059780df0a184a86569d898
Reviewed-on: https://gerrit.libreoffice.org/23223
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:15:04 +00:00
Ashod Nakashian
29e9ba68c3 loolwsd: removed unnecessary childId, which is in the child URL
Change-Id: Ibea2cd73657446ad4660400a0a9a38b376499df5
Reviewed-on: https://gerrit.libreoffice.org/23222
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:14:43 +00:00
Ashod Nakashian
1aa7a6cf05 loolwsd: simplified DocumentBroker::create
Change-Id: Ia97be0861c7c178859d695ae5e2862e88cb3ca77
Reviewed-on: https://gerrit.libreoffice.org/23221
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:14:11 +00:00
Ashod Nakashian
0b18a67da2 loolwsd: DocumentBroker cleanup
Change-Id: Iedf2e0afd3c63d24b96ce1c7923c90d86d82bc13
Reviewed-on: https://gerrit.libreoffice.org/23220
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:13:53 +00:00
Ashod Nakashian
38c4acd5f0 loolwsd: moved document loading outside of MasterProcessSession
Change-Id: I8ecce82abcae6d0f07b86c188c91913ff9ca115a
Reviewed-on: https://gerrit.libreoffice.org/23219
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:13:37 +00:00
Ashod Nakashian
c6b47cc437 loolwsd: removed superfluous getJailPath
Change-Id: Iff11ea791866f31a47cf0d0b1d1fb06d18f5be40
Reviewed-on: https://gerrit.libreoffice.org/23218
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:13:02 +00:00
Ashod Nakashian
c0cf48f5ac loolwsd: jailRoot moved in DocumentBroker
Change-Id: Ic9dfce0cb0f2f87fae9a918df500c89673f15716
Reviewed-on: https://gerrit.libreoffice.org/23217
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:11:47 +00:00
Ashod Nakashian
bb16272e11 loolwsd: DocumentStoreManager -> DocumentBroker
Renamed DocumentStoreManager to DocumentBroker and
restructured the handshake process.

Currently, at first client connection to a given doc
a DocumentBroker is created to serve as the clearing house
of all client-side activities on the document.

Prime goals is loading and saving of the document, but
also to guarantee race-free management of the doc.

Each doc has a unique DocKey based on the URL (the path,
without queries). This DocKey is used as key into a map
of all DocumentBrokers. The latter is shared among
MasterProcessSession instances.

Change-Id: I569f2d235676e88ddc690147f3cb89faa60388c2
Reviewed-on: https://gerrit.libreoffice.org/23216
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:10:08 +00:00
Ashod Nakashian
8ef45a975e loolwsd: child URI now includes docKey
Change-Id: I62b91fee98fd853c84c3c5cbb48e65e5c9788ef0
Reviewed-on: https://gerrit.libreoffice.org/23215
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:09:14 +00:00
Ashod Nakashian
8d108a03b8 loolwsd: childId -> jailId
Change-Id: I56af542e6cf1d9cfd493b5033441d2c6a9edee2f
Reviewed-on: https://gerrit.libreoffice.org/23214
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:07:00 +00:00
Ashod Nakashian
019aed134e loolwsd: using random jailId
Change-Id: Ie9501e4346a124994270ca1fac61869ed04b9b72
Reviewed-on: https://gerrit.libreoffice.org/23213
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:06:29 +00:00
Ashod Nakashian
64d2ff98b8 loolwsd: document saving and restructuring
Change-Id: Ia4c644d07a16ba5284e9cdfaf7b838134fbf640b
Reviewed-on: https://gerrit.libreoffice.org/23212
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:06:13 +00:00
Ashod Nakashian
1268507bf0 loolwsd: child WS URL format changed
The current format is more flexible and standard.

/loolwsd/child?sessionId=xxx&jailId=yyy

The sessionId is the client-specific connection ID (which
 is originally passed to the child via the Broker.

The jailId is the PID of the child.

Change-Id: I69c88e84114f9678addf795896ca2da15ca1221b
Reviewed-on: https://gerrit.libreoffice.org/23211
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:05:38 +00:00
Ashod Nakashian
2a11e1840a loolwsd: improved creating kit sessions
Change-Id: Icc49dc37296fcc87928fc5d4fa4a6a18c3413deb
Reviewed-on: https://gerrit.libreoffice.org/23210
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:04:56 +00:00
Ashod Nakashian
0d8fcf5699 loolwsd: logging
Change-Id: I9a4dc248aca87983e3d7d3ace0071e5bbf92e688
Reviewed-on: https://gerrit.libreoffice.org/23209
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:04:17 +00:00
Ashod Nakashian
52d9e2033c loolwsd: improved WopiStorage with working PutFile
Change-Id: I2bba701ca0c89783851757e91e9336a64f6f6c52
Reviewed-on: https://gerrit.libreoffice.org/23208
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:03:30 +00:00
Ashod Nakashian
e014b0b22f loolwsd: Storage passed to DocumentStoreManager
Change-Id: Ifa7787dea5f558f166d02467c253375df88ae408
Reviewed-on: https://gerrit.libreoffice.org/23207
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:02:23 +00:00
Ashod Nakashian
f1007266e1 loolwsd: DocumentStoreManager shared by MasterProcessSession instances
Change-Id: Id7ada60387cafdf742690dbf345bb1e703b2ca76
Reviewed-on: https://gerrit.libreoffice.org/23206
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:01:48 +00:00
Ashod Nakashian
9bf88691c6 loolwsd: DocumentStoreManager maintains Storage instance
Change-Id: I0c86a7a7a3bb8d52a3f83570ccb4eded42ef4090
Reviewed-on: https://gerrit.libreoffice.org/23205
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:01:07 +00:00
Ashod Nakashian
73bde2b5d2 loolwsd: moved DocumentURI into own file and renamed to DocumentStoreManager
Change-Id: I5948ae532f0fd5917b99369733ec5ea36da2e437
Reviewed-on: https://gerrit.libreoffice.org/23204
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:00:35 +00:00
Ashod Nakashian
0ee9119bc7 loolwsd: refactored DocumentURI creation
Change-Id: Icc1043fdc717f057c97d2b00a5cfc399ee15aa79
Reviewed-on: https://gerrit.libreoffice.org/23203
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 02:59:49 +00:00
Ashod Nakashian
ce702f72e8 loleaflet: pass doc URI to WebSocket
Change-Id: I782961ac52705ac0f677f5ee553d2e123b8707d0
Reviewed-on: https://gerrit.libreoffice.org/23202
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 02:58:56 +00:00
Pranav Kant
7197dab029 loleaflet: Fix lint errors
Change-Id: I4023c81cad92b6f617076b39d3cdbe34e231ede3
2016-03-13 19:40:53 +05:30
Pranav Kant
8519a6a462 loleaflet: Support for memory subscription
Library for creating graphs: D3.js
License: BSD
Currently only being served by a CDN, not copied into the source
tree.

Change-Id: Ib99ec9011da489fc42799c3610612a8c3c8e5c2b
2016-03-13 19:40:52 +05:30
Pranav Kant
ea29196fed loolwsd: Periodic memory usage subscription
By default, queries and stores the total memory usage in
AdminModel every 5 seconds, and caches the last 100 such values.
Both cache size and interval can be changed by simple commands
from the clients.

Change-Id: I86cf8228d0129dc8aab0a03856c12dfeb240b169
2016-03-13 19:40:13 +05:30
Pranav Kant
d0006ae5d8 loolwsd: Wait for client threads to finish
Well, it was already there.
e7f75a3e56 was though correct
introduced it again. Remove duplicate such call.

Change-Id: Iddacbee53aaec58340db489e7830af75354aee34
2016-03-13 19:37:08 +05:30
Pranav Kant
2c3739bdc2 loolwsd: Fix a memory leak
Change-Id: I9a48c2846f74cb7cee8430dd4e72ba0580a7e7f2
2016-03-13 01:09:52 +05:30
Jan Holesovsky
ca4f44099f Revert "loleaflet: pass doc URI to WebSocket"
With this, no document loads.

This reverts commit 081ca0aa9f.
2016-03-11 17:18:26 +01:00
Pranav Kant
aa806f0ec3 ccu#1329: This is not a map, this is libreoffice
... so by selecting and dragging the mouse we do not intend to
look closer what is there, which is an expected behavior for
maps, but doesn't fit well for us.

Change-Id: Ib7e838038fff9310e40912f251cb89c7eb0baaee
2016-03-11 20:08:01 +05:30
Henry Castro
2e49729ff4 loolwsd: coding style minor correctness 2016-03-10 15:42:01 -04:00
Jan Holesovsky
e10e155f72 loleaflet: Document the .uno:SortAscending and .uno:SortDescending. 2016-03-10 20:26:06 +01:00
Miklos Vajna
f6cae2ee2c loolwsd: fix -Werror,-Wshadow 2016-03-10 17:17:32 +01:00
Jan Holesovsky
db1adc643a loleaflet: Update Table of X (Content etc.) related commands. 2016-03-10 16:21:00 +01:00
Jan Holesovsky
f76206258e loleaflet: Add commands for handling table rows / columns in presentatios. 2016-03-10 15:28:16 +01:00
Jan Holesovsky
713987a9aa loleaflet: Add missing .uno: prefixes. 2016-03-10 13:34:31 +01:00
Jan Holesovsky
7882fb34a8 loleaflet: Document .uno: command to change layout of the current slide. 2016-03-10 13:33:54 +01:00
Pranav Kant
3731f0c0d7 loolwsd: Avoid unnecessary copying
Change-Id: Iff888e5ff4577f20fae63a7b62ab1481ea2d71ed
2016-03-10 18:01:04 +05:30
Andras Timar
589261d9ed add Slovenian translation 2016-03-10 09:58:57 +01:00
Andras Timar
8c0764028f .gitignore 2016-03-10 09:55:19 +01:00
Ashod Nakashian
081ca0aa9f loleaflet: pass doc URI to WebSocket
Change-Id: I4798364c3ec655deb214cd3d7d93bbe3e83ad81a
Reviewed-on: https://gerrit.libreoffice.org/23110
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-10 04:25:06 +00:00
Ashod Nakashian
237e0c0e9a loolwsd: minor cleanups and const correctness
Change-Id: Ic3b26e1fbf5feba1667bc3dc1737d037590a5928
Reviewed-on: https://gerrit.libreoffice.org/23109
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-10 04:24:30 +00:00
Ashod Nakashian
e8214c1d2a loolwsd: refactored Storage classes
Change-Id: I3cc3aa2c1ddf70b8d2f3489aa4047f6470c93eb2
Reviewed-on: https://gerrit.libreoffice.org/23108
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-10 04:23:16 +00:00
Ashod Nakashian
05f8757f1d loolwsd: colored logs enabled automatically in tty
It is desirable to have colored logs when running loolwsd
in a terminal, but not redirecting its output to a file.

Outputting to a terminal is now detected and colored logs
are automatically enabled.

To force colored logs in files as well, define
LOOL_LOGCOLOR in the environ. The output color codes
can then be processed using, f.e., `less -r`.

Change-Id: I09fbee4441f210d814ac5ad23dd99d1c33b560b7
Reviewed-on: https://gerrit.libreoffice.org/23080
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 13:27:15 +00:00
Ashod Nakashian
cef1d842f9 loolwsd: added user-agent and response header logging to WOPI GetFile
Change-Id: Ia7fba845d67b27c25accb8515a44c57eed112a9b
Reviewed-on: https://gerrit.libreoffice.org/23054
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 02:36:52 +00:00
Ashod Nakashian
e5fcdb890e loolwsd: corrections to file and wopi URI handling
Change-Id: I7389a30931be01a40714167039055a758187bd82
Reviewed-on: https://gerrit.libreoffice.org/23053
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 02:34:10 +00:00
Ashod Nakashian
978147df55 loolwsd: refactored path manipulation in Storage.
Change-Id: I320c5638353b03df4fd0be612bb66c26e4f498a3
Reviewed-on: https://gerrit.libreoffice.org/23052
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 02:33:39 +00:00
Ashod Nakashian
18a224b413 loolwsd: Color logs can be enabled by defining LOOL_LOGCOLOR envar
Change-Id: I12a38562f05c5d0b5d1c970a4b67240167322daf
Reviewed-on: https://gerrit.libreoffice.org/23051
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 02:32:47 +00:00
Ashod Nakashian
83880c454f loleaflet: removed unnecessary token parameter sent to WSD
Change-Id: Ibdef21665fcbf65c95870c8711321f63f7098596
Reviewed-on: https://gerrit.libreoffice.org/23050
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 02:32:19 +00:00