Commit graph

2415 commits

Author SHA1 Message Date
Andras Timar
028becc511 error: unused parameter ‘part’ [-Werror=unused-parameter] 2016-04-20 13:00:43 +02:00
Jan Holesovsky
97342a2817 bccu#1653: Make the .html's, .css's and .js's versioned.
It is still possible to access them directly via loleaflet/dist/<something>,
but such use can lead to unexpected behaviour due to various caching in the
browsers etc.
2016-04-20 12:58:10 +02:00
Michael Meeks
a47355db2f Expand use of the TileBeingRendered structure.
Implement this for tilecombine, and do tile writes in each client's
thread separately. Add env-var. to trigger sleep, and tune it to 1
second; easily long enough to exercise this code-path.
2016-04-20 11:14:18 +01:00
Andras Timar
14458095ad README: loolwsd's --test option was binned 2016-04-20 12:00:46 +02:00
Andras Timar
59aa99d08d typo: consistenly -> consistently 2016-04-20 11:51:28 +02:00
Andras Timar
f0549f8ba1 document --disable-ssl and related stuff 2016-04-20 11:48:12 +02:00
Andras Timar
af36a3bd13 document --allowlocalstorage and --admincreds 2016-04-20 11:35:31 +02:00
Pranav Kant
4fb1f60e06 Treat minified files as binary files
Helps 'git grep' do its job better.

Change-Id: Ia3c671df471d7ee4545aff3ea96c2bc104d0d025
2016-04-20 14:32:16 +05:30
Tor Lillqvist
2d74d65578 Rant about the duplicate specification of document URI, GET and 'load' 2016-04-20 10:35:38 +03:00
Miklos Vajna
5e2937bf79 Log: strcpy -> strncpy
Change-Id: I2929ad46b422e6e55e198064c2930028df844630
2016-04-20 09:10:30 +02:00
Pranav Kant
da7dd6f634 loleaflet: Remove bunch of warnings from the console
It is incorrect to add the <div> elements with parent as w2ui
toolbar outside of onRefresh() method because toolbar can
refresh multiple times during its lifetime meaning that all such
added elements will be removed after first refresh breaking the
font/back color feedback javascript code.

Hence, this also fixes the font/back color feedback.

Change-Id: Iacd4f8a5c8ebb64e5bba5e7f05ceef8b77051534
2016-04-19 22:13:36 +05:30
Andras Timar
090c246be4 bccu#1696 - enable WOPI connection from the same host (by IP address) by default 2016-04-19 15:32:34 +02:00
Tor Lillqvist
f825fea9db operator '?:' has lower precedence than '+'; '+' will be evaluated first 2016-04-19 16:21:55 +03:00
Tor Lillqvist
bf6dd4e291 Typo 2016-04-19 16:17:58 +03:00
Pranav Kant
79b21598d5 admin console: Handle spaces in filenames
Change-Id: Id63189e5a58e023669304438784d30c6ec48a1c2
2016-04-19 16:38:08 +05:30
Tor Lillqvist
d5bb373447 Improve efficiency when multiple clients of same doc ask for same tile(s)
Keep track of tiles being rendered in TileCache, and when asked to
render the same tile as is already being rendered, just "subscribe" to
the existing ongoing rendering. When a tile has been rendered and is
being sent out to clients, check if there are "subscriptions" and send
it to them, too.

One problem is that if the client that caused a tile rendering to be
initiated goes away before the rendering has completed, it will never
complete, and the subscribers are left without the tile.

Change-Id: Icca237876a0f466c29eb5bf60ffd4da3d9d68600
Reviewed-on: https://gerrit.libreoffice.org/24228
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 10:51:45 +00:00
Andras Timar
fb7de5df8e we need key.pem for admin console in http-only case too 2016-04-19 12:11:37 +02:00
Andras Timar
4864fac25a enable default admin/admin optionally (e.g. for CODE VM) 2016-04-19 12:11:37 +02:00
Pranav Kant
3e93a212f0 loolwsd: Admin console unit tests
Change-Id: Id0baa51c2adb14b77080b5acd2abf0658ee54b2b
2016-04-19 14:40:03 +05:30
Pranav Kant
3111c5c6d1 loolwsd: Use common method to send websocket messages
Will help in placing unit test hooks to better test the admin
console

