adding Mountpoint option to S3 index #450
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
changes to arguments and implementation before the indexing of the files.
Your checklist for this pull request
Describe the problem
While trying to index samples form a S3 bucket i've noticed that samples that where pulled to my "workdirectory", would not be indexed and would give the error that the file could not be found.
In my setup i've mounted the /opt/samples directory on my linux box to the /mnt/samples directory in mquery.
The Workdir option that needs to be used is used to temporary download the files while indexing.
using /tmp for that results in the the ursadb never being able to find the samples.
So to make sure the downloaded files will be shown in ursa; we make the workdir: /opt/samples/workdir directory for this!
Conclusion; still won't work. cause when we whe try indexing the files in ursadb; it looks up /opt/samples/workdir; and this folder does not exist, cause on the Parent device the directory is in /opt/
But the samples can be found in /mnt/sampels on the ursadb/mquery docker.
Solution
I've changed the script on my own system to use an extra argument (default set to none) called --docker-mountpoint; this string value can be configured to overrule the workdir option while indexing.
This means that you still push in the workdirectory as always; but also can discribe the path the files can be found for ursadb.
so if the working directory is set to /opt/samples/workdir, and ursadb/mquery is set to mount /opt/samples to /mnt/samples ; ursadb will be able to find the files in /mnt/samples/workdir.
configuring --docker-mountpoint to /mnt/samples/workdir will make sure that while writing the files down on disk; the import still uses the correct folder to match the file location on disk.
Closing issues
fixes #449