Skip to content

Commit

Permalink
contrib/darkhttpd: new package (1.15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttyyls committed Feb 20, 2024
1 parent 1c8c59a commit 9cadf28
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/darkhttpd/files/darkhttpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# darkhttpd system service

type = process
command = /usr/bin/darkhttpd ${ROOT:-/var/www/htdocs} --addr ${ADDR:-127.0.0.1} --port ${PORT:-8080} --uid _darkhttpd --gid _darkhttpd --chroot --log /var/log/darkhttpd/access.log
env-file = /etc/default/darkhttpd
logfile = /var/log/darkhttpd.log
3 changes: 3 additions & 0 deletions contrib/darkhttpd/files/darkhttpd.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ROOT=/var/www/htdocs
ADDR=127.0.0.1
PORT=8080
3 changes: 3 additions & 0 deletions contrib/darkhttpd/files/sysusers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# create darkhttp user

u _darkhttpd - "darkhttpd daemon user" /var/empty /usr/bin/nologin
4 changes: 4 additions & 0 deletions contrib/darkhttpd/files/tmpfiles.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# create darkhttpd state directories

d /var/www/htdocs 0755 _darkhttpd _darkhttpd -
d /var/log/darkhttpd 0750 _darkhttpd _darkhttpd -
35 changes: 35 additions & 0 deletions contrib/darkhttpd/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pkgname = "darkhttpd"
pkgver = "1.15"
pkgrel = 0
build_style = "makefile"
make_use_env = True
pkgdesc = "Single-threaded static content webserver"
maintainer = "ttyyls <[email protected]>"
license = "ISC"
url = "https://unix4lyfe.org/darkhttpd"
source = f"https://github.com/emikulic/darkhttpd/archive/v{pkgver}.tar.gz"
sha256 = "ea48cedafbf43186f4a8d1afc99b33b671adee99519658446022e6f63bd9eda9"
hardening = ["vis", "cfi"]
# no tests defined
options = ["!check"]


def do_install(self):
self.install_license("COPYING")
self.install_bin("darkhttpd")
self.install_service(self.files_path / "darkhttpd")
self.install_file(
self.files_path / "sysusers.conf",
"usr/lib/sysusers.d",
name="darkhttpd.conf",
)
self.install_file(
self.files_path / "tmpfiles.conf",
"usr/lib/tmpfiles.d",
name="darkhttpd.conf",
)
self.install_file(
self.files_path / "darkhttpd.default",
"etc/default",
name="darkhttpd",
)

0 comments on commit 9cadf28

Please sign in to comment.