Commit graph

62 commits

Author SHA1 Message Date
Yorhel
2e9a40da69 More strict UTF-8 validation on input 2025-08-22 09:21:06 +02:00
Yorhel
5a863c20c2 Version 1.2 2025-07-06 07:25:37 +02:00
Yorhel
02b1dcc328 FU: Set $0 when spawning a new worker
This is primarily useful in error state, to avoid having a worker
process waiting for an incoming connection to be marked as the
supervisor.
2025-06-12 09:12:21 +02:00
Yorhel
5560d9af60 Version 1.1 2025-06-07 09:49:38 +02:00
Yorhel
f8cd8a6d8c FU: Simplify --monitor file change detection
This changes the way that file changes are detected. The upside is that
it now correctly detects changes that happened after the code has loaded
but before the first request came in, the downside is that it now gets
stuck on reloading when a file has a future mtime.
2025-05-27 09:30:49 +02:00
Yorhel
31994a4bf6 Doc typos 2025-05-18 09:51:34 +02:00
Yorhel
32c8fc1b89 Version 1.0 + remove "experimental" notices 2025-05-11 11:03:32 +02:00
Yorhel
8dbc17ab37 FU: Fix error logging of formdata 2025-05-09 09:53:43 +02:00
Yorhel
6c54ee3091 FU: Reject some invalid characters in path 2025-05-09 08:32:41 +02:00
Yorhel
52c36e0aea FU: Preserve existing headers on fu->redirect()
Allows setting custom headers (in particular, cookies) when redirecting.
This behavior is consistent with send_file().
2025-05-04 12:18:36 +02:00
Yorhel
cbccf045b7 DebugInfo: Expand queries table with params & details
Apart from the ugly implementation, this is pretty neat.
2025-05-01 12:18:26 +02:00
Yorhel
af9340f908 DebugInfo: Styling + add request/response body and fu obj contents
Formatting is still shit.
2025-04-30 15:00:26 +02:00
Yorhel
817fa600d0 FU: Add fu->log_verbose() + include request body in error logs 2025-04-27 11:17:54 +02:00
Yorhel
461ed6f39d FU: Suppress warnings about non-existent files in FU::monitor_path checking 2025-04-26 08:05:09 +02:00
Yorhel
e88ad65232 Version 0.5 2025-04-24 14:16:17 +02:00
Yorhel
4833456898 FU: Accept charset argument in JSON request content-type header 2025-04-24 10:50:50 +02:00
Yorhel
13271fa413 Minor changes & fixes 2025-04-23 16:12:39 +02:00
Yorhel
91b2421a84 FU: Add -procname import option and setting $0 to something useful 2025-04-22 09:32:56 +02:00
Yorhel
ea8ad9e483 FU: Throw and handle FU::Validate errors directly
Instead of wrapping them in a FU::err that isn't easily inspected.
2025-04-20 18:37:59 +02:00
Yorhel
1594006739 FU: Improve merging of "Vary" response headers + debug header listing 2025-04-20 11:40:27 +02:00
Yorhel
f2294a709a FU: Fix warning when calling fu->set_header() with undef value 2025-04-20 11:31:15 +02:00
Yorhel
196b1cc3ce FU: Use CLOCK_MONOTONIC for timing 2025-04-07 16:41:29 +02:00
Yorhel
3bf98e4d8f FU: Fix fu->reset also resetting cookies 2025-04-03 15:58:38 +02:00
Yorhel
2f50736782 fdpass_recv: Set O_CLOEXEC on received fds
Turns out this is necessary even if the fd is going to be passed through
exec() soon, because the supervisor might receive multiple fds before
spawning another process, in which case all of them are going to be
passed to the new process instead of just one.
2025-03-24 11:07:39 +01:00
Yorhel
9e1be5bc71 FU: Log errors thrown from error handler 2025-03-22 15:10:59 +01:00
Yorhel
17584f2b8c FU: Fix DB reconnect + not setting debug_info() 2025-03-22 14:58:38 +01:00
Yorhel
90881924d4 Doc fixes 2025-03-21 11:31:20 +01:00
Yorhel
7c765f33bb Version 0.4 2025-03-19 10:54:23 +01:00
Yorhel
6159b33950 FU::Util: Add brotli_compress() and use it for FU output compression
Seems to compresses and perform better than libdeflate at level 6, so
certainly worth using.
2025-03-19 10:12:20 +01:00
Yorhel
bc33fe53f0 FU::Util: Add gzip_compress() wrapper for libdeflate/zlib-ng/zlib
And use it for automatic output compression in FU, as (potentially)
faster alternative to Compress::Raw::Zlib.

