Commit graph

242 commits

Author SHA1 Message Date
Ashod Nakashian
cefc71b198 wsd: add ContentSecurityPolicy manager
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 995c24345eeedc7cbd9e81f9b6c151e79b695fdc)

Change-Id: I75d6da58019d218a121bdf7bc72e73dd0f320216
2023-06-19 07:45:02 -04:00
Ashod Nakashian
9e8238310c make: failing jail cleanup is not fatal
In some cases jail cleaning up may fail.
In such a case, we still want to be able
to build a fresh set of binaries, which
are used to run coolwsd --cleanup.

Since cleaning up the jails and the
systemplate are not strictly required
to building, we now only emmit a warning
and move on.

Change-Id: I4ebf7772cf767b579810247c427d86efa5a6d3ad
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-06-19 07:45:02 -04:00
codewithvk
71039cb0e4 Condense common parameters in Makefile.am
Signed-off-by: codewithvk <vivekpatel7202@gmail.com>
Change-Id: Ie3027c63cc31eea2dea2cb0a997d296a24476581
2023-06-03 14:55:58 +01:00
Ashod Nakashian
c6dd263ab1 make: silence clang complaining of -pthread
The clang linker doesn't need -pthread and
warns of unknown command-line option.

This detects clang and forgoes the -pthread
flag to the linker.

Change-Id: I658cd887c567a5beeeae0e6e1b6d596231894c1b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-15 08:47:26 +01:00
Andras Timar
39e83470a8 Remove distro-specific code from rpm spec file
We'd like to build distro independent rpm packages.
Distro specific macros and other code were removed.
The empty environment file for systemd was removed, it can be
easily created by the user, if necessary.
The obsolete trigger for rebuilding the systemplate was removed,
because we no longer copy system libs to systemplate.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I0ac9be8f72a7089e38349abc1dff0d39b0410e44
2023-05-14 21:29:00 +02:00
Ashod Nakashian
d8d88c740d make: generate compile_commands.json for all .cpp files
Best to have all .cpp files in compile_commands.json
so they can all benefit from the tools that leverage
it. So now we recursively generate the file for all
.cpp files in all subdirectories. Most notably, now
all test files are included.

Change-Id: I312d812463607b32fe6b9e83b10900c17ae86185
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-02 19:54:31 -04:00
Andras Timar
48a1101970 add common/LangUtil.hpp to distribution
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ic7ad5f7a75cab91d7f34d1455737a8838564c502
2023-03-14 23:37:19 +01:00
Andras Timar
e23bb604b8 add OPENSSL_CFLAGS to include path when SSL is enabled
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I1a65f15bd8bfa7a25e368fa54c62fd8f06a3bd8a
2023-02-26 18:50:58 +01:00
Tor Lillqvist
01953730f2 Do build also the browser dir in the (quick-and-dirty) Emscripten case
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ibe7782c8dadd232b4ee4f2f9585e0649d4eb71f1
2023-01-16 18:43:21 +02:00
Tor Lillqvist
1889fe2016 When we are building WASM we don't build the browser subdirectory
This is how I imagine that this stuff should work:

- In one tree you build with --host=wasm32-local-emscripten. This
  results in only the WASM binary being built, containing C++ code
  from Collabora Office core and C++ code from Online (to a similar
  extent as in the iOS, Android, and gtk apps). No HTML and JS for the
  client's browser is produced in this tree. The embedded filesystem
  from the corresponding WASM core build could be copied into this
  tree for use as below. (Or, alternatively the build in the other
  tree could look into the config.status file in this tree to figure
  out where to pick up the embedded fs data file.)

- In another tree you build with --with-wasm-fallback=<path to the
  above WASM tree>. Note that the C++ code will be built normally in
  this case, for Linux. This build results in an otherwise normal COOL
  build, with the added feature that the COOL server sends the whole
  document file also to the COOL client whenever it is saved. The HTML
  and JS browser code will have code that enables receiving the
  document in this case, plus incremental updates to the document (if
  possible), and code to detect that the connection to the COOL server
  is broken and then fall back to using the local WASM in the
  browser. Obviously the WASM binary and related JS and other data
  (like the embedded file system from core) will have to be downloaded
  into the client right at the start, to be present if the connection
  breaks, but the WASM will likely not need to be started until
  needed.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I945c93451d3f5f0b1bc6ad8550da64e8e6453b6b
2023-01-15 19:46:37 +01:00
Michael Stahl
901ad84339 WASM add simple automake file and dummy cpp file
Copy the list of .cpp files from the Android project, assuming this will
be similar in scope.

Signed-off-by: Michael Stahl <michael.stahl@allotropia.de>
Change-Id: I57c7ad2f10d1867307ff4fcea3d0c650726d18d8
2023-01-09 15:21:37 +02:00
Andras Timar
a077c4288b Put all Zotero logic to browser
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib1b071b96322511b7f319ff6b851e902b3556fbb
2022-12-12 13:35:29 +01:00
Pranam Lashkari
2cfae369af initial zotero skeleton
add zotero UI only if user is logged in
when zotero citation edit button is clicked,
fetch the library with zotero API.
Let user select what to insert

