diff --git a/docs/kiwix-serve.rst b/docs/kiwix-serve.rst index 562c523..5b02e88 100644 --- a/docs/kiwix-serve.rst +++ b/docs/kiwix-serve.rst @@ -55,6 +55,18 @@ Options OPDS catalog. ZIM files referred by the :ref:`library XML file ` need not be accessible. + This option may be combined with the :option:`--contentServerURL` option. + +.. option:: --contentServerURL=URL + + In :option:`--catalogOnly` mode book content is not served by this instance + of `kiwix-serve`. If a separate instance of `kiwix-serve` is running for the + same library without that option and thus serves book content, then the root + URL of that server can be passed to this instance so that books can still be + previewed. + + This option must be combined with the :option:`--catalogOnly` option. + .. option:: -i ADDR, --address=ADDR Listen only on this IP address. By default the server listens on all diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index fdf7ed5..64c6628 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -62,6 +62,7 @@ Options: -h --help Print this help -a --attachToProcess= Exit if given process id is not running anymore [default: 0] --catalogOnly Serve only the library catalog + --contentServerURL= Root URL of the server serving ZIM content for this library -d --daemon Detach the HTTP server daemon from the main process -i
--address=
Listen only on the specified IP address. Specify 'ipv4', 'ipv6' or 'all' to listen on all IPv4, IPv6 or both types of addresses, respectively [default: all] -M --monitorLibrary Monitor the XML library file and reload it automatically @@ -231,6 +232,7 @@ int main(int argc, char** argv) std::string indexTemplateString=""; int serverPort = 80; bool catalogOnlyFlag = false; + std::string contentServerURL; bool daemonFlag [[gnu::unused]] = false; bool helpFlag = false; bool noLibraryButtonFlag = false; @@ -259,6 +261,7 @@ int main(int argc, char** argv) for (auto const& arg: args) { FLAG("--help", helpFlag) FLAG("--catalogOnly", catalogOnlyFlag) + STRING("--contentServerURL", contentServerURL) FLAG("--daemon", daemonFlag) FLAG("--verbose", isVerboseFlag) FLAG("--nosearchbar", noSearchBarFlag) @@ -383,6 +386,7 @@ int main(int argc, char** argv) server.setMultiZimSearchLimit(searchLimit); server.setIpMode(ipMode); server.setCatalogOnlyMode(catalogOnlyFlag); + server.setContentServerUrl(contentServerURL); if (! server.start()) { exit(1);