Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kiwix-serve -r (--urlRootLocation) flag failures #521

Closed
holta opened this issue Jan 14, 2022 · 3 comments · Fixed by kiwix/libkiwix#676
Closed

kiwix-serve -r (--urlRootLocation) flag failures #521

holta opened this issue Jan 14, 2022 · 3 comments · Fixed by kiwix/libkiwix#676
Assignees
Milestone

Comments

@holta
Copy link

holta commented Jan 14, 2022

This bug does not affect Internet-in-a-Box.

But it's being reported as a service for others, at it suddenly affects all kiwix-tools nightly builds starting with 2022-01-05.

Specifically, kiwix-serve's -r flag (same as the --urlRootLocation flag) adds the specified string into the URL twice, which breaks all links from kiwix-serve's main/welcome page.

Example run:
./kiwix-serve -r foobar phet_en_2021-08.zim

Example broken link:
http://192.168.0.100/foobar/foobar/phet_en_2021-08

The correct link would (and should!) be:
http://192.168.0.100/foobar/phet_en_2021-08

Recap: this worked in all nightly builds up to and including 2022-01-04.

Related:


ASIDE: when run at the command line, kiwix-serve also advertises the wrong URL, failing to add the string specified by -r = --urlRootLocation

./kiwix-serve -r foobar phet_en_2021-08.zim
The Kiwix server is running and can be accessed in the local network at:
 http://192.168.0.100:80

The correct advertised URL would (and should!) be:
http://192.168.0.100:80/foobar

@kelson42 kelson42 added this to the 3.2.0 milestone Jan 14, 2022
@kelson42 kelson42 added the bug label Jan 14, 2022
@kelson42
Copy link
Contributor

@veloman-yunkan @mgautierfr @juuz0 URGENT We really need to fix this bug (if confirmed) before anything else. It seems we have introduced this regression a few days ago.

@juuz0
Copy link
Collaborator

juuz0 commented Jan 14, 2022

kiwix/libkiwix@66c4081 introduced this regression.

@juuz0
Copy link
Collaborator

juuz0 commented Jan 14, 2022

The problem is in line 109 of index.js (libkiwix) where we set href={root}{link}
Since kiwix/libkiwix@66c4081, OPDS stream provides full URL and we dont need to append {root}. Simply removing it will fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants