Commit Graph

84 Commits (master)

Author SHA1 Message Date
Rashesh Padia c1f0fcf946 indirection_server: migrate document on shutdown
- when COOLWSD get SIGTERM admin sends a "shutdown_received" message to
indirection server
- indirection server sends back migration messages for each document to
migrate it other available COOL server
- there is timeout associated with migration message if COOLWSD doesn't
get message we move on and close the document
- added a new option in coolwsd.xml to change the migration timeout
default is 180s

Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>
Change-Id: Id7d5eea94d1b03ea5905ca67a9dd8f6ca15952f3
2024-05-07 20:26:46 +05:30
Ashod Nakashian 4dfb7ee312 killpoco: use http::Response for Admin metrics
Change-Id: I86eed98061bdb24d4bca8de452e4d4f925f27e93
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian 61cf7b9601 wsd: clean up unused header includes
Clang-tidy recommendation driven header
include clean-up.

Change-Id: I30c32866b7798e70df0463ee6bc7a0bcc3de5049
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-08 08:38:48 +01:00
Ashod Nakashian a44e9411a8 wsd: admin: minor clean-up of memory-tracking members
Change-Id: If06545a097cd13318870f0e6f675367985035a12
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-12-30 10:36:44 +00:00
Rash419 f203a4d68f admin: indirection add new command for sanity check
- routetoken_sanity_check

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ieaabcd044b65ad0620089ae6413e3f626ff68c4c
2023-12-05 10:46:31 +05:30
Michael Meeks 7183a3d3de spdx: improve machine and human readability of headers.
Change-Id: Ice934380029bf27054e830fffc07a5d037d1430f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Michael Meeks 47b89b32ef spdx: improve machine and human readability of headers.
Change-Id: I1b6dcd2ec1fbef6556d70b8af3ccfd5d6a95c59a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-10-31 10:33:07 +00:00
Caolán McNamara 7c9c0f487e cid#321979 Big parameter passed by value
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id514b14c6bfda08cd561d5c75ab2430b933a8919
2023-10-20 17:01:47 +02:00
Rash419 11a0e78ed4 admin:log activities irrespective of logging.level
- It logs activities like when admin logged in, authenticated
  metrics endpoint accessed, external monitor getting connected
  and admin actions like kill the document etc

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I059f6b6ee0d8269aec7e3f521622773e348304a3
2023-10-17 14:57:10 +05:30
Rash419 fcce324cbf admin: added retryInterval option in monitor config
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: If0b94bb043a6a4883affac6cf38adcffd3b72b9a
2023-06-29 18:21:33 +02:00
Rash419 b717be603e implement document migration
- updated protocol.txt

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I67a0515580979e15223ea084c835f5ed801ceb5e
2023-06-29 18:21:33 +02:00
Rash419 f7af990485 admin: added a seprate state for the uploaded document
- previously we set the Modified state in admin panel only when
  wsd successfully upload the document to storage
- modified state updation depends on core, it might happen that
  uploading is already done and successfull but we didnot get
  the modified state from the core which will show wrong modified
  status in admin panel

