Commit graph

98 commits

Author SHA1 Message Date
Andras Timar
1d3c553e51 cosmetics: tab to space
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib0d019a79f3739080bb5fdd78bfbcb39b6ee2c0a
2021-04-15 11:31:43 +02:00
Gabriel Masei
21d514ecff admin: add support for lost kits cleanup
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I31969196aa138b6da964c867679ec23f34c89fd0
2021-04-01 22:09:44 +01:00
Ashod Nakashian
5cffde8734 wsd: limit the maximum PDF rendering resolution
Rendering PDF documents to images can consume
large amount of memory. Here we limit the
maximum allowed resolution to 384. This is
about 400% zoom resolution, given that the
100% resolution is 96 dpi.

If this proves limiting, it can be increased
to 480 dpi, which is about 500% zoom scale.

Change-Id: I719118d517bbaf8b204411223f1e26a31b97ca99
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-01 15:54:30 -04:00
Ashod Nakashian
c323da92d1 wsd: support configurable PDF rendering resolution
The defined envar is used by Core to override its
default resolution (of 96 dpi), when specified.

Change-Id: Ie7164e78f98990ac88b02dbfe2becbae8c134e9c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-01 15:54:30 -04:00
Henry Castro
1df271b363 config: add "macro_security_level" item
"Level of Macro security".

Change-Id: I491648f2a89289c7f4455dfad76d73ac8449b965
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-03-12 08:23:56 -04:00
Henry Castro
50c0fc4492 config: add "enable_macros_execution" item
"Specifies whether the macro execution is enabled in
general. This will disable Basic, Beanshell, Javascript
and Python scripts. If it is set to false, the
macro_security_level is ignored. If it is set to true,
the mentioned entry specified the level of macro security".

Change-Id: I4bc5b690268a93994d17e2b02b7b60b6398646b7
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-03-12 08:23:56 -04:00
Michael Meeks
6307f1ee3d Allow jwt token expiry to be configurable.
Change-Id: Ifd2b078adfa3106765f5b54c0397e04ab66fc804
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-05 18:33:09 +00:00
Miklos Vajna
78f192399d Revert "wsd: disable ssl by default, enable ssl termination by default"
This reverts commit f6bf6f49ed. I did not
consider that this makes it harder to do a local developer setup with
reverse proxy + make run; also that if you don't read the doc to set up
a reverse proxy, then the default now serves http content and advertises
https, which is not helping sysadmins.

This needs more thinking how to improve one scenario without hurting
others.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic789faa2dc5bb19a79d651dc81d4eaaf0b48607a
2021-01-14 13:59:44 +01:00
Miklos Vajna
f6bf6f49ed wsd: disable ssl by default, enable ssl termination by default
The intention is to have defaults which are close to how people
typically use Online in production.

