Commit graph

2133 commits

Author SHA1 Message Date
Michael Meeks
024fd2ee8d Scripting to create and populate jails automatically.
'make check' now builds a system image, and runs tests inside it.
2016-04-07 19:38:33 +01:00
Michael Meeks
ad13dca8f8 First cut at adding integration and unit test hooks into loolwsd.
Add new configure parameter --with-lo-path= which can be used to
auto-populate a system template as required.
2016-04-07 19:38:33 +01:00
Michael Meeks
b6ab8982e6 Guard logger so it can be used during static destructors safely. 2016-04-07 19:38:33 +01:00
Michael Meeks
72a0926b4a Hush - update gitignores. 2016-04-07 19:38:33 +01:00
Tor Lillqvist
c71d12ae63 Process name and id are already part of each logging output line 2016-04-07 20:22:57 +03:00
Tor Lillqvist
557ca90be1 Remove unused IoUtil::readMessage() 2016-04-07 20:18:22 +03:00
Tor Lillqvist
16034f6685 Bin unused INTERVAL_PROBES 2016-04-07 20:09:35 +03:00
Tor Lillqvist
4ed3393f16 Nothing ever passed for the pollTimeoutMs parameter so use the default value in-line 2016-04-07 20:07:56 +03:00
Tor Lillqvist
584a805781 The SocketProcessor() 'name' parameter can now be dropped 2016-04-07 20:07:50 +03:00
Tor Lillqvist
5ea6c4bacf No need to show the SocketProcessor 'name' in the log
The thread name already identifies it sufficiently as can be seen:

kit-05108-00 00:00:01.662974 [loolkit        ] [ChildControllerWS] Starting Socket Processor.
wsd-05087-03 00:00:08.126842 [client_ws_0002 ] [Client_ws_0002] Starting Socket Processor.
wsd-05087-05 00:00:08.153688 [prison_ws_0002 ] [Child_ws_0002] Starting Socket Processor.
2016-04-07 19:52:53 +03:00
Tor Lillqvist
d36c8bbbba Avoid some use-once variables
Also, use different names for the HTTPRequestHandler threads in
ClientRequestHandlerFactory and PrisonerRequestHandlerFactory.
2016-04-07 19:31:56 +03:00
Tor Lillqvist
9acc0b052e Bin one more redundant thread name in debug log 2016-04-07 19:26:01 +03:00
Ashod Nakashian
d014589692 loolwsd: added default LO install path in the config
Change-Id: Ic42acd1a6050104d08a5bcf2ebb90b9b8aabbbfa
Reviewed-on: https://gerrit.libreoffice.org/23899
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 14:02:39 +00:00
Tor Lillqvist
711674f7ce Use Log::debug() here, too, for consistency 2016-04-07 15:56:23 +03:00
Tor Lillqvist
4fdd6d684f Reduce redundant information in logging
The logging functions already display the thread name on all output
lines. No need to mention it another time in the thread start and
finish logging messages.
2016-04-07 15:53:53 +03:00
Tor Lillqvist
175bd4c9e2 Use the actual current process names here, too 2016-04-07 11:53:44 +03:00
Tor Lillqvist
931550b435 Quite essential to change loolbroker to loolforkit here, too 2016-04-07 11:53:44 +03:00
Tor Lillqvist
84cd6bbceb Try to be more consistent in terminology
The "Broker" process is called "ForKit" now. The only things called
"broker" now are the DocumentBroker objects in the WSD process.
2016-04-07 11:53:44 +03:00
Tor Lillqvist
d28354c6a6 Bin unused variables 2016-04-07 11:53:44 +03:00
Tor Lillqvist
c520aa4f05 These are not warnings 2016-04-07 11:53:44 +03:00
Tor Lillqvist
acc59a2ea5 Make error messages more consistent and use Log::syserror() in more places
A call to Log::error() should be enough to indicate that it is an
error. We don't need to prefix the message with the string "Error: "
in some cases but not others. (If we do want such a prefix for all
errors, surely then we should add it in the actual Log::error()
function.)

