Commit graph

1934 commits

Author SHA1 Message Date
Pranav Kant
31200eec6f loolwsd: Add CA path during SSL initialize
Change-Id: I09071b5fc0c32360524506c92f444ed8c6d8e0df
2016-03-25 13:01:01 +05:30
Ashod Nakashian
bea295bf0d loolwsd: wopi saving must post to /contents
Change-Id: I749ffb8818ed0a0463c2c2da0f1c2730d06b6b1f
Reviewed-on: https://gerrit.libreoffice.org/23493
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-24 13:48:30 +00:00
Andras Timar
f9cc0237b3 loolwsd: put config file and cert/key files to /etc 2016-03-24 10:37:17 +01:00
Andras Timar
abe330d390 loleaflet: ws:// -> wss:// 2016-03-23 22:02:50 +01:00
Andras Timar
f15295ac5d loolwsd: remove unused loolwsd.properties 2016-03-23 21:38:46 +01:00
Andras Timar
dd97dadad2 loolwsd: poco soname in loolwsd.spec 2016-03-23 20:20:05 +01:00
Andras Timar
2c9536b8e6 loolwsd: package discovery.xml 2016-03-23 19:48:29 +01:00
Andras Timar
f94cdbd36c loolwsd: add FileServer.hpp to dist 2016-03-23 19:46:32 +01:00
Pranav Kant
2f60313971 loolwsd: Cancel admin stats timer when thread finishes
Change-Id: I19d6a5368e650f0de93ee15b82c3549344a1d4b4
2016-03-23 22:16:35 +05:30
Pranav Kant
cfac07e3a1 loolwsd: Split DocumentBroker to its header and impl file
Change-Id: I8219300e271892f9f8fdecd8b38d9ea445cb7199
2016-03-23 22:16:35 +05:30
Miklos Vajna
cd5889ee9a loolwsd: fix -Werror,-Winconsistent-missing-override 2016-03-23 17:36:56 +01:00
Andras Timar
8584f299ea SSL cert and key for 'localhost'
CollaboraCloudSuiteCA_ca-chain.cert.pem is the CA chain that should
be trusted. Move the file to directory of trusted certs, such as
/usr/share/pki/trust.
2016-03-23 15:27:50 +01:00
Andras Timar
bc8769841b poco 1.7.2 debian packages 2016-03-23 14:23:41 +01:00
Ashod Nakashian
3f3c1bfae9 loolwsd: move configuration boilerplate
...and restored SSL file names temporarily.

Change-Id: I3195fcb888dc282723996321ceefb17088b593d2
Reviewed-on: https://gerrit.libreoffice.org/23468
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 12:12:15 +00: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
ece4538a90 loolwsd: break admin stat gathering if terminating
Change-Id: I3bd7dd9de829d2658d723da031b533504900054b
Reviewed-on: https://gerrit.libreoffice.org/23455
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:07:14 +00:00
Ashod Nakashian
ac65edc910 loleaflet: fixed sample and loadtest to support https
To run loadtest, point the browser to:
file:///abs/path/to/loleaflet/spec/loadtest.html

To run the sample, point the browser to:
file:///abs/path/to/loleaflet/debug/document/document_simple_example.html?file_path=/abs/doc/path/test.odt&host=wss://localhost:9980

Change-Id: If3e9aa2fc321e734ad912158b06ecb3370e37418
Reviewed-on: https://gerrit.libreoffice.org/23454
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:05:56 +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
cf3811a7fb loolwsd: refactored storage construction into factory
Change-Id: I5e1453b100d852424b472d08746d8636b7656755
Reviewed-on: https://gerrit.libreoffice.org/23451
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:04:15 +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
Ashod Nakashian
18829fda3b loolwsd: opportunistic kit session cleanup
When the Document lock cannot be taken
purging doesn't block (which would block
the kit-broker pipe). Instead, purging
is done only when the lock is taken,
otherwise we try again later.

Change-Id: Id201f1c67803d9b1e765e8c55f85206795fe53c0
Reviewed-on: https://gerrit.libreoffice.org/23448
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:01:39 +00:00
Ashod Nakashian
d48d9044a1 loolwsd: run tests on doc copies
Tests can modify the test documents they use.
Currently there is data-loss protection that
saves an open doc if connection is lost with
the client. For tests this means modification
are saved when a connection is terminated
ungracefully and this both adds noise
to the git checkout and makes subsequent
tests fail.

This patch makes temp copies of the original
doc before a test is run and deletes them
afterwards.

