kiwix-serve --contentServerURL=<URL>

This commit is contained in:
Veloman Yunkan
2025-09-07 17:18:17 +04:00
parent 824eddaf94
commit 597223196d
2 changed files with 16 additions and 0 deletions

View File

@@ -55,6 +55,18 @@ Options
OPDS catalog. ZIM files referred by the :ref:`library XML file
<cli-arg-library-file-path>` 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

View File

@@ -62,6 +62,7 @@ Options:
-h --help Print this help
-a <pid> --attachToProcess=<pid> Exit if given process id is not running anymore [default: 0]
--catalogOnly Serve only the library catalog
--contentServerURL=<url> Root URL of the server serving ZIM content for this library
-d --daemon Detach the HTTP server daemon from the main process
-i <address> --address=<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);