40 Commits

Author SHA1 Message Date
Kelson
fcbb4a56bc Merge pull request #668 from kiwix/prepare-release-3.7.0
Prepare release 3.7.0
2024-03-13 15:17:32 +01:00
Emmanuel Engelhart
e37af51dd4 new 3.7.0 Changelog 2024-03-13 15:15:09 +01:00
Emmanuel Engelhart
43704c6154 Proper deb lizim/libkiwix dependencies 2024-03-13 15:15:09 +01:00
Emmanuel Engelhart
d25fda82be Request libzim9 2024-03-13 15:15:03 +01:00
Emmanuel Engelhart
279cdcda0b Bump-up version to 3.7.0 2024-03-13 15:14:11 +01:00
Kelson
331743ea29 Merge pull request #661 from kiwix/max-dependence-version
Check max version of libzim/libkiwix
2024-03-13 15:12:23 +01:00
Emmanuel Engelhart
19f11d8777 Check max version of libzim/libkiwix 2024-03-13 15:10:07 +01:00
Kelson
3377f9e8bb Merge pull request #666 from kiwix/implement_skip_option_2
kiwix-serve: Skip invalid ZIM files and continue startup #659
2024-03-13 15:09:43 +01:00
Emmanuel Engelhart
930c8321ca Add --skipInvalid option to man page 2024-03-10 16:53:15 +01:00
Emmanuel Engelhart
a3239ea8bc Rename --skipBroken to --skipInvalid 2024-03-10 16:50:34 +01:00
Florian Schüller
456c77d8fd kiwix-serve: Skip broken ZIM files and continue startup 2024-03-10 16:47:14 +01:00
Matthieu Gautier
7913b6a4f0 Merge pull request #665 from kiwix/documentation 2024-03-08 09:28:06 +01:00
Veloman Yunkan
027f7d6620 Reinstated the RTD Sphinx Theme for documentation
Sometime in 2023 the default theme on Read-the-Docs was changed to
Alabaster. This change enforces the old theme (sphinx_rtd_theme).
2024-03-07 18:53:37 +04:00
Matthieu Gautier
18b532a923 Merge pull request #664 from kiwix/documentation 2024-03-06 18:19:40 +01:00
Veloman Yunkan
21a145d999 Fixed the copyright date 2024-03-06 21:15:09 +04:00
Veloman Yunkan
be89de2bbe More conspicuous "ZIM name" links 2024-03-06 21:15:09 +04:00
Veloman Yunkan
433010a900 Clarified handling of naming conflicts 2024-03-06 21:15:09 +04:00
Veloman Yunkan
dd14e02741 Documented a couple of /search API's caveats 2024-03-06 21:15:09 +04:00
Veloman Yunkan
8ea12b2ce5 Fixed the "book name"-vs-"ZIM name" bug in docs 2024-03-06 21:15:09 +04:00
Matthieu Gautier
67c0ebd6ad Merge pull request #652 from kiwix/ghaction
Use kiwix-build's github action to download dependencies.
2023-12-20 11:57:05 +01:00
Matthieu Gautier
c5197ceb51 Use kiwix-build's github action to download dependencies. 2023-12-19 17:17:05 +01:00
Kelson
98b4fb3cdf Merge pull request #649 from kiwix/need-libkiwix-13
Requires libkiwix13+
2023-11-19 14:19:31 +01:00
Emmanuel Engelhart
33bdf56bdd Requires libkiwix13+ 2023-11-19 14:16:05 +01:00
Kelson
4556262c87 Merge pull request #648 from kiwix/release-3.6.0
Release 3.6.0
2023-11-19 14:13:57 +01:00
Emmanuel Engelhart
cb2159b114 Changelog for 3.6.0 2023-11-19 14:11:59 +01:00
Emmanuel Engelhart
5b45e1898b Bump-up version to 3.7.0 2023-11-19 13:59:52 +01:00
Kelson
f6128b9079 Merge pull request #643 from computerscienceiscool/patch-2 2023-10-20 10:20:47 +02:00
JJ
ba64c1637e Update README.md
Single spelling error fixed.
2023-10-20 01:02:02 -07:00
Matthieu Gautier
3a0e87d8ea Merge pull request #633 from kiwix/adapt_libkiwix_991 2023-10-12 18:05:52 +02:00
Kelson
9ca2b9fc16 Merge pull request #639 from computerscienceiscool/patch-1
Update README.md
2023-10-08 18:38:47 +02:00
JJ
f5932bf5d3 Update README.md
Fixed a few spelling and grammar errors.
2023-10-08 18:37:52 +02:00
Matthieu Gautier
018df0d563 Adapt to new api introduced in kiwix/libkiwix#991 2023-10-06 15:47:30 +02:00
Matthieu Gautier
76ac5ce93f Remove Ubuntu Kinetic from CI/CD (deprecated) 2023-10-06 15:47:30 +02:00
Matthieu Gautier
d0847525c6 Time to switch the CI to focal. 2023-10-06 15:47:30 +02:00
Matthieu Gautier
7f0c1d8a3f Merge pull request #642 from kiwix/fix_docs 2023-10-06 15:47:10 +02:00
Matthieu Gautier
bd9e67f48e Add readthedocs configuration 2023-10-06 15:33:40 +02:00
Kelson
a4cc4ba55b Merge pull request #636 from kiwix/cpp17
Move to c++17.
2023-09-22 17:38:55 +02:00
Matthieu Gautier
1a1274012f Move to c++17.
All our compilers should handle c++17. Let's move on.
2023-08-30 17:58:40 +02:00
Kelson
74712ff022 Merge pull request #631 from kiwix/kiwix-serve-docker-readme
Dedicated Docker Compose section
2023-08-13 09:39:44 +02:00
Emmanuel Engelhart
3c6971fced Dedicated Docker Compose section 2023-08-13 09:38:59 +02:00
13 changed files with 147 additions and 74 deletions

