Commit graph

2005 commits

Author SHA1 Message Date
Pranav Kant
d186e05a0d loolwsd: Use filename in admin console
... instead of long URIs.

Change-Id: I9d13285ce81967a4ff9eb518086743540d7a2a90
2016-03-31 22:47:26 +05:30
Pranav Kant
b81abc4079 loleaflet: Edit lock implemention on front-end
Change-Id: I97c2b2e0a4ef51c6335cefe3e9ec8f5904deb9f4
2016-03-31 19:24:17 +05:30
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
Pranav Kant
26dd4e0b4b loolwsd: Verify JWT token's expiry time
Change-Id: I6e6913e7918ac4c36ab98457054e5660cce3a854
2016-03-31 17:25:29 +05:30
Tor Lillqvist
422834ebef Improve logging
Don't embed newlines in "lines" written to the log. When logging stuff
read from or written to the fifos, translate newlines to " / " for
clarity.

(If we would want complete, exact verbose logging, we should be really
pedantic and log all non-printable bytes in hex anyway, etc, so
displaying newlines as space-separated slashes should be OK. It isn't
as if there would be totally arbitary data passed through the fifos
anyway.)
2016-03-31 11:01:52 +03:00
Pranav Kant
4ae077200c loolwsd: Separate AdminModel header and implementation
Change-Id: Iddf107aa7985988deba800030e75243a831a7532
2016-03-31 13:00:30 +05:30
Pranav Kant
939388c6e6 loolwsd: Arrange sources/header in makefile alphabetically
Change-Id: I0bc70b34a590d84ac9c15f0d9d0000d02cadba74
2016-03-31 12:57:44 +05:30
Pranav Kant
f1ede0c4ba loolwsd: Split Storage, Auth classes into header/impl files
Change-Id: I5d8990db8f8f4aa7a88bbb0cc84b97149cf4f8c0
2016-03-31 12:57:44 +05:30
Andras Timar
e328d5f590 loleaflet: remove empty po files 2016-03-31 09:15:54 +02:00
Andras Timar
905ce5744b loleaflet: s/kill child/terminate session/ 2016-03-30 21:38:49 +02:00
Pranav Kant
d26246dab0 loolwsd: Temporarily use hard-coded path to key file
We will switch to reading all these values as soon as wip
configuration file object is accessible globally.

Change-Id: I16eff339349683050be1985eefabc34854cccba3
2016-03-31 00:56:57 +05:30
Andras Timar
21cd9167c4 serve loleaflet from apache2, until we solve access control problem 2016-03-30 20:13:38 +02:00
Andras Timar
198c266f8d loleaflet: updated po files 2016-03-30 20:13:08 +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
Miklos Vajna
f30e22d0a3 loolwsd: fix -Werror,-Wshadow 2016-03-30 09:39:48 +02:00
Ashod Nakashian
494b90e541 loolwsd: new unittests
Change-Id: I935dbc79df638a7481f851b3e7b42703b97b93ec
Reviewed-on: https://gerrit.libreoffice.org/23648
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 02:06:32 +00:00
Ashod Nakashian
cbabd6177d loolwsd: improved child spawning and management
Spare child processes are now in a separate
container. A FIFO that gives older instances
priority to avoid using instances too young
to have initialized fully.

In addition, spare instances are now
proactively spawned such that there
is at least a minimum number of
spares at any given time.

