miniserve
miniserve copied to clipboard
How about add "delete file" feature?
After I do some research on many mini http server, miniserve is a great work, which have authentication. But I also have found many mini http servers did not have "delete file" feature including miniserve.
I think "delete file" will be a good point to a mini http server, especially it can combine the authntication.
Another Rust static file server with file deletion feature but less friendly UI: https://github.com/thecoshman/http.
I have some time and would like to work on this. But first I have some questions regarding CLI flags.
There are several options as I see it:
- No new flags. Piggy-back on the existing
[-u|--upload-files]
and[-U|--mkdir]
flags.-u
allowsrm
and-U
allowsrm -rf
. - One new flag that allows both deleting files and directories.
- Two flags, one for files and one for directories.
The later options allow more granular control, but it could be teetering on the edge of over-engineering.
I personally like option 2 the most, because:
- compared to option 1, the granularity is justified, especially considering its relationship to the existing
[-o|--overwrite-files]
flag. - it's not overdoing the granularity either, because it makes little sense to not allow removing entire directories, when a user can just delete all the files one by one.
- There are already many existing short flags. None of
-r
,-d
,-D
is available. The only reasonable one remaining is-R
, which makes only 1 flag desirable.
@svenstaro let me know what you think.
I think option 2. does indeed sound reasonable. Would be happy if you wanted to take a stab at this. Should be fairly easy too. Make sure to use non-blocking deletion though as it can take a long time to recursively delete some stuff.
Has this feature been completed? In what version can it be used?
Not yet. My original plan was to work on it last month, but then I went on a family vacation, and immediately afterward got a new job.
TLDR is I'm kind of busy now. I will likely get some spare time early June, so that'll likely be when I can produce a working prototype.
@cyqsimon Ok, I see. Thank you very much !
Not yet. My original plan was to work on it last month, but then I went on a family vacation, and immediately afterward got a new job.
TLDR is I'm kind of busy now. I will likely get some spare time early June, so that'll likely be when I can produce a working prototype.
Has this feature been completed?
Not yet. My original plan was to work on it last month, but then I went on a family vacation, and immediately afterward got a new job. TLDR is I'm kind of busy now. I will likely get some spare time early June, so that'll likely be when I can produce a working prototype.
Has this feature been completed?
If I had a cent for every time I promised to do something then promptly forgot about it, I'd be doing that all day. No, probably it's enough to buy me a Big Mac or something.
Jokes aside, thanks for reminding me. Sometimes I do need some peer pressure to stop my procrastination. I've finished the prototype implementation today; please check out #1093. You can try it out like so:
cargo run -- --rm-files -- <DIR>
Note that in the current implementation, deletion is permanent. So it's probably a good idea to try it out on a temp dir. I'm not responsible for any of your data loss.
Not yet. My original plan was to work on it last month, but then I went on a family vacation, and immediately afterward got a new job. TLDR is I'm kind of busy now. I will likely get some spare time early June, so that'll likely be when I can produce a working prototype.
Has this feature been completed?
If I had a cent for every time I promised to do something then promptly forgot about it, I'd be doing that all day. No, probably it's enough to buy me a Big Mac or something.
Jokes aside, thanks for reminding me. Sometimes I do need some peer pressure to stop my procrastination. I've finished the prototype implementation today; please check out #1093. You can try it out like so:
cargo run -- --rm-files -- <DIR>
Note that in the current implementation, deletion is permanent. So it's probably a good idea to try it out on a temp dir. I'm not responsible for any of your data loss.
Haha, thank you very much