757 Commits

Author SHA1 Message Date
Matthieu Gautier
53b2dadfce Compile without warning. 2018-04-19 18:05:41 +02:00
Matthieu Gautier
eccf5e194c
Merge pull request #177 from kiwix/rpath
Set rpath of the installed binaries.
2018-04-17 17:14:53 +02:00
Matthieu Gautier
8356277562 Set rpath of the installed binaries.
Let's set RPATH of installed binaries, this way, we will be able to
run dynamically linked binaries without changing LD_LIBRARY_PATH.
2018-04-17 16:29:41 +02:00
Matthieu Gautier
c6ace1eafc
Merge pull request #171 from kiwix/new_version
New version 0.4.0
0.4.0
2018-03-27 12:03:21 +02:00
Matthieu Gautier
8552985cd4 New version 0.4.0 2018-03-27 11:20:21 +02:00
Matthieu Gautier
9997a6ec18
Merge pull request #169 from kiwix/infinit_redirect
Correctly pre-increment the loopCounter.
2018-03-26 10:04:28 +02:00
Matthieu Gautier
8b6abc0e35 Correctly pre-increment the loopCounter.
In case of infinit redirection, if we post-increment the loop counter,
we will exit the loop when loopCounter will be 42 and increment it.
So loop counter will be 43.

Let's pre-increment the counter to still compare with 42 (more consistancy)

Fix #168
2018-03-25 17:07:38 +02:00
Kelson
426796dc37
Merge pull request #135 from kiwix/search_suggestions
Update usage() with --suggestion
2017-12-20 19:54:22 +01:00
kelson42
712cdf5e7b Update usage() with --suggestion 2017-12-20 19:07:38 +01:00
Matthieu Gautier
74cc1d0708
Merge pull request #133 from kiwix/better_search_tool
Better search tool
2017-12-19 15:24:29 +01:00
Matthieu Gautier
3ce668af66 Add a suggestion option to search in suggestion.
There are two kinds of search system :
- Suggestion (search in title only)
- "Classical" search (search in whole content)

The option `--suggestion` allow `kiwix-search` to search for suggestion.
Without the option, a "classical" search is made.

Fix #132.
2017-12-19 14:17:15 +01:00
Matthieu Gautier
2b69cc8ffc Pass verboseFlag to underlying kiwix::Searcher. 2017-12-19 14:13:36 +01:00
Matthieu Gautier
71ffaaa05a
Merge pull request #127 from kiwix/compilation_fixes
Compilation fixes
2017-12-13 16:26:57 +00:00
Matthieu Gautier
f3fb5d61cc Use correct option to compile a static binary in travis.
We must use custom option `static-linkage` instead of meson's
`default-library`.
2017-12-13 17:17:28 +01:00
Matthieu Gautier
05c63536de Force usage of meson 0.43.0.
Static compilation is broken with meson 0.44.0.
2017-12-13 16:43:42 +01:00
Matthieu Gautier
16e12ad463 Stop workaround xapian-core.pc
`xapian-core.pc` is now correct stop workaround it adding extra
link args.
The workaround is broken with meson 0.44.0 and static compilation.

However, libmicrohttpd is using `librt` if present but doesn't declare
it in its `libmicrohttpd.pc` file so we must add it manually if we found
it.
2017-12-13 16:43:08 +01:00
Matthieu Gautier
c91285fc29
Merge pull request #123 from kiwix/fix_crash
Fix crash
2017-12-04 16:04:08 +00:00
Matthieu Gautier
5c11ff1a30 Correctly cast to int in debug message.
A `class enum` is not implicitly cast to an `int`.
It is better to explicitly cast it to avoid future error with different
versions of compiler.
2017-12-04 15:12:27 +00:00
Matthieu Gautier
9eaf512bf9 Correctly handle NULL string for request arguments.
When iterating over arguments of a request, the value can be a null pointer
if the argument is provided without a `=`.
https://www.gnu.org/software/libmicrohttpd/manual/html_node/microhttpd_002drequests.html

We have to handle this correctly.

Should fix #116.
2017-12-04 15:10:45 +00:00
Matthieu Gautier
9a29874f9f Better verbose message.
The parsing of the request in the `RequestContext` constructor may be
buggy and make kiwix-serve crash.

If we print debug information only after the request is parsed, we will
never print the debug information if the parsing crash.

It is better to, at least, write that we've got a new request to avoid
us to try to debug previous request where everything were ok.
2017-12-04 15:08:18 +00:00
Matthieu Gautier
aa9647e88c
Merge pull request #122 from kiwix/gcc5
Compile using gcc-5 on native ubuntu.
2017-12-04 12:29:59 +00:00
Matthieu Gautier
da0c697963 Compile using gcc-5 on native ubuntu.
As dependencies prepared by kiwix-build are build using gcc-5
(kiwix/kiwix-build@7fc557d), we need to also compile libzim using gcc-5.
2017-12-04 11:15:50 +00:00
Matthieu Gautier
77d25686cb
Merge pull request #115 from kiwix/better_search_handling
Better search handling
2017-11-29 16:21:45 +00:00
Matthieu Gautier
3df2fa708b Set the global humanReadableId.
This is needed by kiwix-lib to generate correct "next page" links.
2017-11-27 12:45:41 +00:00
Matthieu Gautier
9021f87715 Handle search with no content and empty query string.
We need to handle :

 - No content because it is how we do multisearch.
 - No query string because it is how we can do geosearch.
