aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Denes <caskd@redxen.eu>2020-11-06 22:56:46 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-12-14 16:23:02 +0000
commit88e5a4c0092f589ef34d7019b7adeb1782d695ed (patch)
tree9d00a4512ec5a27abd0fe726e6a181bcd0c43cb4
parent2ed65ab65fe810e59523ab1981c92093cb67fd2a (diff)
downloadaports-88e5a4c0092f589ef34d7019b7adeb1782d695ed.tar.gz
aports-88e5a4c0092f589ef34d7019b7adeb1782d695ed.tar.bz2
aports-88e5a4c0092f589ef34d7019b7adeb1782d695ed.tar.xz
main/darkhttpd: improve confd and initd
-rw-r--r--main/darkhttpd/APKBUILD12
-rw-r--r--main/darkhttpd/darkhttpd.confd10
-rw-r--r--main/darkhttpd/darkhttpd.initd13
3 files changed, 23 insertions, 12 deletions
diff --git a/main/darkhttpd/APKBUILD b/main/darkhttpd/APKBUILD
index ead1738329..b4c8150915 100644
--- a/main/darkhttpd/APKBUILD
+++ b/main/darkhttpd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Alan Lacerda <alacerda@alpinelinux.org>
pkgname=darkhttpd
pkgver=1.12
-pkgrel=5
+pkgrel=6
pkgdesc="A simple, single-threaded, static content webserver"
url="https://unix4lyfe.org/darkhttpd/"
arch="all"
@@ -23,16 +23,16 @@ build() {
}
package() {
- install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
+ install -Dm755 darkhttpd "$pkgdir"/usr/bin/darkhttpd
install -d "$pkgdir"/var/www/localhost/htdocs \
"$pkgdir"/var/log/darkhttpd
- install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
- install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ install -Dm755 "$srcdir"/darkhttpd.initd "$pkgdir"/etc/init.d/darkhttpd
+ install -Dm644 "$srcdir"/darkhttpd.confd "$pkgdir"/etc/conf.d/darkhttpd
}
sha512sums="e977ba0401b24a122733f8d5084fcdea4a3e2664dd5c127b26b822bfdbe458124104b1d5c673a8689af988b5713ce2e902945238b815b82104f286f577eea8bd darkhttpd-1.12.tar.bz2
bb95277a9f8f227aeec8bfe6ef54f52a2f034ed0dd25258b996c17f9ce9dd4ad220366b10490246b25bb6b18ccde7bda0d52eeb88667941cf2fdab15c940dbbc darkhttpd.logrotate
-4f7a720f05642b26bc2e2254098033e943856986a7da4a607fe8633fcf9d9c763c3e35de98ceb16fe8d88c2e288a54d62a1bd643009a119a77f4d48b95254ebb darkhttpd.initd
-4920c242c80ed9df6dc5589ca2c4fca158ff1fb58669b77b75a24b26be94719a062a959bd52b678b2bd37043440e26a06bff7ac3330dd48256138c31169e21ed darkhttpd.confd
+dd792892588e03cef4a36bb8e81297990884298d8a2bc1c14ae2d8986a0a17af8d15bf3fb4e1830d22b154dc00591d884e20da915f51fd8ecf3b05b6c92dc7d4 darkhttpd.initd
+79ecdbc751e8b5497a1afee294cf0addb4261f041a58a382e7fb51dd698dd99625a369173542c905e1e4eac7c68dfa1d8d778f4777ebe74d5031817a6ec437ad darkhttpd.confd
71a35551e2e34e8ced60e2c836c7d22f9b543b79fda2e273b41eaed7aefc22895d9c0b2e6f86dc7d0f916ed244b9ea42e2236f796eab07e7e0ba83faa4ba5762 0001-Add-svg-support-to-default-mimetypes.patch"
diff --git a/main/darkhttpd/darkhttpd.confd b/main/darkhttpd/darkhttpd.confd
index 0e9013ef3b..1c947b5326 100644
--- a/main/darkhttpd/darkhttpd.confd
+++ b/main/darkhttpd/darkhttpd.confd
@@ -1,8 +1,12 @@
# darkhttpd web server config
#
-# document_root="-/var/www/localhost/htdocs"
+# document_root="/var/www/localhost/htdocs"
+logdir="/var/log/$SVCNAME"
# addr=127.0.0.1
# port=8080
+run_as_user=darkhttpd
+run_as_group=www-data
+run_in_chroot=yes
-#extra arguments
-darkhttpd_args=""
+# extra arguments
+# darkhttpd_args=""
diff --git a/main/darkhttpd/darkhttpd.initd b/main/darkhttpd/darkhttpd.initd
index 93154234d8..2b3e099e07 100644
--- a/main/darkhttpd/darkhttpd.initd
+++ b/main/darkhttpd/darkhttpd.initd
@@ -6,7 +6,7 @@ name="darkhttpd web server"
description="Simple, single-threaded, static content webserver"
command="/usr/bin/darkhttpd"
-command_args="${document_root:-/var/www/localhost/htdocs} --chroot --uid darkhttpd --gid www-data $darkhttpd_args"
+command_args="${document_root:-/var/www/localhost/htdocs} ${darkhttpd_args}"
optional_arg() {
if [ -n "$2" ]; then
@@ -15,10 +15,17 @@ optional_arg() {
}
start_pre() {
- checkpath --directory --owner darkhttpd "${logdir:-/var/log/$SVCNAME}"
- optional_arg --log "${logdir:-/var/log/$SVCNAME}"/access.log
+ if [ -n "$logdir" ]; then
+ checkpath --directory --owner darkhttpd "${logdir}"
+ command_args="$command_args --log ${logdir}/access.log"
+ fi
optional_arg --addr "$addr"
optional_arg --port "$port"
+ optional_arg --uid "$run_as_user"
+ optional_arg --gid "$run_as_group"
optional_arg --mimetypes "$mimetypes"
+ if yesno "${run_in_chroot:-no}"; then
+ command_args="${command_args} --chroot"
+ fi
}