13 Commits
3.0.2 ... 3.1.0

Author SHA1 Message Date
Matthieu Gautier
5d21baa759 Fix typo in meson.build 2020-04-09 23:51:23 +02:00
Matthieu Gautier
6ba6046850 New version 3.1.0 2020-04-08 18:01:34 +02:00
Matthieu Gautier
d24f474dda Merge pull request #367 from kiwix/block-external-links
Add support for external links blocking in kiwix-serve
2020-04-06 20:15:08 +02:00
Kelson
07de2d29c4 Merge pull request #371 from kiwix/better-ci-event
Run Github actions on any push (not only in PR)
2020-04-03 16:28:34 +02:00
Kelson
d99e5cd975 Run Github actions on any push (not only in PR) 2020-04-03 16:26:47 +02:00
Kelson
f82d5aa7e5 CI badge from Github actions (instead of Travis) 2020-04-03 16:24:04 +02:00
renaud gaudin
824aef9189 Add support for external links blocking in kiwix-serve
Add a new `-b` `--blockexternallinks` option to kiwix-serve
triggering the corresponding response taskbar option in kiwix-lib.
2020-04-02 09:10:00 +00:00
Kelson
d6914eb34f Bump-up version to 3.0.3 2020-03-01 15:50:32 +01:00
Kelson
b65212fab7 Merge pull request #364 from kiwix/fix-argument-parsing
Fix argument parsing
2020-03-01 15:49:17 +01:00
Kelson
83427af3d2 Update Changelog 2020-03-01 15:45:31 +01:00
Kelson
d572bf875d Better --version argument parsing 2020-03-01 15:42:44 +01:00
Kelson
833c997782 Remove usell origId option parsing 2020-03-01 15:36:31 +01:00
Kelson
44613aae5d Print information about /data if error 2020-02-18 08:38:18 +01:00
7 changed files with 35 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
name: CI
on: [pull_request]
on: [push]
jobs:
Linux:
@@ -31,25 +31,20 @@ jobs:
container:
image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-26"
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- 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
'--branch', '${{steps.extract_branch.outputs.branch}}'
]
check_call(command, cwd=environ['HOME'])
- name: Install deps

View File

@@ -1,3 +1,13 @@
kiwix-tools 3.1.0
=================
* [SERVER] Add option to block external links
kiwix-tools 3.0.3
=================
* [MANAGER] Fix broken --version argument parsing
kiwix-tools 3.0.2
=================

View File

@@ -8,7 +8,7 @@ command line tools:
* kiwix-search: Fulltext search in ZIM files
* kiwix-serve: HTTP daemon serving ZIM files
[![Build Status](https://travis-ci.com/kiwix/kiwix-tools.svg?branch=master)](https://travis-ci.com/kiwix/kiwix-tools)
[![Build Status](https://github.com/kiwix/kiwix-tools/workflows/CI/badge.svg?query=branch%3Amaster)](https://github.com/kiwix/kiwix-tools/actions?query=branch%3Amaster)
[![CodeFactor](https://www.codefactor.io/repository/github/kiwix/kiwix-tools/badge)](https://www.codefactor.io/repository/github/kiwix/kiwix-tools)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

View File

@@ -16,3 +16,10 @@ fi
CMD="/usr/local/bin/kiwix-serve --port=80 $@"
echo $CMD
$CMD
# If error, print the content of /data
if [ $? -ne 0 ]
then
echo "Here is the content of /data:"
find /data -type f
fi

View File

@@ -1,5 +1,5 @@
project('kiwix-tools', 'cpp',
version : '3.0.2',
version : '3.1.0',
license : 'GPL',
default_options: ['c_std=c11', 'cpp_std=c++11', 'werror=true'])
@@ -13,7 +13,7 @@ if static_linkage
endif
thread_dep = dependency('threads')
kiwixlib_dep = dependency('kiwix', version:'>=9.0.0', static:static_linkage)
kiwixlib_dep = dependency('kiwix', version:'>=9.1.0', static:static_linkage)
microhttpd_dep = dependency('libmicrohttpd', static:static_linkage)
z_dep = dependency('zlib', static:static_linkage)

View File

@@ -119,7 +119,6 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
string zimPath;
string zimPathToSave = ".";
string url;
string origID = "";
int option_index = 0;
int c = 0;
int resultCode = 0;
@@ -133,7 +132,6 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
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}
};
@@ -149,9 +147,6 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
case 'u':
url = optarg;
break;
case 'o':
origID = optarg;
break;
case 'z':
zimPathToSave = optarg;
break;
@@ -228,7 +223,7 @@ int main(int argc, char** argv)
int option_index = 0;
int c;
while (true) {
while (true && argc == 2) {
c = getopt_long(argc, argv, "v", long_options, &option_index);
if (c == -1)
break;

View File

@@ -60,6 +60,7 @@ void usage()
<< "\t-i, --address\t\tlisten only on this ip address, all available ones otherwise" << std::endl
<< "\t-m, --nolibrarybutton\tdo not print the builtin home button in the builtin top bar overlay" << std::endl
<< "\t-n, --nosearchbar\tdo not print the builtin bar overlay on the top of each served page" << std::endl
<< "\t-b, --blockexternal\tprevent users from directly accessing external links" << std::endl
<< "\t-p, --port\t\tTCP port on which to listen to HTTP requests (default: 80)" << std::endl
<< "\t-r, --urlRootLocation\tURL prefix on which the content should be made available (default: /)" << std::endl
<< "\t-t, --threads\t\tnumber of threads to run in parallel (default: " << DEFAULT_THREADS << ")" << std::endl
@@ -90,6 +91,7 @@ int main(int argc, char** argv)
bool noLibraryButtonFlag = false;
bool noSearchBarFlag = false;
bool noDateAliasesFlag = false;
bool blockExternalLinks = false;
bool isVerboseFlag = false;
bool trustlibrary = true;
string PPIDString;
@@ -103,6 +105,7 @@ int main(int argc, char** argv)
{"nolibrarybutton", no_argument, 0, 'm'},
{"nodatealiases", no_argument, 0, 'z'},
{"nosearchbar", no_argument, 0, 'n'},
{"blockexternallinks", no_argument, 0, 'b'},
{"attachToProcess", required_argument, 0, 'a'},
{"port", required_argument, 0, 'p'},
{"address", required_argument, 0, 'i'},
@@ -115,7 +118,7 @@ int main(int argc, char** argv)
while (true) {
int option_index = 0;
int c
= getopt_long(argc, argv, "zmndvVla:p:f:t:r:i:", long_options, &option_index);
= getopt_long(argc, argv, "zmnbdvVla:p:f:t:r:i:", long_options, &option_index);
if (c != -1) {
switch (c) {
@@ -134,6 +137,9 @@ int main(int argc, char** argv)
case 'n':
noSearchBarFlag = true;
break;
case 'b':
blockExternalLinks = true;
break;
case 'z':
noDateAliasesFlag = true;
break;
@@ -249,6 +255,7 @@ int main(int argc, char** argv)
server.setNbThreads(nb_threads);
server.setVerbose(isVerboseFlag);
server.setTaskbar(!noSearchBarFlag, !noLibraryButtonFlag);
server.setBlockExternalLinks(blockExternalLinks);
if (! server.start()) {
cerr << "Unable to instantiate the HTTP daemon. The port " << serverPort