Also, change some more Log::error() calls to Log::syserror() where
appropriate.
2016-04-07 11:53:44 +03:00
Tor Lillqvist
5637064e9a Factor out the prctl() calls
Silly to keep copy-pasting the same couple of lines over and over
again.
2016-04-07 11:53:33 +03:00
Tor Lillqvist
ec604599f1 Introduce separate Log::syserror() function for logging actual syscall errors
Much better than assuming that errno would be relevant at all
Log::error() calls (or alternatively, having to remember to append a
false parameter to the Log::error() call, which had not been done a
single time anyway.)

Call log::syserror() right after a system call has returned an
error. Don't call it otherwise.
2016-04-07 10:36:38 +03:00
Tor Lillqvist
94caec287f We never call Log::warn() with an append_errno parameter
So just drop it. Default parameters are ugly IMHO.
2016-04-07 10:15:51 +03:00
Tor Lillqvist
6229648610 Include dlerror() message in log output also if dlsym() fails 2016-04-07 10:13:56 +03:00
Ashod Nakashian
f04eee1ec4 loolwsd: updated gitignore with renamed binaries
Change-Id: I1c51db6b8254bc70291de51a6bd5f8fd3d53e8fc
Reviewed-on: https://gerrit.libreoffice.org/23882
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:45:58 +00:00
Ashod Nakashian
9485b4fe63 loolwsd: disable loading of local docs by default
Loading documents from the local filesystem
opens the door to security issues.

By default filesystem storage is disabled,
even if enabled in the config file. The
only way to enable it is to set the
allowlocalstorage command-line argument.

Change-Id: Ib8f57377260817436d101a16757aab38276cbdcd
Reviewed-on: https://gerrit.libreoffice.org/23881
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:45:31 +00:00
Ashod Nakashian
00940d5a0b loolwsd: configure wsd using the config file
Most all configuration values can now be defined
in the configuration XML. The command-line arguments
can be used to override some of these values (for
the convenience of developement and testing) and,
in a few cases, as a security measure to avoid
storing sensitive data in the configuration file.

Change-Id: I040b807b1a59a3537bb94646150d3c7d711f8b62
Reviewed-on: https://gerrit.libreoffice.org/23880
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:44:35 +00:00
Ashod Nakashian
29c9ecba2a loolwsd: deny access to directories outside of FileServerRoot
Change-Id: Iea92982ebd5f111c946eb1b12f5dfd7602fffd70
Reviewed-on: https://gerrit.libreoffice.org/23879
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:43:05 +00:00
Ashod Nakashian
1f88aede00 loolwsd: Admin Console credentials passed on the command line
A new command-line argument, admincreds, must be provided
to set the Admin Console credentials.

The new command-line argument specifies the username
and password in the following format: username/password

If not provided, Admin Console is disabled for security
reasons. A warning is emitted at startup and an error
on every invocation of Admin Console is logged when
no credentials are defined.

Change-Id: I348623949fd0b292f5066e4955759c708204540f
Reviewed-on: https://gerrit.libreoffice.org/23878
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:42:15 +00:00
Ashod Nakashian
d75bc16753 loolwsd: removed loolwsd pid logging
loolstat now uses `pgrep loolwsd$` instead
of relying on pid dumping in a temp file.

With the Admin Console this tool (loolstat)
is less useful, so this cleanup is probably
a stepping stone to removing it altogether.

