Re: [dev] A simpler static file server than quark

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 26 Jan 2020 00:02:28 +0100

On Sat, Jan 25, 2020 at 08:59:11PM +0100, Richard Ulmer wrote:
> Hi,
> sometimes it's handy to have an easy to use file server at hand, to
> share a file with a friend, colleague or smartphone, provide a dummy
> server when developing an API or quickly view a website that requires
> AJAX locally [1].
>
> I have used quark for this, but found it annoying, that I have to
> provide a host and port and run it as root (the noroot patch doesn't
> always work either, because the use of fork(2) is restricted). It seems
> like others have similar complaints about quark [2].
>

You can simply build a version of quark with chroot(2) and privdrop commented
out.
fork(2) is not restricted, but chroot(2) and setgid(2) is.

> I thus looked for alternatives and found a very minimalist static
> file server, written in golang, called statico. I forked it, further
> simplified the user interface and added logging. You can find it on
> GitHub [3].
>

It's not much lines of code by itself, but it is not minimalist I think.

> It doesn't require root, it's only (optional) parameter is -p for the
> port, supports GET and HEAD requests and even respects the Range header.
>

For port < 1024 you'd still need root or namespace priviledges usually.

quark supports GET and HEAD requests and supports common byte-ranges too.

> Best regards,
> Richard Ulmer
>
>
> [1] https://stackoverflow.com/questions/6923707/using-ajax-to-read-local-files
> [2] https://lists.suckless.org/dev/1909/33618.html
> [3] https://github.com/codesoap/statico
>

-- 
Kind regards,
Hiltjo
Received on Sun Jan 26 2020 - 00:02:28 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 26 2020 - 00:12:07 CET