2017-11-27 12:44:25 +00:00
Matthieu Gautier
04b05b7902
Merge pull request #111 from kiwix/better_request_parsing
Better request parsing
2017-11-27 11:39:10 +00:00
Matthieu Gautier
a8e73aab98 Move the request context out of kiwix-serve.cpp.
RequestContext is now a "complex" class that handle a lot of thing for
the handlers :
- The rootLocation is correctly handle and remove from the url.
  So a handler doesn't have to care about it (when parsing the url)
- Request arguments and header are stored in a map and there are access
  methods to get it.
- Request arguments can be automatically convert to other type than string.
- Better parsing of the `byte` header. Related to #91.
2017-11-27 11:20:02 +00:00
Matthieu Gautier
234a9d9719 Let the different handlers look for the reader/searcher.
It is to the handlers to get the right reader/searcher they want and
create correct error/default page if the name doesn't correspond to a
zim file.

The `handle_default` function has also be renamed to `build_homepage`
because it is what is done. (And it doesn't handle a request).
2017-11-22 16:16:54 +00:00
Matthieu Gautier
c93617473d Move some variable out of the request's context.
`humanReadableBookId`, `reader` and `searcher` are not so global that
it seems.

Let's move it out of the request object as handler may or not use them.
2017-11-22 15:53:34 +00:00
Matthieu Gautier
09e2039aff Rename variable request_context to request. 2017-11-22 15:47:23 +00:00
Matthieu Gautier
5c6a1870b9
Merge pull request #107 from kiwix/geo_loc
Add a small (private) support for geo query.
2017-11-22 12:46:47 +01:00
Matthieu Gautier
4fffaf41b6 Add a small (private) support for geo query.
This use the small API of kiwix-lib and so, cannot search a text query
and filter around a geo position in the same time.

There is no way to do a search but than write directly the search url
by hand.

If the request is wrongly formatted, the search is simply not done without
error message.
2017-11-14 17:42:01 +01:00
Matthieu Gautier
05c734fc31
Merge pull request #104 from kiwix/library_relative_path
Relative paths are relative to current directory not executable.
2017-11-13 15:14:42 +01:00
Matthieu Gautier
fa9b027a39 Relative paths are relative to current directory not executable.
Almost nothing should be relative to the executable directory.
Content coming from the user should be relative to where the user
is (its working directory).

Fixes #70.
2017-11-13 14:42:52 +01:00
Matthieu Gautier
1fcc1ad9d4
Merge pull request #98 from kiwix/http_byte_range_fix
Fix HTTP request byte range handling #91
2017-11-13 14:42:16 +01:00
kelson42
5fd8dd3c36 Fix HTTP request byte range handling #91 2017-11-13 12:01:45 +01:00
Matthieu Gautier
f03ed85972
Merge pull request #87 from swiftugandan/master
do not cache results for searches from the welcome page
2017-11-09 15:48:15 +01:00
Philip Munaawa
52308b764d do not cache results for searches from the welcome page 2017-11-09 14:24:03 +00:00
Kelson
03bac00019
Merge pull request #99 from kiwix/dattaz-patch_issue_19_good
Dattaz patch issue 19 good
2017-11-08 20:19:57 +01:00
kelson42
905b83b3b1 Small beautification of the code 2017-11-08 20:11:55 +01:00
dattaz
894ed12f37 escape the & character of humanReadableBookId to not be interpreted in urls as a new argument 2017-11-08 19:50:23 +01:00
Kelson
573b826861
Merge pull request #62 from kiwix/julianharty-patch-1
Update kiwix-serve.cpp
2017-11-07 20:01:28 +01:00
Julian Harty
8051773124 Fixed a typo in an error message 2017-11-07 19:10:23 +01:00
Matthieu Gautier
69dd6cd869
Merge pull request #94 from kiwix/man_cleaning
Remove kiwix-index and kiiwx-compact man pages
2017-11-06 15:45:11 +01:00
kelson42
8d32bfd16e Remove kiwix-index and kiiwx-compact man pages 2017-11-06 15:31:06 +01:00
Matthieu Gautier
b1d2a1378b Merge pull request #90 from kiwix/new_release
Release of kiwix-tools 0.3.0.
0.3.0
2017-10-24 11:29:34 +02:00
Matthieu Gautier
df7d44128c Release of kiwix-tools 0.3.0. 2017-10-23 11:40:00 +02:00
Matthieu Gautier
ee5333bb91 Merge pull request #86 from kiwix/swiftugandan_root
Swiftugandan root
2017-10-17 16:21:04 +02:00
Philip Munaawa
871d8f4a51 disable caching for the welcome page 2017-10-17 15:46:55 +02:00
Philip Munaawa
9280d519f5 Adding support for relative url location 2017-10-17 15:46:11 +02:00