at this stage its not a complete solution but just first stage

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Id67d8409bcd6416994713acd9ace495b24823fb0
2022-11-30 20:37:48 +01:00
Andras Timar
d17fb50487 enable link to non-system libpng and openssl
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I109242bde268e63e9918af0f44fcb456e2b8f6c5
2022-11-28 12:41:59 +01:00
Ashod Nakashian
5892bcba1e wsd: test: refactor client connection management
The client connection management had nothing to
do with the WopiTestServer and it was there
for convenience. The issue was that it was
not available to tests that do not need
the custom WopiTestServer and depending
on it would make them unnecessarily
complicated.

This adds a new intermediary class to manage
client connections in tests. The reason
this logic didn't move to UnitWSD or even
UnitBase is simply because the client
connection logic depends on the helpers
namespace and other test-specific code
that isn't available in COOLWSD. In short,
UnitBase and UnitWSD are primarily an
interface that COOLWSD and co depend on
and cannot contain test-specific logic
that isn't linked to coolwsd.

We also move the UnitWebSocket helper class.

Change-Id: I79567774164e137349dc162482529578f150353c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-11-14 18:15:39 -05:00
Michael Meeks
2def6dc3d5 Switch to zstd image compression.
zstd provides for much faster compression server-side, as well
as better decompression.

zstd allows us to de-compress a keyframe and several deltas in a
single call in JS, so it is necessar to add a terminator to the
delta stream so that we can detect when to flush the buffer we
are working on - so the next delta applies to the correct data.

Change-Id: I0e292e3a697b4902d6488b7c04deaba2d1485e94
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-11-02 12:09:53 +01:00
Michael Meeks
1407aedf1f coolstress: add man-page, cleanup somewhat and document a little.
Change-Id: I57b6bb7bde6e0fa8ffd9a08cf5b9d8c8b4759bf2
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-09-01 13:33:20 +01:00
Ashod Nakashian
82a5c3173d wsd: fuzzer: fix build
Change-Id: Ib52e32de04e7af230ed21eed11e0855050e97c74
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian
9419b7ef0d make: minimize fuzzer dependency duplication
Change-Id: I6ff335ab6e4ddeb950cd03ddb08a793790327579
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian
a87d1ae54f wsd: add HttpEcho fuzzer
This is a full round-trip http fuzzer.
It can achieve >1000 iterations per second
on a single 2 Ghz core, even while going
through the network loopback layer.
The advantage is that more networking code
is fuzzed this way, including not just
the http code, but also the sockets.

Change-Id: I75d21bd0e25221ee6621097a2605d62c4bb2ae4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian
5c6516e4e4 wsd: support code-coverage report via --with-coverage
This adds support for code-coverage HTML reporting.
To achieve this, we must use file-linking in jails
so that we can update the coverage data (.gcda files)
from the jails. This means that creating jails is
slower than with bind-mounting and we need to
account for that in our timeouts.

We also can't kill child processes with SIGKILL,
which is un-catchable. Instead, we use SIGTERM
and dump the profile data before exiting.

Change-Id: I16fa534f6ed42f7133014d841bb024423315e0a4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 14:45:12 -04:00
Henry Castro
79bd9e42cb wsd: proxy: add ProxyRequestHandler files
Change-Id: Ic61f70316e921ba3cb988a3b0f8f8d2c7df89cc6
Signed-off-by: Henry Castro <hcastro@collabora.com>
2022-06-27 16:04:32 +01:00
Michael Meeks
47275c6f9e This should do something cooler.
Change-Id: I90d6028c91e88034b48ab91de7429ebde5ba5c25
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-05-10 11:48:33 +01:00
Ashod Nakashian
96adaa15d1 wsd: kill coolwsd_fuzzer
coolwsd_fuzzer predates actual fuzzing
with libfuzzer and is currently unsused.

Change-Id: Id095b165943ba14dbf525ddc607ad329f5d952d4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-20 07:12:03 -04:00
Ashod Nakashian
827d9518c0 wsd: make: build the fuzzer binaries only configured with fuzzing
This reduces the build time significantly while also
minimizing the disk-space requirements for builds.

When configured with --enable-fuzzers the fuzzing
target binaries are built.

Change-Id: Ia8560d876f548d04ac085503e55a3a5dca90f590
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-20 07:12:03 -04:00
Ashod Nakashian
b34de7fad1 wsd: move STATE_ENUM to common/StateEnum.hpp
With some minor modifications.

Change-Id: I5bc06bd96bbf201ccaee87170d052b4ad2a6c778
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-06 18:33:45 -04:00
Rash419
31d8822758 wsd: cleanup: moved all parsing related static methods and containers to HostUtil.cpp
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8555522c6216f893b90ba4c27747314830f7abd2
2022-03-29 12:18:31 +02:00
Ashod Nakashian
1022a7e78e Revert "wsd: exclude deprecated openssl API"
Apparently this breaks the build on at least
CentOS. Reverting for now.

