Compare commits
295 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62e6c7ffb0 | ||
|
|
1df899ea87 | ||
|
|
3dd357e8ac | ||
|
|
2744879df0 | ||
|
|
19c3ebe629 | ||
|
|
cccd17a394 | ||
|
|
e9676ae66f | ||
|
|
2fd393285f | ||
|
|
a44fd1a4d0 | ||
|
|
a9ff2aebee | ||
|
|
a2b944618f | ||
|
|
d27abb41b7 | ||
|
|
5f12d0349f | ||
|
|
7ec2308053 | ||
|
|
e8b33a7136 | ||
|
|
ca943b9d0b | ||
|
|
c6757dd309 | ||
|
|
23b0ff3d01 | ||
|
|
93116c76b3 | ||
|
|
4aca5ff551 | ||
|
|
4eb38869c1 | ||
|
|
d17fd2af94 | ||
|
|
48db92af09 | ||
|
|
612081ec51 | ||
|
|
4b5eb482b5 | ||
|
|
28997ccd58 | ||
|
|
9dd042d813 | ||
|
|
61580bb738 | ||
|
|
dbae6439b2 | ||
|
|
d6094b4112 | ||
|
|
64f1aa2408 | ||
|
|
ed1bae76c3 | ||
|
|
7418702a07 | ||
|
|
796614fd7d | ||
|
|
2ba9037687 | ||
|
|
22be7c0dcf | ||
|
|
3fc9525754 | ||
|
|
a9d8f77526 | ||
|
|
1109b62570 | ||
|
|
3248c0f233 | ||
|
|
f8f66288ea | ||
|
|
98c810eb2a | ||
|
|
50ca36417f | ||
|
|
5a2714c9c9 | ||
|
|
63cc513974 | ||
|
|
63ec03a3d4 | ||
|
|
e2f7c7a0ac | ||
|
|
a14cd5de23 | ||
|
|
06c31430c5 | ||
|
|
8ffff9cd47 | ||
|
|
ef0fc514ad | ||
|
|
6c1739d4cd | ||
|
|
cd44ba53a5 | ||
|
|
d82f9e7d5e | ||
|
|
720a319d53 | ||
|
|
2426c35547 | ||
|
|
794f63e22b | ||
|
|
79a64d5af3 | ||
|
|
2ef160bcad | ||
|
|
817a5d4847 | ||
|
|
2c3882671b | ||
|
|
7e2c5bda03 | ||
|
|
59281bf496 | ||
|
|
ee9ae0e81f | ||
|
|
2dbe0a0016 | ||
|
|
64717c2124 | ||
|
|
fc1eb3c282 | ||
|
|
e31c1cd9a3 | ||
|
|
e897dd4e59 | ||
|
|
7db7d2a2ab | ||
|
|
5b612e67bd | ||
|
|
df047588a9 | ||
|
|
9dede26717 | ||
|
|
a22ae3d467 | ||
|
|
ea93a8a195 | ||
|
|
0a7f375f3a | ||
|
|
66c35b7b3e | ||
|
|
bad7f2ddf1 | ||
|
|
758014a5ba | ||
|
|
4fd961a761 | ||
|
|
c063587a69 | ||
|
|
9b24676b02 | ||
|
|
fc5572f495 | ||
|
|
a1b3f46e4e | ||
|
|
e0177c4923 | ||
|
|
a365c1e720 | ||
|
|
3e97352128 | ||
|
|
78d2530878 | ||
|
|
d09f481b47 | ||
|
|
e0f07086d5 | ||
|
|
bbff57e6aa | ||
|
|
3c24d0a026 | ||
|
|
6107bad17e | ||
|
|
5931ac45c4 | ||
|
|
4de8623a52 | ||
|
|
6eace310a2 | ||
|
|
c6499ad5c6 | ||
|
|
34ceaf37f2 | ||
|
|
f05096e2ce | ||
|
|
3864b2404c | ||
|
|
4cd74dca4b | ||
|
|
88cea54520 | ||
|
|
3061c8bba3 | ||
|
|
2774eb9529 | ||
|
|
77dc2ef2ed | ||
|
|
17d11f9772 | ||
|
|
68ac06c397 | ||
|
|
99f6941614 | ||
|
|
848d058610 | ||
|
|
cdb9b28d35 | ||
|
|
43e1740d52 | ||
|
|
7e8d02990e | ||
|
|
c337cf174e | ||
|
|
8a64083d5b | ||
|
|
d0687e40a6 | ||
|
|
14b0b901f1 | ||
|
|
336cbe691d | ||
|
|
26b4dd5f57 | ||
|
|
8882a716a0 | ||
|
|
fede5ef9b6 | ||
|
|
c5b293c6f3 | ||
|
|
d57a37cde6 | ||
|
|
7d2bec3e39 | ||
|
|
472de06e6d | ||
|
|
51a4a4e8ef | ||
|
|
6e310c7147 | ||
|
|
790bd03bd7 | ||
|
|
15c6252db4 | ||
|
|
6fd22dec61 | ||
|
|
c332c123fe | ||
|
|
e4eafd7459 | ||
|
|
16a29127a1 | ||
|
|
7fa0579ea1 | ||
|
|
978dc47865 | ||
|
|
b7793f6e75 | ||
|
|
8095ae9ea8 | ||
|
|
286f599b3e | ||
|
|
174b236312 | ||
|
|
c7e9d44b38 | ||
|
|
3a80951c23 | ||
|
|
ffaecb5389 | ||
|
|
7b25308248 | ||
|
|
7ac14aa64f | ||
|
|
3c8da8c74c | ||
|
|
9ed3fc353b | ||
|
|
51051752f1 | ||
|
|
4e8a8533c4 | ||
|
|
fd2a0decd3 | ||
|
|
624fb32091 | ||
|
|
067a40a156 | ||
|
|
cfa22365fe | ||
|
|
d5066ba6bf | ||
|
|
f1ec1ec182 | ||
|
|
d1802c52a2 | ||
|
|
38088ee321 | ||
|
|
0f445e9791 | ||
|
|
1032a46c57 | ||
|
|
cbe8f1df87 | ||
|
|
2fe5ec1d7c | ||
|
|
eba80b92ef | ||
|
|
c1e635bd4e | ||
|
|
c8be8fbad8 | ||
|
|
640f907fb2 | ||
|
|
eb407956b9 | ||
|
|
422dde9ff2 | ||
|
|
f691f85724 | ||
|
|
fd4f228a41 | ||
|
|
bf40d4ff91 | ||
|
|
74fecd34e6 | ||
|
|
881fe9f41d | ||
|
|
c23e0bc38a | ||
|
|
d4d32aa2e8 | ||
|
|
4a88c44626 | ||
|
|
0cc5b18488 | ||
|
|
88a32a152f | ||
|
|
4b8c8c5f6f | ||
|
|
f0568ff4a7 | ||
|
|
ccdfe9839d | ||
|
|
221f3ef340 | ||
|
|
0785636ca5 | ||
|
|
a3429fdc88 | ||
|
|
f99b6965e9 | ||
|
|
228402b505 | ||
|
|
a9f8364333 | ||
|
|
9f06c9c5eb | ||
|
|
0efbb2461d | ||
|
|
b251e18af1 | ||
|
|
5c040d3ee6 | ||
|
|
bb1afb5120 | ||
|
|
8fccbc4c99 | ||
|
|
d0dc9ac81b | ||
|
|
f9edd75f6c | ||
|
|
9571148375 | ||
|
|
282b85c341 | ||
|
|
4c3acd06de | ||
|
|
4cd9d78d21 | ||
|
|
efd4a1434e | ||
|
|
dfc601dacf | ||
|
|
7c254544ca | ||
|
|
b22ee94f10 | ||
|
|
3766c4882b | ||
|
|
26da54f9c3 | ||
|
|
4433421c48 | ||
|
|
c00f0be7ef | ||
|
|
773b9e5443 | ||
|
|
fbddabb10f | ||
|
|
3ad50ccf17 | ||
|
|
c265eb8b24 | ||
|
|
6f49e78eb4 | ||
|
|
d25329ecb4 | ||
|
|
bd8d0c3805 | ||
|
|
a01906d273 | ||
|
|
4bd18ce466 | ||
|
|
fb8c14a1e4 | ||
|
|
2acd276753 | ||
|
|
53b2dadfce | ||
|
|
eccf5e194c | ||
|
|
8356277562 | ||
|
|
c6ace1eafc | ||
|
|
8552985cd4 | ||
|
|
9997a6ec18 | ||
|
|
8b6abc0e35 | ||
|
|
426796dc37 | ||
|
|
712cdf5e7b | ||
|
|
74cc1d0708 | ||
|
|
3ce668af66 | ||
|
|
2b69cc8ffc | ||
|
|
71ffaaa05a | ||
|
|
f3fb5d61cc | ||
|
|
05c63536de | ||
|
|
16e12ad463 | ||
|
|
c91285fc29 | ||
|
|
5c11ff1a30 | ||
|
|
9eaf512bf9 | ||
|
|
9a29874f9f | ||
|
|
aa9647e88c | ||
|
|
da0c697963 | ||
|
|
77d25686cb | ||
|
|
3df2fa708b | ||
|
|
9021f87715 | ||
|
|
04b05b7902 | ||
|
|
a8e73aab98 | ||
|
|
234a9d9719 | ||
|
|
c93617473d | ||
|
|
09e2039aff | ||
|
|
5c6a1870b9 | ||
|
|
4fffaf41b6 | ||
|
|
05c734fc31 | ||
|
|
fa9b027a39 | ||
|
|
1fcc1ad9d4 | ||
|
|
5fd8dd3c36 | ||
|
|
f03ed85972 | ||
|
|
52308b764d | ||
|
|
03bac00019 | ||
|
|
905b83b3b1 | ||
|
|
894ed12f37 | ||
|
|
573b826861 | ||
|
|
8051773124 | ||
|
|
69dd6cd869 | ||
|
|
8d32bfd16e | ||
|
|
b1d2a1378b | ||
|
|
df7d44128c | ||
|
|
ee5333bb91 | ||
|
|
871d8f4a51 | ||
|
|
9280d519f5 | ||
|
|
540fcd3be9 | ||
|
|
ad7238b0c9 | ||
|
|
b5c91417ff | ||
|
|
b638df81fa | ||
|
|
58f0a716a6 | ||
|
|
a2324b5e8b | ||
|
|
c2ac40d4f5 | ||
|
|
4534b51f5e | ||
|
|
0364951f75 | ||
|
|
a2627e81c4 | ||
|
|
cd72a2d73c | ||
|
|
fa3f33d3c7 | ||
|
|
a210cb3a4b | ||
|
|
63cb47247b | ||
|
|
3220ee1276 | ||
|
|
4a1b9cbfa9 | ||
|
|
f2b5904221 | ||
|
|
f44722fbbc | ||
|
|
0cfcc59437 | ||
|
|
7776eafbfc | ||
|
|
5989146931 | ||
|
|
ea088b21a4 | ||
|
|
558a0375b0 | ||
|
|
5f0a05e8d8 | ||
|
|
4b9dc39c49 | ||
|
|
08f2373360 | ||
|
|
82fb6bc4d0 | ||
|
|
17eceeff5b | ||
|
|
aef20d6c96 | ||
|
|
4e3ff03059 |
12
.clang-format
Normal file
@@ -0,0 +1,12 @@
|
||||
BasedOnStyle: Google
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: Linux
|
||||
DerivePointerAlignment: false
|
||||
SpacesInContainerLiterals: false
|
||||
Standard: Cpp11
|
||||
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: kiwix # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # https://kiwix.org/support-us/
|
||||
27
.github/move.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
# Configuration for Move Issues - https://github.com/dessant/move-issues
|
||||
|
||||
# Delete the command comment when it contains no other content
|
||||
deleteCommand: true
|
||||
|
||||
# Close the source issue after moving
|
||||
closeSourceIssue: true
|
||||
|
||||
# Lock the source issue after moving
|
||||
lockSourceIssue: false
|
||||
|
||||
# Mention issue and comment authors
|
||||
mentionAuthors: true
|
||||
|
||||
# Preserve mentions in the issue content
|
||||
keepContentMentions: true
|
||||
|
||||
# Move labels that also exist on the target repository
|
||||
moveLabels: true
|
||||
|
||||
# Set custom aliases for targets
|
||||
# aliases:
|
||||
# r: repo
|
||||
# or: owner/repo
|
||||
|
||||
# Repository to extend settings from
|
||||
# _extends: repo
|
||||
77
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: CI
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
Linux:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- native_static
|
||||
- native_dyn
|
||||
- win32_static
|
||||
- win32_dyn
|
||||
include:
|
||||
- target: native_static
|
||||
image_variant: xenial
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: native_dyn
|
||||
image_variant: xenial
|
||||
lib_postfix: '/x86_64-linux-gnu'
|
||||
- target: win32_static
|
||||
image_variant: f31
|
||||
lib_postfix: '64'
|
||||
- target: win32_dyn
|
||||
image_variant: f31
|
||||
lib_postfix: '64'
|
||||
env:
|
||||
HOME: /home/runner
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-26"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
shell: python
|
||||
run: |
|
||||
import json
|
||||
from subprocess import check_call
|
||||
from os import environ
|
||||
with open(environ['GITHUB_EVENT_PATH'], 'r') as f:
|
||||
content = f.read()
|
||||
event_data = json.loads(content)
|
||||
try:
|
||||
branch_ref = event_data['ref'].split('/')[-1]
|
||||
except KeyError:
|
||||
branch_ref = event_data['pull_request']['head']['ref']
|
||||
print("Cloning branch", branch_ref)
|
||||
command = [
|
||||
'git', 'clone',
|
||||
'https://github.com/${{github.repository}}',
|
||||
'--depth=1',
|
||||
'--branch', branch_ref
|
||||
]
|
||||
check_call(command, cwd=environ['HOME'])
|
||||
- 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 /home/runner
|
||||
- name: Compile
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ "${{matrix.target}}" =~ .*_static ]]; then
|
||||
MESON_OPTION="-Dstatic-linkage=true"
|
||||
else
|
||||
MESON_OPTION=""
|
||||
fi
|
||||
if [[ ! "${{matrix.target}}" =~ native_.* ]]; then
|
||||
MESON_OPTION="$MESON_OPTION --cross-file $HOME/BUILD_${{matrix.target}}/meson_cross_file.txt"
|
||||
fi
|
||||
cd $HOME/kiwix-tools
|
||||
meson . build ${MESON_OPTION}
|
||||
cd build
|
||||
ninja
|
||||
env:
|
||||
PKG_CONFIG_PATH: "/home/runner/BUILD_${{matrix.target}}/INSTALL/lib/pkgconfig:/home/runner/BUILD_${{matrix.target}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig"
|
||||
CPPFLAGS: "-I/home/runner/BUILD_${{matrix.target}}/INSTALL/include"
|
||||
11
.travis.yml
@@ -1,11 +0,0 @@
|
||||
language: cpp
|
||||
dist: trusty
|
||||
sudo: required
|
||||
cache: ccache
|
||||
install: travis/install_deps.sh
|
||||
script: travis/compile.sh
|
||||
env:
|
||||
- PLATFORM="native_static"
|
||||
- PLATFORM="native_dyn"
|
||||
- PLATFORM="win32_static"
|
||||
- PLATFORM="win32_dyn"
|
||||
235
Changelog
@@ -1,10 +1,243 @@
|
||||
kiwix-tools 3.0.2
|
||||
=================
|
||||
|
||||
* New option --version for all tools
|
||||
* Remove benchmark.sh file.
|
||||
* [DOCKER] Add ability to download a file at container start.
|
||||
* [CI] Move to github actions instead of travis.
|
||||
* [SERVER] Trust the given library by default.
|
||||
* [SERVER] Add shortcut alias for option `--address` and `--nodatealias`
|
||||
|
||||
kiwix-tools 3.0.1
|
||||
=================
|
||||
|
||||
* Fix --nodatealiases inverted logic regression
|
||||
|
||||
kiwix-tools 3.0.0
|
||||
=================
|
||||
|
||||
* Move kiwix-serve implementation in kiwix-lib.
|
||||
|
||||
kiwix-tools 2.1.0
|
||||
=================
|
||||
|
||||
* Fix few compilation errors.
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Use new api to filter the library.
|
||||
* Mobile friendly top bar.
|
||||
* Add notag parameter to be able to exclude tags from the zim search.
|
||||
|
||||
|
||||
kiwix-tools 2.0.0
|
||||
=================
|
||||
|
||||
kiwix-manage
|
||||
-----------
|
||||
|
||||
* Better usage()
|
||||
* Adding multiple files bug fix
|
||||
* Remove download command.
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Better usage()
|
||||
* Display properly welcome page on 3 columns
|
||||
* New welcome page footer "Powered by Kiwix"
|
||||
|
||||
kiwix-tools 1.2.1
|
||||
=================
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Always use POLL when avaible.
|
||||
|
||||
kiwix-tools 1.2.0
|
||||
=================
|
||||
|
||||
* Remove rpath for installed binaries.
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* New Dockerfile of kiwix-serve
|
||||
* New --nodatealiases option
|
||||
* Do not use POLL on windows
|
||||
|
||||
kiwix-manage
|
||||
------------
|
||||
|
||||
* Do not show all books if book ids has been provided.
|
||||
* Be able to add several zim files in the same time in a library.
|
||||
|
||||
kiwix-tools 1.1.0
|
||||
=================
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Fix bug about handling of absolute url in old zim file.
|
||||
* All the catalog to be searched by tags.
|
||||
|
||||
kiwix-tools 1.0.0
|
||||
=================
|
||||
|
||||
* [CI] Use the new deps archive xz
|
||||
* Move version 1.0.0. There is no need to stay in pre 1.0 version.
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Correctly implement redirection.
|
||||
kiwix-serve now return a 302 http status code instead of resolving the
|
||||
redirection internally and return the content.
|
||||
|
||||
|
||||
kiwix-tools 0.9.0
|
||||
=================
|
||||
|
||||
* Update README
|
||||
* Update man pages
|
||||
* Remove support of external indexes (manage, search, serve)
|
||||
* Update build system as we don't use ctpp2 anymore
|
||||
* Update to last kiwix-lib API.
|
||||
|
||||
kiwix-manage
|
||||
------------
|
||||
|
||||
* Update usage.
|
||||
|
||||
|
||||
kiwix-tools 0.8.0
|
||||
=================
|
||||
|
||||
kiwix-manage
|
||||
------------
|
||||
|
||||
* Be able to remove several books from the library in one command.
|
||||
|
||||
kiwix-tools 0.7.0
|
||||
=================
|
||||
|
||||
* Adapt to kiwix-lib new API
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Dumps only valid books in the opdsfeed.
|
||||
* Allow the opds feed to be filtered by lang and paginated.
|
||||
|
||||
kiwix-manage
|
||||
------------
|
||||
|
||||
* Add a download command to download a remote book locally
|
||||
* Book are referenced by bookId not index.
|
||||
* No more indexType option as it is always XAPIAN.
|
||||
|
||||
kiwix-tools 0.6.1
|
||||
=================
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Update README.
|
||||
* Fix crash when `--library` flag is provided without value.
|
||||
* Correctly handle mimetype of file without extension on 64bits.
|
||||
* Minor fixes
|
||||
|
||||
kiwix-tools 0.6.0
|
||||
=================
|
||||
|
||||
* remove kiwix-install tool.
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Improved taskbar #160
|
||||
* Fix global page when using the option `--nosearchbar`
|
||||
* Return 404 for missing resources
|
||||
* Fix compilation for gcc 4.8.
|
||||
|
||||
kiwix-manage
|
||||
------------
|
||||
|
||||
* Returns proper exit code (not always 0)
|
||||
|
||||
|
||||
kiwix-tools 0.5.0
|
||||
=================
|
||||
|
||||
* Build kiwix-tools setting the RPATH
|
||||
* Compile without warning.
|
||||
|
||||
|
||||
kiwix-serve
|
||||
------------
|
||||
|
||||
* Serve metadata information using the "/meta" url.
|
||||
* Serve an OPDS stream of all zim handled by kiwix-serve
|
||||
All informations cannot be infer from the zim file itself,
|
||||
you should use a library.xml to provide needed information (url, ...)
|
||||
* Update kiwix-serve to use the new API of kiwix-lib
|
||||
|
||||
kiwix-tools 0.4.0
|
||||
=================
|
||||
|
||||
* Use gcc-5 on travis.
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Accept zim file with `&` in the name
|
||||
* Do not cache (on client side) global search (as it can depends on the zim
|
||||
files handled)
|
||||
* Fix HTTP byte range handling. (#91)
|
||||
* Fix opening of relative path (#70)
|
||||
* Add a small (and hidden) API to do geo search.
|
||||
* Better request parsing. (#91)
|
||||
* Better handling of invalid request (#116)
|
||||
* Various bug fixes (#146, #150, #153, #165, #168, #165)
|
||||
|
||||
kiwix-search
|
||||
------------
|
||||
|
||||
* Add an option `--suggestion` to do suggestion search with
|
||||
kiwix-search.(#132)
|
||||
|
||||
kiwix-tools 0.3.0
|
||||
=================
|
||||
|
||||
* Move to C++11
|
||||
|
||||
kiwix-serve
|
||||
-----------
|
||||
|
||||
* Add a global taskbar in the welcome page to search in all zims (#49)
|
||||
* Serve the taskbar as css file instead of including it in the html (#68):
|
||||
* Better client caching
|
||||
* The html encoding is now in the first 1024 bytes and firefox correctly
|
||||
detect the encoding
|
||||
* Make kiwix-server multi-threaded (#82)
|
||||
* Correctly return 404 instead of crashing when request inexistant skin file
|
||||
(#83)
|
||||
* Correctly respond to bytes-range requests.(#84)
|
||||
* Directly respond to first request for a url instead of refusing the first
|
||||
connexion
|
||||
* Add support to relative url location. (#86)
|
||||
* Remove caching (on client side) for the welcome page. (#86)
|
||||
|
||||
|
||||
kiwix-tools 0.2.0
|
||||
=================
|
||||
|
||||
* Remove indexer tools
|
||||
|
||||
kiwix-serve
|
||||
----------
|
||||
-----------
|
||||
|
||||
* Correctly fix the deflate data we send over http. (#15)
|
||||
* Update in the taskbar (or topbar):
|
||||
|
||||
156
README.md
@@ -1,14 +1,36 @@
|
||||
Kiwix tools
|
||||
===========
|
||||
|
||||
The Kiwix tools gathers kiwix command line 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-read: Read ZIM file content
|
||||
* kiwix-search: Fulltext search in ZIM files
|
||||
* kiwix-serve: HTTP daemon serving ZIM files
|
||||
|
||||
[](https://travis-ci.com/kiwix/kiwix-tools)
|
||||
[](https://www.codefactor.io/repository/github/kiwix/kiwix-tools)
|
||||
[](https://www.gnu.org/licenses/gpl-3.0)
|
||||
|
||||
Distribution
|
||||
------------
|
||||
|
||||
#### Official
|
||||
|
||||
[](https://download.kiwix.org/release/kiwix-tools/)
|
||||
[](https://hub.docker.com/r/kiwix/kiwix-serve)
|
||||
|
||||
#### Contribution
|
||||
|
||||
[](https://aur.archlinux.org/packages/kiwix-tools/)
|
||||
[](https://apps.sandstorm.io/app/5uh349d0kky2zp5whrh2znahn27gwha876xze3864n0fu9e5220h)
|
||||
|
||||
Disclaimer
|
||||
----------
|
||||
|
||||
This document assumes you have a little knowledge about software
|
||||
compilation. If you experience difficulties with the dependencies or
|
||||
with the Kiwix libary compilation itself, we recommend to have a look
|
||||
with the Kiwix tools compilation itself, we recommend to have a look
|
||||
to [kiwix-build](https://github.com/kiwix/kiwix-build).
|
||||
|
||||
Preamble
|
||||
@@ -16,24 +38,21 @@ 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 though for GNU/Linux systems and has been tested
|
||||
on recent releases of Ubuntu and Fedora.
|
||||
ones. It is primarly 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).
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
The Kiwix tools rely on a few third parts software libraries. They
|
||||
are prerequisites to the Kiwix library compilation. Following
|
||||
The Kiwix tools rely on a few third party software libraries. They are
|
||||
prerequisites to the Kiwix tools compilation. Therefore, following
|
||||
libraries need to be available:
|
||||
|
||||
* Kiwix lib ....................... https://github.com/kiwix/kiwix-lib
|
||||
(no package for now)
|
||||
* Libmicrohttpd .......... https://www.gnu.org/software/libmicrohttpd/
|
||||
(package libmicrohttpd-dev on Ubuntu)
|
||||
* CTPP2 ..................................... http://ctpp.havoc.ru/en/
|
||||
(package libctpp2-dev on Ubuntu)
|
||||
* Zlib .......................................... http://www.zlib.net/
|
||||
(package zlib1g-dev on Ubuntu)
|
||||
* [Kiwix lib](https://github.com/kiwix/kiwix-lib) (no package so far)
|
||||
* [Libmicrohttpd](https://www.gnu.org/software/libmicrohttpd/)
|
||||
(package `libmicrohttpd-dev` on Debian/Ubuntu)
|
||||
* [Zlib](https://www.zlib.net/) (package `zlib1g-dev` on Debian/Ubuntu)
|
||||
|
||||
These dependencies may or may not be packaged by your operating
|
||||
system. They may also be packaged but only in an older version. They
|
||||
@@ -46,54 +65,34 @@ If you want to install these dependencies locally, then use the
|
||||
kiwix-tools directory as install prefix.
|
||||
|
||||
If you want to compile Kiwix tools statically, the dependencies should
|
||||
be compile statically (provide a lib...a library), for example by
|
||||
using "--enable-static" with "./configure".
|
||||
be compiled statically (provide a `lib...a` library), for example by
|
||||
using `--enable-static` with `./configure`.
|
||||
|
||||
If you compile manually Libmicrohttpd, you might need to compile it
|
||||
without GNU TLS, a bug here will empeach further compilation of Kiwix
|
||||
tools otherwise.
|
||||
|
||||
Environnement
|
||||
Environment
|
||||
-------------
|
||||
|
||||
The Kiwix library builds using [Meson](http://mesonbuild.com/) version
|
||||
0.34 or higher. Meson relies itself on Ninja, pkg-config and few other
|
||||
compilation tools.
|
||||
The Kiwix tools build using [Meson](http://mesonbuild.com/) version
|
||||
0.43 or higher. Meson relies itself on Ninja, pkg-config and few other
|
||||
compilation tools. Install them first:
|
||||
* [Meson](http://mesonbuild.com/)
|
||||
* [Ninja](https://ninja-build.org/)
|
||||
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
||||
|
||||
Install first the few common compilation tools:
|
||||
* Automake
|
||||
* Libtool
|
||||
* Virtualenv
|
||||
* Pkg-config
|
||||
|
||||
Then install Meson itself:
|
||||
```
|
||||
virtualenv -p python3 ./ # Create virtualenv
|
||||
source bin/activate # Activate the virtualenv
|
||||
pip install meson # Install Meson
|
||||
hash -r # Refresh bash paths
|
||||
```
|
||||
|
||||
Finally download and build Ninja locally:
|
||||
```
|
||||
git clone git://github.com/ninja-build/ninja.git
|
||||
cd ninja
|
||||
git checkout release
|
||||
./configure.py --bootstrap
|
||||
mkdir ../bin
|
||||
cp ninja ../bin
|
||||
cd ..
|
||||
```
|
||||
These tools should be packaged if you use a cutting edge operating
|
||||
system. If not, have a look to the [Troubleshooting](#Troubleshooting)
|
||||
section.
|
||||
|
||||
Compilation
|
||||
-----------
|
||||
|
||||
Once all dependencies are installed, you can compile kiwix-lib with:
|
||||
```
|
||||
mkdir build
|
||||
Once all dependencies are installed, you can compile Kiwix tools with:
|
||||
```bash
|
||||
meson . build
|
||||
cd build
|
||||
ninja
|
||||
ninja -C build
|
||||
```
|
||||
|
||||
By default, it will compile dynamic linked libraries. If you want
|
||||
@@ -105,18 +104,61 @@ Depending of you system, `ninja` may be called `ninja-build`.
|
||||
Installation
|
||||
------------
|
||||
|
||||
If you want to install the Kiwix tools you just have compiled on your
|
||||
system, here we go:
|
||||
|
||||
If you want to install the Kiwix tools, here we go:
|
||||
```bash
|
||||
ninja -C build install
|
||||
```
|
||||
ninja install
|
||||
|
||||
You might need to run the command as `root` (or using `sudo`),
|
||||
depending where you want to install the Kiwix tools. After the
|
||||
installation succeeded, you may need to run ldconfig (as `root`).
|
||||
|
||||
Uninstallation
|
||||
------------
|
||||
|
||||
If you want to uninstall the Kiwix tools:
|
||||
```bash
|
||||
ninja -C build uninstall
|
||||
```
|
||||
|
||||
Like for the installation, you might need to run the command as `root`
|
||||
(or using `sudo`).
|
||||
|
||||
Docker
|
||||
------
|
||||
|
||||
An official Docker image of `kiwix-serve` can be found in the [Docker Hub](https://hub.docker.com/r/kiwix/kiwix-serve).
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
If you need to install Meson "manually":
|
||||
```bash
|
||||
virtualenv -p python3 ./ # Create virtualenv
|
||||
source bin/activate # Activate the virtualenv
|
||||
pip3 install meson # Install Meson
|
||||
hash -r # Refresh bash paths
|
||||
```
|
||||
|
||||
If you need to install Ninja "manually":
|
||||
```bash
|
||||
git clone git://github.com/ninja-build/ninja.git
|
||||
cd ninja
|
||||
git checkout release
|
||||
./configure.py --bootstrap
|
||||
mkdir ../bin
|
||||
cp ninja ../bin
|
||||
cd ..
|
||||
```
|
||||
|
||||
You might need to run the command as root, depending where you want to
|
||||
install the libraries.
|
||||
If the compilation still fails, you might need to get a more recent
|
||||
version of a dependency than the one packaged by your Linux
|
||||
distribution. Try then with a source tarball distributed by the
|
||||
problematic upstream project or even directly from the source code
|
||||
repository.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
GPLv3 or later, see COPYING for more details.
|
||||
[GPLv3](https://www.gnu.org/licenses/gpl-3.0) or later, see
|
||||
[COPYING](COPYING) for more details.
|
||||
|
||||
18
docker/server/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM alpine:latest
|
||||
LABEL maintainer Emmanuel Engelhart <kelson@kiwix.org>
|
||||
|
||||
# Install kiwix-serve
|
||||
WORKDIR /
|
||||
RUN apk add --no-cache curl bzip2
|
||||
RUN curl -kL https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-x86_64.tar.gz | tar -xz && \
|
||||
mv kiwix-tools*/kiwix-serve /usr/local/bin && \
|
||||
rm -r kiwix-tools*
|
||||
|
||||
# Run kiwix-serve
|
||||
EXPOSE 80
|
||||
VOLUME /data
|
||||
WORKDIR /data
|
||||
|
||||
COPY ./start.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/start.sh"]
|
||||
26
docker/server/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
Kiwix serve Docker image
|
||||
========================
|
||||
|
||||
With local ZIM file
|
||||
-------------------
|
||||
|
||||
* Download a ZIM file from <https://wiki.kiwix.org/wiki/Content>
|
||||
|
||||
* Given `wikipedia.zim` resides in `/tmp/zim/`, execute the following:
|
||||
|
||||
```bash
|
||||
docker run -v /tmp/zim:/data -p 8080:80 kiwix/kiwix-serve wikipedia.zim
|
||||
```
|
||||
|
||||
With remote ZIM file
|
||||
--------------------
|
||||
|
||||
```bash
|
||||
docker run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -p 8080:80 kiwix/kiwix-serve
|
||||
```
|
||||
|
||||
Screenshots
|
||||
-----------
|
||||
|
||||

|
||||

|
||||
BIN
docker/server/pictures/screenshot_1.png
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
docker/server/pictures/screenshot_2.png
Normal file
|
After Width: | Height: | Size: 302 KiB |
18
docker/server/start.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Download if necessary a file
|
||||
if [ ! -z "$DOWNLOAD" ]
|
||||
then
|
||||
ZIM=`basename $DOWNLOAD`
|
||||
wget $DOWNLOAD -O "$ZIM"
|
||||
|
||||
# Set arguments
|
||||
if [ "$#" -eq "0" ]
|
||||
then
|
||||
set -- "$@" $ZIM
|
||||
fi
|
||||
fi
|
||||
|
||||
CMD="/usr/local/bin/kiwix-serve --port=80 $@"
|
||||
echo $CMD
|
||||
$CMD
|
||||
15
format_code.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
files=(
|
||||
"src/installer/kiwix-install.cpp"
|
||||
"src/searcher/kiwix-search.cpp"
|
||||
"src/reader/kiwix-read.cpp"
|
||||
"src/manager/kiwix-manage.cpp"
|
||||
"src/server/kiwix-serve.cpp"
|
||||
)
|
||||
|
||||
for i in "${files[@]}"
|
||||
do
|
||||
echo $i
|
||||
clang-format -i -style=file $i
|
||||
done
|
||||
33
meson.build
@@ -1,36 +1,29 @@
|
||||
project('kiwix-tools', 'cpp',
|
||||
version : '0.2.0',
|
||||
license : 'GPL')
|
||||
version : '3.0.2',
|
||||
license : 'GPL',
|
||||
default_options: ['c_std=c11', 'cpp_std=c++11', 'werror=true'])
|
||||
|
||||
compiler = meson.get_compiler('cpp')
|
||||
|
||||
add_global_arguments('-DKIWIX_TOOLS_VERSION="@0@"'.format(meson.project_version()), language : 'cpp')
|
||||
|
||||
static_linkage = get_option('static-linkage')
|
||||
if static_linkage
|
||||
add_global_link_arguments('-static-libstdc++', '--static', language:'cpp')
|
||||
endif
|
||||
|
||||
thread_dep = dependency('threads')
|
||||
kiwixlib_dep = dependency('kiwix', static:static_linkage)
|
||||
kiwixlib_dep = dependency('kiwix', version:'>=9.0.0', static:static_linkage)
|
||||
microhttpd_dep = dependency('libmicrohttpd', static:static_linkage)
|
||||
z_dep = dependency('zlib', static:static_linkage)
|
||||
|
||||
# This is a temporary workaround until xapian fix it's xapian-core.pc
|
||||
# For a correct dependency checking we should test if uuid is really installed
|
||||
# but for a workaround, we assume that in xapian is installed, uuid also.
|
||||
if meson.is_cross_build() and host_machine.system() == 'windows'
|
||||
# xapian doesn't use uuid on windows.
|
||||
uuid_dep = declare_dependency()
|
||||
else
|
||||
xapian_dep = dependency('xapian-core', required : false)
|
||||
if xapian_dep.found()
|
||||
uuid_dep = declare_dependency(link_args:['-luuid', '-lrt'])
|
||||
else
|
||||
uuid_dep = declare_dependency()
|
||||
endif
|
||||
all_deps = [thread_dep, kiwixlib_dep, microhttpd_dep, z_dep]
|
||||
|
||||
if static_linkage
|
||||
librt = compiler.find_library('rt', required:false)
|
||||
if librt.found()
|
||||
all_deps += librt
|
||||
endif
|
||||
endif
|
||||
|
||||
all_deps = [thread_dep, kiwixlib_dep, microhttpd_dep, z_dep, uuid_dep]
|
||||
|
||||
#subdir('include')
|
||||
subdir('static')
|
||||
subdir('src')
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Copyright 2011-2014 Emmanuel Engelhart <kelson@kiwix.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <kiwix/common/pathTools.h>
|
||||
#include <kiwix/reader.h>
|
||||
#include <kiwix/manager.h>
|
||||
|
||||
enum supportedAction { NONE, ADDCONTENT };
|
||||
|
||||
void usage() {
|
||||
cout << "Usage: kiwix-install [--verbose] addcontent ZIM_PATH KIWIX_PATH" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
/* Init the variables */
|
||||
const char *contentPath = NULL;
|
||||
const char *kiwixPath = NULL;
|
||||
supportedAction action = NONE;
|
||||
bool verboseFlag = false;
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
|
||||
/* Argument parsing */
|
||||
while (42) {
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
if (c != -1) {
|
||||
c = getopt_long(argc, argv, "vi", long_options, &option_index);
|
||||
|
||||
switch (c) {
|
||||
case 'v':
|
||||
verboseFlag = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (optind < argc) {
|
||||
if (action == NONE) {
|
||||
string actionString = argv[optind++];
|
||||
if (actionString == "addcontent" || actionString == "ADDCONTENT") {
|
||||
action = ADDCONTENT;
|
||||
}
|
||||
} else if (contentPath == NULL) {
|
||||
contentPath = argv[optind++];
|
||||
} else if (kiwixPath == NULL) {
|
||||
kiwixPath = argv[optind++];
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if we have enough arguments */
|
||||
if (contentPath == NULL || kiwixPath == NULL) {
|
||||
usage();
|
||||
}
|
||||
|
||||
/* Make the action */
|
||||
if (action == ADDCONTENT) {
|
||||
|
||||
/* Check if the content path exists and is readable */
|
||||
if (verboseFlag) { std::cout << "Check if the ZIM file exists..." << std::endl; }
|
||||
if (!fileExists(contentPath)) {
|
||||
cerr << "The content path '" << contentPath << "' does not exist or is not readable." << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Check if this is a ZIM file */
|
||||
try {
|
||||
if (verboseFlag) { std::cout << "Check if the ZIM file is valid..." << std::endl; }
|
||||
kiwix::Reader *reader = new kiwix::Reader(contentPath);
|
||||
delete reader;
|
||||
} catch (exception &e) {
|
||||
cerr << "The content available at '" << contentPath << "' is not a ZIM file." << endl;
|
||||
exit(1);
|
||||
}
|
||||
string contentFilename = getLastPathElement(contentPath);
|
||||
|
||||
/* Check if kiwixPath/kiwix/kiwix.exe exists */
|
||||
if (verboseFlag) { std::cout << "Check if the Kiwix path is valid..." << std::endl; }
|
||||
string kiwixBinaryPath = computeAbsolutePath(kiwixPath, "kiwix/kiwix.exe");
|
||||
if (!fileExists(kiwixBinaryPath)) {
|
||||
kiwixBinaryPath = computeAbsolutePath(kiwixPath, "kiwix/kiwix");
|
||||
if (!fileExists(kiwixBinaryPath)) {
|
||||
cerr << "Unable to find the Kiwix binary at '" << kiwixBinaryPath << "[.exe]'." << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if the directory "data" structure exists */
|
||||
if (verboseFlag) { std::cout << "Check the target data directory structure..." << std::endl; }
|
||||
string dataPath = computeAbsolutePath(kiwixPath, "data/");
|
||||
if (!fileExists(dataPath)) {
|
||||
makeDirectory(dataPath);
|
||||
}
|
||||
|
||||
/* Check if the directory "data/content" structure exists */
|
||||
string dataContentPath = computeAbsolutePath(kiwixPath, "data/content/");
|
||||
if (!fileExists(dataContentPath)) {
|
||||
makeDirectory(dataContentPath);
|
||||
}
|
||||
|
||||
/* Check if the directory "data/library" structure exists */
|
||||
string dataLibraryPath = computeAbsolutePath(kiwixPath, "data/library/");
|
||||
if (!fileExists(dataLibraryPath)) {
|
||||
makeDirectory(dataLibraryPath);
|
||||
}
|
||||
|
||||
/* Copy the file to the data/content directory */
|
||||
if (verboseFlag) { std::cout << "Copy ZIM file to the target directory..." << std::endl; }
|
||||
string newContentPath = computeAbsolutePath(dataContentPath, contentFilename);
|
||||
if (!fileExists(newContentPath) || getFileSize(contentPath) != getFileSize(newContentPath)) {
|
||||
copyFile(contentPath, newContentPath);
|
||||
}
|
||||
|
||||
/* Add the file to the library.xml */
|
||||
if (verboseFlag) { std::cout << "Create the library XML file..." << std::endl; }
|
||||
kiwix::Manager libraryManager;
|
||||
string libraryPath = computeAbsolutePath(dataLibraryPath, contentFilename + ".xml");
|
||||
string bookId = libraryManager.addBookFromPathAndGetId(newContentPath, "../content/" + contentFilename, "", false);
|
||||
if (!bookId.empty()) {
|
||||
libraryManager.setCurrentBookId(bookId);
|
||||
libraryManager.writeFile(libraryPath);
|
||||
} else {
|
||||
cerr << "Unable to build or save library file '" << libraryPath << "'" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
executable('kiwix-install', ['kiwix-install.cpp'],
|
||||
dependencies:all_deps,
|
||||
install:true)
|
||||
@@ -1,23 +0,0 @@
|
||||
.TH KIWIX 1 "21 May 2012"
|
||||
.SH NAME
|
||||
kiwix-compact \- Compacteur d'index pour fichier ZIM
|
||||
.SH SYNOPSIS
|
||||
.IX Header SYNOPSIS
|
||||
kiwix-compact INDEX_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Compacte les fichiers d'index des ZIM à l'aide de xapian-compact.
|
||||
|
||||
.TP
|
||||
\fBINDEX_PATH\fR
|
||||
Chemin de l'index plein texte à compacter.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix-index(1) kiwix-manage(1) xapian-compact(1)
|
||||
.br
|
||||
kiwix-install(1) kiwix-serve(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -1,31 +0,0 @@
|
||||
.TH KIWIX 1 "21 May 2012"
|
||||
.SH NAME
|
||||
kiwix\-index \- Indexeur de fichiers ZIM
|
||||
.SH SYNOPSIS
|
||||
.IX Header SYNOPSIS
|
||||
kiwix\-index [\-\-backend|\-b=xapian|clucene] ZIM_PATH INDEX_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Génère un index plein texte xapian ou cLucene pour un fichier ZIM.
|
||||
|
||||
.TP
|
||||
\fB\-\-backend=xapian|clucene\fR
|
||||
Séléctionne un moteur d'indexation.
|
||||
|
||||
.TP
|
||||
\fBZIM_PATH\fR
|
||||
Chemin du fichier ZIM à indexer.
|
||||
|
||||
.TP
|
||||
\fBINDEX_PATH\fR
|
||||
Chemin où enregistrer l'index plein texte.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix\-compact(1) kiwix\-manage(1) kiwix\-serve(1)
|
||||
.br
|
||||
kiwix(1) kiwix\-install(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -1,40 +0,0 @@
|
||||
.TH KIWIX 1 "21 May 2012"
|
||||
.SH NAME
|
||||
kiwix\-install \- Installeur de fichiers ZIM
|
||||
.SH SYNOPSIS
|
||||
.IX Header SYNOPSIS
|
||||
kiwix\-install [\-\-verbose|-v] [\-\-backend|\-b=xapian|clucene] [\-\-buildIndex|\-i] addcontent ZIM_PATH KIWIX_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Créé une arborescence contenant Kiwix et des données pour redistribution.
|
||||
.br
|
||||
Si demandé, créé aussi un index plein texte.
|
||||
|
||||
.TP
|
||||
\fB\-\-verbose\fR
|
||||
Active le mode verbeux de la sortie.
|
||||
|
||||
.TP
|
||||
\fB\-\-backend=xapian|clucene\fR
|
||||
Séléctionne un moteur d'indexation.
|
||||
|
||||
.TP
|
||||
\fB\-\-buildIndex\fR
|
||||
Créer un index plein texte pour le fichier ZIM.
|
||||
|
||||
.TP
|
||||
\fBZIM_PATH\fR
|
||||
Chemin du fichier de contenu ZIM.
|
||||
|
||||
.TP
|
||||
\fBKIWIX_PATH\fR
|
||||
Chemin d'accès dossier kiwix/.
|
||||
.br
|
||||
Le chemin doit contenit le binaire statique de Kiwix.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix\-index(1) kiwix\-serve(1) kiwix\-compact(1) kiwix\-manage(1)
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -57,8 +57,8 @@ Chemin vers l'index plein texte correspondant au fichier ZIM.
|
||||
Définit l'adresse URL corresponsant au fichier ZIM pour pouvoir être téléchargé depuis Kiwix.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix\-index(1) kiwix\-install(1) kiwix\-serve(1) kiwix\-compact(1)
|
||||
kiwix(1) kiwix\-install(1) kiwix\-serve(1)
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
|
||||
@@ -52,10 +52,10 @@ Chemin vers le fichier bibliothèque de Kiwix.
|
||||
Le fichier bibliothèque est un fichier XML créé avec \fBkiwix-manage\fB.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix\-index(1) kiwix\-manage(1)
|
||||
kiwix(1) kiwix\-manage(1)
|
||||
.br
|
||||
kiwix\-install(1) kiwix\-compact(1)
|
||||
kiwix\-install(1)
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
.TH KIWIX 1 "12 juin 2012"
|
||||
.SH NAME
|
||||
Kiwix \- Lecteur hors-ligne de fichiers ZIM
|
||||
.SH SYNOPSIS
|
||||
.B kiwix [-jsconsole] [-articleByUrl] [-articleByTitle] [FILE]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Kiwix est un lecteur de content au format ZIM.
|
||||
.br
|
||||
Les fichiers ZIM sont des archives de contenus compressés (généralement HTML)
|
||||
.br
|
||||
Les fichiers ZIM les plus populaires sont ceux de Wikipédia et Wikileaks.
|
||||
|
||||
.TP
|
||||
\fB\-jsconsole\fR
|
||||
Active la console de debogage JavaScript de Xulrunner.
|
||||
\fB\-articleByUrl url\fR
|
||||
Ouvre un article en particulier en renseignant son url. FILE doit être donné.
|
||||
.TP
|
||||
\fB\-articleByTitle title\fR
|
||||
Ouvre un article en particulier en renseignant son titre. FILE doit être donné.
|
||||
|
||||
.PP
|
||||
Fonctionnalités:
|
||||
* Lecteur de ZIM natif
|
||||
* Moteur de recherche plein texte
|
||||
* Signets et Notes
|
||||
* Serveur Web pour diffuser les fichiers ZIM sur le réseau
|
||||
* Export HTML et PDF
|
||||
* Traduits dans de nombreuses langues
|
||||
* Suggestions de recherche
|
||||
* Indexation des fichiers ZIM
|
||||
* Onglets de navigation
|
||||
* Bibliothèque de contenus intégrée
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix-index(1) kiwix-install(1) kiwix-serve(1)
|
||||
.br
|
||||
kiwix-compact(1) kiwix-manage(1)
|
||||
|
||||
|
||||
.SH TROUBLESHOOTING
|
||||
Aller à http://reportabug.kiwix.org pour plus de détails sur comment rapporter un bogue.
|
||||
|
||||
.SH AUTHORS
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
Guillaume Duhamel <gduhamel@linterweb.com>
|
||||
Fabien Coullon <fcoulon@linterweb.com>
|
||||
Renaud Gaudin <rgaudin@gmail.com>
|
||||
Wilfredo Rodriguez <wilfredor@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -1,5 +1,3 @@
|
||||
install_man('kiwix-index.1',
|
||||
'kiwix-install.1',
|
||||
'kiwix-manage.1',
|
||||
install_man('kiwix-manage.1',
|
||||
'kiwix-serve.1',
|
||||
install_dir:get_option('mandir')+'/fr/man1')
|
||||
install_dir:get_option('mandir')+'/fr/man1')
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
.TH KIWIX 1 "21 May 2012"
|
||||
.SH NAME
|
||||
kiwix-compact \- ZIM index compacter
|
||||
.SH SYNOPSIS
|
||||
.IX Header SYNOPSIS
|
||||
kiwix-compact INDEX_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Compacts ZIM index files used by Kiwix using xapian-compact
|
||||
|
||||
.TP
|
||||
\fBINDEX_PATH\fR
|
||||
Full-text index path to compact.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix-index(1) kiwix-manage(1) xapian-compact(1)
|
||||
.br
|
||||
kiwix-install(1) kiwix-serve(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -1,31 +0,0 @@
|
||||
.TH KIWIX 1 "21 May 2012"
|
||||
.SH NAME
|
||||
kiwix\-index \- Kiwix ZIM Indexer
|
||||
.SH SYNOPSIS
|
||||
.IX Header SYNOPSIS
|
||||
kiwix\-index [\-\-backend|\-b=xapian|clucene] ZIM_PATH INDEX_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Generates a xapian or clucene full-text index for a ZIM file.
|
||||
|
||||
.TP
|
||||
\fB\-\-backend=xapian|clucene\fR
|
||||
Select an indexing backend.
|
||||
|
||||
.TP
|
||||
\fBZIM_PATH\fR
|
||||
ZIM file path to index.
|
||||
|
||||
.TP
|
||||
\fBINDEX_PATH\fR
|
||||
Path to save the full\-text index to.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix\-compact(1) kiwix\-manage(1) kiwix\-serve(1)
|
||||
.br
|
||||
kiwix(1) kiwix\-install(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -1,40 +0,0 @@
|
||||
.TH KIWIX 1 "21 May 2012"
|
||||
.SH NAME
|
||||
kiwix\-install \- Kiwix ZIM Installer
|
||||
.SH SYNOPSIS
|
||||
.IX Header SYNOPSIS
|
||||
kiwix\-install [\-\-verbose|-v] [\-\-backend|\-b=xapian|clucene] [\-\-buildIndex|\-i] addcontent ZIM_PATH KIWIX_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Creates a standalone Kiwix + data hierarchy.
|
||||
.br
|
||||
If specified, also creates a full\-text index.
|
||||
|
||||
.TP
|
||||
\fB\-\-verbose\fR
|
||||
Enable verbose output.
|
||||
|
||||
.TP
|
||||
\fB\-\-backend=xapian|clucene\fR
|
||||
Select an indexing backend.
|
||||
|
||||
.TP
|
||||
\fB\-\-buildIndex\fR
|
||||
Build an index for the ZIM file.
|
||||
|
||||
.TP
|
||||
\fBZIM_PATH\fR
|
||||
ZIM content file path.
|
||||
|
||||
.TP
|
||||
\fBKIWIX_PATH\fR
|
||||
Path to the kiwix/ folder.
|
||||
.br
|
||||
The path must contain the kiwix standalone binary.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix\-index(1) kiwix\-serve(1) kiwix\-compact(1) kiwix\-manage(1)
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
@@ -15,12 +15,12 @@ kiwix\-manage LIBRARY_PATH add ZIM_PATH ...
|
||||
.PP
|
||||
\fBkiwix\-manage\fP tool for managing a kiwix library.
|
||||
.PP
|
||||
Allows one to manage the content of the kiwix library. Library file is an XML flat file
|
||||
listing ZIM files with all necessary information like favicon, date, creator,
|
||||
description, indexpath, filepath, title, source/metalink etc.
|
||||
Allows one to manage the content of the kiwix library. The library file is a
|
||||
flat XML file listing ZIM files with all necessary information like favicon,
|
||||
date, creator, description, indexpath, filepath, title, source/metalink, etc.
|
||||
.
|
||||
.PP
|
||||
Example library file can be found at http://www.kiwix.org/library\.xml
|
||||
Example library file can be found at https://www.kiwix.org/library\.xml
|
||||
.br
|
||||
.TP
|
||||
\fBadd\fR
|
||||
@@ -55,8 +55,8 @@ Path to full-text index for that ZIM file.
|
||||
Set the content location of the ZIM file over the network for in\-kiwix download.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix\-index(1) kiwix\-install(1) kiwix\-serve(1) kiwix\-compact(1)
|
||||
kiwix(1) kiwix\-serve(1)
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
|
||||
@@ -9,11 +9,11 @@ kiwix\-serve [\-\-index=INDEX_PATH] [\-\-port=PORT] [\-\-verbose] [\-\-daemon] [
|
||||
kiwix\-serve \-\-library [\-\-port=PORT] [\-\-verbose] [\-\-daemon] [\-\-attachToProcess=PID] LIBRARY_PATH
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Stand\-alone HTTP server for serving ZIM content over the network.
|
||||
Stand\-alone HTTP server for serving ZIM contents over the network.
|
||||
|
||||
.TP
|
||||
\fB\-\-index=INDEX_PATH\fR
|
||||
Path to index folder created using \fBkiwix-index\fB.
|
||||
Path to index folder created using \fBkiwix-install\fB.
|
||||
|
||||
.TP
|
||||
\fB\-\-port=PORT\fR
|
||||
@@ -27,7 +27,7 @@ Enable verbose output.
|
||||
|
||||
.TP
|
||||
\fB\-\-daemon\fR
|
||||
Run the server as a daemon
|
||||
Run the server as a daemon.
|
||||
|
||||
.TP
|
||||
\fB\-\-attachToProcess=PID\fR
|
||||
@@ -49,13 +49,12 @@ Serves the contents of a library file instead of a single ZIM file.
|
||||
\fBLIBRARY_PATH\fR
|
||||
Kiwix library file path.
|
||||
.br
|
||||
Library is XML file created using \fBkiwix-manage\fB.
|
||||
Library is an XML file created using \fBkiwix-manage\fB.
|
||||
|
||||
.SH SEE ALSO
|
||||
kiwix(1) kiwix\-index(1) kiwix\-manage(1)
|
||||
.br
|
||||
kiwix\-install(1) kiwix\-compact(1)
|
||||
kiwix(1) kiwix\-manage(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Emmanuel Engelhart <kelson@kiwix.org>
|
||||
.br
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
Vasudev Kamath <kamathvasudev@gmail.com> (Manual)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
install_man('kiwix-index.1',
|
||||
'kiwix-install.1',
|
||||
'kiwix-manage.1',
|
||||
install_man('kiwix-manage.1',
|
||||
'kiwix-serve.1')
|
||||
subdir('fr')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011 Emmanuel Engelhart <kelson@kiwix.org>
|
||||
* Copyright 2011-2019 Emmanuel Engelhart <kelson@kiwix.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -17,59 +17,230 @@
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <getopt.h>
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <kiwix/common/pathTools.h>
|
||||
#include <kiwix/tools/stringTools.h>
|
||||
#include <kiwix/manager.h>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
enum supportedAction { NONE, ADD, SHOW, REMOVE };
|
||||
|
||||
void show(kiwix::Library* library, const std::string& bookId)
|
||||
{
|
||||
try {
|
||||
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
|
||||
<< "title:\t\t" << book.getTitle() << std::endl
|
||||
<< "name:\t\t" << book.getName() << std::endl
|
||||
<< "tags:\t\t" << book.getTags() << std::endl
|
||||
<< "description:\t" << book.getDescription() << std::endl
|
||||
<< "creator:\t" << book.getCreator() << std::endl
|
||||
<< "date:\t\t" << book.getDate() << std::endl
|
||||
<< "articleCount:\t" << book.getArticleCount() << std::endl
|
||||
<< "mediaCount:\t" << book.getMediaCount() << std::endl
|
||||
<< "size:\t\t" << book.getSize() << " KB" << std::endl;
|
||||
} catch (std::out_of_range&) {
|
||||
std::cout << "No book " << bookId << " in the library" << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void show(kiwix::Library library) {
|
||||
std::vector<kiwix::Book>::iterator itr;
|
||||
unsigned int inc = 1;
|
||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||
std::cout << "#" << inc++
|
||||
<< std::endl << "id:\t\t" << itr->id
|
||||
<< std::endl << "path:\t\t" << itr->path
|
||||
<< std::endl << "indexpath:\t" << itr->indexPath
|
||||
<< std::endl << "url:\t\t" << itr->url
|
||||
<< std::endl << "title:\t\t" << itr->title
|
||||
<< std::endl << "name:\t\t" << itr->name
|
||||
<< std::endl << "tags:\t\t" << itr->tags
|
||||
<< std::endl << "description:\t" << itr->description
|
||||
<< std::endl << "creator:\t" << itr->creator
|
||||
<< std::endl << "date:\t\t" << itr->date
|
||||
<< std::endl << "articleCount:\t" << itr->articleCount
|
||||
<< std::endl << "mediaCount:\t" << itr->mediaCount
|
||||
<< std::endl << "size:\t\t" << itr->size << " KB"
|
||||
<< std::endl << std::endl;
|
||||
/* Print correct console usage options */
|
||||
void usage()
|
||||
{
|
||||
std::cout << "Usage:" << std::endl
|
||||
<< "\tkiwix-manage LIBRARY_PATH add ZIM_PATH [OPTIONS]" << std::endl
|
||||
<< "\tkiwix-manage LIBRARY_PATH remove ZIM_ID [ZIM_ID]..." << std::endl
|
||||
<< "\tkiwix-manage LIBRARY_PATH show [ZIM_ID]..." << std::endl
|
||||
<< std::endl
|
||||
|
||||
<< "Purpose:" << std::endl
|
||||
<< "\tManipulates the Kiwix library XML file"
|
||||
<< std::endl << std::endl
|
||||
|
||||
<< "Arguments:" << std::endl
|
||||
<< "\tLIBRARY_PATH\tis the XML library file path."
|
||||
<< std::endl << std::endl
|
||||
<< "\tACTION\t\tis the pre-defined string to specify the action to run on the XML library file."
|
||||
<< std::endl << std::endl
|
||||
<< "\t\t\tMust be one of the following values:" << std::endl
|
||||
<< "\t\t\t* add: add a ZIM file to the library" << std::endl
|
||||
<< "\t\t\t* remove: remove a ZIM file from the library" << std::endl
|
||||
<< "\t\t\t* show: show the content of the library"
|
||||
<< std::endl << std::endl
|
||||
<< "\tZIM_ID\t\tZIM file unique ID"
|
||||
<< std::endl << std::endl
|
||||
<< "\tOPTIONS\t\tCustom options for \"add\" action:" << std::endl
|
||||
<< "\t\t\t--zimPathToSave=CUSTOM_ZIM_PATH to replace the current ZIM file path" << std::endl
|
||||
<< "\t\t\t--url=HTTP_ZIM_URL to create an \"url\" attribute for the online version of the ZIM file" << std::endl
|
||||
<< std::endl
|
||||
<< "\t\t\tOther options:" << std::endl
|
||||
<< "\t\t\t-v, --version to print the software version" << std::endl
|
||||
<< std::endl
|
||||
|
||||
<< "Examples:" << std::endl
|
||||
<< "\tAdd ZIM files to library: kiwix-manage my_library.xml add first.zim second.zim" << std::endl
|
||||
<< "\tRemove ZIM files from library: kiwix-manage my_library.xml remove e5c2c003-b49e-2756-5176-5d9c86393dd9" << std::endl
|
||||
<< "\tShow all library ZIM files: kiwix-manage my_library.xml show" << std::endl
|
||||
<< std::endl
|
||||
|
||||
<< "Documentation:" << std::endl
|
||||
<< "\tSource code\thttps://github.com/kiwix/kiwix-tools" << std::endl
|
||||
<< "\tMore info\thttps://wiki.kiwix.org/wiki/Kiwix-manage" << std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
int handle_show(kiwix::Library* library, const std::string& libraryPath,
|
||||
int argc, char* argv[])
|
||||
{
|
||||
if (argc > 3 ) {
|
||||
for(auto i=3; i<argc; i++) {
|
||||
std::string bookId = argv[i];
|
||||
show(library, bookId);
|
||||
}
|
||||
} else {
|
||||
auto booksIds = library->getBooksIds();
|
||||
for(auto& bookId: booksIds) {
|
||||
show(library, bookId);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void usage() {
|
||||
cerr << "Usage:" << endl;
|
||||
cerr << "\tkiwix-manage LIBRARY_PATH add ZIM_PATH [--zimPathToSave=../content/foobar.zim] [--current] [--indexBackend=xapian] [--indexPath=FULLTEXT_IDX_PATH] [--url=http://...metalink]" << endl;
|
||||
cerr << "\tkiwix-manage LIBRARY_PATH show [CONTENTID1] [CONTENTID2] ... (show everything if no param.)" << endl;
|
||||
cerr << "\tkiwix-manage LIBRARY_PATH remove CONTENTID1 [CONTENTID2]" << endl;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
string libraryPath = "";
|
||||
supportedAction action = NONE;
|
||||
string zimPath = "";
|
||||
kiwix::Manager libraryManager;
|
||||
int handle_add(kiwix::Library* library, const std::string& libraryPath,
|
||||
int argc, char* argv[])
|
||||
{
|
||||
string zimPath;
|
||||
string zimPathToSave = ".";
|
||||
string url;
|
||||
string origID = "";
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
int resultCode = 0;
|
||||
|
||||
/* Argument parsing */
|
||||
if (argc <= 3) {
|
||||
std::cerr << "Path to zim file to add is missing in the command line" << std::endl;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Options parsing */
|
||||
optind = 3;
|
||||
static struct option long_options[] = {
|
||||
{"url", required_argument, 0, 'u'},
|
||||
{"origId", required_argument, 0, 'o'},
|
||||
{"zimPathToSave", required_argument, 0, 'z'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
bool has_option = false;
|
||||
while (true) {
|
||||
c = getopt_long(argc, argv, "cz:u:", long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
has_option = true;
|
||||
switch (c) {
|
||||
case 'u':
|
||||
url = optarg;
|
||||
break;
|
||||
case 'o':
|
||||
origID = optarg;
|
||||
break;
|
||||
case 'z':
|
||||
zimPathToSave = optarg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (optind >= argc) {
|
||||
std::cerr << "Path to zim file to add is missing in the command line" << std::endl;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (has_option && argc-optind > 1) {
|
||||
std::cerr << "You cannot give option and several zim files to add" << std::endl;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
kiwix::Manager manager(library);
|
||||
|
||||
for(auto i=optind; i<argc; i++) {
|
||||
std::string zimPath = argv[i];
|
||||
if (!zimPath.empty()) {
|
||||
auto _zimPathToSave = zimPathToSave == "." ? zimPath : zimPathToSave;
|
||||
manager.addBookFromPathAndGetId(zimPath, _zimPathToSave, url, false);
|
||||
} else {
|
||||
std::cerr << "Invalid zim file path" << std::endl;
|
||||
resultCode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return(resultCode);
|
||||
}
|
||||
|
||||
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);
|
||||
int exitCode = 0;
|
||||
|
||||
if (argc <= 3) {
|
||||
std::cerr << "BookId to remove missing in the command line" << std::endl;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (!totalBookCount) {
|
||||
std::cerr << "Library is empty, no book to delete."
|
||||
<< std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (int i = 3; i<argc; i++) {
|
||||
bookId = argv[i];
|
||||
|
||||
if (!library->removeBookById(bookId)) {
|
||||
std::cerr << "Invalid book id '" << bookId << "'." << std::endl;
|
||||
exitCode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return(exitCode);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
string libraryPath = "";
|
||||
supportedAction action = NONE;
|
||||
kiwix::Library library;
|
||||
|
||||
/* General argument parsing */
|
||||
static struct option long_options[] = {
|
||||
{"version", no_argument, 0, 'v'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
int option_index = 0;
|
||||
int c;
|
||||
while (true) {
|
||||
c = getopt_long(argc, argv, "v", long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'v':
|
||||
version();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Action related argument parsing */
|
||||
if (argc > 2) {
|
||||
libraryPath = argv[1];
|
||||
string actionString = argv[2];
|
||||
@@ -89,123 +260,32 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
/* Try to read the file */
|
||||
libraryPath = isRelativePath(libraryPath) ?
|
||||
computeAbsolutePath(getCurrentDirectory(), libraryPath) :
|
||||
libraryPath;
|
||||
libraryManager.readFile(libraryPath, false);
|
||||
libraryPath = isRelativePath(libraryPath)
|
||||
? computeAbsolutePath(getCurrentDirectory(), libraryPath)
|
||||
: libraryPath;
|
||||
kiwix::Manager manager(&library);
|
||||
manager.readFile(libraryPath, false);
|
||||
|
||||
/* SHOW */
|
||||
if (action == SHOW) {
|
||||
show(libraryManager.cloneLibrary());
|
||||
} else if (action == ADD) {
|
||||
string zimPath;
|
||||
string zimPathToSave = ".";
|
||||
string indexPath;
|
||||
kiwix::supportedIndexType indexBackend = kiwix::XAPIAN;
|
||||
string url;
|
||||
string origID="";
|
||||
bool setCurrent = false;
|
||||
|
||||
if (argc>3) {
|
||||
zimPath = argv[3];
|
||||
}
|
||||
|
||||
/* Options parsing */
|
||||
optind = 2;
|
||||
while (42) {
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"url", required_argument, 0, 'u'},
|
||||
{"origId", required_argument, 0, 'o'},
|
||||
{"indexPath", required_argument, 0, 'i'},
|
||||
{"indexBackend", required_argument, 0, 'b'},
|
||||
{"zimPathToSave", required_argument, 0, 'z'},
|
||||
{"current", no_argument, 0, 'c'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "cz:u:i:b:", long_options, &option_index);
|
||||
|
||||
if (c != -1) {
|
||||
|
||||
switch (c) {
|
||||
case 'u':
|
||||
url = optarg;
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
origID = optarg;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
setCurrent = true;
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
indexPath = optarg;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
if (!strcmp(optarg, "xapian")) {
|
||||
indexBackend = kiwix::XAPIAN;
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
zimPathToSave = optarg;
|
||||
break;
|
||||
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!zimPath.empty()) {
|
||||
zimPathToSave = zimPathToSave == "." ? zimPath : zimPathToSave;
|
||||
string bookId = libraryManager.addBookFromPathAndGetId(zimPath, zimPathToSave, url, false);
|
||||
|
||||
if (!bookId.empty()) {
|
||||
|
||||
if (setCurrent)
|
||||
libraryManager.setCurrentBookId(bookId);
|
||||
|
||||
/* Save the index infos if necessary */
|
||||
if (!indexPath.empty())
|
||||
libraryManager.setBookIndex(bookId, indexPath, indexBackend);
|
||||
|
||||
} else {
|
||||
cerr << "Unable to build or save library file '" << libraryPath << "'" << endl;
|
||||
}
|
||||
} else {
|
||||
std::cerr << "Invalid zim file path" << std::endl;
|
||||
}
|
||||
|
||||
} else if (action == REMOVE) {
|
||||
unsigned int bookIndex = 0;
|
||||
const unsigned int totalBookCount = libraryManager.getBookCount(true, true);
|
||||
|
||||
if (argc>3) {
|
||||
bookIndex = atoi(argv[3]);
|
||||
}
|
||||
|
||||
if (bookIndex > 0 && bookIndex <= totalBookCount) {
|
||||
libraryManager.removeBookByIndex(bookIndex - 1);
|
||||
} else {
|
||||
if (totalBookCount > 0) {
|
||||
std::cerr << "Invalid book index number. Please give a number between 1 and " << totalBookCount << std::endl;
|
||||
} else {
|
||||
std::cerr << "Invalid book index number. Library is empty, no book to delete." << std::endl;
|
||||
}
|
||||
}
|
||||
int exitCode = 0;
|
||||
switch (action) {
|
||||
case SHOW:
|
||||
exitCode = handle_show(&library, libraryPath, argc, argv);
|
||||
break;
|
||||
case ADD:
|
||||
exitCode = handle_add(&library, libraryPath, argc, argv);
|
||||
break;
|
||||
case REMOVE:
|
||||
exitCode = handle_remove(&library, libraryPath, argc, argv);
|
||||
break;
|
||||
case NONE:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Rewrite the library file */
|
||||
if (action == REMOVE || action == ADD) {
|
||||
libraryManager.writeFile(libraryPath);
|
||||
library.writeToFile(libraryPath);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
exit(exitCode);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
subdir('installer')
|
||||
subdir('manager')
|
||||
subdir('reader')
|
||||
subdir('searcher')
|
||||
|
||||
@@ -18,59 +18,58 @@
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <kiwix/common/tree.h>
|
||||
#include <kiwix/reader.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
void usage() {
|
||||
cout << "Usage: kiwix-read --suggest=<PATTERN> ZIM_FILE_PATH" << endl;
|
||||
exit(1);
|
||||
#include "../version.h"
|
||||
|
||||
void usage()
|
||||
{
|
||||
cout << "Usage: kiwix-read [--verbose] [--version] --suggest=<PATTERN> ZIM_FILE_PATH" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void updateSuggestionTree(tree< pair<string, unsigned> > &suggestionTree, string suggestion) {
|
||||
return;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
/* Init the variables */
|
||||
const char *filePath = NULL;
|
||||
const char *pattern = NULL;
|
||||
const char* filePath = NULL;
|
||||
const char* pattern = NULL;
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
|
||||
kiwix::Reader *reader = NULL;
|
||||
kiwix::Reader* reader = NULL;
|
||||
|
||||
/* Argument parsing */
|
||||
while (42) {
|
||||
static struct option long_options[]
|
||||
= {{"verbose", no_argument, 0, 'v'},
|
||||
{"version", no_argument, 0, 'V'},
|
||||
{"suggest", required_argument, 0, 's'},
|
||||
{0, 0, 0, 0}};
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{"suggest", required_argument, 0, 's'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
if (c != -1) {
|
||||
c = getopt_long(argc, argv, "vs:", long_options, &option_index);
|
||||
c = getopt_long(argc, argv, "Vvs:", long_options, &option_index);
|
||||
|
||||
switch (c) {
|
||||
case 'v':
|
||||
break;
|
||||
case 's':
|
||||
pattern = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
break;
|
||||
case 'V':
|
||||
version();
|
||||
return 0;
|
||||
case 's':
|
||||
pattern = optarg;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (optind < argc) {
|
||||
if (filePath == NULL) {
|
||||
filePath = argv[optind++];
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
if (filePath == NULL) {
|
||||
filePath = argv[optind++];
|
||||
} else {
|
||||
usage();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,30 +84,19 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* Start to read an article */
|
||||
if (reader != NULL) {
|
||||
string mainPageUrl = reader->getMainPageUrl();
|
||||
string content;
|
||||
string contentType;
|
||||
unsigned int contentLength = 0;
|
||||
string suggestion;
|
||||
|
||||
|
||||
if (pattern != NULL) {
|
||||
std::cout << "Searching suggestions for: " << pattern << std::endl;
|
||||
|
||||
reader->searchSuggestionsSmart(pattern, 10);
|
||||
while (reader->getNextSuggestion(suggestion)) {
|
||||
std::cout << suggestion << std::endl;
|
||||
std::cout << suggestion << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (reader->getContentByUrl(mainPageUrl, content, contentLength, contentType)) {
|
||||
cout << content << endl;
|
||||
}
|
||||
*/
|
||||
|
||||
// tree< pair<string, unsigned> > tree;
|
||||
//updateSuggestionTree(tree, string(suggestion));
|
||||
|
||||
delete reader;
|
||||
} else {
|
||||
cerr << "Unable instanciate the Kiwix reader." << endl;
|
||||
|
||||
@@ -18,57 +18,73 @@
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
#include <kiwix/reader.h>
|
||||
#include <kiwix/searcher.h>
|
||||
|
||||
void usage() {
|
||||
cout << "Usage: kiwix-search [--verbose|-v] ZIM_PATH SEARCH" << endl;
|
||||
exit(1);
|
||||
#include "../version.h"
|
||||
|
||||
void usage()
|
||||
{
|
||||
cout << "Usage: kiwix-search [OPTIONS] ZIM PATTERN" << endl << endl
|
||||
<< " kiwix-search allows to find articles based on the a fulltext search pattern." << endl << endl
|
||||
<< " ZIM is the full path of the ZIM file." << endl
|
||||
<< " PATTERN is/are word(s) - or part of - to search in the ZIM." << endl << endl
|
||||
<< " -s, --suggestion\tSuggest article titles based on the few letters of the PATTERN instead of making a fulltext search. Work a bit like a completion solution." << endl
|
||||
<< " -v, --verbose\t\tGive details about the search process" << endl
|
||||
<< " -V, --version\t\tPrint software version" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
/* Init the variables */
|
||||
//const char *indexPath = "/home/itamar/.www.kiwix.org/kiwix/43k0i1j4.default/6d2e587b-d586-dc6a-dc6a-e4ef035a1495d15c.index";
|
||||
//const char *indexPath = "/home/itamar/testindex";
|
||||
const char *zimPath = NULL;
|
||||
const char *search = NULL;
|
||||
// const char *indexPath =
|
||||
// "/home/itamar/.www.kiwix.org/kiwix/43k0i1j4.default/6d2e587b-d586-dc6a-dc6a-e4ef035a1495d15c.index";
|
||||
// const char *indexPath = "/home/itamar/testindex";
|
||||
const char* zimPath = NULL;
|
||||
const char* search = NULL;
|
||||
bool verboseFlag = false;
|
||||
bool suggestionFlag = false;
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
|
||||
kiwix::Searcher *searcher = NULL;
|
||||
kiwix::Reader *reader = NULL;
|
||||
kiwix::Searcher* searcher = NULL;
|
||||
kiwix::Reader* reader = NULL;
|
||||
|
||||
/* Argument parsing */
|
||||
while (42) {
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
static struct option long_options[]
|
||||
= {{"verbose", no_argument, 0, 'v'},
|
||||
{"suggestion", no_argument, 0, 's'},
|
||||
{"version", no_argument, 0, 'V'},
|
||||
{0, 0, 0, 0}};
|
||||
|
||||
if (c != -1) {
|
||||
c = getopt_long(argc, argv, "vb:", long_options, &option_index);
|
||||
c = getopt_long(argc, argv, "Vvsb:", long_options, &option_index);
|
||||
|
||||
switch (c) {
|
||||
case 'v':
|
||||
verboseFlag = true;
|
||||
break;
|
||||
case 'v':
|
||||
verboseFlag = true;
|
||||
break;
|
||||
case 'V':
|
||||
version();
|
||||
return 0;
|
||||
case 's':
|
||||
suggestionFlag = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (optind < argc) {
|
||||
if (zimPath == NULL) {
|
||||
zimPath = argv[optind++];
|
||||
} else if (search == NULL) {
|
||||
search = argv[optind++];
|
||||
} else {
|
||||
cout << zimPath << endl;
|
||||
usage();
|
||||
}
|
||||
if (zimPath == NULL) {
|
||||
zimPath = argv[optind++];
|
||||
} else if (search == NULL) {
|
||||
search = argv[optind++];
|
||||
} else {
|
||||
cout << zimPath << endl;
|
||||
usage();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,28 +96,30 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* Try to prepare the indexing */
|
||||
try {
|
||||
reader = new kiwix::Reader(zimPath);
|
||||
reader = new kiwix::Reader(zimPath);
|
||||
} catch (...) {
|
||||
/* Cannot open the zimPath, maybe it is a plain old xapian database directory */
|
||||
/* Cannot open the zimPath, maybe it is a plain old xapian database
|
||||
* directory */
|
||||
}
|
||||
|
||||
if ( reader ) {
|
||||
searcher = new kiwix::Searcher("", reader);
|
||||
if (reader) {
|
||||
searcher = new kiwix::Searcher();
|
||||
searcher->add_reader(reader);
|
||||
} else {
|
||||
try {
|
||||
searcher = new kiwix::Searcher(zimPath, NULL);
|
||||
} catch (...) {
|
||||
cerr << "Unable to search through zim '" << zimPath << "'." << endl;
|
||||
exit(1);
|
||||
}
|
||||
cerr << "Unable to search through zim '" << zimPath << "'." << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Start the indexing */
|
||||
if (searcher != NULL) {
|
||||
string searchString(search);
|
||||
searcher->search(searchString, 0, 10);
|
||||
if (suggestionFlag) {
|
||||
searcher->suggestions(searchString, verboseFlag);
|
||||
} else {
|
||||
searcher->search(searchString, 0, 10, verboseFlag);
|
||||
}
|
||||
kiwix::Result* p_result;
|
||||
while ( (p_result = searcher->getNextResult()) ) {
|
||||
while ((p_result = searcher->getNextResult())) {
|
||||
cout << p_result->get_title() << endl;
|
||||
delete p_result;
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Parse command line
|
||||
zim=$1
|
||||
serve=$2
|
||||
if (( $# != 2 ))
|
||||
then
|
||||
echo "Usage: ./benchmark ZIM_PATH KIWIX-SERVE_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Constants
|
||||
delay=0.01
|
||||
top_log=/tmp/top.log
|
||||
top_calc=/tmp/top.calc
|
||||
|
||||
# Available memory
|
||||
memory_kb=`cat /proc/meminfo | grep "MemTotal" | tr -d " " | cut -f2 -d: | sed -e 's/[^0123456789]//g'`
|
||||
memory_mb=`echo "scale=2;$memory_kb/1024" | bc -l`
|
||||
|
||||
# Start Kiwix-serve
|
||||
echo "Starting kiwix-serve to be tested..."
|
||||
$serve --port=8080 "$zim" &
|
||||
serve_pid=$!
|
||||
|
||||
# Start top to monitor resource usage
|
||||
top -d $delay -b -p $serve_pid | grep $serve_pid > "$top_log" &
|
||||
top_pid=$!
|
||||
|
||||
# Print environnement informations
|
||||
echo "Process to monitor: $serve_pid"
|
||||
echo "Monitoring process: $top_pid"
|
||||
echo "Monitoring delay: $delay s"
|
||||
echo "ZIM file path: $zim"
|
||||
echo "Kiwix-serve path: $serve"
|
||||
echo "Total memory: $memory_mb MB"
|
||||
echo
|
||||
|
||||
# Compute artice list
|
||||
echo "Computing article list snippet..."
|
||||
articles=`zimdump -l $zim | grep ".html" | shuf | head -n 1000`
|
||||
|
||||
# Run wget against kiwix-serve
|
||||
start_date=`date +%s`
|
||||
for LINE in $articles
|
||||
do
|
||||
echo "Scrapping $LINE..."
|
||||
wget --quiet p -P /dev/shm/tmp "http://localhost:8080/wikipedia_en_medicine_2016-09/A/$LINE"
|
||||
rm -rf /dev/shm/tmp
|
||||
done
|
||||
end_date=`date +%s`
|
||||
|
||||
# Kill top instance
|
||||
kill -s STOP $top_pid 2>&1 > /dev/null
|
||||
sed -i '$ d' "$top_log"
|
||||
times=`cat "$top_log" | wc -l`
|
||||
|
||||
# Compute KPI
|
||||
duration=`echo "$end_date-$start_date" | bc -l`
|
||||
cpu_percent=`cat "$top_log" | sed -r -e "s;\s\s*; ;g" -e "s;^ *;;" | cut -d' ' -f9 | tr '\n' '+0' | sed -r -e "s;(.*)[+]$;\1;" -e "s/.*/scale=2\n(&)\/$times\nquit\n/" > "$top_calc" ; bc -q "$top_calc"`
|
||||
memory_percent=`cat "$top_log" | sed -r -e "s;\s\s*; ;g" -e "s;^ *;;" | cut -d' ' -f10 | tr '\n' '+' | sed -r -e "s;(.*)[+]$;\1;" -e "s/.*/scale=2\n(&)\/$times\nquit\n/" > "$top_calc" ; bc -q "$top_calc"`
|
||||
memory_absolut=`echo "scale=2;$memory_mb/100*$memory_percent" | bc -l`
|
||||
|
||||
echo
|
||||
echo "Measure count: $times"
|
||||
echo "Duration: $duration s"
|
||||
echo "CPU (average): $cpu_percent %"
|
||||
echo "Memory (average): $memory_absolut MB"
|
||||
|
||||
# Kill kiwix-serve & top instances
|
||||
kill -s STOP $serve_pid 2>&1 > /dev/null
|
||||
#rm "$top_log" "$top_calc"
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
sources = ['kiwix-serve.cpp']
|
||||
sources += server_resources
|
||||
|
||||
executable('kiwix-serve', sources,
|
||||
dependencies:all_deps,
|
||||
|
||||
32
src/version.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2009-2016 Emmanuel Engelhart <kelson@kiwix.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _KIWIX_TOOLS_VERSION_H_
|
||||
#define _KIWIX_TOOLS_VERSION_H_
|
||||
|
||||
#ifndef KIWIX_TOOLS_VERSION
|
||||
#define KIWIX_TOOLS_VERSION "undefined"
|
||||
#endif
|
||||
|
||||
void version()
|
||||
{
|
||||
std::cout << KIWIX_TOOLS_VERSION << std::endl;
|
||||
}
|
||||
|
||||
#endif //_KIWIX_TOOLs_VERSION_H_
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
res_compiler = find_program('compile_resources.py')
|
||||
|
||||
subdir('server')
|
||||
@@ -1,55 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Welcome to Kiwix Server</title>
|
||||
<script type="text/javascript" src="/skin/jquery-ui/external/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="/skin/jquery-ui/jquery-ui.min.js"></script>
|
||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.min.css" rel="Stylesheet" />
|
||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
|
||||
<style>
|
||||
body {
|
||||
background:
|
||||
radial-gradient(#EEEEEE 15%, transparent 16%) 0 0,
|
||||
radial-gradient(#EEEEEE 15%, transparent 16%) 8px 8px,
|
||||
radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px,
|
||||
radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 8px 9px;
|
||||
background-color:#E8E8E8;
|
||||
background-size:16px 16px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-width: 65.8em;
|
||||
}
|
||||
.book__list { text-align: center; }
|
||||
.book {
|
||||
display: inline-block; vertical-align: bottom; margin: 8px; padding: 12px 15px; width: 300px;
|
||||
border: 1px solid #ccc; border-radius: 8px;
|
||||
text-align: left; color: #000; font-family: sans-serif; font-size: 13px;
|
||||
background-color:#F1F1F1;
|
||||
box-shadow: 2px 2px 5px 0px #ccc;
|
||||
}
|
||||
.book:hover { background-color: #F9F9F9; box-shadow: none;}
|
||||
.book__background { background-repeat: no-repeat; background-size: auto; background-position: top right; }
|
||||
.book__title {
|
||||
padding: 0 55px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
font-size: 18px; color: #0645ad;
|
||||
}
|
||||
.book__description {
|
||||
padding: 5px 55px 5px 0px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
font-size: 15px;
|
||||
}
|
||||
.book__info { line-height: 18px; color: #777; font-weight: bold; font-size: 13px; }
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
$( "#accordion" ).accordion();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="kiwix">
|
||||
|
||||
<div class="kiwix">
|
||||
__BOOKS__
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,24 +0,0 @@
|
||||
<script type="text/javascript" src="/skin/jquery-ui/external/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="/skin/jquery-ui/jquery-ui.min.js"></script>
|
||||
<script>
|
||||
var jk = jQuery.noConflict();
|
||||
jk(function() {
|
||||
jk( "#kiwixsearchbox" ).autocomplete({
|
||||
|
||||
source: "/suggest?content=__CONTENT__",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
|
||||
select: function(event, ui) {
|
||||
jk( "#kiwixsearchbox" ).val(ui.item.value);
|
||||
jk( "#kiwixsearchform" ).submit();
|
||||
},
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
/* cybook hack */
|
||||
if (navigator.userAgent.indexOf("bookeen/cybook") != -1) {
|
||||
jk("html").addClass("cybook");
|
||||
}
|
||||
</script>
|
||||
9789
static/server/jquery-ui/external/jquery/jquery.js
vendored
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
7
static/server/jquery-ui/jquery-ui.min.css
vendored
13
static/server/jquery-ui/jquery-ui.min.js
vendored
@@ -1,8 +0,0 @@
|
||||
|
||||
server_resources = custom_target('resources',
|
||||
input: 'resources_list.txt',
|
||||
output: ['server-resources.cpp', 'server-resources.h'],
|
||||
command:[res_compiler, '--cxxfile', '@OUTPUT0@', '--hfile', '@OUTPUT1@', '@INPUT@'],
|
||||
build_always: true
|
||||
)
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
jquery-ui/jquery-ui.structure.min.css
|
||||
jquery-ui/jquery-ui.min.js
|
||||
jquery-ui/external/jquery/jquery.js
|
||||
jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png
|
||||
jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png
|
||||
jquery-ui/images/ui-icons_222222_256x240.png
|
||||
jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png
|
||||
jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
||||
jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png
|
||||
jquery-ui/images/ui-icons_2e83ff_256x240.png
|
||||
jquery-ui/images/ui-icons_cd0a0a_256x240.png
|
||||
jquery-ui/images/ui-icons_888888_256x240.png
|
||||
jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png
|
||||
jquery-ui/images/animated-overlay.gif
|
||||
jquery-ui/images/ui-bg_glass_75_dadada_1x400.png
|
||||
jquery-ui/images/ui-icons_454545_256x240.png
|
||||
jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png
|
||||
jquery-ui/jquery-ui.theme.min.css
|
||||
jquery-ui/jquery-ui.min.css
|
||||
home.html.tmpl
|
||||
include.html.part
|
||||
taskbar.css
|
||||
taskbar.html.part
|
||||
@@ -1,88 +0,0 @@
|
||||
#kiwixtoolbar {
|
||||
position: fixed;
|
||||
padding: .5em;
|
||||
left:0;
|
||||
right:0;
|
||||
top: 0;
|
||||
z-index:100;
|
||||
}
|
||||
|
||||
#kiwixtoolbar > a {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.height_separator {
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#kiwixsearchbox {
|
||||
width: 20em;
|
||||
}
|
||||
|
||||
.kiwix .kiwix_centered {
|
||||
max-width: 720px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.kiwix .kiwix_button_wrapper {
|
||||
float: left;
|
||||
}
|
||||
.kiwix .kiwix_searchform {
|
||||
float: right;
|
||||
}
|
||||
.kiwix #kiwixtoolbar button,
|
||||
.kiwix #kiwixtoolbar input[type="submit"] {
|
||||
box-sizing: border-box !important;
|
||||
height: 26px !important;
|
||||
line-height: 20px !important;
|
||||
margin-right: 5px !important;
|
||||
padding: 2px 6px !important;
|
||||
border: 1px solid #999 !important;
|
||||
border-radius: 3px !important;
|
||||
background-color: #ededed !important;
|
||||
font-weight: normal !important;
|
||||
cursor: pointer !important;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
.kiwix #kiwixtoolbar a {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.kiwix #kiwixtoolbar #kiwixsearchform input[type='text'] {
|
||||
box-sizing: border-box !important;
|
||||
height: 26px !important;
|
||||
line-height: 20px !important;
|
||||
border: 1px solid #999 !important;
|
||||
border-radius: 3px !important;
|
||||
background-color: #fff !important;
|
||||
padding: 2px 2px 2px 3px !important;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
/* Try to fix buggy stuff in jquery-ui autocomplete */
|
||||
#ui-id-1, .ui-autocomplete {
|
||||
background: white !important;
|
||||
border: solid 1px grey !important;
|
||||
}
|
||||
|
||||
li.ui-state-focus {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
.kiwixsearch {
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 645px) {
|
||||
.kiwixsearch {
|
||||
float: none;
|
||||
}
|
||||
#kiwixsearchbox {
|
||||
width: 65%;
|
||||
}
|
||||
#kiwixsearchform input[type="submit"] {
|
||||
width: 28%;
|
||||
}
|
||||
.height_separator {
|
||||
height: 6em;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.min.css" rel="Stylesheet" />
|
||||
<link type="text/css" href="/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" />
|
||||
<span class="kiwix">
|
||||
<span id="kiwixtoolbar" class="ui-widget-header">
|
||||
<div class="kiwix_centered">
|
||||
<div class="kiwix_button_wrapper">
|
||||
<a id="kiwix_serve_taskbar_library_button" href="/"><button>Library</button></a>
|
||||
<a id="kiwix_serve_taskbar_home_button" href="/__CONTENT__/"><button>Home</button></a>
|
||||
<a id="kiwix_serve_taskbar_random_button" href="/random?content=__CONTENT__"><button>Random</button></a>
|
||||
</div>
|
||||
<div class="kiwix_searchform">
|
||||
<form class="kiwixsearch" method="GET" action="/search" id="kiwixsearchform">
|
||||
<input type="hidden" name="content" value="__CONTENT__" />
|
||||
<input autocomplete="off" class="ui-autocomplete-input" id="kiwixsearchbox" name="pattern" type="text">
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
<div style="display: block; height: 5em;"></div>
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
BUILD_DIR=${HOME}/BUILD_${PLATFORM}
|
||||
INSTALL_DIR=${BUILD_DIR}/INSTALL
|
||||
|
||||
|
||||
case ${PLATFORM} in
|
||||
"native_static")
|
||||
MESON_OPTION="--default-library=static"
|
||||
;;
|
||||
"native_dyn")
|
||||
MESON_OPTION="--default-library=shared"
|
||||
;;
|
||||
"win32_static")
|
||||
MESON_OPTION="--default-library=static --cross-file ${BUILD_DIR}/meson_cross_file.txt"
|
||||
;;
|
||||
"win32_dyn")
|
||||
MESON_OPTION="--default-library=shared --cross-file ${BUILD_DIR}/meson_cross_file.txt"
|
||||
;;
|
||||
"android_arm")
|
||||
MESON_OPTION="-Dandroid=true --default-library=shared --cross-file ${BUILD_DIR}/meson_cross_file.txt"
|
||||
;;
|
||||
"android_arm64")
|
||||
MESON_OPTION="-Dandroid=true --default-library=shared --cross-file ${BUILD_DIR}/meson_cross_file.txt"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
cd ${TRAVIS_BUILD_DIR}
|
||||
export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/x86_64-linux-gnu/pkgconfig
|
||||
export PATH=${INSTALL_DIR}/bin:$PATH
|
||||
meson . build -Dctpp2-install-prefix=${INSTALL_DIR} ${MESON_OPTION}
|
||||
cd build
|
||||
ninja
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
REPO_NAME=${TRAVIS_REPO_SLUG#*/}
|
||||
ARCHIVE_NAME=deps_${PLATFORM}_${REPO_NAME}.tar.gz
|
||||
|
||||
# Packages.
|
||||
case ${PLATFORM} in
|
||||
"native_static")
|
||||
PACKAGES="gcc cmake libbz2-dev ccache zlib1g-dev uuid-dev libctpp2-dev"
|
||||
;;
|
||||
"native_dyn")
|
||||
PACKAGES="gcc cmake libbz2-dev ccache zlib1g-dev uuid-dev libctpp2-dev libmicrohttpd-dev"
|
||||
;;
|
||||
"win32_static")
|
||||
PACKAGES="g++-mingw-w64-i686 gcc-mingw-w64-i686 gcc-mingw-w64-base mingw-w64-tools ccache"
|
||||
;;
|
||||
"win32_dyn")
|
||||
PACKAGES="g++-mingw-w64-i686 gcc-mingw-w64-i686 gcc-mingw-w64-base mingw-w64-tools ccache"
|
||||
;;
|
||||
"android_arm")
|
||||
PACKAGES="gcc cmake ccache"
|
||||
;;
|
||||
"android_arm64")
|
||||
PACKAGES="gcc cmake ccache"
|
||||
;;
|
||||
esac
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq python3-pip ${PACKAGES}
|
||||
pip3 install meson
|
||||
|
||||
# Ninja
|
||||
cd $HOME
|
||||
git clone git://github.com/ninja-build/ninja.git
|
||||
cd ninja
|
||||
git checkout release
|
||||
./configure.py --bootstrap
|
||||
sudo cp ninja /bin
|
||||
|
||||
# Dependencies comming from kiwix-build.
|
||||
cd ${HOME}
|
||||
wget http://tmp.kiwix.org/ci/${ARCHIVE_NAME}
|
||||
mkdir -p BUILD_${PLATFORM}
|
||||
cd BUILD_${PLATFORM}
|
||||
tar xf ${HOME}/${ARCHIVE_NAME}
|
||||