diff --git a/.drone.yml b/.drone.yml index 02cdb2c..174b1f6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,18 +7,16 @@ steps: image: gcc commands: - make + - mv quark quark-dirl -- name: run - image: debian - commands: - - cp quark /usr/local/bin - - useradd web - - mkdir -p web && cd web && echo "hello from quark" > index.html - - quark -p 9130 -h run -l -u web -g web - detach: true - -- name: test - image: curlimages/curl - commands: - - sleep 15 - - curl http://run:9130 +- name: publish + image: appleboy/drone-scp + settings: + host: friedl.net + username: + from_secret: deploy_user + password: + from_secret: deploy_password + port: 22 + target: /var/services/dirlist/repo/bin/suckless/quark + source: quark-dirl diff --git a/README.md b/README.md index c26554f..c2d1193 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,94 @@ found at https://git.suckless.org/quark. Quark is a small http server. -# Issues +# DIRL -## fork: Resource temporarily unavailable -When running [quark](http://tools.suckless.org/quark/) (#6606994) on my system -with `sudo ./quark -p 9763 -u -g ` it dies with `./quark: fork: -Resource temporarily unavailable` at `fork()`. +dirl is a quark extension for customized directory listings. -Reason being that by default quark sets the RLIMIT_NPROC to 512 processes. When running as a non-exclusive user this limit is easily reached before even starting quark. +Per default dirl generates html for a directory listing like this: -`resource-depletion-fix` contains a small forkbomb (`minibomb.c`) to simulate a user with > 512 processes. Compile it with `make minibomb`. When running the minibomb and quark with the same user quark fails. +```html + + + + + + Index of {uri} + + +

Index of {uri}

+

↵ Parent Directory

+
+ + + -The `resource-depletion-fix` branch contains a fix by setting the RLIMIT_NPROC only if the current system limit is lower than what would be set by quark. You can [download the patch](https://dirlist.friedl.net/suckless/quark/), or compile from the `resource-depletion-fix` branch. + + + + + + + -Note that quark also has a `-n` parameter with which the max number of processes can be set as an alternative to this patch. + +
NameModifiedSize
{entry}{suffix} + {modified}{size}
+
+

+ Served by quark and dirl +

+ + + +``` + +## Customize + +The default listing can be styled by a `style.css` in the root directory. + +You can also use your fully customized template by creating one or all the +template files for each section. Per default the section templates are named: +- .header.tpl +- .entry.tpl (repeated for each directory entry) +- .footer.tpl + +Note that if you only provide some of the template files, they have to be +compatible with the generated default for the other sections. + +For each of these templates you can use placeholders that are replaced by their respective values: +- header + * `{uri}`: Replaced by the current path +- entry + * `{entry}`: Name of the entry + * `{suffix}`: A suffix for the entry, mostly useful to distinguish directories (suffix '/') from files + * `{modified}`: Date the entry was last modified + * `{size}`: Size of the entry (if available) + +### Subdirectory styling + +dirl tries to the closest template for the currently visited path. This gives +you the opportunity to override templates in subdirectories. dirl walks the +directory hierarchy upwards from the currently visited path. As soon as it finds +one of the template files in a directory, it stops searching and uses the +templates in that directory. + +In case no templates are found up until and including root, the default +templates are used. + +### Customize names + +The files defined as templates and style are ignored in the directory listing +itself. In case you need to list one of these directories, or have any other +reason to choose different names, the filenames can be configured in `dirl.h`. +Note that you need to compile your own quark version then. + +# Download +You can also download CI builds for [quark-dirl](https://dirlist.friedl.net/bin/suckless/quark/). + +There are no official releases. Quark has no dependencies and you can easily +build it from source. Don't forget to read up on the [suckless +philosophy](http://suckless.org/philosophy/). # Github Users If you are visiting this repository on GitHub, you are on a mirror of