View File

@@ -14,10 +14,10 @@ jobs:
- win32_dyn
include:
- target: native_static
image_variant: bionic
image_variant: focal
lib_postfix: '/x86_64-linux-gnu'
- target: native_dyn
image_variant: bionic
image_variant: focal
lib_postfix: '/x86_64-linux-gnu'
- target: win32_static
image_variant: f35
@@ -37,11 +37,10 @@ jobs:
id: extract_branch
- name: Checkout code
uses: actions/checkout@v3
- name: Install deps
shell: bash
run: |
ARCHIVE_NAME=deps2_${OS_NAME}_${{matrix.target}}_kiwix-tools.tar.xz
wget -O- http://tmp.kiwix.org/ci/${ARCHIVE_NAME} | tar -xJ -C ${{env.HOME}}
- name: Install dependencies
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
with:
target_platform: ${{ matrix.target }}
- name: Compile
shell: bash
run: |

View File

@@ -8,7 +8,6 @@ jobs:
fail-fast: false
matrix:
distro:
- ubuntu-kinetic
- ubuntu-jammy
- ubuntu-focal
steps:
@@ -41,14 +40,6 @@ jobs:
args: --no-sign
ppa: ${{ steps.ppa.outputs.ppa }}
- uses: legoktm/gh-action-build-deb@ubuntu-kinetic
if: matrix.distro == 'ubuntu-kinetic'
name: Build package for ubuntu-kinetic
id: build-ubuntu-kinetic
with:
args: --no-sign
ppa: ${{ steps.ppa.outputs.ppa }}
- uses: legoktm/gh-action-build-deb@ubuntu-focal
if: matrix.distro == 'ubuntu-focal'
name: Build package for ubuntu-focal

21
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,21 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt

View File