However, keep using ssl for 'make run', so that the https environment in
the browser is unchanged.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I7fd725a83b0e9ca1012f2c0e0c3bf038e5fa0059
2021-01-13 13:33:44 +01:00
Andras Timar
3f81bfd987 Add /var/log (default log path) to ReadWritePaths of loolwsd.service (fixes GH #739)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I47e8a0983fd74656739498bf02bad117e821cfbf
2020-11-20 20:19:43 +01:00
Andras Timar
f4e52a81d8 The non-implemented WebDAV host was cleaned up, so let's kill these references, too.
Change-Id: Ib677fd35c9a2a1d72f2d8b4de0d37f92c691dded
2020-10-07 18:41:43 +02:00
Yunus Bulut
35ad7d4265 Destroy WebDAVStorage and <webdav> section #169
Change-Id: I7ce095f722599a37b82e8789baeb6145028dd10d
2020-10-07 14:55:26 +03:00
Andrea Gelmini
9d01540680 Fix typos
Change-Id: I7d487f32ca43e19023760ef3c6bb1683607f93d1
2020-10-07 12:51:08 +02:00
Ashod Nakashian
c5f9d605e4 wsd: make outgoing connection timeout configurable
The default Poco connection timeout is 60 seconds,
which is probably excessive. The current configurable
default is a more reasonable 30 seconds.

Currently we set this timeout on Storage connections
going out (i.e. WOPI connections).

Change-Id: Ie80a9141ca9bf721addc74baf94e62e0ad72fdd2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98913
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ash@collabora.com>
2020-08-11 20:11:14 +02:00
Ashod Nakashian
5c9988f2e3 wsd: faster jail setup via bind-mount
loolmount now works and supports mounting and
unmounting, plus numerous improvements,
refactoring, logging, etc..  When enabled,
binding improves the jail setup time by anywhere
from 2x to orders of magnitude (in docker, f.e.).

A new config entry mount_jail_tree controls
whether mounting is used or the old method of
linking/copying of jail contents. It is set to
true by default and falls back to linking/copying.
A test mount is done when the setting is enabled,
and if mounting fails, it's disabled to avoid noise.

Temporarily disabled for unit-tests until we can
cleanup lingering mounts after Jenkins aborts our
build job. In a future patch we will have mount/jail
cleanup as part of make.

The network/system files in /etc that need frequent
refreshing are now updated in systemplate to make
their most recent version available in the jails.
These files can change during the course of loolwsd
lifetime, and are unlikely to be updated in
systemplate after installation at all. We link to
them in the systemplate/etc directory, and if that
fails, we copy them before forking each kit
instance to have the latest.

This reworks the approach used to bind-mount the
jails and the templates such that the total is
now down to only three mounts: systemplate, lo, tmp.

As now systemplate and lotemplate are shared, they
must be mounted as readonly, this means that user/
must now be moved into tmp/user/ which is writable.

The mount-points must be recursive, because we mount
lo/ within the mount-point of systemplate (which is
the root of the jail). But because we (re)bind
recursively, and because both systemplate and
lotemplate are mounted for each jails, we need to
make them unbindable, so they wouldn't multiply the
mount-points for each jails (an explosive growth!)
Contrarywise, we don't want the mount-points to
be shared, because we don't expect to add/remove
mounts after a jail is created.

The random temp directory is now created and set
correctly, plus many logging and other improvements.

Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-07-01 05:42:43 +02:00
Szymon Kłos
3141bf7775 notebookbar: Introduce switch in loolwsd.xml
Change-Id: I94546a899fde1cecc2c35dc527e41e8a36061750
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93050
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2020-06-30 08:16:25 +02:00
Andras Timar
faf9ccbd0a Add LOKit logging option to configuration file
Environment variable in sysconfig.loolwsd was not good, because:
1) it was a systemd antipattern
2) this systemd environment file was not present on all distros
3) we had to take care about this separately, when we did not start
   loolwsd from systemd

Change-Id: I5c47668ca388c2f4b0afd6da8c575a3fb3cfab3b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96291
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-06-15 16:06:37 +02:00
Gabriel Masei
ac17984226 admin: cleanup resource consuming kits
Change-Id: Ifafbadc61b788adc90c03fb92e0231f9e599c360
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95794
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-06-09 11:25:44 +02:00
Michael Meeks
2cbf6d12a0 Proxy: only accept request from localhost.
Also - add net.proxy_prefix setting to enable this.

Change-Id: I87f5aab2316c053ea1bc8cc177e4a54ba0455697
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93682
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-05-08 18:05:14 +02:00
Michael Meeks
92eff552a5 Lower convert-to process priorities by default.
Interactive / editing processes should take precedence over batch
thumbnailing processes to keep responsiveness good.

Change-Id: Ib100409e312cb2ca545586a734711a31a92f110c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93323
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-05-02 22:03:36 +02:00
Michael Meeks
f9f392ab5c Storage: add as_scheme to allow auto-determination of whether to use SSL.
This is the new default - do as we're told by the client.
The old setting is left to allow users to force SSL if they are
concerned that they may receive unhelpful URLs.

Change-Id: Idea83aacea6826a8f37264e34d49c7550efe6d27
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93179
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-30 14:53:25 +02:00
Andras Timar
6ad6028b91 add more info to description of storage.ssl.ca_file_path setting
Change-Id: I35ad72be99635fcc11d552072b52ffbd45ba3044
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93036
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-04-28 15:39:15 +02:00
Muhammet Kara
f507302993 Welcome: Add config for enabling the dismiss button
Change-Id: Ia2fbf066493d91a2b10866e66d11332b5cfc10fa
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92593
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-04-20 20:35:08 +02:00
Jan Holesovsky
f004090201 Revert "Welcome: fix the default path of welcome message"
This reverts commit df4a241d0f.