Change-Id: I014a8f92753fc6a93b37921d0f3cdce390bef35e
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
2023-05-04 11:35:07 +05:30
Ashod Nakashian 3dbfce54d3 wsd: helper to dump the state of an object as a string
Change-Id: Ib49a47be2dc37663ef06ac80be981c9f3c029814
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-04-11 08:03:01 -04:00
Rash419 bd3dee9cbc admin: fix: monitor doesnot try connecting again after disconnecting
regression from 49bac0da17

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Id006db718d49da2b1f9142c4d6d5c6985b18ecc9
2023-02-14 14:55:48 +01:00
Rash419 7e06860ddf js: get full uri from indirection server
instead of just routeToken

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I3755fc2536d4358d2c63effdc9e9f9e5da246504
2023-01-31 15:32:30 +01:00
Rash419 c5fd805619 admin: added new admin->client command
routing_rmdoc command is added specifically to notify indirection url
server about document getting removed with its wopiSrc

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ic077f210d520394e3ef8ced778604b7343436328
2023-01-31 15:32:30 +01:00
Rash419 c1dbe39a29 admin: monitors configurable with remote config
- make sure online connect to unique monitors
- able to disconnect monitor if uri doesnot exist in updated
  json

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ia6cfd6c8e56416c37d211aae55828c92a4ba27e5
2023-01-31 15:32:30 +01:00
Michael Meeks ef09966978 mutex include cleanup.
Change-Id: I63d4184260d204a9d5f7658ad51fbe63dbb3c9e4
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-08-31 21:31:31 +01:00
Michael Meeks f91e0349d8 Admin: shutdown cleanly to avoid races during close.
Suspect cause for SEGV in:

    std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<DocumentBroker> >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<DocumentBroker> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<DocumentBroker> > > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    COOLWSD::closeDocument(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Admin::triggerMemoryCleanup(unsigned long)
    Admin::pollingThread()

Change-Id: Id09e4db4b21cb7a11dddb867758aded4b28ff3ec
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-03-03 09:04:06 +00: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
Rash419 ea4d455f3a Admin Console: add wopihost name in the dashboard
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8ce68653200bb16877f6ced57fc77f6291b375a8
2021-09-09 10:13:40 +05:30
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
Gökay Şatır 8b937cfc14 Rename _channelName to channelName.
Change-Id: Ib0fe1f7cfcff4747cd8c0a520204fcf36410d546
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
2020-12-07 17:30:51 -05:00
Gökay Şatır b51413c0a0 Admin console: Cosmetic changes and documentation.
Change-Id: I977b5bc56f44c44b8bedf9f9bd710e7050fe67ff
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
2020-12-07 17:30:51 -05:00
Gökay Şatır ace1c23a99 Admin console log levels.
Now chosen log level is propagated to forkit and kits.
Also, admin console users can filter logs according to their channel names on client side.

Change-Id: Ife15a6148ed87533b81e9d63da252c633e74e559
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
2020-12-07 17:30:51 -05:00
Michael Meeks c069f72c4d Socket - re-work disposition to ensure we transfer sockets.
A number of call-sites, eg. clipboard, or admin-ws were
writing to sockets assuming they could return all the data
in a single series of writes, without needing to poll. As
such they failed to addSocketToPoll on the new poll - eg.
the docBroker. Unfortunately this meant that on EAGAIN
writes, the socket would be closed and the last parts
of a message lost.

Browsers would give net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)

The situation is/was intermittent, so painful to debug.
On under-loaded developer machines, socket buffers are larger,
so this was seldom seen.

The re-factor forces a transfer to another SocketPoll via
the disposition, except for a couple of corner cases.

Change-Id: I2f1b2f99f179c4fda84464c9241fe434fa527725
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2020-12-07 14:32:43 +00:00
Andras Timar 0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +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
Gabriel Masei 16f6d8c25a admin: notify subscribers that doc memory has changed
Change-Id: I139c7d49a2cd1b86c3a281613f5628f6af8b3365
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95133
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-06-04 12:59:34 +02:00
Ashod Nakashian 4a8937d0d1 wsd: performance improvements
Change-Id: I137dc67b4231df1cd23a9dce72e6b12dc1bf364e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95343
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-06-02 20:01:39 +02:00
gokaysatir ac682772a6 tdf#114982 - AdminConsole: control logging
Change-Id: I53cf4b0ff81ea9d6bf4ad595077f7365e7e34c00
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94130
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-05-30 11:10:19 +02:00
Pranam Lashkari 8b349716eb killpoco: removed Poco::Process completely
Change-Id: Iba67abf9342c11517c69c1d94903bf4752aa87d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/83770
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-29 14:27:54 +02:00
Gabriel Masei d006204478 wsd: admin: send smaps fd along websocket upgrade request
Change-Id: I2c5c23284b7578f4c177ec337cc1262bf1259e96
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93074
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-28 17:20:07 +02:00
Andras Timar 33000dfded typo fixes in comments and code
Change-Id: I6f31e050aab701e31064e1abc9429dce0a50c279
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92953
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-04-26 23:19:52 +02:00
Gabriel Masei 6b486f229a wsd: admin: move kit memory reporting from kit to admin module
Sometimes kit process goes into a heavy processing state (or even hangs)
and is not able to report its memory usage. Thus we can't implement cleanup
of problematic kit processes based on memory information reported by kit.
By moving memory reporting to admin module we avoid this problem.