Change-Id: Ic4daae685a8fe493a0395d94e40112bf119c93e3
2016-04-19 14:39:50 +05:30
Pranav Kant
56d18909d5 loolwsd: Remove unused code
Change-Id: I7edf6b8d4f83f2cf9f85a2075d1dca216cda3d34
2016-04-19 14:39:50 +05:30
Jan Holesovsky
aa158331fc Move css stuff from loleaflet.htms to the appropriate .css files. 2016-04-19 10:23:06 +02:00
Andras Timar
69c156e6dd bccu#1696 enable WOPI connection from the same host by default 2016-04-19 10:17:50 +02:00
Miklos Vajna
55f18b4038 loolwsd: fix -Werror=shadow 2016-04-19 09:35:36 +02:00
Miklos Vajna
17de53981e Storage: fix missing underscore for non-static members
Change-Id: Ibde55358c9640344e8bb4e6e24b287b1e7d8c6b5
2016-04-19 09:10:28 +02:00
Ashod Nakashian
f62f336d5c loolwsd: fix typo in config
Change-Id: I27618137bb0b6a7162c1a03806942ee0033be74e
Reviewed-on: https://gerrit.libreoffice.org/24234
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 01:44:15 +00:00
Ashod Nakashian
23003c455c bccu#1696 - enable WOPI connection from the same host by default
Since auto-discovery is problematic, this patch implements
support for both regex patterned hostnames/IPs to allow,
and those to block/deny.

A hostname/IP must be both allowed, and not denied, to
be accepted.

By setting ranges of allowed hostnames/IPs, and others
to block/deny, an admin can configure Online with
great flexibility.

Defaults updated with same values, but not exhaustive.

Change-Id: Iedfcafe41d07d905b549fb450c3fe625ad44599e
Reviewed-on: https://gerrit.libreoffice.org/24233
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 01:41:51 +00:00
Ashod Nakashian
3878f3b515 loolwsd: initialization and resetting support in RegexListMatcher
Change-Id: Ic262cf9e4a21d30b6dfd9d9fc0d895f89d7d8e7b
Reviewed-on: https://gerrit.libreoffice.org/24232
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 01:41:00 +00:00
Ashod Nakashian
7d65e30595 loolwsd: regex matching class against whitelist/blacklist
With unittests.

Change-Id: Ibb14c493cc6de61b6497ab84e34e105481afe464
Reviewed-on: https://gerrit.libreoffice.org/24231
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 01:40:37 +00:00
Henry Castro
c29944a386 loolwsd: fix close after close
The closing handshake.
Either peer can send a control frame with data containing
a specified control sequence to begin the closing handshake.

Upon receiving such a frame, the other peer sends a
Close frame in response, if it hasn't already sent one.
2016-04-18 20:27:27 -04:00
Tor Lillqvist
5c0788254b Add "exit" command and comment syntax to input files for the 'connect' program 2016-04-18 21:31:57 +03:00
Tor Lillqvist
bbcc70c69f Add debug hack to intentionally slow down tile rendering
When compiled with --enable-debug, when requesting a tile for part=42,
actually use part=0, and sleep five seconds before passing the
rendered tile back up. This makes it easier to debug handling of
simultaneous requests for the same tile from multiple clients.
2016-04-18 18:29:47 +03:00
Tor Lillqvist
d012075dc8 Sanity check 2016-04-18 16:40:28 +03:00
Andras Timar
59944636b0 allow="true" attribute has to be written out 2016-04-18 15:37:30 +02:00
Jan Holesovsky
5e96e32b56 bccu#1699: Use 256 pixels at 96dpi as the TWIPs size (3840 TWIPs). 2016-04-18 14:42:25 +02:00
Tor Lillqvist
f769474d25 The "unload" message is not implemented and likely won't be 2016-04-18 15:39:51 +03:00
Tor Lillqvist
a08b2a0e0b Just use "/" instead of Poco::Path::separator() 2016-04-18 15:34:34 +03:00
Tor Lillqvist
311a748d45 Clean up jails of exited loolkit processes sooner
In loolforkit, whenever we have forked a new loolkit, also check if
any previously forked children have exited. Remove the jails of
those. (The loolkit process itself does not even try to remove all of
its jail, see 3aadd910c6e32c0e557671effa5a4c606cd6e8bf.)

