aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* WIP bump libwebtest-multiformXavier Del Campo Romero2024-01-201-0/+0
|
* README.md: Update according to thumbnail generationXavier Del Campo Romero2023-11-242-2/+97
|
* Display thumbnails, if availableXavier Del Campo Romero2023-11-243-21/+177
|
* Add thumbnail generation toolXavier Del Campo Romero2023-11-248-0/+802
| | | | | | | | | | | This new application runs separately from slcl and communicates with it via a named pipe. When files are added/removed to/from the user directory, slcl shall write to the named pipe. Then, this new tool shall process incoming entries and generate or remove thumbnails accordingly. Such thumbnails are stored into a new directory inside the database directory, namely thumbnails/, which replicates the same structure as user/.
* main.c: Add -m command line option to open a named pipeXavier Del Campo Romero2023-11-241-47/+288
| | | | | | | | | | | | | | | | | | | | | | | This write-only named pipe is meant to inform other processes about files that have been added/removed to/from the user/ directory. The syntax is line-oriented and is described below. For added files: +<space ...><path><LF> For removed files: -<space ...><path><LF> Paths shall always be absolute. Examples: + /home/test/db/user/alice/a picture.jpg - /home/test/db/user/bob/essay.txt As reported above, this feature has been made completely optional so as not to introduce breaking changes. A new command line option, namely -m, is required to enable this feature.
* auth.c: Make use of crealpathXavier Del Campo Romero2023-11-241-44/+4
| | | | | crealpath already provides a mechanism to determine the current working directory from getcwd(3).
* Introduce crealpathXavier Del Campo Romero2023-11-244-0/+184
| | | | | | | | | | | | | | | | | | crealpath (for "custom realpath") is a custom implementation of realpath(3) that aims to work similarly to GNU's realpath(1). This implementation is provided due to the following reasons: - Future commits will require extracting an absolute path from a relative path, and/or process relative components from a path, such as ".." or ".". - realpath(3) is defined by POSIX.1-2008 as a XSI extension, and extensions are generally avoided in this repository whenever possible. - Additionally, realpath(3) requires the file or directory pointed to by the path to exist, which might not always be the case for slcl. - auth.c uses its own implementation to extract a dynamically allocated string by repeatedly calling getcwd(3). Future commits will also require this future, so it makes sense to keep it on a separate component.
* configure: Fix typoXavier Del Campo Romero2023-11-241-1/+1
| | | | | | | | | | slweb was renamed to libweb some time ago: commit 28ae865e5ecad9b398ac21fa148fc4b93c987226 Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Tue Oct 10 23:43:47 2023 +0200 Apply slweb renaming to libweb
* .gitignore: Ignore only ./MakefileXavier Del Campo Romero2023-11-241-1/+1
| | | | | Future commits might introduce Makefiles on other directories that should not be ignored.
* Bump libwebXavier Del Campo Romero2023-11-241-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The following commit should increase performance for slcl: commit b0accd099fa8c5110d4c3c68830ad6fd810ca3ec Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Fri Nov 24 00:52:50 2023 +0100 http.c: Unify read operations So far, libweb would perform different read operations depending on its state: - For HTTP headers or request bodies, one byte at a time was read. - For multipart/form-data, up to BUFSIZ bytes at a time were read. However, this caused a significant extra number of syscalls for no reason and would increase code complexity, specially when parsing multiform/form-data boundaries. Now, http_read always reads up to BUFSIZ bytes at a time and process them on a loop. Apart from reducing code complexity, this should increase performance due to the (much) lower number of syscalls required.
* CMakeLists.txt: Fix wrong parameters for projectXavier Del Campo Romero2023-11-231-1/+1
| | | | When VERSION is given, LANGUAGES becomes mandatory.
* Upgrade to new libweb interfaceXavier Del Campo Romero2023-11-232-2/+12
| | | | | | | | | | | | | | | | | | | | | | | Recent commits from libweb brought a few breaking changes. The one below affected slcl, so it had to be updated according to the new interface: commit 98f5f52461b0c1ab1ee3331722bd32e2db9e1d41 Author: Xavier Del Campo <xavier.delcampo@midokura.com> Date: Thu Nov 16 12:23:08 2023 +0100 Split handler_loop from handler_listen Some applications might set up a struct handler object to listen on any port i.e., 0, but still need a way to determine which port number was eventually selected by the implementation. Therefore, handler_listen has been reduced to the server initialization bit, whereas the main loop has been split into its own function, namely handler_loop. Because of these changes, it no longer made sense for libweb to write the selected port to standard output, as this is something now applications can do on their own.
* main.c: Treat non-existing upload dir as non-fatalXavier Del Campo Romero2023-11-231-4/+52
| | | | | | | | | | When a user attempts to upload a file into a non-existing directory, slcl would not check whether the directory exists. Then, rename(3) would fail and slcl would treat this as a fatal error, effectively closing itself. Since this is an example of ill-formed user input, it must be treated as a non-fatal error, and instead slcl should return a bad request page.
* Bump libwebXavier Del Campo Romero2023-11-121-0/+0
| | | | | | | | | | | | | | | | | | More bugfixes related to partial boundary parsing were provided by this commit: commit b71a6174e12b4709acaf8bc151938ba12d2a54f6 Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Sun Nov 12 23:31:57 2023 +0100 http.c: Fix more issues with partial boundaries - http_memmem must not check strlen(a) > n because, in case of a partial boundary, it would wrongfully return NULL. - If one or more characters from a partial boundary are found at the end of a buffer, but the next buffer does not start with the rest of the boundary, the accumulated boundary must be reset, and then look for a new boundary.
* Bump libwebXavier Del Campo Romero2023-11-121-0/+0
| | | | | | | | | | | | | | | | | | | Several bugfixes related to partial boundary parsing were provided by this commit: commit 7d02b225fe11fb0c7233cd2ea576485ee920f203 Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Sun Nov 12 06:16:26 2023 +0100 http.c: Fix several issues with partial boundaries - Writing to m->boundary[len] did not make any sense, as len is not meant to change between calls to read_mf_boundary_byte. - For the same reason, memset(3)ing "len + 1" did not make any sense. - When a partial boundary is found, http_memmem must still return st. - Calling reset_boundary with prev == 0 did not make sense, since that case typically means a partial boundary was found on a previous iteration, so m->blen must not be reset.
* libweb: Bump new signature for http_decode_urlXavier Del Campo Romero2023-11-122-15/+30
| | | | | | The new signature allows callers to distinguish decoding errors from fatal errors. This is important for slcl to avoid crashing when ill-formed data is received from a client.
* README.md: Remove wrong comment about /tmpv0.1.0-rc4v0.1.0Xavier Del Campo Romero2023-10-251-3/+1
| | | | | /tmp is at least defined by POSIX.1-2017 at section 10 (Directory Structure and Devices).
* Bump libweb to v0.1.0-rc6Xavier Del Campo Romero2023-10-251-0/+0
|
* CMakeLists.txt: set project VERSIONXavier Del Campo Romero2023-10-251-1/+1
|
* Bump libweb to v0.1.0-rc5Xavier Del Campo Romero2023-10-251-0/+0
|
* Replace handwritten Makefile with configure scriptXavier Del Campo Romero2023-10-254-52/+172
|
* CMake: Find system libweb or dynstr if availableXavier Del Campo Romero2023-10-252-1/+35
| | | | | So far, slcl's build system would always build libweb and dynstr. However, this is discouraged by distribution packagers.
* usergen: Call mkdir(1) before database swapXavier Del Campo Romero2023-10-191-1/+1
| | | | No changes must be committed to the database if mkdir(1) fails.
* usergen: Replace use of non-standard mktemp(1)Xavier Del Campo Romero2023-10-191-1/+8
| | | | | | Despite common use in several POSIX operating systems, mktemp(1) is not defined by POSIX.1-2008, nor even POSIX.1-2017. As long as it is not introduced, m4(1)'s mkstemp can be used with similar effect.
* main.c: Use BUFSIZ instead of arbitrary valueXavier Del Campo Romero2023-10-191-1/+1
| | | | | | | | | | According to C99 7.19.1p3: BUFSIZ is a macro that expands to an integer constant expression that is the size of the buffer used by the setbuf function. In other words, this means BUFSIZ is the most optimal length for a buffer that reads a file into memory in chunks using fread(3).
* CMakeLists.txt: Fix wrong library nameXavier Del Campo Romero2023-10-141-1/+1
|
* auth.c: Fix potential signed integer overflowXavier Del Campo Romero2023-10-141-2/+2
| | | | | | | | For platforms where int is a 16-bit data type, this operation might overflow and possibly cause either unexpected behaviour and/or a compiler warning. Therefore, it is safer to promote each integer constant accordingly.
* Implement HEAD supportXavier Del Campo Romero2023-10-143-0/+90
|
* List number of files and directoriesv0.1.0-rc3Xavier Del Campo Romero2023-10-111-23/+82
| | | | | Sometimes, users want to know how many files and/or directories reside on a directory. Now, slcl prints such information below the logout form.
* page.c: Force whitespace renderingXavier Del Campo Romero2023-10-111-1/+1
|
* Apply slweb renaming to libwebXavier Del Campo Romero2023-10-1111-27/+27
|
* Bump slwebv0.1.0-rc2Xavier Del Campo Romero2023-10-021-0/+0
|
* Bump slweb to v0.1.0-rc1v0.1.0-rc1Xavier Del Campo Romero2023-09-271-0/+0
|
* man1: Replace LICENSE/AUTHORS with COPYRIGHTXavier Del Campo Romero2023-09-272-10/+14
| | | | | LICENSE is not copied to the installation prefix, so adding a short copyright notice instead might be a better reference.
* CMakeLists.txt: Install targetsXavier Del Campo Romero2023-09-272-0/+12
|
* Makefile: add install targetXavier Del Campo Romero2023-09-273-0/+33
|
* slcl.1: Remove obsolete TODOXavier Del Campo Romero2023-09-271-3/+0
| | | | | | | | | | This feature was already implemented by: commit 0822a982ef3b085dc109ec373ff537974503eb04 Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Sat Jul 8 00:54:59 2023 +0200 Implement file/directory removal
* main.c: Refactor calls to handler_addXavier Del Campo Romero2023-09-161-13/+39
|
* usergen: Remove dependency against sha256sum(1)Xavier Del Campo Romero2023-09-161-1/+1
| | | | | | sha256sum(1) is a GNU utility that might not be available under some POSIX systems. Since OpenSSL is already a dependency, it makes sense to reuse it to generate SHA256 digests.
* usergen: Remove dependency against xxd(1)Xavier Del Campo Romero2023-09-162-6/+15
| | | | | xxd(1) is closely related to vim(1), might not be available under some POSIX systems.
* usergen: Reject non-numeric, invalid quotaXavier Del Campo Romero2023-09-161-0/+1
|
* Reduce minimum required major version for OpenSSLXavier Del Campo Romero2023-09-162-2/+2
| | | | | slcl has been successfully tested with OpenSSL 2.0 on an OpenBSD 7.3 host.
* auth.c: Add missing includeXavier Del Campo Romero2023-09-151-0/+1
| | | | | As opposed to other integer constants such as ULLONG_MAX, SIZE_MAX is defined by stdint.h, not limits.h.
* main.c: Remove string duplication in get_formsXavier Del Campo Romero2023-09-092-11/+2
| | | | | | | slweb now assumes application/x-www-form-urlencoded-data as text, so it now returns a null-terminated string on struct http_post member "data". This removes the need for slcl to call strdup(3) in order to obtain a null-terminated string.
* Check directory on uploadsXavier Del Campo Romero2023-09-092-3/+16
| | | | | | | | | For historical reasons, slweb used to check for a name called "dir" on multipart/form-data POST requests. However, stricly speaking this is application logic, so it has been now moved from slweb to slcl. This has resulted in a couple of breaking changes in slweb that had to be updated on slcl.
* page.c: Update project URLXavier Del Campo Romero2023-09-091-1/+1
|
* main.c: Return 1 on null bufferXavier Del Campo Romero2023-09-091-0/+1
| | | | | Malformed POST requests might include no payload data. However, this is not considered a fatal error, but wrong user input.
* Bump slwebXavier Del Campo Romero2023-09-071-0/+0
| | | | Last commits introduced several minor bugfixes and improvements.
* Add screenshotsXavier Del Campo Romero2023-08-083-0/+6
|
* Bump slwebXavier Del Campo Romero2023-08-081-0/+0
| | | | | | | | | d55b84f68b90fe5c2521724d0c22ebf22e62b0b4 introduces a bugfix: Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Tue Aug 8 00:32:21 2023 +0200 html.c: Fix wrong encoding for '>' and '<'