Change-Id: Icf274e3a3a97b33623a93f9d2dc1e640ad9b7d99
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92752
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-25 09:11:35 +02:00
Michael Meeks b0f7cf992f Admin: cleanup lifecycle of Document.
When moving items across to _expiredDocuments we could end up
default copy constructors and destructors instead of swapping,
which can cause grief when extended. Switch to unique_ptr to
protect us in the future & clean.

Change-Id: I5bcdb95786c783eaacde972bbed4e5e7efc67f02
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92888
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-25 09:11:13 +02:00
Tor Lillqvist 4eb598711c Use #pragma once
LibreOffice core uses that, too, and we support an even more
restricted set of compilers.

Change-Id: I0d0e2c8608e323eb5ef0f35ee8c46d02ab49a745
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92467
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-18 15:00:18 +02:00
Michael Meeks 28a9c4dc05 Poll - cleanup method naming, and fix merge issues.
This mends several problems from commit
5710c86323.

Change-Id: I1b29f29ca81679608a2692488fa1ef22b2e62dfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92032
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-10 13:58:00 +02:00
Michael Meeks 5710c86323 Poll - switch to ppoll for closer to microsecond accuracy.
Change-Id: Ib8a2bb6f60302df8631edadbbb8db626894c457c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92000
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-10 10:06:23 +02:00
Gabriel Masei 0ac330f599 Add segmentation fault metric for Kit processes
Change-Id: Ifb0de004274213ef512f601e4419f98f456c7288
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91857
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-08 15:06:39 +02:00
Gabriel Masei 70af76e28c Replaced pipe with websocket based on Unix socket in communication with ForKit
Change-Id: I80f1a4e84ca6820503966a8ee5d9958a150eac14
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91585
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-07 15:04:47 +02:00
Miklos Vajna a4e0a00bfe Add an initial libfuzzer based fuzzer for the admin console
Run the actual fuzzer like this:

./admin_fuzzer -max_len=16384 fuzzer/admin-data/

Change-Id: I5891df8033ff1837afce86775ee62447587f2f20
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91504
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-02 12:11:24 +02:00
Miklos Vajna 797c996c56 Fix -Werror,-Woverloaded-virtual warnings
Probably these were just not adapted by accident in commit
f70e627795 (WebSocket - simplify
handleMessage for now., 2020-03-05).

Change-Id: I578d95d938c0c466e9547dcda3d2b297dc347a34
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90076
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-06 11:31:43 +01:00
Gabriel Masei 2164f5207c Add REST endpoint for admin metrics.
Change-Id: I701485631931334d27594c4907cb770f9888e5bf
Reviewed-on: https://gerrit.libreoffice.org/82492
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-25 13:06:01 +01:00
Miklos Vajna 5391c09fba tools: make members private in Map
Change-Id: I9f23d5095e387888e43c0a0d2e6ed041ac5aed68
2019-01-10 09:11:55 +01:00
Miklos Vajna 8244726d39 MonitorConnectRecord: make members private
Change-Id: I485ed48bca0e5c2c0be15f44f553fc48651c59c9
2019-01-09 08:45:53 +01:00
Miklos Vajna 8ad281e12f wsd: avoid unnecessary value parameter 2018-07-09 09:11:20 +02:00
Jérémie Lesage f084ea53f6 Ensure all sessions have a sessionId and are subscribed.
Simplify constructors, and factor out subscription code.

Change-Id: I4f3ed1eb06abec193d6db1f7c78815ffe1e1b5aa
2018-06-29 18:10:03 +01:00
Michael Meeks 7475120c81 If a monitor is dis-connected, try to re-connect it.
Change-Id: I04f254acfe823f07e7fb11b277e661c09e146ebd
2018-05-18 17:35:19 +01:00
Michael Meeks b483f477dd Allow a 'monitor' to be connected to remotely if configured.
So far monitors have the access an permissions of an
authenticated admin.

Change-Id: I59dfa8a646a60584a5c113ee0521e9afba4f6b76
2018-05-18 15:16:39 +02:00