In order to be able to notice exited child processes in loolforkit, we
no longer can set the action for SIGCHLD to SIG_IGN. That means that
exiting loolkit processes will be in the zombie state until loolforkit
picks up their exit status. As loolforkit does this check only in
connection with forking a new child, zombie loolkit processes will
hang around for some time, until the next loolkit process is
forked. Not sure if this is a problem.

countLoolKitProcesses() in httpwstest now needs to skip zombies.

Loolwsd still takes care of removing whatever jails are left when it
finishes.
2016-04-18 14:30:09 +03:00
Tor Lillqvist
3aadd910c6 We can't remove jailPath when inside the chroot as it does not exist there
When inside the chroot, what we would need to do is remove everything
below / . But doing that is a bit too risky, in case some developer
screws up some detail and that code happens to run outside the chroot
after all, and the developer's machine gets trashed. So just remove
paths we can reasonably assume won't exist as global pathnames on a
developer machine: loSubPath and JAILED_DOCUMENT_ROOT.

Currently the actual complete cleanup of loolkit jails happens in
loolwsd when it is exiting. That is a bug and will have to be
fixed. It should be done in loolforkit as soon as possible after the
loolkit process has exited.
2016-04-18 13:18:39 +03:00
Andras Timar
6eaece12e1 package looltool 2016-04-18 10:31:31 +02:00
Andras Timar
4fd2354bc0 Add missing headers to dist tarball 2016-04-18 10:30:32 +02:00
Tor Lillqvist
996898f9ce The default number of preforked loolkit processes is actually just one
At least, that is the value of the num_prespawn_children element in
the loolwsd.xml as shipped. But maybe that is not what is meant with
"default"? It is unclear to me what the "default" attribute means.
2016-04-18 09:52:25 +03:00
Tor Lillqvist
70c7ca5a57 The --nocaps option does not take an argument 2016-04-18 09:49:21 +03:00
Tor Lillqvist
16e4ad5fc5 The 'loadtest' programs can surely die 2016-04-18 09:43:39 +03:00
Tor Lillqvist
c6941c71c6 Bin a few unneeded #includes and usings 2016-04-18 09:43:39 +03:00
Miklos Vajna
0f82a3a6ae loolwsd: fix -Werror,-Wshadow
Change-Id: I33095de03e5f3df3ed8919121f6a078f80c26ae9
2016-04-18 08:41:19 +02:00
Miklos Vajna
b1b947cfb3 loolwsd: fix -Werror,-Wlogical-not-parentheses
Change-Id: I035347339cf789e49994640b03f239a3e161f9b7
2016-04-18 08:40:03 +02:00
Ashod Nakashian
385359824a loolwsd: unittest to validate correct doc reloading while unloading
Change-Id: Id956fc9e243c44ecd3914b448ab92f87e011d3ee
Reviewed-on: https://gerrit.libreoffice.org/24185
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:37:54 +00:00
Ashod Nakashian
b933988a59 loolwsd: flag and wait if document is unloading before relaoding
When a new view is created on a document that is
in the process of unloading, all sorts of things
can go wrong. This is especially problematic when
the document needs to be saved before unloading,
which takes significantly longer than otherwise.

Change-Id: Ib33a18cafa9d5a3a17f6bd8c6145f9331ae54044
Reviewed-on: https://gerrit.libreoffice.org/24184
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:36:45 +00:00
Ashod Nakashian
892358e5cb loolwsd: new Admin API to remove documents
Normally, when each client view closes, the
session count is decremented until the last
view is closed. However this doesn't work
when the kit child process terminates.

Due to a race condition between the last
client disconnecting, and the internal
structure destructing, and the next
client connecting (on the same doc),
the Admin loses track of the doc and pid.

This is an issue of assuming a document
and its pid are unique and will always
remain unchanged.

This patch adds a new API to remove a
doc and all its views unconditionally
to try to avoid the above issues.

Change-Id: I0c181260679875b0464dd9b6548b29b8d6a361f7
Reviewed-on: https://gerrit.libreoffice.org/24183
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:35:29 +00:00