Commit graph

107 commits

Author SHA1 Message Date
5a9b2518be Allow dropping privs on platforms without setresuid() 2022-01-29 16:14:37 +11:00
47e075383f Set facility with openlog, fix message priorites. 2022-01-29 16:01:29 +11:00
Solene Rapenne
01f2503376 fix NetBSD macro check 2022-01-26 13:04:04 +01:00
Solene Rapenne
ed6dc1ed12 add .gitignore for build artifacts 2021-12-13 21:44:03 +01:00
Solene Rapenne
0d3d453498 test.sh should be executable out of the box 2021-12-13 21:34:49 +01:00
Solene Rapenne
914a143c3f add Nix shell file 2021-12-13 21:34:35 +01:00
Solene Rapenne
a319de23f7 Add configure script 2021-12-13 21:32:08 +01:00
prx
15d09d2c01 fix user chroot issue + style 2021-10-21 11:41:22 +02:00
prx
843d1f0ab7 send header before other messages 2021-04-30 12:45:34 +02:00
prx
f8aff7fe05 fix cgi error (file not found) and useless 'unveil' pledge promise 2021-04-30 09:38:12 +02:00
prx
4972df5999 Fix virtualhost support changing the way request is parsed 2021-03-22 21:44:23 +01:00
Solene Rapenne
365e99400a Support all other BSD ! <3 2021-03-14 21:29:51 +01:00
Solene Rapenne
807d1b8409 Add a configure script to make compiling on Linux easier 2021-03-14 14:18:06 +01:00
prx
02d2d1dc7d percent-decoding 2021-03-09 20:45:12 +01:00
prx
de52acecfc Merge branch 'master' of tildegit.org:solene/vger 2021-03-09 20:37:46 +01:00
Omar Polo
ee8569c6e6 simplify cgi function
Don't fork+execlp the script.  There's no need to do so since on exec
the new process will inherit our file descriptor table (and hence our
stdout), so copying from its stdout to ours is just a waste of time.
This allows to drop the ``proc'' pledge(2) promise and to (slightly)
improve performance.
2021-03-09 19:14:42 +01:00
Omar Polo
16a5ed7b30 drop unnecessary unveil(NULL, NULL)
the next line is a call to pledge, that alone is will block further
calls to unveil(2) since ``unveil'' isn't in the set of pledges.
2021-03-09 19:14:42 +01:00
Omar Polo
8454548b51 add test for redirect with trailing slash with vhosts on 2021-03-09 19:14:42 +01:00
Omar Polo
cbcf4ec9b6 fix redirect when vhost support is enabled 2021-03-09 19:14:42 +01:00
Omar Polo
7431d3eeec Use the correct error codes and meaningful explanations
Introduce status_error: it's like status or status_redirect but for
errors, thus it doesn't add ``;lang=$lang'' at the end.
2021-03-09 19:14:42 +01:00
prx
e9be1b73a7 percent-decode uri 2021-03-02 10:06:09 +01:00
prx
e87b36c991 check request length for empty and too long 2021-03-02 10:04:04 +01:00
Solene Rapenne
e3b5fb2ab3 Revert "deal with too small/long requests"
This reverts commit efa1f639fc.
2021-03-01 19:35:41 +01:00
Solene Rapenne
9525d66afb Revert "follow spec, fread() get nmemb-1"
This reverts commit fbacb35170.
2021-03-01 19:35:37 +01:00
Solene Rapenne
d086262d1a Revert "empty request should works all the time, not only when in virtualhost"
This broke vger from inetd but it passed the tests.

This reverts commit 7b0686bdfa.
2021-03-01 19:35:17 +01:00
Solene Rapenne
7b0686bdfa empty request should works all the time, not only when in virtualhost 2021-02-27 19:59:28 +01:00
prx
fbacb35170 follow spec, fread() get nmemb-1 2021-02-25 20:30:30 +01:00
prx
efa1f639fc deal with too small/long requests 2021-02-25 18:37:48 +01:00
Solene Rapenne
458592594e Repair chroot, the only feature that isn't covered by tests 2021-02-23 23:24:12 +01:00
Solene Rapenne
31d384833f Rewording 2021-02-08 21:55:55 +01:00
Solene Rapenne
ff78ea5049 Documentation rewording 2021-02-05 21:28:41 +01:00
Solene Rapenne
349e56c28c Bump LICENSE to include 2021 2021-02-05 21:28:21 +01:00
Solene Rapenne
2191a8a18b Fix make clean, find conditions are tricky 2021-02-05 21:24:32 +01:00
prx
84120dca09 remove double ticks 2021-02-03 21:01:07 +01:00
prx
43170e6804 restore all tests after mistake 2021-02-03 21:00:38 +01:00
prx
f0dbd2c9ed ready for Linux && disable solene's specific tests 2021-02-03 20:46:36 +01:00
prx
55042768e5 restore parent link in autoindex and add comments 2021-01-31 22:05:48 +01:00
prx
189803ab52 useless space 2021-01-31 21:21:46 +01:00
prx
de7cd12f9f ignore after ? and make cgi+virtualhost work (sort of) 2021-01-31 21:21:15 +01:00
prx
3510035711 fix unacceptable ../ in autoidx and code formatting 2021-01-31 13:59:24 +01:00
prx
2cc63136f8 alphasort autoindex + add proper error code fir cgi 2021-01-14 14:30:11 +01:00
prx
495fa3213f small tip for cgi 2021-01-14 13:54:29 +01:00
prx
f6bc000adc fix status code in cgi script 2021-01-14 13:49:46 +01:00
prx
470e47a018 Add simple cgi support +:
* read file byte after byte
* format code (syslog + err)
* move functions in utils.c
2021-01-14 13:31:51 +01:00
Solene Rapenne
332a5cd1d6 Tell about autoindex in README 2021-01-10 13:11:46 +01:00
Solene Rapenne
c2debd2d6c Man page rewording 2021-01-10 13:10:32 +01:00
prx
f60ea88c8d add mimetype and autoindex option + minor changes
* follow style(9) for prototypes
* move first most used extension for more effeciciency when looking for mime
* add opts.h to deal with options
* remove lang=en by default
* add option to set default mimetype
* add option to autoindex if no index.gmi found
* redirect if ending "/" is missing
* send appropriate status code if request too long
* edit manpage and README for new options
2021-01-10 09:30:35 +01:00
prx
4a1b0c8ce2 fix issue if missing ending '/' and add appropriate test 2021-01-06 21:37:38 +01:00
Solene Rapenne
ec3d847e1c explain inetd should only answer on 127.0.0.1 instead of all interfaces. Suggestion from xhr 2021-01-03 21:42:18 +01:00
Solene Rapenne
b2ccab7448 Error code = 51 (not found) and redirection is now 30 following specifications Appendix https://gemini.circumlunar.space/docs/specification.html 2021-01-03 17:50:45 +01:00