Commit Graph

138 Commits

Author SHA1 Message Date
Solene Rapenne 12010338c2 we don't support -m from vger 2022-08-21 13:20:29 +02:00
Solene Rapenne 1e8d353859 todo 2022-08-21 13:20:19 +02:00
Solene Rapenne 872aeffe77 use Network.URI instead of a regex 2022-08-21 13:16:17 +02:00
Solene Rapenne 9144140aff bump licence 2022-08-19 18:22:09 +02:00
Solene Rapenne 9816876c62 remove shell.nix 2022-08-19 18:20:57 +02:00
Solene Rapenne 014b9efb64 mention hix 2022-08-19 18:19:20 +02:00
Solene Rapenne caaca49a54 integration tests should use the new vger path 2022-08-19 18:19:07 +02:00
Solene Rapenne 48ab9299d8 use hix project framework 2022-08-19 18:16:39 +02:00
Solene Rapenne 92f356e09f improve gemini protocol cases 2022-08-19 15:04:41 +02:00
Solene Rapenne 1809a0d13a move file 2022-08-19 14:59:54 +02:00
Solene Rapenne 95a2ef910e apply ormolu for formatting 2022-08-19 14:58:58 +02:00
Solene Rapenne 32bee65a20 support code 31 for directories 2022-08-17 12:48:25 +02:00
Solene Rapenne 74803a76ca support index 2022-08-17 12:35:44 +02:00
Solene Rapenne 9a145bb042 add getopt to support language 2022-08-13 21:12:22 +02:00
Solene Rapenne aa900ac405 unit tests for mime 2022-08-13 17:52:09 +02:00
Solene Rapenne d8c9d26e30 use uppercase for unit file 2022-08-13 14:03:10 +02:00
Solene Rapenne 56740f7f14 start cleaning up the README 2022-08-13 14:01:46 +02:00
Solene Rapenne aa3aff9854 remove C bits from Procfile 2022-08-13 14:00:41 +02:00
Solene Rapenne bb1de0e0cc more unit tests 2022-08-13 14:00:29 +02:00
Solene Rapenne 0b1d5d399d haskell mode 2022-08-13 13:56:09 +02:00
Solene Rapenne 7212128831 init version haskell 2022-08-12 14:49:24 +02:00
prx fd0e70ab5b really fix size computation 2022-08-08 23:16:55 +02:00
prx 4d3b585951 fix wrong data size calculation 2022-08-08 23:12:12 +02:00
prx f973351945 reformat as much as possible.
Now main() is much simpler.
Removed all goto.
Less variables in main.
Simplified status_ to status().
Use a stop() function to log, send messages to stderr if necessary and close vger.
Minor fixes with defaults, mimes
There is still work to do to compare path using stat().
2022-08-08 22:57:03 +02:00
Solene Rapenne 76fafe0a9d fix a makefile source requirement 2022-07-04 21:52:45 +02:00
Solene Rapenne 4496e744e8 introduce the unit tests file 2022-07-04 21:52:20 +02:00
Solene Rapenne 9cca2408c3 Separate vger functions into a new file
This will ease the creation of unit tests
and code reusability
2022-07-04 21:00:31 +02:00
Solene Rapenne 8bd1144178 README: use repology to list where vger is packaged 2022-05-01 23:53:37 +02:00
Solene Rapenne 6743c54359 README: openbsd and arch linux has a package, mentions nix shell 2022-05-01 23:50:03 +02:00
solene bbd0f05663 Merge pull request 'fix cgi support for PATH_INFO' (#3) from phoebos/vger:merge into master
Reviewed-on: #3
2022-03-31 08:07:06 +00:00
aabacchus aa1affb6c2
fix cgi support for PATH_INFO
looks for files immediately after the cgidir, and anything after that file
if there are '/'s becomes PATH_INFO.

also adds a function strip_trailing_slash which may be useful in other parts too.
2022-03-26 20:31:50 +00:00
solene 8efcdb7512 Merge pull request 'remove any query_string before chdir' (#4) from phoebos/vger:query_string_slashes into master
Reviewed-on: #4
2022-03-26 08:27:24 +00:00
aabacchus 394b86bca8
remove any query_string before chdir
a query string could contain a '/' character, which would make vger try
to chdir to an incorrect directory. remove the query_string before this,
and before percent-decoding (in case there is an encoded '?'). This
should happen even if we are not doing cgi, because some clients might
send a query_string anyway, which should be ignored.
2022-03-19 14:49:44 +00: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