737 Commits

Author SHA1 Message Date
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
Matthieu Gautier
540fcd3be9 Merge pull request #84 from kiwix/byte_range
Byte range
2017-10-11 17:14:01 +02:00
Matthieu Gautier
ad7238b0c9 Stop refusing the first connection.
I don't know why we are refusing the first connection.

It seems to work without this.
Moreover, this is not thread safe and it would be pretty complex to
make it thread safe.
2017-10-11 17:00:55 +02:00
Matthieu Gautier
b5c91417ff Better debug information of each request. 2017-10-11 17:00:55 +02:00
Matthieu Gautier
b638df81fa Implement response to bytes range request.
Handle bytes range request http header.
Do not read the full buffer but try to stream it as far as possible.
2017-10-11 17:00:55 +02:00
Matthieu Gautier
58f0a716a6 Correctly return 404 if asked skin is not existing.
Fix #83
2017-10-10 17:02:15 +02:00
Matthieu Gautier
a2324b5e8b Use a structure RequestContext to pass all the context of a request.
This simplifies the code and avoid to pass a lot of arguments to
each function.
2017-10-10 16:59:45 +02:00
Matthieu Gautier
c2ac40d4f5 Merge pull request #82 from kiwix/multi_thread
Make kiwix-server multi-threaded.
2017-10-10 14:43:50 +02:00
Matthieu Gautier
4534b51f5e Use printf instead of cout.
`std::cout` stream is not thread safe at all.
Printing from different threads can lead to corrupted stream (and no
output working).

Using `printf` may still lead to interleaved output but nothing will broke.
2017-10-10 14:39:42 +02:00
Matthieu Gautier
0364951f75 Make kiwix-server multi-threaded. 2017-10-03 16:35:03 +02:00
Matthieu Gautier
a2627e81c4 Merge pull request #78 from kiwix/patch-1
Look for renamed kiwix-compile-resources script as well
2017-09-27 19:15:57 +02:00
Kunal Mehta
cd72a2d73c Look for renamed kiwix-compile-resources script as well
See https://github.com/kiwix/kiwix-lib/pull/76
2017-09-27 19:10:57 +02:00
Matthieu Gautier
fa3f33d3c7 Use sudo to install pip dependencies in travis 2017-09-27 19:03:11 +02:00
Matthieu Gautier
a210cb3a4b Merge pull request #68 from kiwix/css_taskbar
Css taskbar
2017-08-15 15:51:09 -04:00
Matthieu Gautier
63cb47247b Serve the taskbar css as separated file.
For firefox, the file encoding must be specified in the first 1024 bytes.
If it is not, firefox will reload the page when it founds it.

By inserting the taskbar's css directly in the html, we are "moving" down
the encoding of the page, and the encoding is not inside the first 1024
bytes.

This also improve a bit the performance as the browser can cache the css
file and it's avoid us to send the css in earch html file.
2017-08-15 15:15:26 -04:00
Matthieu Gautier
3220ee1276 Move <link> tag in <head> tag.
In html, the link tag should be in head tag, not in the body tag.
2017-08-15 15:08:56 -04:00
Matthieu Gautier
4a1b9cbfa9 Merge pull request #67 from kiwix/no_globalsearch_on_zim
Do not do globalSearch if the zim file has no full text index.
2017-08-15 14:54:35 -04:00
Matthieu Gautier
f2b5904221 Do not do globalSearch if the zim file has no full text index.
Global search is made only on the global task bar.
Task bar display in the article should provide full text search only
if the zim file has associated full text index.

This is done by having a `NULL` searcher. However, commit `558a0375`
return the globalSearcher if no searcher is associated to a zim.

This commit associate a `NULL` searcher to the zim, so we will not use
the globalSearcher.
2017-08-13 11:35:57 -04:00
Matthieu Gautier
f44722fbbc Merge pull request #64 from kiwix/fix_protocol
Correctly set ProtocolPrefix and SearchProtocolPrefix for searcher.
2017-08-11 00:44:28 -04:00
Matthieu Gautier
0cfcc59437 Update to new kiwix-lib API about Searcher instantiation.
`kiwix-lib` remove `setContentHumanReadableId` method in favour of
specifying directly it in the constructor.
2017-08-10 09:45:08 -04:00
Matthieu Gautier
7776eafbfc Correctly set ProtocolPrefix and SearchProtocolPrefix for searcher.
Default `protocolPrefix` for the kiwix-lib searcher is `zim:://`.
We have to change it to `/` for all searcher we create else the search's
results will have a `zim://...` url, which will obviously won't work.
2017-08-09 20:20:56 -04:00