Commit graph

2152 commits

Author SHA1 Message Date
Ashod Nakashian
26c9150786 loolwsd: simplified cache dir usage in TileCache
Change-Id: I134763350e741145c34ee08fffb8b3e9e8782e1f
Reviewed-on: https://gerrit.libreoffice.org/23536
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 17:05:54 +00:00
Ashod Nakashian
92ef78b608 loolwsd: optimized TileCache::toplevelCacheDirName away
Change-Id: Iaac48b77e186e8069017093dffc1c432cfca8572
Reviewed-on: https://gerrit.libreoffice.org/23535
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 17:05:18 +00:00
Ashod Nakashian
7129779aa9 loolwsd: simplified TileCache::cacheDirName
Change-Id: I3de34c104606945eecbb01034425f21c499c959b
Reviewed-on: https://gerrit.libreoffice.org/23534
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 17:04:48 +00: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
Ashod Nakashian
0f580476fc loolwsd: improving unittests
Dumping of registered tests in preparation
to allow for selective test running.

Change-Id: I83af1c9be211804f757918c326602a0b53815704
Reviewed-on: https://gerrit.libreoffice.org/23531
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 16:56:58 +00:00
Ashod Nakashian
d7732bdcaa loolwsd: new unittests and test improvements
Change-Id: I14e53f8bc3958dda1da1a95283c42cfef0bccd99
Reviewed-on: https://gerrit.libreoffice.org/23530
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 16:53:57 +00:00
Ashod Nakashian
a35006cdef loolwsd: no need to lock in destructor
Change-Id: I1650bc5b44c23f1de8b5f65e621da43f1a2755eb
Reviewed-on: https://gerrit.libreoffice.org/23529
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 16:53:07 +00:00
Ashod Nakashian
82bd7a606a loolwsd: recursive_mutex -> mutex and new loading synchronization mechanics
Change-Id: I20249ca56ca3e9203e6a989e6fe9972b6b4eca36
Reviewed-on: https://gerrit.libreoffice.org/23528
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-03-26 16:52:25 +00:00
Miklos Vajna
08b52fae72 MasterProcessSession: fix missing prefixes 2016-03-25 17:10:16 +01:00
Pranav Kant
aa391888d5 loolwsd: Remove the AdminModel document after expired
The plan was to keep the document's open and close history right
from the moment the server started up to the end, so we would
only expire() the document. For now, just destroy the document
as soon as user session is closed.

Change-Id: Id8f5b550a2b9bda217f7f8f8f1f82f85b1aa3502
2016-03-25 20:06:48 +05:30
Pranav Kant
18e1f2f8e7 loleaflet: Do not track built admin-src.js
Also delete the admin-src from there. It is not supposed to be
under git. This is generated during make from all the files in
src/admin

Change-Id: Ib1c8b637c40bf7bec7924a9582262f50fb093e47
2016-03-25 18:24:11 +05:30
Pranav Kant
bc64cae93e loleaflet: eslint no-unused-vars:0 for exported items
These are exported objects which lint complains about.
/* eslint exported */ doesn't seem to work well here.

Change-Id: I2b55d1ddeca84a89b72b3bcc05be22f078563456
2016-03-25 18:24:11 +05:30
Pranav Kant
1c452c9c6c loleaflet: fix lint errors
Change-Id: Idc363f92f065f405a764b472d30faa090e0b791b
2016-03-25 18:24:11 +05:30
Pranav Kant
c013b40735 loleaflet: Fix 'Outline' styles in impress
Change-Id: I1815dcfae7d7b0c107357d13a6dbe70a7d9ef4bc
2016-03-25 18:24:11 +05:30
Pranav Kant
32e24dcab3 loleaflet: Make style l10n work in new toolbar
Please note that this is just a workaround because there is no
consistent pattern between LO sending us programmatic, UI names.
During the initial command value event, we get programmatic names
from it. During the state change event, we get UI names for
Writer, but programmatic ones for others.

Change-Id: I7e69e1d437b22a34e54d2026b76e81951c4cc601
2016-03-25 18:24:11 +05:30
Andras Timar
6ce06767dd loolwsd: add --fileserverroot=/srv/www/htdocs/ to loolwsd.service 2016-03-25 13:08:42 +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
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