feat: add initial CGI support with environment variable passing and user permission fields

Implement core CGI execution infrastructure including cgi_config_init, cgi_is_executable, cgi_detect_headers, and cgi_execute functions in new src/cgi/cgi.c module. Extend auth_user_t struct with cgi_enabled, cgi_timeout, cgi_max_output, webserve_enabled, directory_listing, default_index, and granular read/write/execute permission fields. Add HTTP_206_PARTIAL_CONTENT, HTTP_416_RANGE_NOT_SATISFIABLE, and HTTP_500_INTERNAL_ERROR status codes to enum. Introduce streaming configuration block with buffer sizes, sendfile threshold, and per-request memory limit in config struct. Add pathmapping.c to both server and CLI build sources. Extend CLI webdavctl with user directory, permission, and CGI management subcommands. Expose auth_get_db function and sqlite3 forward declaration in auth.h.
This commit is contained in:
2025-11-28 04:34:38 +00:00
parent f75e1e6d9a
commit 4afdcf567b
21 changed files with 3218 additions and 40 deletions
+3
View File
@@ -117,6 +117,7 @@ typedef enum {
HTTP_200_OK = 200,
HTTP_201_CREATED = 201,
HTTP_204_NO_CONTENT = 204,
HTTP_206_PARTIAL_CONTENT = 206,
HTTP_207_MULTI_STATUS = 207,
HTTP_301_MOVED_PERMANENTLY = 301,
HTTP_302_FOUND = 302,
@@ -130,8 +131,10 @@ typedef enum {
HTTP_412_PRECONDITION_FAILED = 412,
HTTP_413_PAYLOAD_TOO_LARGE = 413,
HTTP_415_UNSUPPORTED_MEDIA_TYPE = 415,
HTTP_416_RANGE_NOT_SATISFIABLE = 416,
HTTP_423_LOCKED = 423,
HTTP_424_FAILED_DEPENDENCY = 424,
HTTP_500_INTERNAL_ERROR = 500,
HTTP_500_INTERNAL_SERVER_ERROR = 500,
HTTP_501_NOT_IMPLEMENTED = 501,
HTTP_502_BAD_GATEWAY = 502,