Change-Id: Ibdb206d88473adb306c274f4af39798c784258a0
Reviewed-on: https://gerrit.libreoffice.org/23647
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 02:05:57 +00:00
Ashod Nakashian
2ba9bddf9a loolwsd: logging improvements
Change-Id: Ie656aa9d9f19762a960f6608cdadccf3c7eee665
Reviewed-on: https://gerrit.libreoffice.org/23646
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 02:03:25 +00:00
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
ecce874315 loolwsd: new PipeReader class to poll and tokenize pipe messages
Change-Id: I5676b313ca4c7e711ead04c1491fe36591a00531
Reviewed-on: https://gerrit.libreoffice.org/23644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:59:31 +00:00
Ashod Nakashian
c966a804f8 loolwsd: throw when we fail to connect to lokit
Change-Id: I52f5c923cfc8fa4c28309066d8457418154e6b20
Reviewed-on: https://gerrit.libreoffice.org/23643
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:57:21 +00:00
Ashod Nakashian
9150d560c0 loolwsd: thread -> session
Change-Id: I7d9f84a2c9afea5f541f5815929745d2de93c8fa
Reviewed-on: https://gerrit.libreoffice.org/23642
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:56:45 +00:00
Ashod Nakashian
59db6cbc09 loolwsd: recursive_mutex -> mutex in LOOLBroker
Change-Id: I72be54cc67b965bbd13a6630d1243d8d59ba0fc4
Reviewed-on: https://gerrit.libreoffice.org/23641
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:55:55 +00:00
Ashod Nakashian
4b38df7455 loolwsd: lokit command handling improvements
Change-Id: I81baddb30805ee1bce5399171a40e73a18af68bf
Reviewed-on: https://gerrit.libreoffice.org/23640
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:52:55 +00:00
Ashod Nakashian
4305d333b2 loolwsd: lokit process can only host one url in its lifetime
Change-Id: I561e5b81a748b7ec567af9aff968ba5c66ad44bf
Reviewed-on: https://gerrit.libreoffice.org/23639
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:49:36 +00:00
Ashod Nakashian
3d2c2fde3b loolwsd: logging and misc cleanup
Change-Id: If3cea8191fe15fc752c436cd33d2a68dc2d88598
Reviewed-on: https://gerrit.libreoffice.org/23638
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-30 01:46:34 +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
Jan Holesovsky
09ee912e08 loolwsd: Default to the most verbose log level.
Still in heavy development, useful to know about everything...
2016-03-29 14:47:09 +02:00
Jan Holesovsky
9b54337568 loleaflet: Warn when somebody tries to use ws: for the websocket. 2016-03-29 14:47:09 +02:00
Miklos Vajna
89f79a1bf4 MessageQueue: moving a local object in a return statement prevents copy elision
As pointed out by clang -Wpessimizing-move.
2016-03-29 13:36:30 +02:00
Tor Lillqvist
9fc71de84d Clarify semantics of LOK_FORK
Also, talk about "kit" processes, not LibreOfficeKit instances. That
is the terminology used in the code.
2016-03-29 14:33:53 +03:00
Jan Holesovsky
22914aacd1 loolwsd: Install the certificates during the build. 2016-03-29 13:29:07 +02:00
Michael Meeks
0534c511f0 First cut documentation on environment variables. 2016-03-29 12:24:32 +01:00
Michael Meeks
c5ef3ec4b1 Don't take loolwsd down with an assert on bad input. 2016-03-29 12:19:18 +01:00
Michael Meeks
b499743932 Print what is done for capabilities. 2016-03-29 12:19:18 +01:00
Jan Holesovsky
9e180171c2 WaE: Shadowed variable. 2016-03-29 12:42:45 +02:00
Andras Timar
aeb4b305dc loolwsd: unused DemoAuthVerificationUrl variable 2016-03-29 09:36:10 +02:00
Andras Timar
be4b25fddc loolwsd: unused LOOLWSD_NUMPRESPAWNS environment 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
9f39e465a6 loolwsd: cleanup of the command parser
Change-Id: I654e42ab6de92b7120ae2212d7e08c682d3d36f0
Reviewed-on: https://gerrit.libreoffice.org/23584
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 02:47:56 +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
69b4f42d3c loolwsd: preparing MessageQueue for vector<char> payload
Change-Id: I30bf7b4c641f4363790587ddc8ba8fb2bf9d269a
Reviewed-on: https://gerrit.libreoffice.org/23582
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-29 02:46:54 +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
Tor Lillqvist
2604824d5f Need to #include <Poco/Net/PrivateKeyPassphraseHandler.h> to avoid warning 2016-03-28 13:26:37 +03:00
Ashod Nakashian
b4a4c45a36 loolwsd: Storage gets last modified time and simplified TileCache construction
Change-Id: I4a7e7b941c136b59ffd7d935310d37d73ac4ec63
Reviewed-on: https://gerrit.libreoffice.org/23540
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 17:10:25 +00:00