Change-Id: Ib7732a00c3d3ea54dffcb71e9fe1a56c4a88016e
Reviewed-on: https://gerrit.libreoffice.org/23877
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:40:27 +00:00
Ashod Nakashian
05ec505452 loolwsd: added more configuration entries to loolwsd.xml
Change-Id: Iab5ef89b1e152605e6ea869d6c89192e824d92f2
Reviewed-on: https://gerrit.libreoffice.org/23876
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:39:39 +00:00
Ashod Nakashian
e8ffea5d1c loolwsd: minor cleanup of path handling in config
Change-Id: I6a858e819372326ab582af91ad55a8e84b81608d
Reviewed-on: https://gerrit.libreoffice.org/23875
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-07 04:39:04 +00:00
Henry Castro
cec63101c5 loleaflet: progress bar for document loading, saving, etc. 2016-04-06 20:48:12 -04:00
Henry Castro
a06974e2b3 loleaflet: add loading spinner to slide show 2016-04-06 15:54:55 -04:00
Jan Holesovsky
204a9c742f loolwsd: Allow asking for credentials even during websocket setup.
It may happen that admin.html is cached, which leads to the cookie not being
set up, which then leads to endless amount of attempts to log in.
2016-04-06 20:17:24 +02:00
Henry Castro
b6dc37fadf loleaflet: fix slide show when it is used "file://" scheme 2016-04-06 10:15:41 -04:00
Ashod Nakashian
6e5e9033f2 loolwsd: removed Admin pipe
Admin no longer needs a pipe as it's notified
from WSD. It is now a singleton with improved
locking.

The tracking of documents and views still needs
improvement and corrections.

Change-Id: If614331de6dd595c6dd4443f480d4ab588ca4551
Reviewed-on: https://gerrit.libreoffice.org/23860
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-06 13:52:57 +00:00
Ashod Nakashian
0aa60f8745 loolwsd: ignore SIGCHLD and auto-reap zombies
Change-Id: Ia927d4d01c38a8929a47fb8aa014f0ed5896f8ed
Reviewed-on: https://gerrit.libreoffice.org/23859
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-06 13:52:25 +00:00
Ashod Nakashian
5e41763386 loolwsd: disconnect WS before killing/abandoning child
Change-Id: Iff0ac1b57ce9e0fe61871fad9a499d370c2c9294
Reviewed-on: https://gerrit.libreoffice.org/23858
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-06 13:52:05 +00:00
Henry Castro
ab0429622e loleflet: rework progress bar 2016-04-06 09:14:54 -04:00
Tor Lillqvist
594d925c9e This is not the place for this documentation any more
Besides, I don't think we actually use such a terminology as that
comment claimed.
2016-04-06 12:51:45 +03:00
Tor Lillqvist
7af1db615d These enums are indeed not used, and are not a good idea, so kill them
To use such enums would be a mistake. It is quite enough to just use
the message tokens as strings. Duplicating them as enums will just
lead to the enums getting out of synch (as they already were). We
would also need functions to covert between the string and enum
forms. It seems to be hard enough to keep the messages documented in
protocol.txt.
2016-04-06 12:51:31 +03:00
Tor Lillqvist
2e5a268bbc bccu#1399: Factor out check whether message indicates user interaction
Add a function to determine whether a client message indicates user
interaction. We need that distinction when deciding when to do an
automatic ("idle" or "auto") save of document being edited.

"Interaction" is a loose term, possibly what we actually want is to
see whether the user is actively doing an edit that changes the
contents of meta-data of the document.
2016-04-06 12:51:02 +03:00
Tor Lillqvist
d4ede7136c bccu#1399: Restrict the meaning of the 'last message' timestamp and rename
It should keep track only of messages that indicate explicit editing
actions by the user. For now, treat anything except 'tile' messages as
such.
2016-04-06 12:50:42 +03:00
Tor Lillqvist
381bd75fe4 Add some clarifying comments 2016-04-06 12:50:09 +03:00
Tor Lillqvist
41a1c0b3f9 Introduce LOOL_NO_AUTOSAVE environment variable 2016-04-06 12:49:13 +03:00
Jan Holesovsky
fa4ea0200b loleaflet: Show the 'More' button only when there are more items. 2016-04-06 09:00:48 +02:00
Pranav Kant
7da31f6fa3 bccu#1660: Remove unused/superfluous links
Change-Id: Ib5e78586a1c33ca16bd4848e0912313434b7db54
2016-04-06 10:15:49 +05:30
Jan Holesovsky
560dc6c6ab loleaflet: It is not necessary to inform about EDITING, that's the default. 2016-04-05 17:55:05 +02:00