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>
feature/calczoom
Andras Timar 2019-10-01 10:35:38 +02:00
parent 36eb587517
commit db176ee45b
9 changed files with 30 additions and 32 deletions

View File

@ -287,7 +287,7 @@ run: all @JAILS_PATH@
@cp $(abs_top_srcdir)/test/data/hello.ods $(abs_top_srcdir)/test/data/hello-world.ods
@cp $(abs_top_srcdir)/test/data/hello.odp $(abs_top_srcdir)/test/data/hello-world.odp
@echo
./loolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" --o:lo_template_path="@LO_PATH@" \
./loolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
@ -311,7 +311,7 @@ run-valgrind: all @JAILS_PATH@
@cp $(abs_top_srcdir)/test/data/hello.ods $(abs_top_srcdir)/test/data/hello-world.ods
@cp $(abs_top_srcdir)/test/data/hello.odp $(abs_top_srcdir)/test/data/hello-world.odp
valgrind --tool=memcheck --trace-children=no -v --read-var-info=yes \
./loolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" --o:lo_template_path="@LO_PATH@" \
./loolwsd --o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
@ -327,7 +327,7 @@ run-gdb: all @JAILS_PATH@
@cp $(abs_top_srcdir)/test/data/hello.odp $(abs_top_srcdir)/test/data/hello-world.odp
gdb --tui --args \
./loolwsd --o:security.capabilities="false" \
--o:sys_template_path="@SYSTEMPLATE_PATH@" --o:lo_template_path="@LO_PATH@" \
--o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
@ -343,7 +343,7 @@ run-callgrind: all @JAILS_PATH@
@cp $(abs_top_srcdir)/test/data/hello.odp $(abs_top_srcdir)/test/data/hello-world.odp
valgrind --tool=callgrind --simulate-cache=yes --dump-instr=yes --num-callers=50 --error-limit=no --trace-children=yes \
./loolwsd --o:security.capabilities="false" \
--o:sys_template_path="@SYSTEMPLATE_PATH@" --o:lo_template_path="@LO_PATH@" \
--o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \
@ -359,7 +359,7 @@ run-strace: all @JAILS_PATH@
@cp $(abs_top_srcdir)/test/data/hello.odp $(abs_top_srcdir)/test/data/hello-world.odp
strace -o strace.log -f -tt -s 256 \
./loolwsd --o:security.capabilities="false" \
--o:sys_template_path="@SYSTEMPLATE_PATH@" --o:lo_template_path="@LO_PATH@" \
--o:sys_template_path="@SYSTEMPLATE_PATH@" \
--o:child_root_path="@JAILS_PATH@" --o:storage.filesystem[@allow]=true \
--o:ssl.cert_file_path="$(abs_top_srcdir)/etc/cert.pem" \
--o:ssl.key_file_path="$(abs_top_srcdir)/etc/key.pem" \

View File

@ -506,29 +506,32 @@ AS_IF([test -n "$LOKIT_PATH"],
[CPPFLAGS="$CPPFLAGS -I${LOKIT_PATH}"])
lokit_msg="$LOKIT_PATH"
LO_PATH="/usr/lib64/libreoffice"
AC_MSG_CHECKING([for LibreOffice path])
if test -n "$with_lo_path"; then
# strip trailing '/' from LO_PATH, 'ln -s' with such path will otherwise fail
LO_PATH="${with_lo_path%/}"
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([LibreOffice path must be configured: --with-lo-path])
fi
JAIL_PATH=not-set
SYSTEMPLATE_PATH=not-set
have_lo_path=false
AC_MSG_CHECKING([whether to run tests against a LibreOffice])
if test -n "$with_lo_path"; then
# strip trailing '/' from LO_PATH, 'ln -s' with such path will otherwise fail
LO_PATH="${with_lo_path%/}"
version_file="$with_lo_path/program/versionrc"
if test -f $version_file; then
JAILS_PATH="\${abs_top_builddir}/jails"
SYSTEMPLATE_PATH="\${abs_top_builddir}/systemplate"
have_lo_path=true
lo_msg="test against $LO_PATH"
AC_MSG_RESULT([yes])
else
lo_msg="no integration tests"
AC_MSG_RESULT([no])
fi
version_file="$with_lo_path/program/versionrc"
if test -f $version_file; then
JAILS_PATH="\${abs_top_builddir}/jails"
SYSTEMPLATE_PATH="\${abs_top_builddir}/systemplate"
have_lo_path=true
lo_msg="test against $LO_PATH"
AC_MSG_RESULT([yes])
else
lo_msg="no integration tests"
AC_MSG_RESULT([no])
lo_msg="no integration tests"
AC_MSG_RESULT([no])
fi
AC_SUBST(LO_PATH)
AC_DEFINE_UNQUOTED([LO_PATH],["$LO_PATH"],[Path to LibreOffice installation])
AC_SUBST(JAILS_PATH)

View File