This reverts commit 23f02b8929.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Change-Id: Ie8f00bbc53a63098b473d625846c0b6fd4e074bd
2022-03-22 08:41:59 +01:00
Ashod Nakashian
23f02b8929 wsd: exclude deprecated openssl API
There are no deprecated API currently in use,
but that is a moving target as we upgrade openssl.
This prevents any accidental use of deprecated API
and will reveal any deprecated API used in any
particular build.

Change-Id: I969f7f7c4efe163d4704dea9aab45c09550baa40
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-21 08:57:41 +00:00
Michael Meeks
42f565faf7 add $ make stress
Change-Id: I7da764b711f1a143ee67ef7a2f48fc34e3d17487
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-03-04 10:06:33 +00:00
Michael Meeks
96b15bd704 Count and report on various internal exceptions.
An initial set of seven of these, easy to add more as/when needed.

Change-Id: I6c65e052d00f9eaa10adee3c9464043e4c594848
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-02-18 13:51:41 +00:00
Ashod Nakashian
4fcd07b172 make: silence chmod failure on missing path
Change-Id: I38d302377a26f2ebe4a734b5f16286613e762891
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
3d04a857bd wsd: test: improved and simplify test logging
Build-time unit-test output is now only
displayed when the test fails. This is to
reduce noise while building when not helpful.

Change-Id: I273d97dae192a24e9a1ae9f662b0fcd7ff555b75
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
203a58f6d8 wsd: test: add SaveOnExit test
Refactor UnitWOPIDocumentConflict.cpp into
WOPIUploadConflictCommon.hpp and reuse for both
DocumentConflict and SaveOnExit tests.

Change-Id: I54ec1e37e5e9c6298b12a2b2e596363683fb2e34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-08 20:46:01 -05:00
Aron Budea
c6155a3513 coolconfig: Add config migration tool
Usage:
coolconfig migrateconfig [--old-config-file=<path>]
  [--config-file=<path>] [--write]

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I44e16bd07588887e01732b430e4c6e368a034cd1
2022-01-10 20:11:26 +01:00
Jan Holesovsky
dbe05b2d48 Cleanup the old binaries
Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: I16375c3d1c55cf7bda690a3c71dd5c996cd8be5a
2021-11-19 21:16:32 +01:00
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Andras Timar
504c05df3b rename: loolwsd-systemplate-setup -> coolwsd-systemplate-setup
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I699db87f94f9080909c2ca783e04ad8b4dd98025
2021-11-17 22:10:58 +01:00
Andras Timar
bf5bce7669 rename: loolwsd-generate-proof-key -> coolwsd-generate-proof-key
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I3aa30ce4e5f6df2068fa2e0788034e83cb0ae26b
2021-11-17 22:06:34 +01:00
Andras Timar
26d71a293a rename: remove old man files, add coolwsd man file, and create compat loolwsd symlink
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I4171e2d2825924cf73da692e743f2041a546b1a9
2021-11-17 22:02:46 +01:00
Mert Tumer
f32715a7bb rename: loolconvert -> coolconvert
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I3283cb0d222fbdf1edb09b549ae7945d6370c289
2021-11-17 21:51:05 +01:00
Mert Tumer
b59fbe8d4c rename: loolmap -> coolmap
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I3136305d5733c5c7a886baa230fd4c1e1401b734
2021-11-17 21:51:05 +01:00
Mert Tumer
c9a4d2f6f3 rename: loolmount -> coolmount
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ic025c5a76c6f27cdf1a6267f24cf8052733f1f24
2021-11-17 21:51:05 +01:00
Mert Tumer
5ebabf9f58 rename: loolwsd -> coolwsd only binary
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ia44f7f96bcad7200031ad87f6a6fdd3e361f2808
2021-11-17 18:08:19 +03:00
Andras Timar
9a88a95097 --disable-lool-user-checking was renamed to --disable-cool-user-checking at some places, now replace it everywhere
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I881f8b7adfbb396da8beb07c4d0300a153ecd304
2021-11-17 09:56:09 +01:00
Mert Tumer
81f61c8073 rename: loolforkit -> coolforkit
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I1de688dce4b068bff35451604486b72ecc8c91d4
2021-11-16 21:02:24 +01:00
Andras Timar
cde4d9322e add compatibility symlink 'loolconfig' for 'coolconfig'
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I4715b4469d5f11f63eff4b76651eee549000c1c2
2021-11-15 22:07:53 +01:00
Mert Tumer
78ccaa845e rename: loolconfig -> coolconfig
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ied23cb46a668f754931fc125745b674b546a0195
2021-11-15 22:07:53 +01:00
Jan Holesovsky
74d601920e Remove even the loleaflet/ dir if it is around
Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: Ib264307672ea3fa351a1540fd3f4a6fafdd87d5a
2021-11-10 17:18:56 +01:00
Henry Castro
e3ebcb8f09 makefile: rename loleaflet -> browser
Change-Id: Iaaa33e3da68995e3d20ade69e7c70eaf27b32500
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-10 17:18:56 +01:00