Commit graph

299 commits

Author SHA1 Message Date
Andras Timar
324f72d844 Revert "serve loleaflet from apache2, until we solve access control problem"
This reverts commit 21cd9167c4.
2016-04-01 16:31:33 +02:00
Pranav Kant
b8e9075f23 bccu#1621: Introduce an edit lock
... which can be taken only one at a time. Others can only view,
not edit. When a session with edit lock exits, the edit lock is
handed over to the next alive session.

Change-Id: I712a4e70369f1d07c1d83af416a0f5c288b05c7d
2016-03-31 19:24:14 +05:30
Andras Timar
21cd9167c4 serve loleaflet from apache2, until we solve access control problem 2016-03-30 20:13:38 +02:00
Pranav Kant
ba96b95954 loolwsd: Setup client SSL
We act as a client when we communicate with owncloud server.

For time being, just accept whatever certificates owncloud server
gives us. We might want to get more strict here in future.

Change-Id: I4813d19412b66ecf57d6cdef9c3ac94fbbaa521f
2016-03-30 21:41:00 +05:30
Pranav Kant
27a42affd0 loolwsd: This is a server, not client
Change-Id: I8db0a73048998566b4b60a7f39fe57617b9dca8d
2016-03-30 21:41:00 +05:30
Ashod Nakashian
fe69c4d5b6 loolwsd: pipe plumbing cleanup
Change-Id: I5519235a4601e1e38cedc3f06ffe9386434a292d
Reviewed-on: https://gerrit.libreoffice.org/23645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 02:02:53 +00:00
Ashod Nakashian
b25fe9d88a loolwsd: moved SocketProcessor to IoUtil and generalized more
Change-Id: I527e57d2430e21249cf8cd4867f22fdbbd092b09
Reviewed-on: https://gerrit.libreoffice.org/23637
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:45:20 +00:00
Ashod Nakashian
ce2fabb733 loolwsd: moved IO utilities into IoUtil file
Change-Id: I1e8d5562787134cbb490c38b19d83b7514ec9baa
Reviewed-on: https://gerrit.libreoffice.org/23586
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 14:09:04 +00:00
Michael Meeks
c5ef3ec4b1 Don't take loolwsd down with an assert on bad input. 2016-03-29 12:19:18 +01:00
Andras Timar
aeb4b305dc loolwsd: unused DemoAuthVerificationUrl variable 2016-03-29 09:36:10 +02:00
Ashod Nakashian
7d2d2aab1c loolwsd: message handling cleanups
Change-Id: I346511819907757bd84895c3751f0cbce4f37084
Reviewed-on: https://gerrit.libreoffice.org/23585
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 02:48:28 +00:00
Ashod Nakashian
3217b4592a loolwsd: queue payload changed to vector<char>
All messages now pass through the queue.
This resolves a race between single-line
messages and multi-line ones.

Previously, single-line messages were
processed on the queue (on a background
thread) while multi-line ones were handled
immediatly. This resulted in order-inversion
due to a race between the queue thread and the
next multi-line message, which caused stability
issues every so often.

Change-Id: Ia220791d1d75c4f3e3e0965dd0c6f81bae63a296
Reviewed-on: https://gerrit.libreoffice.org/23583
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 02:47:27 +00:00
Ashod Nakashian
7c92e263e8 loolwsd: improved websocket reading
Change-Id: Ibedf3c6715742f18b5e4c80e47ceb0b4bf24f384
Reviewed-on: https://gerrit.libreoffice.org/23581
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 02:45:46 +00:00
Tor Lillqvist
a219819ebf Avoid defining constant strings in multiple places
It is not a good idea to have the same string somewhat arbitrarily
both as a static const members of the LOOLWSD class and then as a
file-local static const in another file. Or defined as a separate
local const static in each compilation unit that includes
Common.hpp. Use constexpr instead, in Common.hpp.
2016-03-28 14:17:30 +03:00
Tor Lillqvist
45fc60d428 No need to have PIDLOG as a static const class member
This is C++, not Java. Or is there a school of thought for C++ style
that says one should avoid plain "C-style" file-local static
variables, and instead put everything always in a class, even as
static members? Do we want to follow that?
2016-03-28 13:43:18 +03:00
Tor Lillqvist
af1973eea8 No need to have Config as a static member in the class
Its value is already available as a macro from config.h even.
2016-03-28 13:38:36 +03:00
Ashod Nakashian
8b34e75722 loolwsd: cache directory path moved to DocumentBroker
Change-Id: Ic7733bf4f35243afeb34d0ac2d85b619b8f49457
Reviewed-on: https://gerrit.libreoffice.org/23533
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 17:02:59 +00:00
Ashod Nakashian
48dfce13de loolwsd: moved TileCache into DocumentBroker
Change-Id: If44a2d3158801e0910cf0f991c75b5ef845a5a30
Reviewed-on: https://gerrit.libreoffice.org/23532
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 16:58:55 +00:00
Miklos Vajna
08b52fae72 MasterProcessSession: fix missing prefixes 2016-03-25 17:10:16 +01:00
Pranav Kant
e7ff2399e1 loolwsd: Fix WOPI urlsrc
Since we are serving loleaflet from loolwsd now