Change-Id: I1dd6ff2b839701e85c8bd502ba75170c01fa106e
Reviewed-on: https://gerrit.libreoffice.org/23447
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-23 00:00:34 +00:00
Pranav Kant
844ff4c571 loolwsd: Use automake generated tag rules to create tags file
Automake already have rules, make tags and make ctags, for emacs
and vim style tags respectively. We can pass our custom flags to
them using the AM_ macros.

https://www.gnu.org/software/automake/manual/html_node/Tags.html

This commit also adds support to create emacs style tags using
automake's pre-generated tag rules.

Change-Id: I4f6ed997fab6964b3c1f6637e3fd0365f8d4c8b8
Reviewed-on: https://gerrit.libreoffice.org/23442
Reviewed-by: pranavk <pranavk@collabora.com>
Tested-by: pranavk <pranavk@collabora.com>
2016-03-22 18:53:36 +00:00
Tor Lillqvist
129f797c83 Need to #include <Poco/Net/PrivateKeyPassphraseHandler.h> to avoid warning
Poco/SharedPtr.h: In instantiation of ‘static void Poco::ReleasePolicy<C>::release(C*) [with C = Poco::Net::PrivateKeyPassphraseHandler]’:
Poco/SharedPtr.h:130:14:   required from ‘Poco::SharedPtr<C, RC, RP>::SharedPtr(C*) [with C = Poco::Net::PrivateKeyPassphraseHandler; RC = Poco::ReferenceCounter; RP = Poco::ReleasePolicy<Poco::Net::PrivateKeyPassphraseHandler>]’

Poco/SharedPtr.h:70:3: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
    delete pObj;

Poco/SharedPtr.h:66:25: warning: ‘pObj’ has incomplete type
    static void release(C* pObj)

Poco/Net/PrivateKeyFactory.h:30:7: note: forward declaration of ‘class Poco::Net::PrivateKeyPassphraseHandler’
    class PrivateKeyPassphraseHandler;
2016-03-22 20:32:46 +02: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
418fc3f203 Use SSL here, too 2016-03-22 20:06:44 +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
744c4143c2 Indentation nit-pick 2016-03-22 18:41:14 +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
06bc5cf33e Update READMEs for SSL and Admin panel
Change-Id: I7b511071ab286474b35f40f40839aa2c44fa53f1
2016-03-22 16:09:22 +05:30
Miklos Vajna
7ccb2c0a13 loolwsd: fix -Werror,-Wunused-private-field 2016-03-22 08:08:44 +01:00
Pranav Kant
95598c9fd3 loleaflet: Use SSL for admin websockets for docs in debug/
Change-Id: I49495fb68076cc2b7e797f1bc5318dc4b464afa0
2016-03-22 01:42:29 +05:30
Pranav Kant
8e799c6569 loleaflet: Fix unit tests to use secure websockets
Change-Id: I6441d994bde40fa97ffe65be8c2a78e114dd7316
2016-03-22 01:27:33 +05:30
Pranav Kant
1cfca1766c loolwsd: Add information about admin panel to README
Change-Id: Ic163eec1bdcae4f4b3fcc107c990f43e4b724c19
2016-03-22 01:02:45 +05:30
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
ee5ebb8489 loleaflet: Move admin console related files to dist/admin
Better to put all admin related content in a separate directory
rather than mixing it with other files in dist/

Change-Id: I328ff95cf23251ff91bb438c3b9be923ccc2017f
2016-03-22 00:05:29 +05:30
Pranav Kant
06f1c874d6 loolwsd: Use JWT authentication to access admin console
File server serves the admin html file after successfull
authentication, and sets the cookie in client which would be sent
for all subsequent connections by client to connect to admin websocket.

Change-Id: I0ee3bbfca7eefc428020d29612374410556b1e27
2016-03-22 00:05:29 +05:30
Pranav Kant
4699e98c30 loolwsd: FileServer class to serve static contents
Only purpose, at the moment, is to create
Poco::HTTPRequestHandler which would be passed on the serving
handling the static file requests.

Change-Id: I97c3fc0c73da077d3efee919416098b880c9c2ad
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
1ba4d27aba Revert "loolwsd: FileServer class to serve static contents"
This reverts commit 8f435d6e7e.
2016-03-21 16:52:54 +02:00
Tor Lillqvist
3ccce7d4ca Revert "loolwsd: Use JWT authentication to access admin console"
This reverts commit a0d3c5f3e4.
2016-03-21 16:52:53 +02:00
Tor Lillqvist
e41be7c0f4 Revert "loleaflet: Move admin console related files to dist/admin"
This reverts commit 3a09c992f7.
2016-03-21 16:52:52 +02:00