2020-10-02 03:53:04 -05:00
|
|
|
Collabora Online WebSocket server
|
|
|
|
=================================
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2015-04-23 07:53:41 -05:00
|
|
|
Dependencies
|
2015-04-21 05:48:17 -05:00
|
|
|
------------
|
|
|
|
|
2020-10-02 03:53:04 -05:00
|
|
|
Collabora Online WebSocket server has the following dependencies:
|
2015-04-21 05:48:17 -05:00
|
|
|
|
|
|
|
* libpng
|
2022-07-07 00:02:56 -05:00
|
|
|
* Poco library: https://pocoproject.org/
|
|
|
|
* libcap-dev (Debian/Ubuntu) / libcap-progs (SUSE/openSUSE) / libcap-devel (RedHat/CentOS)
|
|
|
|
* libpam-dev (Debian/Ubuntu) / pam-devel (RedHat/CentOS/SUSE/openSUSE)
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2019-09-13 03:15:48 -05:00
|
|
|
If your Linux distro doesn't provide a Poco package (versions 1.7.5 and
|
|
|
|
newer should work), you can build it yourself and install in a
|
2022-07-07 00:02:56 -05:00
|
|
|
location of your choice.
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2019-09-13 03:15:48 -05:00
|
|
|
On openSUSE Leap 15.1, you can use:
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2019-07-08 02:06:00 -05:00
|
|
|
zypper ar http://download.opensuse.org/repositories/devel:/libraries:/c_c++/openSUSE_Leap_15.1/devel:libraries:c_c++.repo
|
2020-06-09 07:16:34 -05:00
|
|
|
zypper in poco-devel libcap-progs python3-polib libcap-devel npm
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2019-09-13 03:15:48 -05:00
|
|
|
Similar repos exist for other openSUSE and SLE releases.
|
2016-03-23 08:23:41 -05:00
|
|
|
|
2015-04-21 05:48:17 -05:00
|
|
|
Building
|
|
|
|
--------
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
coolwsd uses autoconf/automake, so especially when building from .git
|
2019-09-13 03:15:48 -05:00
|
|
|
(as opposed to from a distribution tarball) you need to run:
|
2015-04-27 03:44:59 -05:00
|
|
|
|
2019-09-13 03:15:48 -05:00
|
|
|
./autogen.sh
|
2016-04-11 09:04:16 -05:00
|
|
|
|
|
|
|
and then
|
|
|
|
|
2016-04-11 12:21:16 -05:00
|
|
|
./configure --enable-silent-rules --with-lokit-path=${MASTER}/include \
|
|
|
|
--with-lo-path=${MASTER}/instdir --enable-debug
|
2015-04-21 05:48:17 -05:00
|
|
|
make
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2016-04-11 09:04:16 -05:00
|
|
|
|
2015-04-27 03:44:59 -05:00
|
|
|
where ${MASTER} is the location of the LibreOffice source tree.
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2016-04-11 09:04:16 -05:00
|
|
|
When building from a tarball less magic is needed.
|
|
|
|
|
2016-04-11 12:21:16 -05:00
|
|
|
Run 'make check' after each commit.
|
2016-02-17 04:43:03 -06:00
|
|
|
|
2021-11-16 03:59:05 -06:00
|
|
|
Note that the coolforkit program needs the CAP_SYS_CHROOT capability,
|
2015-04-22 07:50:09 -05:00
|
|
|
thus you will be asked the root password when running make as it
|
|
|
|
invokes sudo to run /sbin/setcap.
|
|
|
|
|
2015-04-21 05:48:17 -05:00
|
|
|
If you have self-built Poco, add the following to ./configure:
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2015-04-23 06:44:41 -05:00
|
|
|
--with-poco-includes=<POCOINST>/include --with-poco-libs=<POCOINST>/lib
|
|
|
|
|
|
|
|
where <POCOINST> means the Poco installation location.
|
2015-03-18 08:36:27 -05:00
|
|
|
|
2015-04-21 07:24:28 -05:00
|
|
|
If you have the Poco debugging libraries (eg. you have a self-built
|
|
|
|
Poco), you can add --enable-debug to the configure options for
|
|
|
|
additional debugging.
|
2015-03-09 04:30:56 -05:00
|
|
|
|
|
|
|
For Windows, a proper VS2013 project is needed.
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2015-04-21 07:24:28 -05:00
|
|
|
There is still unconditional debugging output etc. This is a work in
|
|
|
|
progress.
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2015-04-21 05:48:17 -05:00
|
|
|
Running
|
|
|
|
-------
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2021-01-26 06:28:54 -06:00
|
|
|
You can just do:
|
2016-04-11 12:21:16 -05:00
|
|
|
|
|
|
|
make run
|
|
|
|
|
2021-11-03 06:19:43 -05:00
|
|
|
and follow the link that recommends (see browser/README for more info).
|
2016-04-11 12:21:16 -05:00
|
|
|
|
|
|
|
Again, ${MASTER} is location of the LibreOffice source tree with a built
|
|
|
|
LibreOffice. This is work in progress, and consequently needs the latest
|
|
|
|
LibreOffice master.
|
|
|
|
|
|
|
|
|
|
|
|
Running manually
|
|
|
|
----------------
|
|
|
|
|
|
|
|
If you want to do the 'make run' yourself, you need to set up a minimal
|
|
|
|
chroot system, and directory for the jails:
|
2015-04-23 10:24:22 -05:00
|
|
|
|
2015-04-27 03:44:59 -05:00
|
|
|
SYSTEMPLATE=`pwd`/systemplate # or tweak for your system
|
|
|
|
ROOTFORJAILS=`pwd`/jails # or tweak for your system
|
|
|
|
|
2015-04-27 04:00:31 -05:00
|
|
|
rm -Rf ${SYSTEMPLATE} # clean
|
2021-11-17 15:09:50 -06:00
|
|
|
./coolwsd-systemplate-setup ${SYSTEMPLATE} ${MASTER}/instdir # build template
|
2015-04-27 04:00:31 -05:00
|
|
|
mkdir -p ${ROOTFORJAILS} # create location for transient jails.
|
2015-04-23 10:24:22 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
To run coolwsd the way it is supposed to eventually be run "for real", you can
|
2015-04-23 10:24:22 -05:00
|
|
|
now do:
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
./coolwsd --o:sys_template_path=${SYSTEMPLATE} --o:child_root_path=${ROOTFORJAILS}
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2015-04-27 03:44:59 -05:00
|
|
|
The ${SYSTEMPLATE} is a directory tree set up using the
|
2021-11-17 15:09:50 -06:00
|
|
|
coolwsd-systemplate-setup script here. (It should not exist before
|
2015-05-19 06:17:46 -05:00
|
|
|
running the script.) It will contain the runtime environment needed by
|
|
|
|
the LibreOffice dynamic libraries used through LibreOfficeKit.
|
|
|
|
Improvements to that script are very likely needed on various distros.
|
2015-04-14 10:30:23 -05:00
|
|
|
|
2015-04-27 03:44:59 -05:00
|
|
|
The ${ROOTFORJAILS} directory above is a presumably initially empty
|
2021-11-18 06:08:14 -06:00
|
|
|
directory under which coolwsd will create chroot jails for editing
|
2015-04-21 07:24:28 -05:00
|
|
|
each specific document.
|
2015-04-14 10:30:23 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
As coolwsd uses hardlinks to "copy" the contents of both
|
2015-04-27 03:44:59 -05:00
|
|
|
${SYSTEMPLATE} and the ${MASTER}/instdir directories into each chroot
|
|
|
|
jail, ${SYSTEMPLATE} and ${MASTER}/instdir need to be on the same file
|
|
|
|
system as ${ROOTFORJAILS}.
|
2015-04-14 10:30:23 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
Leaflet files are served itself by coolwsd internal file server. You
|
2016-06-27 02:41:41 -05:00
|
|
|
can specify the root of this fileserver using the --o:file_server_root_path
|
2021-11-18 06:08:14 -06:00
|
|
|
flag in coolwsd commandline. By default, if you do not specify this
|
|
|
|
flag, the parent directory of coolwsd/ is assumed to be the
|
2016-06-27 02:41:41 -05:00
|
|
|
file_server_root_path. So, for development purposes, you can access the
|
2021-11-10 06:35:56 -06:00
|
|
|
COOL files (using /browser/), but it is advised to explicitly set
|
2016-06-27 02:41:41 -05:00
|
|
|
the file_server_root_path to prevent any unwanted files from reading,
|
2021-11-15 10:00:44 -06:00
|
|
|
especially when cool is deployed for normal public usage on servers.
|
2016-04-11 12:21:16 -05:00
|
|
|
|
2021-11-10 06:35:56 -06:00
|
|
|
Please note that it is necessary that all the COOL files that are
|
2021-11-03 06:19:43 -05:00
|
|
|
meant to be served is under a directory named 'browser'. Since, the
|
2021-11-10 06:35:56 -06:00
|
|
|
COOL files, in the git repo, are itself in a directory named
|
2021-11-03 06:19:43 -05:00
|
|
|
'browser', this would work out of the box for development purposes.
|
2016-04-11 12:21:16 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
If you run coolwsd on HTTPS, you have to set up your own private key
|
2016-04-20 04:46:31 -05:00
|
|
|
and certificates (in PEM format only). The name and location of key,
|
|
|
|
certificate and CA certificate chain is defined in
|
2021-11-18 06:08:14 -06:00
|
|
|
${sysconfdir}/coolwsd/coolwsd.xml. Dummy self-signed cert.pem,
|
2016-04-20 04:46:31 -05:00
|
|
|
ca-chain.cert.pem and key.pem are already included, but it is better
|
2016-08-09 12:39:29 -05:00
|
|
|
to replace those with your own files.
|
|
|
|
|
|
|
|
To generate the new self-signed certificate, you can do the following. Maybe
|
|
|
|
there is a less verbose way, but this worked for me:
|
|
|
|
|
|
|
|
# create tha ca-chain.cert.pem
|
|
|
|
|
|
|
|
mkdir private
|
|
|
|
|
|
|
|
openssl genrsa -aes256 -out private/ca.key.pem 4096
|
|
|
|
|
|
|
|
# You will be asked many questions, put the IP in Common Name
|
|
|
|
openssl req -new -x509 -days 365 -key private/ca.key.pem -sha256 -extensions v3_ca -out ca.cert.pem
|
|
|
|
|
|
|
|
openssl genrsa -aes256 -out private/intermediate.key.pem 4096
|
|
|
|
|
|
|
|
openssl req -sha256 -new -key private/intermediate.key.pem -out intermediate.csr.pem
|
|
|
|
|
|
|
|
mkdir -p demoCA/newcerts
|
|
|
|
touch demoCA/index.txt
|
|
|
|
echo 1000 > demoCA/serial
|
|
|
|
openssl ca -keyfile private/ca.key.pem -cert ca.cert.pem -extensions v3_ca -notext -md sha256 -in intermediate.csr.pem -out intermediate.cert.pem
|
|
|
|
|
|
|
|
cat intermediate.cert.pem ca.cert.pem > ca-chain.cert.pem
|
|
|
|
|
|
|
|
# create the key / cert
|
|
|
|
|
|
|
|
openssl genrsa -out key.pem 2048
|
|
|
|
|
|
|
|
openssl req -sha256 -new -key key.pem -out csr.pem
|
|
|
|
|
|
|
|
# change "unique_subject = yes" to "unique_subject = no" in demoCA/index.txt.attr
|
2016-08-11 17:37:06 -05:00
|
|
|
# otherwise you'll get the following error:
|
|
|
|
# failed to update database
|
|
|
|
# TXT_DB error number 2
|
2016-08-09 12:39:29 -05:00
|
|
|
|
|
|
|
openssl ca -keyfile private/ca.key.pem -cert ca.cert.pem -extensions usr_cert -notext -md sha256 -in csr.pem -out cert.pem
|
|
|
|
|
|
|
|
HTTPS is the default. HTTP-only mode can be enabled with --disable-ssl
|
2018-09-28 04:54:20 -05:00
|
|
|
configure option.
|
2016-03-22 05:39:22 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
If you plan to hack on coolwsd, you probably want to familiarize
|
|
|
|
yourself with coolwsd's --o:num_prespawn_children switch, and the 'connect'
|
2016-04-20 05:00:46 -05:00
|
|
|
test program.
|
2015-04-14 10:30:23 -05:00
|
|
|
|
2016-04-20 05:00:46 -05:00
|
|
|
For interactive testing, you can use the 'connect' program. It accepts
|
|
|
|
"commands" from the protocol on standard input.
|
2015-03-04 17:14:04 -06:00
|
|
|
|
2018-10-05 06:41:00 -05:00
|
|
|
|
|
|
|
Test running with integration for developers
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
|
|
Unless you want to test SSL itself, it is easier to go for the non-SSL option.
|
|
|
|
|
|
|
|
Setup Nextcloud or ownCloud on localhost, and install the richdocuments app.
|
|
|
|
Good tutorials exist how to install ownCloud or Nextcloud, we don't repeat
|
|
|
|
them here. richdocuments is called Collabora Online in the respective app
|
|
|
|
stores / marketplaces / whatever.
|
|
|
|
|
|
|
|
When you have a running Nextcloud or ownCloud instance at
|
|
|
|
http://localhost/nextcloud or at http://localhost/owncloud
|
|
|
|
go to Collabora Online settings, and set the WOPI URL to
|
|
|
|
http://localhost:9980
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
Then in the build tree, edit the generated coolwsd.xml and set ssl setting to
|
|
|
|
false. You can run make run, and test coolwsd with the ownCloud or Nextcloud
|
2018-10-05 06:41:00 -05:00
|
|
|
integration.
|
|
|
|
|
2016-03-22 05:39:22 -05:00
|
|
|
Admin Panel
|
|
|
|
-----------
|
|
|
|
|
2016-05-11 05:07:27 -05:00
|
|
|
You can access the admin panel by directly accessing the admin.html file
|
2021-11-03 09:39:37 -05:00
|
|
|
from browser directory. See browser/README for more details.
|
2016-05-11 05:07:27 -05:00
|
|
|
|
|
|
|
Websocket connections to admin console can be made at path: /adminws/ on the
|
2021-11-18 06:08:14 -06:00
|
|
|
same url and port as coolwsd is running on. However, one needs a JWT token to
|
2016-05-11 05:07:27 -05:00
|
|
|
authenticate to the admin console websocket. This is stored as a cookie with
|
|
|
|
`Path: /adminws/` when user successfully authenticates when trying to access
|
2021-11-03 06:19:43 -05:00
|
|
|
/browser/dist/admin/admin*html files (HTTP Basic authentication). Token
|
2016-05-11 05:07:27 -05:00
|
|
|
is expired after every half an hour, so websocket connection to admin console
|
|
|
|
must be established within this period.
|
|
|
|
|
|
|
|
It should also be possible to do various sorts of tasks such as killing
|
2016-12-05 10:10:46 -06:00
|
|
|
documents that are open for more than 10 hours etc. See protocol.txt for
|
2016-05-11 05:07:27 -05:00
|
|
|
various commands. Only tricky thing here is getting the JWT token which can
|
|
|
|
be obtained as described above.
|
2016-03-22 05:39:22 -05:00
|
|
|
|
2015-04-23 10:24:22 -05:00
|
|
|
Debugging
|
|
|
|
---------
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
When debugging, you want to add --o:num_prespawn_children=1 to the coolwsd parameters to
|
2015-04-23 10:24:22 -05:00
|
|
|
limit the amount of concurrently running processes.
|
|
|
|
|
|
|
|
When the crash happens too early, you also want to
|
|
|
|
|
|
|
|
export SLEEPFORDEBUGGER=<number of seconds>
|
2019-12-18 14:28:14 -06:00
|
|
|
or
|
|
|
|
export PAUSEFORDEBUGGER=1
|
2015-04-23 10:24:22 -05:00
|
|
|
|
|
|
|
so that you have time to attach to the process.
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
Then run coolwsd, and attach your debugger to the process you are
|
2021-11-16 03:59:05 -06:00
|
|
|
interested in. Note that as the coolforkit executable file has
|
2016-04-11 09:00:11 -05:00
|
|
|
capabilities set, so when debugging that you need to run the debugger
|
|
|
|
with super-user privilege.
|
2015-04-28 03:14:46 -05:00
|
|
|
|
|
|
|
Also, note that as the child processes run in a chroot environment,
|
|
|
|
they see the LibreOffice shared libraries as being in a directory tree
|
|
|
|
/lo , but your debugger does not. So in order to be able to
|
|
|
|
effectively debug the LibreOffice code as used through LibreOfficeKit
|
2021-11-18 06:08:14 -06:00
|
|
|
by a child coolwsd process, you need to symlink the "lo" subdirectory
|
|
|
|
of a running child coolwsd process's chroot jail as /lo. Something like:
|
2015-04-28 03:14:46 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
sudo ln -s ~/libreoffice/master/cool-child-roots/1046829984599121011/lo /lo
|
2015-04-28 03:14:46 -05:00
|
|
|
|
|
|
|
Use the ps command to find out exactly the path to use.
|
2015-04-21 05:48:17 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
Set COOL_DEBUG=1 to trap SIGSEGV and SEGBUS and prompt for debugger.
|
2016-01-10 21:13:32 -06:00
|
|
|
|
2019-12-18 14:28:14 -06:00
|
|
|
if you choose PAUSEFORDEBUGGER send the signal SIGUSR1 to resume the process
|
|
|
|
|
2020-01-23 10:56:00 -06:00
|
|
|
In order to run and debug one unit test, run the commandline that is printed
|
|
|
|
when the test fails. To run one single CppUnit test from a suite, additionally use:
|
2016-07-04 14:38:21 -05:00
|
|
|
|
2020-01-23 10:56:00 -06:00
|
|
|
CPPUNIT_TEST_NAME="HTTPWSTest::testCalcEditRendering" <printed commandline>
|
2016-07-04 14:38:21 -05:00
|
|
|
|
2015-04-21 05:48:17 -05:00
|
|
|
Protocol description
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
See protocol.txt for a description of the protocol to be used over the
|
|
|
|
websocket.
|
2015-04-24 06:34:43 -05:00
|
|
|
|
2016-01-06 23:41:32 -06:00
|
|
|
Architecture
|
|
|
|
------------
|
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
There are three processes: CoolWSD, CoolForKit, and CoolKit.
|
2016-01-06 23:41:32 -06:00
|
|
|
|
|
|
|
WSD is the top-level server and is intended to run as a service.
|
2016-04-07 03:27:43 -05:00
|
|
|
It is responsible for spawning ForKit and listening on public
|
|
|
|
port for client connections.
|
2016-01-06 23:41:32 -06:00
|
|
|
|
2016-04-07 03:27:43 -05:00
|
|
|
The ForKit is only responsible for forking Kit instances. There is
|
|
|
|
only one ForKit per WSD instance and there is one Kit instance per
|
|
|
|
document.
|
2016-01-06 23:41:32 -06:00
|
|
|
|
|
|
|
WSD listens on a public port and using internal pipes requests
|
2016-04-07 03:27:43 -05:00
|
|
|
the ForKit to fire a child (Kit) instance to host documents.
|
|
|
|
The ForKit then has to find an existing Kit that hosts that
|
2016-01-06 23:41:32 -06:00
|
|
|
document, based on the public URI as unique key, and forward
|
|
|
|
the request to this existing Kit, which then loads a new
|
|
|
|
view to the document.
|
|
|
|
|
2016-04-12 10:34:54 -05:00
|
|
|
There is a singleton Admin class that gets notified of all the
|
|
|
|
important changes and update the AdminModel object accordingly.
|
2016-03-21 14:32:45 -05:00
|
|
|
AdminModel object has subscribers which corresponds to admin
|
|
|
|
panel sessions. Subscriber can subscribe to specific commands
|
|
|
|
to get live notifications about, and to update the UI accordingly.
|
|
|
|
|
2016-01-06 23:41:32 -06:00
|
|
|
Whether a document is loaded for the first time, or this is
|
|
|
|
a new view on an existing one, the Kit connects via a socket
|
|
|
|
to WSD on an internal port. WSD acts as a bridge between
|
2016-04-07 03:27:43 -05:00
|
|
|
the client and Kit by tunnelling the traffic between the two
|
|
|
|
sockets (that which is between the client and WSD and the one
|
2016-01-06 23:41:32 -06:00
|
|
|
between WSD and Kit).
|
|
|
|
|
|
|
|
File System
|
|
|
|
-----------
|
|
|
|
|
|
|
|
WSD is given childroot argument on the command line. This is
|
|
|
|
the root directory of jailed FS. This path can be anywhere, but
|
|
|
|
here we'll designate it as:
|
|
|
|
|
|
|
|
/childroot
|
|
|
|
|
2016-04-07 03:27:43 -05:00
|
|
|
Before spawning a ForKit instance, WSD needs to generate a random
|
2016-01-06 23:41:32 -06:00
|
|
|
Jail-ID to use as the jail directory name. This JailID is then
|
2016-04-07 03:27:43 -05:00
|
|
|
passed to ForKit as argument jailid.
|
2016-01-06 23:41:32 -06:00
|
|
|
|
|
|
|
Note: for security reasons, this directory name is randomly generated
|
2016-04-07 03:27:43 -05:00
|
|
|
and should not be given out to the client. Since there is only one
|
|
|
|
ForKit per WSD instance, there is also one JailID between them.
|
2016-01-06 23:41:32 -06:00
|
|
|
|
2016-04-07 03:27:43 -05:00
|
|
|
The ForKit creates a chroot in this directory (the jail directory):
|
2016-01-06 23:41:32 -06:00
|
|
|
|
|
|
|
/childroot/jailid/
|
|
|
|
|
2016-04-07 03:27:43 -05:00
|
|
|
ForKit copies the LO instdir (essentially installs LO in the chroot),
|
2016-01-06 23:41:32 -06:00
|
|
|
then copies the Kit binary into the jail directory upon startup.
|
|
|
|
Once done, it chroot-s and drops caps.
|
|
|
|
|
2016-04-07 03:27:43 -05:00
|
|
|
ForKit then waits on a read pipe to which WSD writes when a new
|
|
|
|
request from a client is received. ForKit is responsible for spawning
|
2016-01-06 23:41:32 -06:00
|
|
|
(or forking) Kit instances. For our purposes, it doesn't matter
|
|
|
|
whether Kit is spawned or forked.
|
|
|
|
|
|
|
|
Every document is hosted by a Kit instance. Each document is stored
|
|
|
|
in a dedicated directory within the jail directory. The document
|
|
|
|
root within the jail is /user/docs. The absolute path on the system
|
|
|
|
(which isn't accessible to the Kit process as it's jailed) is:
|
|
|
|
|
|
|
|
/childroot/jailid/user/docs
|
|
|
|
|
|
|
|
Within this path, each document gets its own sub-directory based on
|
|
|
|
another random Child-ID (which could be the Process ID of the Kit).
|
2016-04-07 03:27:43 -05:00
|
|
|
This ChildId will be given out to clients to facilitate the insertion
|
|
|
|
and downloading of documents. (Although strictly speaking the client
|
2016-01-06 23:41:32 -06:00
|
|
|
can use the main document URI as key, this is the current design.)
|
|
|
|
|
|
|
|
/childroot/jailid/user/docs/childid
|
|
|
|
|
|
|
|
|
2016-04-07 03:27:43 -05:00
|
|
|
A request from a client to load a document will trigger the following
|
2016-01-06 23:41:32 -06:00
|
|
|
chain of events.
|
|
|
|
|
|
|
|
- WSD public socket will receive the connection request followed
|
|
|
|
by a "load" command.
|
|
|
|
- WSD creates MasterProcessSession (ToClient) to handle the client traffic.
|
2016-04-07 03:27:43 -05:00
|
|
|
- MasterProcessSession requests ForKit to find or spawn Kit for
|
2016-01-06 23:41:32 -06:00
|
|
|
the given URI.
|
2016-04-07 03:27:43 -05:00
|
|
|
- ForKit sends Kit request to host URI via pipe.
|
2016-01-06 23:41:32 -06:00
|
|
|
- Kit connects to WSD on an internal port.
|
|
|
|
- WSD creates another MasterProcessSession (ToPrisoner) to service Kit.
|
|
|
|
- MasterProcessSession (ToClient) is linked to the ToPrisoner instance,
|
|
|
|
copies the document into jail (first load only) and sends
|
|
|
|
(via ToPrisoner) the load request to Kit.
|
|
|
|
- Kit loads the document and sets up callbacks with LOKit.
|
|
|
|
- MasterProcessSession (ToClient) and MasterProcessSession (ToPrisoner)
|
2016-04-07 03:27:43 -05:00
|
|
|
tunnel the traffic between client and Kit both ways.
|
2016-01-06 23:41:32 -06:00
|
|
|
|
|
|
|
|
2015-04-24 06:34:43 -05:00
|
|
|
Coding style
|
|
|
|
------------
|
|
|
|
|
|
|
|
There is not really any serious rationale why the code ended up being
|
|
|
|
written in the style it is... but unless you plan to change some style
|
2016-04-20 04:51:28 -05:00
|
|
|
detail completely and consistently all over, please keep to the style
|
2015-04-24 06:34:43 -05:00
|
|
|
of the existing code when editing.
|
|
|
|
|
|
|
|
The style is roughly as follows, in rough order of importance:
|
|
|
|
|
|
|
|
- As in LO, no hard TABs in source files. Only spaces. Indentation
|
|
|
|
step is four columns.
|
|
|
|
|
|
|
|
- As in LO, the braces { and } of the block of if, switch, and while
|
|
|
|
statements go on separate lines.
|
|
|
|
|
2016-01-15 00:40:51 -06:00
|
|
|
- Following Poco conventions, non-static member variables are prefixed
|
|
|
|
with an underscore. Static members have a CamelCase name.
|
2015-04-24 06:34:43 -05:00
|
|
|
|
|
|
|
- Do use C++11. I admit in some places (out of laziness or ignorance)
|
|
|
|
I use Poco API even if there probably is an equivalent std::
|
|
|
|
API. (Like for threads.) Feel free to change those, if the std:: API
|
|
|
|
is not much more verbose or ugly, and you are sure it is equivalent.
|
|
|
|
|
|
|
|
- Always prefer the C++ wrapped version of a C library
|
|
|
|
API. I.e. include <cstring> instead of <string.h>, use std::memcpy()
|
|
|
|
instead of memcpy(), etc.
|
|
|
|
|
|
|
|
- Use std:: prefix for all std API, i.e. don't ever do "using
|
|
|
|
std;". But it's OK to use "using Poco::Foo;" all over. Maybe that is
|
2016-01-06 23:41:32 -06:00
|
|
|
not a good idea? But please no "using" in headers.
|
2015-04-24 06:34:43 -05:00
|
|
|
|
|
|
|
- Member functions use camelCaseWithInitialLowerCase. I don't like
|
|
|
|
CamelCaseWithInitialUpperCase.
|
|
|
|
|
2016-07-28 01:39:03 -05:00
|
|
|
- [ No kind of Hungarian prefixes. ]
|
2017-03-30 04:15:28 -05:00
|
|
|
|
|
|
|
- return - is not a function; but a statement - it doesn't need extra ()
|
|
|
|
|
2018-02-07 07:58:23 -06:00
|
|
|
- Use 'auto' in the following cases only:
|
|
|
|
|
|
|
|
- iterators
|
|
|
|
|
|
|
|
- range-based for loops
|
|
|
|
|
|
|
|
- the type is spelled out in the same line already (e.g. initializing from a
|
|
|
|
cast or a function that has a single type parameter)
|
|
|
|
|
|
|
|
In other cases it makes the code more readable to still spell out the type
|
|
|
|
explicitly.
|
2023-08-14 01:19:13 -05:00
|
|
|
|
|
|
|
Security credential related changes
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
- Instead of the usual one, two reviews are needed.
|
|
|
|
|
|
|
|
- Instead of just choosing the 'approve' option on GitHub, please add your
|
|
|
|
explicit sign-off to the commit message when you review.
|