Change-Id: Ie9b1150f59fcbfef8e22fcf94fa1fbdbfd1ab9cc
2016-03-25 15:55:36 +05:30
Pranav Kant
31200eec6f loolwsd: Add CA path during SSL initialize
Change-Id: I09071b5fc0c32360524506c92f444ed8c6d8e0df
2016-03-25 13:01:01 +05:30
Andras Timar
f9cc0237b3 loolwsd: put config file and cert/key files to /etc 2016-03-24 10:37:17 +01:00
Ashod Nakashian
b4e4ccb666 loolwsd: configuration support
Configuration XML is added with SSL as sample use-case.

A 'desc' attribute can be used to describe the fields,
and another 'type' to help define the corresponding data
type in the code.

Since Poco allows accessing group nodes (that have the
same name) by index, order can be preserved.

SSL initialization refactored and cert/key file
paths moved to the config file.

Change-Id: I259826a19697bd851587bebcc4f0cd233ab6848b
Reviewed-on: https://gerrit.libreoffice.org/23464
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 11:28:14 +00:00
Ashod Nakashian
8081db3fd9 loolwsd: fixed file info for local files
Change-Id: I8e2588d55d5ecccb9d0becafad4757b7fcb99eaf
Reviewed-on: https://gerrit.libreoffice.org/23453
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:05:35 +00:00
Ashod Nakashian
ef95d51b67 loolwsd: FileInfo used to authenticate and store with original name
Change-Id: I94105441134ded2146736affba7b763eb3d54791
Reviewed-on: https://gerrit.libreoffice.org/23452
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:04:58 +00:00
Ashod Nakashian
ca9c14dfdd loolwsd: logs and comments
Change-Id: I2fbfb7ee7ada48390bec65ee6911bde00885fbdb
Reviewed-on: https://gerrit.libreoffice.org/23450
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:03:36 +00:00
Ashod Nakashian
66c8c0a300 loolwsd: refactored DocumentBroker
Change-Id: Ie7d9f46e49db8978541b4775fbf6d2578879a111
Reviewed-on: https://gerrit.libreoffice.org/23449
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:02:49 +00:00
Tor Lillqvist
9d35b956d9 bccu#1399: Initial code for auto/idle save
Just a skeleton, actual saving not yet implemented. Also, not sure
the logic when to trigger save is as intended.

Note that no separate timer classes or objects are used. The existing
watpid/sleep loop that wakes up once every two seconds currently is
used. If that loop is re-factored to be less silly, the auto/idle save code
must be implemented differently.
2016-03-22 20:27:38 +02:00
Tor Lillqvist
0677c4abc9 No need for the DocumentBroker map to be in the LOOLWSD class
It can be a simple static variable in LOOLWSD.cpp. It is not used
anywhere else.
2016-03-22 18:47:05 +02:00
Tor Lillqvist
6b505e561f Bin unneeded #include 2016-03-22 18:45:22 +02:00
Tor Lillqvist
1222d7ff6d Linux surely always has WCOREDUMP defined 2016-03-22 18:11:06 +02:00
Tor Lillqvist
a68f0b89e3 Improve wording in log message 2016-03-22 17:58:37 +02:00
Tor Lillqvist
e1d5f991e8 Get rid of weird looping behaviour
When no child process has died, I don't see the point in calling
waitpid() eleven times in quick succession (with WNOHANG), doing
nothing else, and then sleeping for a bit. Let's call waitpid() just
once, and sleep only if the return value indicates that no child
process has died.
2016-03-22 17:52:50 +02:00
Tor Lillqvist
913ed1114a Sort #include and 'using' lines 2016-03-22 17:25:35 +02:00
Pranav Kant
7f371958ae SSL everywhere
Use same port (9989) for all client connections. This includes
admin panel, static file serving and normal client websocket
connections.

