kiwix-serve --catalogOnly

pull/759/head
Veloman Yunkan 8 months ago
parent 7413682060
commit 824eddaf94

@ -49,6 +49,12 @@ Options
that the command line argument is rather a :ref:`library XML file
<cli-arg-library-file-path>`.
.. option:: --catalogOnly
In this mode ``kiwix-serve`` only serves the welcome (library) page and the
OPDS catalog. ZIM files referred by the :ref:`library XML file
<cli-arg-library-file-path>` need not be accessible.
.. option:: -i ADDR, --address=ADDR
Listen only on this IP address. By default the server listens on all

@ -61,6 +61,7 @@ Mandatory arguments:
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
-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
@ -229,6 +230,7 @@ int main(int argc, char** argv)
std::string customIndexPath="";
std::string indexTemplateString="";
int serverPort = 80;
bool catalogOnlyFlag = false;
bool daemonFlag [[gnu::unused]] = false;
bool helpFlag = false;
bool noLibraryButtonFlag = false;
@ -256,6 +258,7 @@ int main(int argc, char** argv)
for (auto const& arg: args) {
FLAG("--help", helpFlag)
FLAG("--catalogOnly", catalogOnlyFlag)
FLAG("--daemon", daemonFlag)
FLAG("--verbose", isVerboseFlag)
FLAG("--nosearchbar", noSearchBarFlag)
@ -379,6 +382,7 @@ int main(int argc, char** argv)
server.setIpConnectionLimit(ipConnectionLimit);
server.setMultiZimSearchLimit(searchLimit);
server.setIpMode(ipMode);
server.setCatalogOnlyMode(catalogOnlyFlag);
if (! server.start()) {
exit(1);

Loading…
Cancel
Save