Commit Graph

50 Commits

Author SHA1 Message Date
Omar Polo
02be96c6dd add `require client ca' rule to require certs signed by a CA 2021-02-09 22:30:04 +00:00
Omar Polo
b63e30ff44 define TLS_CLIENT_NOT_BEFORE/NOT_AFTER in CGI scripts 2021-02-07 21:47:01 +00:00
Omar Polo
3abf91b0b4 improve logs management 2021-02-07 15:30:28 +00:00
Omar Polo
a709ddf5eb added prefork option 2021-02-07 12:05:32 +00:00
Omar Polo
2b92a4477a reorder stuff 2021-02-06 18:50:42 +00:00
Omar Polo
6c6f242a54 escape % 2021-02-06 18:28:56 +00:00
Omar Polo
e3ddf39095 add the ``entrypoint'' option 2021-02-06 18:28:43 +00:00
Omar Polo
6abda252e9 added `block return'' and `strip'' options 2021-02-06 17:22:37 +00:00
Omar Polo
38d4db740d improve manpage 2021-02-04 14:38:37 +00:00
Omar Polo
3007f56596 mention SIGHUP in manpage 2021-02-04 13:34:27 +00:00
Omar Polo
4ee08bd148 fix location example 2021-02-03 14:01:00 +00:00
Omar Polo
87f2b68b58 cgi now follows globbing rules 2021-02-02 22:38:35 +00:00
Omar Polo
ee655e64d7 sync CGI section with actual implementation 2021-02-01 13:19:06 +00:00
Omar Polo
39a7b61145 sync date 2021-01-30 12:16:18 +00:00
Omar Polo
6016a593a3 invert the location precedence: first match wins
It's how httpd(8) does it, and it allows us to call fnmatch less time
2021-01-30 12:04:20 +00:00
Omar Polo
714685c10c manpage improvements 2021-01-30 11:49:27 +00:00
Omar Polo
75fbb1789e manual improvements & add section about MIME 2021-01-28 16:29:06 +00:00
Omar Polo
8904fa0e64 -v for verbose logging 2021-01-27 23:14:16 +00:00
Omar Polo
46af8c6cfe drop the daemon config in favour of the -f flag
Now it daemonize by default when running with a config, unless the -f
flag is given.
2021-01-27 12:04:37 +00:00
Omar Polo
71cf39757d added missing argument for -H 2021-01-25 14:32:16 +00:00
Omar Polo
f28d96d399 sync manpage with actual usage and improve examples 2021-01-25 14:31:34 +00:00
Omar Polo
ae08ec7da5 chroot & drop privileges 2021-01-25 10:30:07 +00:00
Omar Polo
252908e6bb added support for location blocks 2021-01-24 18:53:26 +00:00
Omar Polo
c8b7433918 added support for location blocks 2021-01-24 14:11:40 +00:00
Omar Polo
28ec617809 sync the CGI environment with the manpage
while there also add SERVER_PROTOCOL
2021-01-24 10:06:48 +00:00
Omar Polo
a7b9bb4d24 specify in which directory CGI scripts are executed 2021-01-24 09:20:38 +00:00
Omar Polo
e7a2a99b5a added index option 2021-01-24 09:14:01 +00:00
Omar Polo
de27389e83 add globbing notice and sync example with actual flags 2021-01-21 09:17:13 +00:00
Omar Polo
6119e13e8a moving "default type" from global options to server options 2021-01-19 11:28:41 +00:00
Omar Polo
05c23a54ea add "lang" server option 2021-01-19 10:58:29 +00:00
Omar Polo
eb6997835a trying to get the man on par with the recent changes 2021-01-18 21:52:01 +00:00
Omar Polo
1590277007 conf & vhosts
* gmid.c (main): changed behaviour: daemon off by default
(main): changed -c in -C (cert option)
(main): changed -k in -K (key option, for consistency with -C)
(main): added -c to load a configuration
(main): certs, key and doc (-C -K and -d) doesn't have a default value anymore
(handle_handshake): add vhosts support
2021-01-15 09:17:43 +00:00
Omar Polo
b9220ca4de new README + wording in manpage 2021-01-11 12:51:25 +00:00
Omar Polo
85dff1f9c3 fix remote_user for CGI and add -6 flag to enable ipv6 2021-01-11 12:08:50 +00:00
Omar Polo
ef04b55160 switch to Bjoern Hoehrmann UTF-8 decoder
It's correct, while my hacked valid_multibyte_utf8 would allow things
that aren't technically UTF8.
2021-01-09 20:32:23 +00:00
Omar Polo
00781742c5
reject %00 2020-12-26 00:37:43 +01:00
Omar Polo
df6ca41da3
IRI support
This extends the URI parser so it supports full IRI (Internationalized
Resource Identifiers, RFC3987).  Some areas of it can/may be improved,
but here's a start.

Note: we assume UTF-8 encoded IRI.
2020-12-26 00:33:11 +01:00
Omar Polo
043acc97b1
mention the %2F caveat 2020-12-25 13:15:15 +01:00
Omar Polo
83000e2dd4
improve wording
"concurrently" means at the same time, which can be confusing when we
say that it's single-threaded on a single process.
2020-12-21 15:51:09 +01:00
Omar Polo
d7802bb44a
logging reworked and daemonize by default
The -l option was removed: now it logs on syslog if -f (foreground) is
not passed.
2020-12-02 21:18:01 +01:00
Omar Polo
677afbd3f8
clients certs support for CGI
internally, gmid doesn’t care if the client issued a certificate, but
now we pass that information to the CGI script in some new environment
variables.
2020-12-02 15:17:19 +01:00
Omar Polo
721e232529
make port number configurable 2020-11-18 09:12:27 +01:00
Omar Polo
a5d310bc0d
[cgi] added support for path parameters
enhance the CGI scripting support so that script can take path
parameters.  That is, a script at /cgi/foo is called when the request
path is /cgi/foo/bar/...

This commit also introduce some backward incompatible changes as the
default env variables set for the CGI script changed.
2020-11-10 14:07:36 +01:00
Omar Polo
0ed5656795
documentation improvements 2020-11-06 18:11:45 +01:00
Omar Polo
72342dc960
implementing CGI – NOT READY YET!
This is a first try at implementing CGI scripting.  The idea is that,
if CGI is explicitly enabled by the user, when a user requires an
executable file instead of serving it to the client, that file will be
executed and its output fed to the client.

There are various pieces that are still lacking, the firsts that comes
to mind are:

 - performance: the handle_cgi just loops ignoring the
   WANT_POLLIN/POLLOUT and blocking if the child process hasn’t
   outputted anything.
 - we don’t parse query variable (yet)
 - we need to set more variables in the child environment
   side question: it’s better to set the variables using setenv() or
   by providing an explicit environment?
 - document what environment the CGI script will get
 - improve the horrible unveil/pledge(cgi ? …)

but now I can serve “hello-world”-tier script from gmid!
2020-11-06 13:01:31 +01:00
Omar Polo
2c3a40faf8
added option to log to a file 2020-11-06 10:58:30 +01:00
Omar Polo
20f688381a
doc: point out that we can handle multiple clients concurrently 2020-11-05 17:06:12 +01:00
Omar Polo
fab952e1d7
minor documentation edits 2020-10-03 17:49:09 +02:00
Omar Polo
6980aad6d7
fix errors in manpage
man -Tlint -l gmid.1

helped a lot
2020-10-02 19:44:32 +02:00
Omar Polo
3e4749f7f9
initial commit 2020-10-02 19:39:00 +02:00