Reason for revert: As we agreed, we have to improve the default,
but this patch actually just doubles something that is working
out of the box.

Change-Id: Idc22dabc3621d537f1bba3bc3b13a7d943c80c36
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92299
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-16 13:25:23 +02:00
Andras Timar
df4a241d0f Welcome: fix the default path of welcome message
Change-Id: I4661c005e8c284a16c708ee26d7922f5789c3e04
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92344
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-04-16 12:44:03 +02:00
Jan Holesovsky
0ec796dbee Welcome: Add ./configure of the welcome message default.
Change-Id: I090c7d657d2b0a696117f64f25c11ffb249fb272
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92277
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-16 11:36:00 +02:00
Jan Holesovsky
7f96586922 Welcome: Serve the release notes files from a given (configured) directory.
Change-Id: Iae36c1c48fee963659662436d594be659908a3e3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92216
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-16 11:30:00 +02:00
Michael Meeks
fa14102b3b Restore Javascript protocol logging.
If you don't want protocol logging by default in debugging builds
then either poke loolwsd.xml:

<protocol type="bool" descr="Enable minimal client-site JS protocol logging from the start">false</protocol>

Or - configure with --disable-debug and --disable-debug-protocol.

Also remove redundant and unused co-ordinate parameters to the
message queue, and logging.

Change-Id: I489e32ef4758a6f0ef35c8d8d322a402a3e268e6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91096
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-03-26 19:35:04 +01:00
Andras Timar
d04e1f4bd7 tabs to spaces
Change-Id: I8feb0f88e50c31ece6247b6f1c940b5cef8ed420
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89853
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-03-02 21:54:36 +01:00
Aron Budea
dff1d32624 Default redlining_as_comments config to false
For better performance, many comment boxes reduce performance in
browser.

Change-Id: If041c3d147ee7512d90f41a4a1bfe7a1ff8646a9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89065
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2020-02-20 04:59:07 +01:00
Andras Timar
e24eda5d64 tdf#129928 add a comment
Change-Id: I3e9714445b8144445d71113450827dd72bcf0ba5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88441
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-02-12 11:20:01 +01:00
Eduard Ardeleanu
3ca4d27957 Update per_document loolwsd settings
Remove obsolete settings: limit_virt_mem_kb, limit_data_mem_kb and add entry for setting limit_virt_mem_mb

Change-Id: Ieda5bdc9078f94ab2269d96092d7718b068f4fc7
Reviewed-on: https://gerrit.libreoffice.org/85288
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-12-17 12:19:56 +01:00
Michael Meeks
83e02ab38b Add a time limit for badly behaved / huge document conversions.
Handles problems with load, save, and lingering DocumentBrokers.

Change-Id: I6079cba3a4fa2a84c303b3a8669d94863a04f474
2019-12-12 03:38:50 +00:00
Ashod Nakashian
70b8939688 loolwsd.xml: improve the description of server_name
Change-Id: I002d09e8bcccdea64eec3c804615ce678e4bb0e4
Reviewed-on: https://gerrit.libreoffice.org/84712
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-12-08 21:14:54 +01:00
Michael Meeks
0d97efbfcc locking: renew lock after timeout.
Change-Id: I6191ee34239b978292aeb6795be74312a954e240
2019-11-27 19:17:27 +00:00
Andras Timar
8d5d9e427f APP_NAME tweaks
Change-Id: I16016cfc575620f98c0124fdb85e39cf56e0453a
2019-11-27 12:16:07 +01:00
mert
8ca7391f05 Added an option to override watermark texts
in loolwsd.xml. If set, watermarks will be the same
as entered for all the views instead of per view
watermarks sent in CheckFileInfo

Change-Id: I0943520423abc2567f44920f8679057b3cfbf01f
Reviewed-on: https://gerrit.libreoffice.org/83666
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-25 13:10:05 +01:00
Michael Meeks
98617e40e2 Enable protocol debugging by default in debug mode.
Also add a config option for logging.protocol - to help catch early
protocol issues during startup.

Change-Id: I6f0cc6dcf14b2797bc6b2bd36c44750d74eb0608
2019-11-15 18:01:02 +00:00
Ashod Nakashian
8c4edb5087 Reuse cookies from the browser
Reviewed-on: https://gerrit.libreoffice.org/78195
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 8deecf4ea6966c059458bdc71e365be426238e09)

