Commit graph

85 commits

Author SHA1 Message Date
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
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
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
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
Ashod Nakashian
ceaefabc91 Revert "loolwsd: replace fifo for socket WSD -> Broker"
This reverts commit 97c8f35ddf.

Since the Broker design has been extremely simplified,
all communication between Broker <-> Kit are gone.
Only a pipe between WSD and Broker remain.

Temporarily reverting this to apply the Broker redesign,
after which this patch can be reviewed and merged.
This will be easier than trying to merge the redesigned
Broker on top of this.

Change-Id: Ia901fad604008654c01841df62e88918adad45e1
Reviewed-on: https://gerrit.libreoffice.org/23769
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-04 04:00:45 +00:00
Henry Castro
97c8f35ddf loolwsd: replace fifo for socket WSD -> Broker 2016-04-03 08:12:10 -04: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
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
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
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
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
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
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
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
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
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
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
6c69519562 Storage is used to manage files locally
Change-Id: Id50eca8fe1136777ca99c60d78c15e1a47397993
Reviewed-on: https://gerrit.libreoffice.org/23049
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-09 02:31:47 +00:00
Tor Lillqvist
e7e1ef58ae Cosmetics: Sort and prune #include and 'using' lines 2016-03-08 09:44:04 +02:00
Ashod Nakashian
743311af21 loolwsd: added wopi storage manager
Change-Id: Ia28fb3d42c43387432e0b183a1bcf6b0924da820
Reviewed-on: https://gerrit.libreoffice.org/22885
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-04 03:06:28 +00:00
Ashod Nakashian
c980ece8bc loolwsd: preparing for wopi storage
Change-Id: Iae1bd042d84603cf81115789df40f50e8dc20d16
Reviewed-on: https://gerrit.libreoffice.org/22884
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-04 03:04:43 +00:00
Tor Lillqvist
9d655cbcc0 Don't pretend this will work on anything except Linux 2016-02-29 14:25:12 +02:00
Henry Castro
ba47e28581 loolwsd: re-work UriToDocumentURIMap
This is not in synchronization with lokit process because
it is normal that lokit dies now.
2016-02-21 08:26:29 -04:00
Ashod Nakashian
d8df19d064 loolwsd: Authentication and Authorization support
An abstract class to request an access token, given
an authorization grant. The class should be
specialized for each authentication/authorization
type we support.

Currently it's not enabled in the code as it's
an early stage in developing an general API.

Change-Id: I4f2efd376d575640bd3e17c7257994020b11bbe8
Reviewed-on: https://gerrit.libreoffice.org/22512
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-19 21:44:55 +00:00
Henry Castro
75b552bf71 loolwsd: create named pipes workspace 2016-02-13 13:22:15 -04:00
Henry Castro
9e3d5c0337 loolwsd: ensure chroot jail every lokit process 2016-02-13 10:15:28 -04:00
Miklos Vajna
4b3c5ea8ff loolwsd: doxygenize class comments 2016-01-28 19:16:32 +01:00
Henry Castro
35fbb27cfd loolwsd: remove unused private methods 2016-01-25 22:43:03 -04:00
Henry Castro
2baae1b324 loolwsd: simplify one loolbroker 2016-01-25 21:07:10 -04:00
Henry Castro
e3fd07ad0e loolwsd: remove unnecessary inter process mutex
It is no longer needed becuase loolbroker handle connections
2016-01-25 12:26:22 -04:00
Pranav Kant
f429001ff9 loolwsd: Display version information on command line
Change-Id: Ie65c30574ca4cef619a224ec6df3501d6bda086a
Reviewed-on: https://gerrit.libreoffice.org/20847
Reviewed-by: jan iversen <jani@documentfoundation.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-01-19 16:36:00 +00:00
Miklos Vajna
de7823744e loolwsd: fix naming style of LOOLWSD static members 2016-01-15 09:44:07 +01:00
Ashod Nakashian
3d803dd9b0 loolwsd: Document -> DocumentURI
Change-Id: I7e5989dbee368314a4db7c723439060f1064e844
Reviewed-on: https://gerrit.libreoffice.org/21469
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-14 13:39:43 +00:00
Ashod Nakashian
5bf75f56ca loolwsd: centralized signal handling and eased debugging
Change-Id: Ifdb3e2bca540bec3c6dea1ab24173c8ea0267706
Reviewed-on: https://gerrit.libreoffice.org/21325
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-11 04:06:56 +00:00
Ashod Nakashian
cb772746d8 loolwsd: multiple documents load correctly now
Change-Id: I86adda24d5ea576aa17829f27b78cb02d0350a4b
Reviewed-on: https://gerrit.libreoffice.org/21323
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-11 04:05:36 +00:00
Henry Castro
49fbf1126b loolwsd: fix search document. 2016-01-07 12:14:52 -04:00
Ashod Nakashian
06c20923c5 loolwsd: Kit is given the jailed path
Change-Id: I5b475798c7f654aaa3e0032332d5aa97a103a4c8
Reviewed-on: https://gerrit.libreoffice.org/21185
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:58:08 +00:00
Ashod Nakashian
a7556a7c1e loolwsd: new Document class to manage the lifetime of a document
Change-Id: I8596d0f2514106e384bc6519ce05028753026678
Reviewed-on: https://gerrit.libreoffice.org/21184
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:57:25 +00:00
Ashod Nakashian
7f9485e318 loolwsd: jailId now static member
Change-Id: I7142038d421d642a3e9dfd3e1069c7401ec7db5c
Reviewed-on: https://gerrit.libreoffice.org/21183
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:56:25 +00:00
Ashod Nakashian
0b5bc5f244 loolwsd: random jailId dir created by WSD and renamed childId -> jailId
Change-Id: Ib5ce65c578c0c7fd3dbf81628906cd17728fb3ff
Reviewed-on: https://gerrit.libreoffice.org/21182
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:56:01 +00:00
Ashod Nakashian
b0cd3e5a46 loolwsd: spawn one broker and one only
Change-Id: I9ec23e7e9e9672e5e4e6d55b7a79e6db1f617e45
Reviewed-on: https://gerrit.libreoffice.org/21181
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-07 05:54:44 +00:00
Ashod Nakashian
82c455ef94 loolwsd: dropCapability now works with --enable-debug
Change-Id: I1a852b0cb4fe0b08fcc00f2f7ab15eea3d36801b
Reviewed-on: https://gerrit.libreoffice.org/21133
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-05 19:30:02 +00:00
Ashod Nakashian
0869cace37 loolwsd: consolidated TerminationFlag
Change-Id: Ic06b940f3b48888e4f398816e5ee45c0f49046e3
Reviewed-on: https://gerrit.libreoffice.org/21059
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-03 15:15:46 +00:00
Ashod Nakashian
88b76fe9d4 loolwsd: removed dead code
Variables and options lingering from previous iterations removed.
Standardizing static member names.
Header inclusion cleanups.

Change-Id: I65182ad4d100e0077f1b450be50cf95d7b8f0fc7
Reviewed-on: https://gerrit.libreoffice.org/20997
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2015-12-28 23:36:55 +00:00