1
1
mirror of https://tildegit.org/solderpunk/molly-brown synced 2024-09-22 06:00:40 +02:00
Commit Graph

66 Commits

Author SHA1 Message Date
Solderpunk
b30fc0923b Handle CGI requests with URI components after the script. 2020-07-01 10:38:31 +02:00
Solderpunk
68398ef0be Extensive refactor, trying to keep the main request handling function relatively simple. 2020-06-30 22:25:37 +02:00
Solderpunk
fd31094cb6 Allow .molly files to set certificate zones. 2020-06-30 20:39:26 +02:00
Solderpunk
1794ff643b Allow .molly files to configure redirects. 2020-06-30 20:19:13 +02:00
Solderpunk
d7663ab688 Removing debugging print. 2020-06-30 19:34:01 +02:00
Solderpunk
e43fc7877c Big rearrange: resolve URL to filesystem earlier, so we can check for .molly files ASAP, so that they can handle redirects, certificate zones, etc. 2020-06-30 19:31:27 +02:00
Solderpunk
990b7071d0 gofmt fixes. 2020-06-30 19:13:02 +02:00
Solderpunk
44af303de6 Fix silly mistake in hasty port checking fix. 2020-06-30 19:11:49 +02:00
Solderpunk
4c27911e8f Check that request port matches configured server port. Should fix #9. 2020-06-30 17:27:53 +02:00
Solderpunk
4dbe52adf8 Permit .molly files to specify MIME overrides. 2020-06-30 17:01:19 +02:00
Solderpunk
18c056167f Make it possible to toggle handling of .molly files on and off via main config. 2020-06-29 17:17:43 +02:00
Solderpunk
77691d6983 Introduce error log. 2020-06-28 18:34:50 +02:00
Solderpunk
31161cf21c Permit multiple authorised certificates per zone. 2020-06-28 14:47:36 +02:00
Solderpunk
a0dacf4bbd Basic implementation of certificate zones - only one authorised cert per zone. 2020-06-28 13:47:30 +02:00
Solderpunk
5377c2941f Allow overriding MIME types based on path regexes. 2020-06-28 00:12:32 +02:00
Solderpunk
a07645dd2e Allow overriding directory listing options with .molly files. 2020-06-27 23:44:15 +02:00
Solderpunk
7066bad570 Use headings in .gmi files instead of filenames in directory listings. 2020-06-27 22:57:03 +02:00
Solderpunk
3f98a9edf1 Permit sorting of files in automatic directory listings by various factors. 2020-06-27 18:52:29 +02:00
Solderpunk
6da5ec79dd Fix typo. 2020-06-17 15:22:21 +02:00
Solderpunk
30a5369f8a Add missing return, fixes #4. 2020-06-13 09:08:04 +02:00
Solderpunk
e57a3d5ecf Read header for directory listings from .mollyhead. 2020-06-11 22:43:13 +02:00
Solderpunk
b0b18971f4 Run gofmt on everything for the first time ever! 2020-06-10 21:31:13 +02:00
Solderpunk
3e80488f92 Add DefaultLang config variable to set text/gemini lang parameter. Overridable via .molly file. 2020-06-10 21:22:15 +02:00
Solderpunk
7fb5ca052b Fix parent directory walking logic to work at the DocRoot. 2020-06-10 21:20:01 +02:00
Solderpunk
cb1e0da7d5 Read .molly files from parent directories of served file, permitting overrides to text/gemini file extension. 2020-06-10 20:40:13 +02:00
Solderpunk
599bbf4b52 Proper tilde path clean up. 2020-06-10 19:43:49 +02:00
Solderpunk
8d2309f889 Quick hacky fix to tilde path transformation. 2020-06-08 23:03:19 +02:00
Solderpunk
b8034c1576 Make text/gemini extension configurable. 2020-06-08 21:47:33 +02:00
Solderpunk
4681d3f971 Support multiple CGI paths. 2020-06-08 21:46:39 +02:00
Solderpunk
8f395d7932 Add link to parent directory in directory listings. 2020-06-08 20:01:03 +02:00
Solderpunk
301d3409f1 Support temporary and permanent redirects. 2020-06-08 19:59:16 +02:00
Solderpunk
433c43e98e Add file size and modification dates to automatically generated directory listings. 2020-06-06 21:28:12 +02:00
Solderpunk
11beddcfb1 Add rudimentary support for specifying redirects. 2020-06-06 13:36:10 +02:00
Solderpunk
548697b094 Get rid of debugging prints. 2020-06-06 13:35:47 +02:00
Solderpunk
2c99228610 Pass pointers to the log entry to functions which can set the status code, so changes are reflected in the main handle function. 2020-06-06 12:08:34 +02:00
Solderpunk
b0a08f8231 Break CGI and SCGI stuff out into its own file. 2020-06-06 11:46:29 +02:00
Solderpunk
54ed1ab265 Merge CGI and SCGI variable preparation. 2020-06-06 11:33:00 +02:00
Solderpunk
d78c840056 First step toward unstubbing SCGI. 2020-06-06 00:12:46 +02:00
Solderpunk
b384105d86 Factor out request reading code. 2020-06-05 20:13:48 +02:00
Solderpunk
7ffbb6c6ef Pass some client cert information to CGI programs. 2020-06-05 19:55:24 +02:00
Solderpunk
6f3887bdc4 Request client certificates, check validity dates of received certs and pass certs to handleCGI. 2020-06-05 19:39:28 +02:00
Solderpunk
4e262d634a Fix line endings in response headers. 2020-06-05 19:37:56 +02:00
Solderpunk
fc730c8b1c Refuse to serve any sensitive files. 2020-06-04 23:24:19 +02:00
Solderpunk
532dd83414 Make sure to always provide a MIME type. 2020-06-04 23:12:09 +02:00
Solderpunk
a16a5fac12 Switch CGI implementation to actual CGI. 2020-06-04 22:38:22 +02:00
Solderpunk
de119aa0bb Fix trailing slash redirects. 2020-06-04 21:32:20 +02:00
Solderpunk
920f06597f Stub implementation of SCGI. 2020-06-04 20:41:40 +02:00
Solderpunk
93f3c9e620 Break handleGeminiRequest up into smaller, clearer functions. 2020-06-04 20:35:14 +02:00
Solderpunk
9c51f26d74 Do not crash if os.Stat returns an error other than not found or no permission, which seems to mysteriously happen sometimes... 2020-06-01 21:27:15 +02:00
Solderpunk
5fdb3622e9 Remove vestigial generic response code. 2020-06-01 21:23:24 +02:00