@ -81,7 +81,7 @@ cp -a libreoffice/instdir "$INSTDIR"/opt/libreoffice
# build
( cd online && ./autogen.sh ) || exit 1
( cd online && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-silent-rules --with-lokit-path="$BUILDDIR"/libreoffice/include --with-lo-path="$INSTDIR"/opt/libreoffice $ONLINE_EXTRA_BUILD_OPTIONS) || exit 1
( cd online && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-silent-rules --with-lokit-path="$BUILDDIR"/libreoffice/include --with-lo-path=/opt/libreoffice $ONLINE_EXTRA_BUILD_OPTIONS) || exit 1
( cd online/loleaflet/po && ../../scripts/downloadpootle.sh )
( cd online/loleaflet && make l10n) || exit 1
( cd online && scripts/locorestrings.py "$BUILDDIR"/online "$BUILDDIR"/libreoffice/translations )

View File

@ -43,4 +43,4 @@ perl -pi -e "s/<password (.*)>.*<\/password>/<password \1>${password}<\/password
) &
# Start loolwsd
su -c "/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/libreoffice --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd ${extra_params}" -s /bin/bash lool
su -c "/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd ${extra_params}" -s /bin/bash lool

View File

@ -71,7 +71,7 @@ To see an example:
* run loolwsd, like:
./loolwsd --o:sys_template_path=${SYSTEMPLATE} --o:lo_template_path=${MASTER}/instdir --o:child_root_path=${ROOTFORJAILS}
./loolwsd --o:sys_template_path=${SYSTEMPLATE} --o:child_root_path=${ROOTFORJAILS}
Note that this will, by default, set the loolwsd's file server's root to the parent directory of loolwsd,
which means you can access all the files in loleaflet using /loleaflet/ path. It is advised to set

View File

@ -6,7 +6,6 @@
<allowed_languages desc="List of supported languages of Writing Aids (spell checker, grammar checker, thesaurus, hyphenation) on this instance. Allowing too many has negative effect on startup performance." default="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru">de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru</allowed_languages>
<sys_template_path desc="Path to a template tree with shared libraries etc to be used as source for chroot jails for child processes." type="path" relative="true" default="systemplate"></sys_template_path>
<lo_template_path desc="Path to a LibreOffice installation tree to be copied (linked) into the jails for child processes. Should be on the same file system as systemplate." type="path" relative="false" default="@LO_PATH@"></lo_template_path>
<child_root_path desc="Path to the directory under which the chroot jails for the child processes will be created. Should be on the same file system as systemplate and lotemplate. Must be an empty directory." type="path" relative="true" default="jails"></child_root_path>
<server_name desc="Hostname:port of the server running loolwsd. If empty, it's derived from the request." type="string" default=""></server_name>

View File

@ -88,7 +88,6 @@ if test "z$tst" == "z"; then
echo "Executing external tests"
${trace} \
${abs_top_builddir}/loolwsd --o:sys_template_path="$systemplate_path" \
--o:lo_template_path="$lo_path" \
--o:child_root_path="$jails_path" \
--o:storage.filesystem[@allow]=true \
--o:logging.level=trace \
@ -128,7 +127,6 @@ else # newer unit tests.
echo "Running $tst | $tst_log ...";
if ${trace} \
${abs_top_builddir}/loolwsd --o:sys_template_path="$systemplate_path" \
--o:lo_template_path="$lo_path" \
--o:child_root_path="$jails_path" \
--o:storage.filesystem[@allow]=true \
--o:logging.level=trace \
@ -144,7 +142,6 @@ else # newer unit tests.
echo "============================================================="
echo "Test failed on unit: $tst re-run with:"
echo " $ gdb --args ${abs_top_builddir}/loolwsd --o:sys_template_path=\"$systemplate_path\" \\"
echo " --o:lo_template_path=\"$lo_path\" \\"
echo " --o:child_root_path=\"$jails_path\" \\"
echo " --o:storage.filesystem[@allow]=true \\"
echo " --o:logging.level=trace \\"

View File

@ -796,7 +796,6 @@ void LOOLWSD::initialize(Application& self)
{ "child_root_path", "jails" },
{ "file_server_root_path", "loleaflet/.." },
{ "lo_jail_subpath", "lo" },
{ "lo_template_path", LO_PATH },
{ "logging.anonymize.filenames", "false" }, // Deprecated.
{ "logging.anonymize.usernames", "false" }, // Deprecated.
// { "logging.anonymize.anonymize_user_data", "false" }, // Do not set to fallback on filename/username.
@ -1056,7 +1055,7 @@ void LOOLWSD::initialize(Application& self)
#endif
SysTemplate = getPathFromConfig("sys_template_path");
LoTemplate = getPathFromConfig("lo_template_path");
LoTemplate = LO_PATH;
ChildRoot = getPathFromConfig("child_root_path");
ServerName = config().getString("server_name");

View File

@ -108,7 +108,7 @@ chroot system, and directory for the jails:
To run loolwsd the way it is supposed to eventually be run "for real", you can
now do:
./loolwsd --o:sys_template_path=${SYSTEMPLATE} --o:lo_template_path=${MASTER}/instdir --o:child_root_path=${ROOTFORJAILS}
./loolwsd --o:sys_template_path=${SYSTEMPLATE} --o:child_root_path=${ROOTFORJAILS}
The ${SYSTEMPLATE} is a directory tree set up using the
loolwsd-systemplate-setup script here. (It should not exist before