Change-Id: Idcfd7dd8925523c36e884717c41a3b6a827f6ff3
2016-03-22 00:05:29 +05:30
Pranav Kant
7b763f0aff loolwsd: Allow specifying custom file server root
By default, use git directory root.

Change-Id: I4ee1173c43f313de3abb1732e6a7401169896189
2016-03-22 00:05:29 +05:30
Pranav Kant
4dd14c0024 loolwsd: SSL infrastructure
... and use SSL for client connections. Also fix our test suite
to use HTTPS now.

Change-Id: Id396a7c2d1830da8d3b0ce446522403363ac17c1
Reviewed-on: https://gerrit.libreoffice.org/23395
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-03-22 00:05:26 +05:30
Tor Lillqvist
9a66e75e83 Revert "loolwsd: SSL infrastructure"
This reverts commit fb9c9a9ec7.
2016-03-21 16:52:55 +02:00
Tor Lillqvist
09d3c5f230 Revert "loolwsd: Allow specifying custom file server root"
This reverts commit a5f8ba44a2.
2016-03-21 16:52:46 +02:00
Pranav Kant
a5f8ba44a2 loolwsd: Allow specifying custom file server root
By default, use git directory root.

Change-Id: I4ee1173c43f313de3abb1732e6a7401169896189
2016-03-21 16:33:47 +02:00
Pranav Kant
fb9c9a9ec7 loolwsd: SSL infrastructure
... and use SSL for client connections.

Change-Id: Id396a7c2d1830da8d3b0ce446522403363ac17c1
Reviewed-on: https://gerrit.libreoffice.org/23395
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-03-21 14:05:10 +00:00
Henry Castro
3f93cdc1d1 Revert "loolwsd: read WOPI scheme, hostname from config values"
This reverts commit ad980bee02.
2016-03-16 19:58:44 -04:00
Henry Castro
ad980bee02 loolwsd: read WOPI scheme, hostname from config values 2016-03-16 16:45:20 -04:00
Henry Castro
8a6cfdf961 loolwsd: load default configuration files 2016-03-16 15:52:01 -04:00
Henry Castro
bda64dbf2b loolwsd: fix get host from request 2016-03-15 19:16:58 -04:00
Henry Castro
8a2bd1127b loolwsd: WOPI, handle request discovery 2016-03-15 11:35:59 -04:00
Jan Holesovsky
6b15dfd552 loolwsd, loleaflet: Rename 'connectionclose' to 'disconnect'. 2016-03-15 10:32:28 +01:00
Jan Holesovsky
2c1664b9d5 loolwsd, loleaflet: Let the server know when we are closing the session.
This is to distinguish the deliberate close of connection, and timeout,
connection drop, or forced close.

When the last session is closed non-deliberately, force a save so that the
edits are not lost.
2016-03-15 09:46:37 +01:00
Ashod Nakashian
981e83ece6 loolwsd: fixed convert-to (POST) tests
Change-Id: I6d48971b9daf0beaa16defa0b5f4dfb94575713c
Reviewed-on: https://gerrit.libreoffice.org/23228
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:18:03 +00:00
Ashod Nakashian
66cd6cd5c3 loolwsd: improved DocumentBroker lifetime and thread handling
Change-Id: Ic8e16f0ec6b273165f7ba4e9b8d95003503530a6
Reviewed-on: https://gerrit.libreoffice.org/23226
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-14 03:17:24 +00:00