Change-Id: I96bbdd3e71bc9d0ecfddea7debc0ebcc303a49ae
Reviewed-on: https://gerrit.libreoffice.org/81558
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-28 10:45:14 +01:00
Michael Meeks
2f534842cd fallback to ssl.enable for storage.ssl.enable for back-compat.
Implements TODO from 5d57f5aef3

Change-Id: I32bc4cc2b875a4ec44bc8d254af7b03c8016e887
2019-10-25 10:57:24 +01:00
Andras Timar
5d57f5aef3 storage.ssl.enable should be in sync with ssl.enable by default
storage.ssl.enable=false by default is not good. loolwsd default config should
work, e.g. in case of snapshot docker images. When ssl.enable=true, this implies
storage.ssl.enable=true, because browsers do not allow mixed content, so it is
not possible to connect to the storage with plain HTTP, while the content from
loolwsd is served with HTTPS.

TODO: find out what to do in case of upgrade, when the user has an old config
file. Probably storage.ssl.enable should default to ssl.enable when it is not
present in config file.

Change-Id: Ifdcb070745d649dd9840dccf2e5641058a13d4e4
Reviewed-on: https://gerrit.libreoffice.org/80660
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-10-11 23:43:09 +02:00
Gabriel Masei
d597f22dac Add minimal TLS support for communication with storage
Change-Id: Iafd9946a4240063c07f5c519b8af30b52e23d3e8
Reviewed-on: https://gerrit.libreoffice.org/80373
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-08 18:57:36 +02:00
Andras Timar
db176ee45b Remove lo_template_path option
It was not very useful to let this setting configurable by the user.
On the other hand, old path in config file caused issues after
upgrade. It is better to decide the location of LOKit core
during compilation. From now on the --with-lo-path configure
option is compulsory.

Change-Id: Icdcbc21bde5dad329fdb6e30ed17efde6b0e73de
Reviewed-on: https://gerrit.libreoffice.org/79943
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-10-08 09:36:44 +02:00
Szymon Kłos
0a6ba8d727 Set default out of focus time to 2 minutes
Change-Id: Iff2c75ec820e55aef0b16d52da39db200806cafe
2019-10-03 14:50:17 +01:00
Michael Meeks
f384b8a414 Add watermark opacity setting.
Change-Id: I839e8aef91acfed40d4afd8c1b50176ed54c670a
2019-08-26 16:29:12 -04:00
Ashod Nakashian
919a93cd4b wsd: improved anonymization algorithm
Better hashing algorithm based on FNV-1a.
Adds support for salting the hash, and
for providing salt via configuration.

More unit-tests added, and better formatting.

Change-Id: I2be42675d0cdbaa73c3d7faed99e07631a9c20fc
Reviewed-on: https://gerrit.libreoffice.org/70034
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71091
2019-08-17 04:26:35 +02:00
Ashod Nakashian
226c2fe71c wsd: unify anonymization flags under one
This simplifies the anonymization configuration
as virtually always they are all either enabled
together, or not at all.

Change-Id: I6fe60f5287fc5d71cd7a6ac3268eac67e5e6e9fb
Reviewed-on: https://gerrit.libreoffice.org/70033
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71090
2019-08-17 03:42:19 +02:00
Andras Timar
c5f5e7312a Allow Docker's 172.17.0.0/16 subnet in sample (default) net.post_allow.host array
Change-Id: I49ad6093e4f390ac2ae647615f81c2ebf1dcc469
Reviewed-on: https://gerrit.libreoffice.org/74620
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-06-24 08:56:14 +02:00
Miklos Vajna
717816d44d wsd: add new always_save_on_exit config option
The default behavior is unchanged: once the last editor exits, we still
only perform a save when the document is modified.

It's possible to opt in for the new behavior, though: in that case the
save after the exit of the last editor will happen even for unmodified
documents.

Change-Id: I14c17035a932cf952217f3b71fdef57fede0ce24
2019-06-06 11:48:54 +02:00
Miklos Vajna
3c927a9f32 wsd: allow disabling idlesave and autosave from configuration
The code already assumed a signed integer, but the configuration advertised
unsigned, standardize on signed.

This way it doesn't matter if the "disable" value is zero or a negative
number.

Change-Id: I56632c8a36be01afefdc5f2a35e70bde945d69d3
2019-06-05 17:28:03 +02:00