aboutsummaryrefslogtreecommitdiff
path: root/page.h
Commit message (Collapse)AuthorAgeFilesLines
* Display thumbnails, if availableXavier Del Campo Romero2025-09-241-2/+3
|
* main.c: Forbid sharing non-existing filesXavier Del Campo Romero2025-01-231-0/+1
| | | | | | | | | | | So far, slcl would allow to share literally any directory or file, even if they did not exist, as long as valid credentials were given. Now, directories cannot be shared, since this is already restricted by the web interface. This is now considered an invalid request. On the other hand, attempting to share non-existing files shall now return a 404 Not Found response to the user.
* Implement HEAD supportXavier Del Campo Romero2023-10-141-0/+1
|
* Apply slweb renaming to libwebXavier Del Campo Romero2023-10-111-1/+1
|
* Adapt to slweb's include pathsXavier Del Campo Romero2023-07-211-1/+1
| | | | | slweb puts its header files into its own directory in order to avoid potential name clashing.
* Limit amount of search resultsXavier Del Campo Romero2023-07-111-0/+2
| | | | | | | | | | When a user enters a search term that is too generic, slcl would generate a long list of search results, where this generation could have a big impact on the server performance and its available resources. Therefore, it is reasonable to limit the number of search results to an arbitrary limit, so that users are forced to enter a more specific search term in order to achieve more relevant results.
* Allow admins to define their own stylesheetXavier Del Campo Romero2023-07-111-1/+1
| | | | | | | | | | | | slcl used to provide a hardcoded stylesheet. However, it would be desirable for some admins to provide a custom stylesheet without having to rebuild the application. Now, slcl creates a default stylesheet, namely style.css, into the target directory, that can be later modified by admins. While this might contradict the suckless philosophy a bit, hopefully some admins might find this new feature useful.
* Implement file/directory removalXavier Del Campo Romero2023-07-081-0/+7
| | | | | | | | | | | | | | | The following workflow has been implemented: - A new checkbox for each object inside a directory is shown. - When one or more objects are selected, the user submits a request through a HTML5 form. - Then, slcl will ask the user for confirmation, listing the selected objects, while reminding the user about the effects. - The user confirms the selection. - slcl removes the selected objects. All objects from non-empty directories are removed, too. - Finally, slcl redirects the user to the directory the request was made from.
* Implement searchXavier Del Campo Romero2023-06-061-0/+13
| | | | | | This new feature adds a HTML form on each directory listing that allows to search files recursively, starting from the current user directory. Wildcard patterns are also allowed.
* Implement file previewsXavier Del Campo Romero2023-04-231-2/+10
| | | | | | | | | | | | | When using HTTP "Content-Disposition: attachment;", users are forced to download files in order to use them, whereas others might prefer to open them in the browser. Therefore, now that URL parameters are supported by http.h, previews can be forced by adding "preview=1" or "preview=true" (case-insensitive) as a URL parameters. Any other parameters are ignored by slcl. For users, a "Preview" link has been added next to the "Share" button for each file.
* Send response on quota exceededXavier Del Campo Romero2023-03-201-0/+2
| | | | | | | | | | | | | | | | | So far, slcl would just close the connection with a client when the Content-Length of an incoming request exceeded the user quota, without any meaningful information given back to the user. Now, slcl responds with a HTML file with meaningful information about the error. Limitations: - While this commits has been successfully tested on ungoogled-chromium, LibreWolf (and I assume Firefox and any other derivates too) does not seem to receive the response from the server. - However, this issue only occurred during local testing, but not on remote instances.
* Implement public file sharingXavier Del Campo Romero2023-03-091-0/+2
| | | | | | | | | | | | | An HTML form is now added next to each regular file, that generates a POST request. Then, slcl replies with a HTML document with a link to the public resource (which are implemented as symlinks). Limitations: - For now, only regular files can be shared i.e., sharing directories is not possible. While feasible, it still requires a larger refactor to list_dir and resource_layout, so that read-only access to the directory is provided to anonymous users.
* Implement user quotaXavier Del Campo Romero2023-03-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature allows admins to set a specific quota for each user, in MiB. This feature is particularly useful for shared instances, where unlimited user storage might be unfeasible or even dangerous for the server. Also, a nice HTML5 <progress> element has been added to the site that shows how much of the quota has been consumed. If no quota is set, slcl falls back to the default behaviour i.e., assume unlimited storage. Limitations: - While HTTP does specify a Content-Length, which determines the length of the whole request, it does not specify how many files are involved or their individual sizes. - Because of this, if multiple files are uploaded simultaneously, the whole request would be dropped if user quota is exceeded, even if not all files exceeded it. - Also, Content-Length adds the length of some HTTP boilerplate (e.g.: boundaries), but slcl must rely on this before accepting the whole request. In other words, this means some requests might be rejected by slcl because of the extra bytes caused by such boilerplate. - When the quota is exceeded, slcl must close the connection so that the rest of the transfer is cancelled. Unfortunately, this means no HTML can be sent back to the customer to inform about the situation.
* Initial commitXavier Del Campo Romero2023-02-281-0/+14