| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
| |
Otherwise, it is not ensured web browsers would translate a relative
directory such as "dir/.." to a URL with a trailing '/'. Therefore, a
POST request to "/user?download=1" would fail because slcl only
considers "/user/" (note the trailing '/') as valid.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far, clicking on a directory name previewed it, whereas clicking on a
file name would download it, and file previews were on a separate
column. This behaviour was found to be confusing, so it has been
simplified.
Now, clicking on a file or directory name would preview it. On the other
hand, the "Preview" column has been replaced with a "Download" column,
so that both files and directories can be downloaded.
Thanks to Avron for the suggestion. [1]
[1]: https://codeberg.org/xavidcr/slcl/issues/2
|
| |
|
|
|
|
| |
It feels more intuitive to keep the thumbnail and file name as first
columns. It is assumed removing files and/or directories is not the
main interaction from users.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thanks to the fdzipstream library [1] and zlib [2], it is possible to
generate ZIP files on-the-fly, therefore requiring no extra disk space
usage and only a small amount of memory.
Unfortunately, as of the time of this writing fdzipstream is not
packaged by any distributions yet [3], so it had to be imported as a git
submodule as a workaround.
While libarchive [4] could be an interesting alternative, writing ZIP
files is only supported by very recent versions (>= 3.8.0), which are
still not packaged by many distributions [5], either.
Moreover, libarchive is a package with several dependencies other than
zlib and is significantly larger compared to fdzipstreams, so
fdzipstreams was ultimately considered a better fit for this purpose.
[1]: https://github.com/CTrabant/fdzipstream.git
[2]: http://zlib.net/
[3]: https://repology.org/projects/?search=fdzipstream
[4]: https://www.libarchive.org/
[5]: https://repology.org/project/libarchive/versions
|
| |
|
|
|
|
| |
Thanks to Avron for the suggestion. [1]
[1]: https://codeberg.org/xavidcr/slcl/issues/2
|
| |
|
|
|
|
| |
Thanks to Avron for the suggestion. [1]
[1]: https://codeberg.org/xavidcr/slcl/issues/2
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This allows directories with many files and directories inside them to
be split into pages, in order to limit resource usage.
|
| |
|
|
|
|
| |
This change should provide the same behaviour, but would avoid
unnecessary calls to dynstr_append and basename(3) when a preview is to
be served.
|
| |
|
|
|
| |
Now, the same file descriptor can be reused for all of the operations
above, instead of calling stat(2) and fopen(3) separately.
|
| |
|
|
|
| |
Otherwise, files with special characters, such as '%', could not be
downloaded or previewed.
|
| | |
|
| |
|
|
|
| |
Sometimes, users want to know how many files and/or directories reside
on a directory. Now, slcl prints such information below the logout form.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Despite designed around portability and minimalism, I feel slcl no
longer aligns with the philosophical views from the suckless project.
Therefore, I think it was appropriate to unlink its branding from it.
|
| |
|
|
|
| |
slweb puts its header files into its own directory in order to avoid
potential name clashing.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Since removing files or directories is currently not an option in
searches, it is better to leave checkboxes out to avoid confusion.
|
| |
|
|
|
|
|
|
| |
- The back button would not return to the previous directory, but to the
user root directory.
- While this could have been solved easily (e.g.: by inserting the
referrer directory into the form), it would have implied extra and
unneeded complexity.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This was probably a copy-paste issue when implementing page_search based
on page_quota_exceeded.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
- Rules applying to body already apply to input.
- input already had a "margin: auto" rule.
- Missing whitespace on "margin:auto" rule.
|
| |
|
|
|
| |
ENOTDIR is another non-fatal errno value that can be returned by
stat(2).
|
| |
|
|
|
|
| |
While commit 1ffba8f5 fixed a wrong display of the mkdir, upload and
logout forms, it did not take login forms into consideration, which must
displayed as grid.
|
| | |
|
| |
|
|
|
| |
Otherwise, each element from the form would be stacked on top of
another, which is confusing to users.
|
| |
|
|
| |
This will help users to read tables with long file names.
|
| |
|
|
| |
This will help users to navigate through large tables.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
This allows using the default compiler defined by make(1) (i.e.,
c99(1)), thus improving POSIX compatibility.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far, slcl used the default browser behaviour (i.e.,
Content-Disposition: inline), which means files were typically shown on
the web browser itself. However, this caused two issues:
- Users would have to right-click -> "Save Link As..." to download a
file, which might be inconvenient for some users.
- The original file name would not be retrieved for publicly shared
files.
Now, file download is always requested to the browser, and the original
file path is retrieved via readlink(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.
|
| | |
|
| |
|
|
| |
This will be used by future commits.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|