Was also planning to maybe add support for Zstd or Brotli, but given the
performance of libdeflate, I'm not sure that's really necessary. Brotli
does tend to do a better job at compressing HTML, though.
2025-03-18 16:59:43 +01:00
Yorhel
c2e0f158ac FU: Add fu->cookie() 2025-03-17 16:18:12 +01:00
Yorhel
d8ecc71abb FU: Add fu->set_cookie() (+ uri_unescape '+' fix) 2025-03-17 13:46:14 +01:00
Yorhel
65cf842500 FU: Some fixes and consistency in fu->json and fu->formdata 2025-03-16 18:26:57 +01:00
Yorhel
9685287523 Version 0.3 2025-03-10 12:43:02 +01:00
Yorhel
70c5199df4 FU: Add JSON reading & writing methods 2025-03-08 15:49:43 +01:00
Yorhel
17176738a0 FU: Support multipart file uploads + some doc fixes
API is not super convenient and implementation is lousy, but uploading
files is not a super common operation so that should be fine.

At least it supports large files with only a single in-memory copy.
2025-03-08 14:06:10 +01:00
Yorhel
e5755ddd80 Validate: Human-readable error messages 2025-03-06 10:16:14 +01:00
Yorhel
cbebc3a21e Validate: Rework API, ->validate() now throws error instead of result object
This is a slight simplification and removes the need to pass around
partially normalized data. I've never found a use for the unsafe_data()
method.
2025-03-05 15:35:23 +01:00
Yorhel
7839e7df78 FU: Fix typo in error handling 2025-03-02 21:09:59 +01:00
Yorhel
3fd424c6e3 Compat fixes + 0.2 release 2025-02-28 14:05:48 +01:00
Yorhel
3662931fc2 FU: Add "denied" and "notfound" convenience methods 2025-02-27 14:00:28 +01:00
Yorhel
b06cc24826 FU: Add super awesome and butt-ugly FU::debug_info web interface
This is so much more useful than embedding debugging info inside pages,
as I've been doing before.
2025-02-27 13:44:25 +01:00
Yorhel
8dca0a22a9 FU: Add randomized --max-reqs option 2025-02-26 11:31:15 +01:00
Yorhel
29dd09e809 FU: Drop Zstd support
Compress::Zstd decided to bundle libzstd instead of linking to the
system lib, and it predictably hasn't been updated in 6 years. I
consider that broken to the point of DO-NOT-USE.

Maybe I'll do a custom dlopen() wrapper for that later, but for now
let's just stick with gzip.
2025-02-26 08:59:36 +01:00
Yorhel
7b0ba45346 Docs, compatibility fixes again, 0.1 release 2025-02-25 17:02:33 +01:00
Yorhel
69262992ca FU::Validate: Add module + integrate with FU
Copied from TUWF::Validate with a few small changes. I have a few more
features planned, but let's see how this goes first.

It's been an incredibly useful module in the past, I'm not sure right
now if I had ideas for potential improvements at some point, will need
to check notes.
2025-02-25 14:31:38 +01:00
Yorhel
06e2f950fe Add fu->redirect, change $st->row behavior on 0 results, minor fixes
And with this, I have a working rewrite of the manned.org backend into
FU. \o/

The $st->row methods are very useful even for queries that may not
return anything, so their old behavior was unhelpful. Interestingly
enough, the error-on-multiple-rows did catch an actual bug in
Manned.org, so I'm keeping that behavior.
2025-02-24 15:55:27 +01:00
Yorhel
8595c4ba64 FU: HTTP date handling + fu->send_file 2025-02-24 11:12:01 +01:00
Yorhel
18e642290d Some fixes and framework docs 2025-02-23 14:05:43 +01:00
Yorhel
a5f9584b02 FU::Log: Add logger and basic integration with FU 2025-02-21 17:13:32 +01:00