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

Ability to specify a single file directly (similar to httpfs) #86

Closed
breisig opened this issue Aug 25, 2021 · 12 comments
Closed

Ability to specify a single file directly (similar to httpfs) #86

breisig opened this issue Aug 25, 2021 · 12 comments
Labels
enhancement New feature or request

Comments

@breisig
Copy link

breisig commented Aug 25, 2021

Is it possible to add the functionality to be able to show just 1 file instead of a directory file listing in a mounted path? I have a ISO file in a path that doesn't support web directory file listing and would like to be able to mount and show only that ISO file if I specify it directly.

Example.

httpdirfs --no-range-check https://www.example.com/mycrazypath/rocky-linux-8.iso /cdrom/

And it should should show
ls /cdrom/*
rocky-linux-8.iso

@breisig breisig changed the title Ability to specify 1 file (ISO) directly instead of a web directory file listing path? [FEATURE] Ability to specify 1 file (ISO) directly instead of a web directory file listing path? Aug 25, 2021
@fangfufu fangfufu added the wontfix This will not be worked on label Aug 25, 2021
@fangfufu
Copy link
Owner

You can mount the directory containing the ISO file, then loop mount the ISO file as usual.

@breisig
Copy link
Author

breisig commented Aug 25, 2021

@fangfufu Yes, that is only correct only if the destination file browsing is enabled [or an index.html with the iso file listed in an ahref link]

What Works Currently:
If https://www.example.com/mycrazypath/ remote path has directory browsing enabled [and returns a 200 result code] or an index,html with the rocky-linux-8.iso file list in the HTML file as a a-href, I can mount the https://www.example.com/mycrazypath/ path, do an 'ls' and see the rocky-linux-8.iso file and loop mount the ISO file. [I can verify I can download it directly from https://www.example.com/mycrazypath/rocky-linux-8.iso even without directory browsing].

What Doesn't Work: [and would be a great feature to have] is:
If directory browsing is disabled on https://www.example.com/mycrazypath/ [Returns a 403 Forbidden] but I know that I can still access/download the ISO file directly if the path is known [https://www.example.com/mycrazypath/rocky-linux-8.iso can be downloaded directly from my browser], it would be nice if I could still httpdirfs mount that 1 file to show up in my mounted path. Currently, this does not work with the latest version from master.

Example of what would be great to support

httpdirfs --no-range-check https://www.example.com/mycrazypath/rocky-linux-8.iso /cdrom/

And it should should show
ls /cdrom/*
rocky-linux-8.iso

@fangfufu
Copy link
Owner

@breisig , you can use httpfs for that.

@breisig
Copy link
Author

breisig commented Aug 25, 2021

@fangfufu I have used httpfs but it's been abandoned for awhile now and mounting SSL url's is broken [only http links work]. This would be a great feature to add to httpdirfs for everyone to switch to your project.

@fangfufu
Copy link
Owner

Ok, you managed to convince me, I don't really have a timeline on when this will be done though.

@fangfufu fangfufu reopened this Aug 25, 2021
@fangfufu fangfufu added enhancement New feature or request and removed wontfix This will not be worked on labels Aug 25, 2021
fangfufu added a commit that referenced this issue Aug 31, 2021
Implemented feature request
#86
@fangfufu
Copy link
Owner

fangfufu commented Aug 31, 2021

@breisig , implemented via f42264d. It should be in the latest master branch. You need to activate it using single-file-mode.

For example:

./httpdirfs -f --cache --single-file-mode https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.0.0-amd64-netinst.iso mnt

Please have a try, and let me know what you think. If you like it, please spread good words of this software! 🙂

@fangfufu fangfufu pinned this issue Aug 31, 2021
@fangfufu fangfufu changed the title [FEATURE] Ability to specify 1 file (ISO) directly instead of a web directory file listing path? Ability to specify a single file directly (similar to httpfs) Aug 31, 2021
@fangfufu fangfufu unpinned this issue Aug 31, 2021
@WizzardSK
Copy link

Please, how to mount the file with url containing spaces? when I mounted in escaped format, the file name is escaped too and cannot be opened in OS. When I provide URL non excaped, it does not mount (Error:src/network.c:163:curl_process_msgs: 3 - URL using bad/illegal format or missing URL)

@fangfufu fangfufu reopened this Apr 7, 2024
@fangfufu
Copy link
Owner

fangfufu commented Apr 7, 2024

Re-opened the ticket - will investigate.

@WizzardSK
Copy link

It seems that the problem is only present when I am using --cache, what is the most of times. Otherwise mounting of files with spaces in name (%20) works fine, but it is of course slow without cache.

@fangfufu
Copy link
Owner

fangfufu commented Apr 9, 2024

Yes, the filename resolution has two paths. Because I wrote them at different times, and I wasn't good with software engineer (I probably still am not.) My team mate would call this "skills issue".

@EyitopeIO Could you propose a fix please? :P

@EyitopeIO
Copy link
Contributor

Hey, @WizzardSK
This is now WIP and should have been fixed in a few days.

@fangfufu
Copy link
Owner

Closing this issue as the original request had been completed. @WizzardSK , in future please open new issues for bugs, rather than commenting on old feature request issues. :)

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

No branches or pull requests

4 participants