From e1847cb058efca5a93bdb3fbf4295b665a618bab Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 11 Sep 2022 14:43:40 +0200 Subject: [PATCH 1/3] Move back the 'Troubleshooting' section to the end --- README.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9ead4accd..9d5798bc2 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ where you want to install the libraries. After the installation succeeded, you may need to run `ldconfig` (as `root`). Uninstallation ------------- +-------------- If you want to uninstall the Kiwix library: ```bash @@ -134,28 +134,6 @@ ninja -C build uninstall Like for the installation, you might need to run the command as `root` (or using `sudo`). -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 .. -``` - Custom Index Page ----------------- @@ -205,6 +183,28 @@ distribution. Try then with a source tarball distributed by the problematic upstream project or even directly from the source code repository. +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 .. +``` + License ------- From ee3514d2d6672dc7be105f8c7f13da343bff78cc Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 11 Sep 2022 15:36:36 +0200 Subject: [PATCH 2/3] Documentation for static files --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 9d5798bc2..4cd47356e 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,29 @@ meson . build -Dwrapper=android -Dwerror=false ninja -C build ``` +Static files compilation +------------------------ + +Libkiwix has a few static files 'compiled' within the binary +code. This is mostly Javascript/HTML/pictures necessary for the HTTP +daemon. + +These static files are available in the `static` directory and are +compiled by custom Python code available in this repository `scripts` +directory. This happens automatically at compilation time without any +additional command to run. + +To avoid HTTP caching issue, the URLs (to the static content) are +appended with a `cacheid` parameter (this is called "cache +busting"). This `cacheid` value derived from the SHA1SUM of each +targeted static file. As a consequence, each time you change a static +file, the corresponding `cacheid` value will change. To properly test +this feature, this `cacheid` needs to be added manually to the +automated test and has to be commited. To know what are the expected +`cacheid` values, you can build once the libkiwix and then run `grep +-r cacheid build/static/`. Finally update `test/server.cpp` with the +appropriate `cacheid` values which have changed. + Testing ------- From 5130bf97747787ec123379d35d85d0808eebbbc0 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Wed, 14 Sep 2022 15:54:25 +0200 Subject: [PATCH 3/3] Fix: testlog based cacheid retrieval --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4cd47356e..f12e160fd 100644 --- a/README.md +++ b/README.md @@ -113,16 +113,20 @@ compiled by custom Python code available in this repository `scripts` directory. This happens automatically at compilation time without any additional command to run. -To avoid HTTP caching issue, the URLs (to the static content) are +To avoid HTTP caching issues, the URLs (to the static content) are appended with a `cacheid` parameter (this is called "cache -busting"). This `cacheid` value derived from the SHA1SUM of each -targeted static file. As a consequence, each time you change a static -file, the corresponding `cacheid` value will change. To properly test -this feature, this `cacheid` needs to be added manually to the -automated test and has to be commited. To know what are the expected -`cacheid` values, you can build once the libkiwix and then run `grep --r cacheid build/static/`. Finally update `test/server.cpp` with the -appropriate `cacheid` values which have changed. +busting"). This `cacheid` value derived from the +[sha1sum](https://en.wikipedia.org/wiki/Sha1sum) of each targeted +static file. As a consequence, each time you change a static file, the +corresponding `cacheid` value will change. + +To properly test this feature, this `cacheid` needs to be added +manually to the automated tests and has to be commited. After +modifying the needed static file, [run the automated +tests](#Testing). They will fail, but the inspection of the testing +log will give you the new `cacheid` value(s). Finally update +`test/server.cpp` with the appropriate `cacheid` value(s) which have +changed. Testing -------