@@ -1,7 +1,17 @@
Unreleased
==========
kiwix-tools 3.7.0
=================
* Additional docker images archs for armv6 and i386.
* Fixed ZIM name vs Book name confusion in documentation (@veloman-yunkan #663)
* Fixes compilation dependencies to rely on appropriate version (@kelson42 #667)
* New --skipInvalid Kiwix Server command line option (@schuellerf @kelson42 #666)
kiwix-tools 3.6.0
=================
* Improved kiwix-serve man page (@iArchitSharma #626)
* C++17 compliant code base (@mgautierfr #636)
* Support of libkiwix13 (@mgautierfr #633)
* Additional docker images archs for armv6 and i386 (@rgaudin #622)
kiwix-tools 3.5.0
=================

View File

@@ -4,7 +4,7 @@ Kiwix tools
The Kiwix tools is a collection of [Kiwix](https://kiwix.org) related
command line tools:
* kiwix-manage: Manage XML based library of ZIM files
* kiwix-search: Fulltext search in ZIM files
* kiwix-search: Full text search in ZIM files
* kiwix-serve: HTTP daemon serving ZIM files
[![latest release](https://img.shields.io/github/v/tag/kiwix/kiwix-tools?label=latest%20release&sort=semver)](https://download.kiwix.org/release/kiwix-tools/)
@@ -29,8 +29,8 @@ Preamble
--------
Although the Kiwix tools can be compiled/cross-compiled on/for many
sytems, the following documentation explains how to do it on POSIX
ones. It is primarly thought for GNU/Linux systems and has been tested
systems, the following documentation explains how to do it on POSIX
ones. It is primarily thought for GNU/Linux systems and has been tested
on recent releases of
[Debian](https://debian.org)/[Ubuntu](https://ubuntu.com) and
[Fedora](https://getfedora.org).
@@ -62,7 +62,7 @@ Environment
-------------
The Kiwix tools build using [Meson](http://mesonbuild.com/) version
0.43 or higher. Meson relies itself on Ninja, pkg-config and few other
0.43 or higher. Meson relies itself on Ninja, pkg-config and a few other
compilation tools. Install them first:
* [Meson](http://mesonbuild.com/)
* [Ninja](https://ninja-build.org/)
@@ -96,7 +96,7 @@ ninja -C build install
```
You might need to run the command as `root` (or using `sudo`),
depending where you want to install the Kiwix tools. After the
depending on where you want to install the Kiwix tools. After the
installation succeeded, you may need to run ldconfig (as `root`).
Uninstallation

4
debian/control vendored
View File

@@ -3,8 +3,8 @@ Section: utils
Priority: optional
Maintainer: Kiwix team <kiwix@kiwix.org>
Build-Depends: debhelper-compat (= 13),
libkiwix-dev (>= 10.0.0~),
libzim-dev (>= 7.2.0~),
libzim-dev (>= 9.0.0), libzim-dev (<< 10.0.0),
libkiwix-dev (>= 13.0.0), libkiwix-dev (<< 14.0.0),
meson,
pkg-config,
Standards-Version: 4.5.0

View File

@@ -42,7 +42,12 @@ Build an image for an ARM based GNU/Linux:
docker build . -t ghcr.io/kiwix/kiwix-serve:latest --build-arg ARCH="arm32v7/"
```
You can also deploy kiwix with [`docker-compose`](https://docs.docker.com/compose/). Check out a sample at [docker-compose.yml.example](docker-compose.yml.example)
Docker Compose
--------------
You can also deploy kiwix with
[`docker-compose`](https://docs.docker.com/compose/). Check out a
sample at [docker-compose.yml.example](docker-compose.yml.example).
Screenshots
-----------

View File

@@ -18,7 +18,7 @@ import os
# -- Project information -----------------------------------------------------
project = 'kiwix-tools'
copyright = '2022, kiwix-team'
copyright = '2024, kiwix-team'
author = 'kiwix-team'
@@ -30,6 +30,7 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_rtd_theme"
]
# Add any paths that contain templates here, relative to this directory.
@@ -41,8 +42,7 @@ templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
if not on_rtd:
html_theme = 'sphinx_rtd_theme'
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,

View File

@@ -339,8 +339,8 @@ filtering criteria must be specified via the following URL parameters:
* ``q`` - include in the results only entries that contain the specified text
in the title or description.
* ``name`` - include in the results only the entry with the specified
:term:`name <ZIM name>`.
* ``name`` - include in the results only entries with a matching
:term:`book name <Book name>`.
Examples:
@@ -532,7 +532,7 @@ specified ZIM file.
**Parameters:**
``content``: :term:`name <ZIM name>` of the ZIM file.
``content``: :term:`name of the ZIM file <ZIM name>`.
.. _raw:
@@ -609,7 +609,7 @@ A multi-ZIM search request must comply with the following constraints:
below list take precedence over subsequent ones (the later ones, even if
present in the request, are simply ignored).
``content``: :term:`name <ZIM name>` of the ZIM file (for a single-ZIM
``content``: :term:`name of the ZIM file <ZIM name>` (for a single-ZIM
search). This is a :ref:`legacy parameter <deprecation>`. ``books.name``
should be used instead.
@@ -617,9 +617,23 @@ A multi-ZIM search request must comply with the following constraints:
a multi-ZIM search, however must respect the :ref:`multi-ZIM search
constraints <multi-zim-search-constraints>`.
``books.name``: :term:`name <ZIM name>` of the ZIM file. Can be repeated
for a multi-ZIM search, however must respect the :ref:`multi-ZIM search
constraints <multi-zim-search-constraints>`.
.. note::
If any of the provided ``books.id`` values refers to a book missing
from the library then an error is returned instead of running the
search on the remaining (valid) entries.
``books.name``: :term:`name of the ZIM file <ZIM name>` (not to be confused
with ``books.filter.name`` which selects/filters based on the :term:`book
name <Book name>`). Can be repeated for a multi-ZIM search, however must
respect the :ref:`multi-ZIM search constraints
<multi-zim-search-constraints>`.
.. note::
If any of the provided ``books.name`` values refers to a book missing
from the library then an error is returned instead of running the
search on the remaining (valid) entries.
``books.filter.{criteria}``: allows to take full advantage of :ref:`library
filtering <library-filtering>` functionality of the `/catalog/v2/entries`_
@@ -739,7 +753,7 @@ added as an option to perform a full text search in the said ZIM file.
**Parameters:**
``content`` (mandatory): :term:`name <ZIM name>` of the ZIM file.
``content`` (mandatory): :term:`name of the ZIM file <ZIM name>`.
``term`` (optional; defaults to an empty string): query text.
@@ -799,6 +813,21 @@ Glossary
.. glossary::
Book name
Name of the book as specified in the ZIM file metadata (for a
``kiwix-serve`` started *WITHOUT* the :option:`--library` option) or the
library XML file (for a ``kiwix-serve`` started with the
:option:`--library` option).
.. note::
Two or more books may have the same name in the library. That's not
considered a conflict, because there may be multiple versions of the
"same" book (differing by the settings of the scraper, date, etc).
:ref:`Library filtering <library-filtering>` by name will return all
matching books.
ZIM filename
Name of a ZIM file on the server filesystem.
@@ -808,20 +837,22 @@ Glossary
Identifier of a ZIM file in the server's library (used for referring to a
particular ZIM file in requests).
For a ``kiwix-serve`` started with a list of ZIM files, ZIM names are
derived from the filename by dropping the extension and replacing certain
characters (spaces are replaced with underscores, and ``+`` symbols are
replaced with the text ``plus``). Presence of the
:option:`-z`/:option:`--nodatealiases` option will create additional names
(aliases) for filenames with dates.
ZIM names are derived from the filenames as follows:
For a ``kiwix-serve`` started with the :option:`--library` option, ZIM
names come from the library XML file.
- file extension is removed,
- all characters are converted to lowercase,
- diacritics are removed,
- spaces are replaced with underscores,
- ``+`` symbols are replaced with the text ``plus``.
Presence of the :option:`-z`/:option:`--nodatealiases` option will create
additional names (aliases) for filenames with dates.
ZIM names are expected to be unique across the library. Any name conflicts
(including those caused by the usage of the
:option:`-z`/:option:`--nodatealiases` option) are reported on STDERR but,
otherwise, are ignored.
otherwise, are ignored (i.e. only one of the entries can be accessed via
the conflicting name).
ZIM title

View File

@@ -1,7 +1,7 @@
project('kiwix-tools', 'cpp',
version : '3.5.0',
version : '3.7.0',
license : 'GPL',
default_options: ['c_std=c11', 'cpp_std=c++11', 'werror=true'])
default_options: ['c_std=c11', 'cpp_std=c++17', 'werror=true'])
compiler = meson.get_compiler('cpp')
@@ -16,8 +16,10 @@ if static_linkage
endif
thread_dep = dependency('threads')
kiwixlib_dep = dependency('kiwix', version:'>=12.0.0', static:static_linkage)
libzim_dep = dependency('libzim', version:'>=8.1.0', static:static_linkage)
libzim_dep = dependency('libzim', version:'>=9.0.0', static:static_linkage)
libzim_dep = dependency('libzim', version:'<10.0.0', static:static_linkage)
kiwixlib_dep = dependency('kiwix', version:'>=13.0.0', static:static_linkage)
kiwixlib_dep = dependency('kiwix', version:'<14.0.0', static:static_linkage)
all_deps = [thread_dep, kiwixlib_dep, libzim_dep]

View File

@@ -88,6 +88,10 @@ Override the welcome page with a custom HTML file.
\fB-L N, --ipConnectionLimit=N\fR
Max number of (concurrent) connections per IP (default: infinite, recommended: >= 6).
.TP
\fB-k, --skipInvalid\fR
Startup even when ZIM files are invalid (those will be skipped)
.TP
\fB-v, --verbose\fR
Print debug log to STDOUT.

View File

@@ -29,10 +29,10 @@ using namespace std;
enum supportedAction { NONE, ADD, SHOW, REMOVE };
void show(kiwix::Library* library, const std::string& bookId)
void show(const kiwix::Library& library, const std::string& bookId)
{
try {
auto& book = library->getBookById(bookId);
auto& book = library.getBookById(bookId);
std::cout << "id:\t\t" << book.getId() << std::endl
<< "path:\t\t" << book.getPath() << std::endl
<< "url:\t\t" << book.getUrl() << std::endl
@@ -96,7 +96,7 @@ void usage()
<< std::endl;
}
int handle_show(kiwix::Library* library, const std::string& libraryPath,
int handle_show(const kiwix::Library& library, const std::string& libraryPath,
int argc, char* argv[])
{
if (argc > 3 ) {
@@ -105,7 +105,7 @@ int handle_show(kiwix::Library* library, const std::string& libraryPath,
show(library, bookId);
}
} else {
auto booksIds = library->getBooksIds();
auto booksIds = library.getBooksIds();
for(auto& bookId: booksIds) {
show(library, bookId);
}
@@ -113,7 +113,7 @@ int handle_show(kiwix::Library* library, const std::string& libraryPath,
return(0);
}
int handle_add(kiwix::Library* library, const std::string& libraryPath,
int handle_add(kiwix::LibraryPtr library, const std::string& libraryPath,
int argc, char* argv[])
{
string zimPath;
@@ -182,11 +182,11 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
return(resultCode);
}
int handle_remove(kiwix::Library* library, const std::string& libraryPath,
int handle_remove(kiwix::Library& library, const std::string& libraryPath,
int argc, char* argv[])
{
std::string bookId;
const unsigned int totalBookCount = library->getBookCount(true, true);
const unsigned int totalBookCount = library.getBookCount(true, true);
int exitCode = 0;
if (argc <= 3) {
@@ -203,7 +203,7 @@ int handle_remove(kiwix::Library* library, const std::string& libraryPath,
for (int i = 3; i<argc; i++) {
bookId = argv[i];
if (!library->removeBookById(bookId)) {
if (!library.removeBookById(bookId)) {
std::cerr << "Invalid book id '" << bookId << "'." << std::endl;
exitCode = 1;
}
@@ -216,7 +216,7 @@ int main(int argc, char** argv)
{
string libraryPath = "";
supportedAction action = NONE;
kiwix::Library library;
auto library = kiwix::Library::create();
/* General argument parsing */
static struct option long_options[] = {
@@ -261,7 +261,7 @@ int main(int argc, char** argv)
libraryPath = kiwix::isRelativePath(libraryPath)
? kiwix::computeAbsolutePath(kiwix::getCurrentDirectory(), libraryPath)
: libraryPath;
kiwix::Manager manager(&library);
kiwix::Manager manager(library);
if (!manager.readFile(libraryPath, false)) {
if (kiwix::fileExists(libraryPath) || action!=ADD) {
std::cerr << "Cannot read the library " << libraryPath << std::endl;
@@ -273,13 +273,13 @@ int main(int argc, char** argv)
int exitCode = 0;
switch (action) {
case SHOW:
exitCode = handle_show(&library, libraryPath, argc, argv);
exitCode = handle_show(*library, libraryPath, argc, argv);
break;
case ADD:
exitCode = handle_add(&library, libraryPath, argc, argv);
exitCode = handle_add(library, libraryPath, argc, argv);
break;
case REMOVE:
exitCode = handle_remove(&library, libraryPath, argc, argv);
exitCode = handle_remove(*library, libraryPath, argc, argv);
break;
case NONE:
break;
@@ -292,7 +292,7 @@ int main(int argc, char** argv)
/* Rewrite the library file */
if (action == REMOVE || action == ADD) {
// writeToFile return true (1) if everything is ok => exitCode is 0
if (!library.writeToFile(libraryPath)) {
if (!library->writeToFile(libraryPath)) {
std::cerr << "Cannot write the library " << libraryPath << std::endl;
return 1;
}

View File

@@ -77,6 +77,7 @@ void usage()
<< "\t-z, --nodatealiases\tCreate URL aliases for each content by removing the date" << std::endl
<< "\t-c, --customIndex\tAdd path to custom index.html for welcome page" << std::endl
<< "\t-L, --ipConnectionLimit\tMax number of (concurrent) connections per IP (default: infinite, recommended: >= 6)" << std::endl
<< "\t-k, --skipInvalid\tStartup even when ZIM files are invalid (those will be skipped)" << std::endl
<< std::endl
<< "Documentation:" << std::endl
@@ -197,7 +198,7 @@ int main(int argc, char** argv)
#endif
std::string rootLocation = "/";
kiwix::Library library;
auto library = kiwix::Library::create();
unsigned int nb_threads = DEFAULT_THREADS;
std::vector<std::string> zimPathes;
std::string libraryPath;
@@ -217,6 +218,7 @@ int main(int argc, char** argv)
unsigned int PPID = 0;
int ipConnectionLimit = 0;
int searchLimit = 0;
bool skipInvalid = false;
static struct option long_options[]
= {{"daemon", no_argument, 0, 'd'},
@@ -237,6 +239,7 @@ int main(int argc, char** argv)
{"monitorLibrary", no_argument, 0, 'M'},
{"ipConnectionLimit", required_argument, 0, 'L'},
{"searchLimit", required_argument, 0, 's'},
{"skipInvalid", no_argument, 0, 'k'},
{0, 0, 0, 0}};
std::set<int> usedOptions;
@@ -307,6 +310,9 @@ int main(int argc, char** argv)
case 's':
searchLimit = atoi(optarg);
break;
case 'k':
skipInvalid = true;
break;
case '?':
usage();
return 2;
@@ -331,7 +337,7 @@ int main(int argc, char** argv)
}
/* Setup the library manager and get the list of books */
kiwix::Manager manager(&library);
kiwix::Manager manager(library);
std::vector<std::string> libraryPaths;
if (libraryFlag) {
libraryPaths = kiwix::split(libraryPath, ";");
@@ -340,7 +346,7 @@ int main(int argc, char** argv)
}
/* Check if the library is not empty (or only remote books)*/
if (library.getBookCount(true, false) == 0) {
if (library->getBookCount(true, false) == 0) {
std::cerr << "The XML library file '" << libraryPath
<< "' is empty (or has only remote books)." << std::endl;
}
@@ -348,9 +354,13 @@ int main(int argc, char** argv)
std::vector<std::string>::iterator it;
for (it = zimPathes.begin(); it != zimPathes.end(); it++) {
if (!manager.addBookFromPath(*it, *it, "", false)) {
std::cerr << "Unable to add the ZIM file '" << *it
<< "' to the internal library." << std::endl;
exit(1);
if (skipInvalid) {
std::cerr << "Skipping invalid '" << *it << "' ...continuing" << std::endl;
} else {
std::cerr << "Unable to add the ZIM file '" << *it
<< "' to the internal library." << std::endl;
exit(1);
}
}
}
}
@@ -376,8 +386,8 @@ int main(int argc, char** argv)
}
#endif
kiwix::UpdatableNameMapper nameMapper(library, noDateAliasesFlag);
kiwix::Server server(&library, &nameMapper);
auto nameMapper = std::make_shared<kiwix::UpdatableNameMapper>(library, noDateAliasesFlag);
kiwix::Server server(library, nameMapper);
if (!customIndexPath.empty()) {
try {
@@ -447,7 +457,7 @@ int main(int argc, char** argv)
if ( libraryMustBeReloaded && !libraryPaths.empty() ) {
libraryFileTimestamp = curLibraryFileTimestamp;
reloadLibrary(manager, libraryPaths);
nameMapper.update();
nameMapper->update();
libraryMustBeReloaded = false;
}
} while (waiting);