Skip to content

Allow directories in kiwix-serve paths #743

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Allow directories in kiwix-serve paths #743

wants to merge 2 commits into from

Conversation

juuz0
Copy link
Collaborator

@juuz0 juuz0 commented Apr 26, 2025

Fixes #739
Added the ability to provide directories along with filePaths in kiwix-serve

Example usage:
kiwix-serve --port 8080 directoryPath filePath anotherDirectoryPath

For a file structure of this kind:
image

Output (note the verbose flag):
image

juuz0 added 2 commits April 26, 2025 17:29
Fixed the spelling mistake in zimPathes.
Added the ability to provide a directory path along with files.
If the path provided is a directory, we recursively scan it and either add the files in it or go through the same operation for sub directories.
@kelson42 kelson42 removed the request for review from mgautierfr May 4, 2025 10:20
Copy link
Contributor

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juuz0 Thank you for your code. Here my remarks:

  • Please update the usage()
  • It should add only the .zim .ZIM .zimaa .ZIMAA files, all the others should be ignored
  • There is no security avoiding loop parsing following directory symlinks (you need to keep track of real directory paths to avoid looping).
  • I would really like to have the code in libkiwix to be able to share it with Kiwix Desktop (or there is a reason already why this is not shared)?

All of this said - and this is not the less important - it works from a user perspective :)

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

Successfully merging this pull request may close these issues.

Allow to serve a full directory of ZIM files
2 participants