Commit graph

19 commits

Author SHA1 Message Date
Laslo Hunhold
50c85ec642
Rename "target" to "URI" where appropriate
Of course URIs point at "targets", but the URIs themselves should
be called what they are, not only in the interest of clarity in terms
of nomenclature.

Signed-off-by: Laslo Hunhold <dev@frign.de>
2020-08-22 23:38:38 +02:00
Laslo Hunhold
ce77dd7962
Update manpage to list capabilities and behaviour
Signed-off-by: Laslo Hunhold <dev@frign.de>
2020-08-18 08:46:52 +02:00
Nihal Jere
8ccef4b27a
Make host parameters optional
For me at least, the first valid configuration found by getaddrinfo
works fine most of the time. Obviously if this isn't the configuration
you want, you can specify the host explicitly.
2020-04-21 17:04:52 +02:00
Laslo Hunhold
33def953e9
Improve tokenization for m- and v-flag parsing
I wasn't happy with the tokenizer for the m- and v-flags, because it
was handling space-separated input and there was no way to have spaces
within the tokens themselves. This is a fine detail, but I didn't want
to impose this restriction where it could be solved (path prefixes or
folder names can very well contain spaces).

Given it's a bit quirky to handle multiple arguments to a single flag
in the command line, especially when parameters are optional, this
alternative wasn't further considered and I instead implemented a
tokenizer that allows escaping spaces with '\'.

While at it, I clarified the manual regarding this point.

Signed-off-by: Laslo Hunhold <dev@frign.de>
2019-02-24 21:50:39 +01:00
Laslo Hunhold
065394cb64
Change target prefix mapping argument order
Put the chost-specification at the end and make it optional. This makes
more sense than having to give an arbitrary useless name in case you
weren't using virtual hosts in the first place.

While at it, clear up the wording in the manpage.

Signed-off-by: Laslo Hunhold <dev@frign.de>
2019-02-24 00:53:03 +01:00
Laslo Hunhold
f2afbc4dd7
Add a space after the number in the Xr mandoc macro
Detected with the mandoc(1)-linter.

Signed-off-by: Laslo Hunhold <dev@frign.de>
2019-02-18 23:44:12 +01:00
Josuah Demangeon
c3ddb2dd14 permit prefix to be empty in -v format string
The previous parsing of the -v vhosts made sure there were 4 tokens.
If there was no prefix specified, usage() is called.  Now, it only
checks for the firsts 3, with .prefix set to null if there are only
3 tokens.
2018-04-02 09:57:58 +02:00
Laslo Hunhold
a20136fa18 Update the documentation to reflect the new flag-centric usage 2018-03-05 09:51:29 +01:00
Laslo Hunhold
e35d3e1287 Refine manpage concerning the UNIX-domain socket file 2018-02-05 17:15:05 +01:00
Laslo Hunhold
d3c1091669 Allow switching vhosts using flags and rework the usage 2017-07-11 15:02:00 +02:00
Quentin Rameau
141bb88af1 Cleanup socket file at exit.
We can't unlink the file if it's outside the chroot, so we need to keep
a simple worker outside of it.
2017-07-11 14:09:27 +02:00
Quentin Rameau
3b3fdd00e2 Split synopsis to reflect the dual usage. 2017-07-11 14:09:27 +02:00
Quentin Rameau
e46344e449 Change -U udsname to -U sockfile for clarification. 2017-07-11 14:09:27 +02:00
Hiltjo Posthuma
c369738fa4 make directory listing a run-time flag
remove const in the config.h since it can be changed at run-time now.
2017-06-27 23:31:08 +02:00
FRIGN
0ce86bba15 Initial commit of quark rewrite
Roughly 700 LOC (half of the old quark on the Hiltjo branch) in size,
this rewrite supports partial content and other good stuff that will
make it fun again to use quark for simple static purposes.
The error checking is rigorous and strict and it will report proper
error codes back to the client whenever there was a problem or the
request was invalid in some way.

A cool feature is the support for listening on a UNIX-domain socket,
which will in the long run allow us to solve problems with virtual hosts
and other things in separate programs. But until then, this should be
robust enough for most use-cases.

This resets quark's version to 0, but this was no problem as there
haven't been any quark releases yet.

Feedback is appreciated.
2016-09-02 09:59:02 +02:00
FRIGN
0e8cac1ee4 Prepare repository for rewrite
It was sad to see that quark never got the attention it deserved in my
opinion. However, there were good reasons why that was the case.

The project lost focus by trying to add CGI support, which in all
fairness worked only half of the time.
For the rest of the use cases, a static server to make it dead simple to
publish a directory, it was also pretty bad, given it does not support
partial content. Seeking in a mp3 was impossible and it was very
frustrating.

Long ago we discussed in the team how exciting it would be to test out
new concepts of having a web server that listens on a UNIX-domain
socket, potentially allowing new concepts for realizing virtual hosts
and other things.

It took me half a year to make the decision to rewrite quark, so it is
now time to purge the repo and push the initial commit.
2016-09-02 09:46:01 +02:00
Ivan Delalande
e42bb27846 change the behavior of docroot
Change the behavior of docroot, which is now used as a prefix path for
all file operations related to static files. And add chrootdir, which is
just the old docroot behavior and allows to control the path into which
quark will chroot.

Not having properly distinct configuration variables for chroot,
document root and CGI root was specially annoying since commit 2822488
which allowed users to retrieve the CGI script or binary by just
guessing its path, since quark was chrooting into docroot before
anything else, and thus the CGI script/binary was in the user accessible
path.

This is implemented by moving the reqbuf buffer in the middle of a
bigger buffer, reqpath. That buffer contains the value of docroot at its
beginning and reqbuf simply points to the first byte after this value.
2014-11-30 23:35:10 +01:00
FRIGN
ca2c107f30 Remove whitespace from manual 2014-08-20 20:44:13 +02:00
Hiltjo Posthuma
c00949d37d quark.1: add manpage
quark.c: alphabeticly sort options, like in the manpage.
Makefile: add manpage rule to Makefile and fix make dist.
2014-08-20 20:42:58 +02:00