Skip to content

[BUG] Kiwix-Serve Add URL Root Location Variable #91

@SasquatchSecurity

Description

@SasquatchSecurity

Describe the bug
Not necessarily a bug, but a feature request. I could've probably done a pull request but logged it this way instead.

The template does not allow setting the --urlRootLocation or -r argument to support using a reverse proxy.

Documentation for the option: https://kiwix-tools.readthedocs.io/en/latest/kiwix-serve.html#cmdoption-r

To Reproduce
Steps to reproduce the behavior:

  1. Run docker container for kiwix-serve
  2. Configure reverse proxy of your choice with something like https://example.com/kiwix
  3. Attempt to navigate to the reverse proxy URL
  4. Kiwix won't load based on how it rewrites URLs by default based on the base URL

Expected behavior
Once implemented, Kiwix can be displayed through a reverse proxy.

Screenshots
None to provide. It just won't work.

Additional context
The fix should be easy to implement. Something like below. In my testing, it worked by hardcoding the argument and value without using environment variables.
In /usr/local/bin/start.sh add the following to the CMD line

CMD="/usr/local/bin/kiwix-serve --port=$PORT --urlRootLocation=$urlRoot $@"

Then add a default variable for urlRoot in the template and allow it to be set. In this case the environment variable urlRoot being set to kiwix would work for https://example.com/kiwix through the reverse proxy as intended.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions