Seems to not cause any serious regressions in the iOS app or in "make
run", but of course I am not able to run a comprehensive check of all
functionality.
Change-Id: I44a0e8d60bdbc0a885db88475961575c5e95ce88
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93037
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
The code does not work on iOS as locales apparently are differently
named than on Linux.
Besides, we have been able to open files with arbitrary non-ASCII
names, like 000🇹🇩🇲🇶🍉🥨111.odt, just fine for some time already.
Change-Id: I3f4a342721a7ad22786b8bdb1cd9829087539178
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97020
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
It turned out that C.UTF-8 is not supported on RH7/CentOS7.
We started to use C.UTF-8 because it was widely available and we
could shave off locale data in Ubuntu based docker images and
AppImage. With this patch we fall back en_US.UTF-8 if C.UTF-8 does
not exist and add some logging.
Change-Id: Idea0ae885dc8cdd9ef33279bd90eb882a656d75c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96788
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
This hoists the common parts of the HTTPRequest
for all WOPI requests to avoid errors when changing them.
Change-Id: Ia02ef657a43b7a7d2fc13be3da012836fa0d7650
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96372
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
...and pollute the logs with warnings if it fails.
Change-Id: I71828205b8d020287f5b6d0bb82feb17c2fdd2f7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96567
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
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>
Dung out lots of pointless intermediate variables, and overly
verbose code. Vertical space is not a renewable resource.
Most variables had a consistent pattern, except these:
caller var c'tor parameter member name
Change-Id: I7910b713b8c4f6950b1e7be9c3a8e4eb4f54e249
----------------------------------------------------------
userId userid _userId
userName username _username
canWrite userCanWrite _userCanWriter
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96129
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Also called if/as/when the document is unloading as you connect.
Change-Id: I494dc207219298e07fba664cd2cbdd5d5b8ac889
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95809
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
re-factor to make it hard not to.
Change-Id: I26ebc48b4660276ede64a22167ac4779cebf5cd4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95440
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
reuse_cookies is now always encoded in the URL.
And, there is no need for the WOPISrc in the three cases
in this patch, and by passing the DocumentURI proper
(without /ws?WOPISrc=...) ensures that all query-params
in the DocumentURI are properly processed.
This fixes the reuse_cookies regression where it
wasn't passed to WOPI requests.
Change-Id: I8dccfb09a7b4102d10c1aef24f43b699a07bfed8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95293
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
...with support for properly extracting the different
fields with unit-test.
URIs are quite complex and varied. For historic reasons
they have all been treated without distinction, which
makes support for all variants difficult. RequestDetails
encapsulates this complexity, and now it is almost
completely documented both descriptively and functionally
(via extensive unit-tests).
Parsing of the URIs is now more structured by having
named fields instead of relying on knowing which
token should contain which field, which is error-prone
and very opaque.
Change-Id: I68d07c2e00baf43f0ade97d20f62691ffb3bf576
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95292
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
The tokenizer(s) are more generic than the protocol
logic, and are used from contexts that don't involve
the protocol as such.
Change-Id: Ie8c256bf11a91e466bff794021f41603c9596a7f
This avoids depending on LOOLWSD's statics, which
makes adding unit-tests much more difficult due to
the high number of dependencies LOOLWSD pulls.
Adds a number of unit-tests for RequestDetails.
Change-Id: I9f1d56f80a633505c7ff548ec0e33ffe61f59f53
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95290
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
StringVector is heavily used for tokenization
and benefits from inlining of small functions.
Also, cat doesn't need to be slower than necessary.
Change-Id: I4ab2ff1b1f1a81092049d2cde64b6df10b34b5f7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95287
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
More readable and typically more efficient.
Change-Id: I9bd5bfc91f4ac255bb8ae0987708fb8b56b398f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95285
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
because en_US.UTF-8 is not present in minimal
environments such as docker images
Change-Id: I9edcb44df8a8f33117b2c5f1d2fa9e330bfc1770
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95018
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Passing --version-hash to loolwsd now prints the
hash and exits. This is designed to be used with
proxy.php to check the version running.
Also, include the version and hash in the
hosting/capabilities JSON response.
Note that --version still prints/logs the version
and doesn't exit. It seems that is designed to
log it before running, and so it might be used
in the wild. Changing the behavior in minor upgrade
might break some production servers that have
--version added to their execution command-line.
Change-Id: I30e6945f797a902ed4b3aae6f5f1b8518000946b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94911
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Otherwise they are not passed through the proxy...
Change-Id: I307018e760ff99ac42c25ab7fa2fa3df4911ef8d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94811
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Can fix hangs on insertion where the read side of the socket is
done sending, but not yet closed.
Change-Id: Ib2e943699e54a3d566434a46200402b8ec4937e0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94798
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>