aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorSodface <sod@sodface.com>2021-02-18 20:49:31 -0500
committerLeo <thinkabit.ukim@gmail.com>2021-02-19 20:49:58 +0000
commit15a2ca29f4507091bb2a0da06b1b68aac5392029 (patch)
treed375c4e799770fe2f403d2d05d1c230ac95525ae /community
parent00ab692f3019487f5980a4377bb8814274da5f09 (diff)
downloadaports-15a2ca29f4507091bb2a0da06b1b68aac5392029.tar.gz
aports-15a2ca29f4507091bb2a0da06b1b68aac5392029.tar.bz2
aports-15a2ca29f4507091bb2a0da06b1b68aac5392029.tar.xz
community/althttpd: move from testing
Diffstat (limited to 'community')
-rw-r--r--community/althttpd/10-allow-filename-plus-sign.patch15
-rw-r--r--community/althttpd/APKBUILD33
-rw-r--r--community/althttpd/althttpd.confd51
-rw-r--r--community/althttpd/althttpd.initd29
4 files changed, 128 insertions, 0 deletions
diff --git a/community/althttpd/10-allow-filename-plus-sign.patch b/community/althttpd/10-allow-filename-plus-sign.patch
new file mode 100644
index 0000000000..f794699fe8
--- /dev/null
+++ b/community/althttpd/10-allow-filename-plus-sign.patch
@@ -0,0 +1,15 @@
+The following table contains 1 for all characters that are permitted in
+the part of the URL before the query parameters and fragment. This patch
+adds the plus sign (0x2b) to the list of characters allowed by upstream
+which are 0-9a-zA-Z,-./:_~
+--- src/althttpd.c.orig
++++ src/althttpd.c
+@@ -1212,7 +1212,7 @@
+ /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
+ /* 0x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ /* 1x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+-/* 2x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
++/* 2x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+ /* 3x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ /* 4x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ /* 5x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
diff --git a/community/althttpd/APKBUILD b/community/althttpd/APKBUILD
new file mode 100644
index 0000000000..46a4d0fd12
--- /dev/null
+++ b/community/althttpd/APKBUILD
@@ -0,0 +1,33 @@
+# Contributor: Sodface <sod@sodface.com>
+# Maintainer: Sodface <sod@sodface.com>
+pkgname=althttpd
+pkgver=202102112256
+pkgrel=0
+pkgdesc="Small, simple, stand-alone HTTP server"
+url="https://sqlite.org/althttpd/doc/trunk/althttpd.md"
+arch="all"
+license="Public-Domain"
+options="!check" # no test suite
+subpackages="$pkgname-openrc"
+source="$pkgname-$pkgver.zip::https://sqlite.org/althttpd/zip?in=althttpd.c&r=$pkgver
+ 10-allow-filename-plus-sign.patch
+ $pkgname.confd
+ $pkgname.initd"
+builddir="$srcdir/"
+
+build() {
+ gcc $CFLAGS althttpd.c $LDFLAGS -o althttpd
+}
+
+package() {
+ install -Dm 644 "$srcdir"/althttpd.confd \
+ "$pkgdir"/etc/conf.d/althttpd
+ install -Dm 755 "$srcdir"/althttpd.initd \
+ "$pkgdir"/etc/init.d/althttpd
+ install -D althttpd "$pkgdir"/usr/bin/althttpd
+}
+
+sha512sums="9b1801c43a0e397b2ae427fd7cc541c571a20cf52be750f1cf016d5060cb87ce460b458316765f2ee124dd6b54cb9b5f4225a0dee2cc028b3dd6479e29191065 althttpd-202102112256.zip
+6eabeac2b889a9027e58a69dca8f345150d309ccd93608982dc8f007cd4596e754dffbe7dec22b9536286ee63f33a0fe950d6555818900e40e633fc1095b387c 10-allow-filename-plus-sign.patch
+aeb1252915176d11cddb1ff5f1c13f532bb3df8f52760f71ae087fde90a4d4422cc65570a59adac12232dacc5aed67a673790a019a3d53203899b7909ca8503b althttpd.confd
+f21867430470b836d97d60215d9dda835125140cced3bb9c856349228572f2c73ac0574d3f705d72938879fc2b5a37855768a5f7de5c29943e3aa6ead5d72d9c althttpd.initd"
diff --git a/community/althttpd/althttpd.confd b/community/althttpd/althttpd.confd
new file mode 100644
index 0000000000..154f98c888
--- /dev/null
+++ b/community/althttpd/althttpd.confd
@@ -0,0 +1,51 @@
+#** Command-line Options:
+#**
+#** --root DIR Defines the directory that contains the various
+#** $HOST.website subdirectories, each containing web content
+#** for a single virtual host. If launched as root and if
+#** "--user USER" also appears on the command-line and if
+#** "--jail 0" is omitted, then the process runs in a chroot
+#** jail rooted at this directory and under the userid USER.
+#** This option is required for xinetd launch but defaults
+#** to "." for a stand-alone web server.
+#**
+#** --port N Run in standalone mode listening on TCP port N
+#**
+#** --user USER Define the user under which the process should run if
+#** originally launched as root. This process will refuse to
+#** run as root (for security). If this option is omitted and
+#** the process is launched as root, it will abort without
+#** processing any HTTP requests.
+#**
+#** --logfile FILE Append a single-line, CSV-format, log file entry to FILE
+#** for each HTTP request. FILE should be a full pathname.
+#** The FILE name is interpreted inside the chroot jail. The
+#** FILE name is expanded using strftime() if it contains
+#** at least one '%' and is not too long.
+#**
+#** --https Indicates that input is coming over SSL and is being
+#** decoded upstream, perhaps by stunnel. (This program
+#** only understands plaintext.)
+#**
+#** --family ipv4 Only accept input from IPV4 or IPV6, respectively.
+#** --family ipv6 These options are only meaningful if althttpd is run
+#** as a stand-alone server.
+#**
+#** --jail BOOLEAN Indicates whether or not to form a chroot jail if
+#** initially run as root. The default is true, so the only
+#** useful variant of this option is "--jail 0" which prevents
+#** the formation of the chroot jail.
+#**
+#** --max-age SEC The value for "Cache-Control: max-age=%d". Defaults to
+#** 120 seconds.
+#**
+#** --max-cpu SEC Maximum number of seconds of CPU time allowed per
+#** HTTP connection. Default 30. 0 means no limit.
+#**
+#** --debug Disables input timeouts. This is useful for debugging
+#** when inputs is being typed in manually.
+#**
+#** Command-line options can take either one or two initial "-" characters.
+#** So "--debug" and "-debug" mean the same thing, for example.
+
+ALTHTTPD_OPTS=""
diff --git a/community/althttpd/althttpd.initd b/community/althttpd/althttpd.initd
new file mode 100644
index 0000000000..c32869b2ff
--- /dev/null
+++ b/community/althttpd/althttpd.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+
+# user-servicable parts go in /etc/conf.d/althttpd
+pidfile=/var/run/althttpd.pid
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting althttpd"
+
+ cd /
+ start-stop-daemon \
+ --start --exec /usr/bin/althttpd \
+ --pidfile ${pidfile} \
+ --make-pidfile \
+ --background \
+ -- \
+ ${ALTHTTPD_OPTS}
+
+ eend $? "Failed to start althttpd"
+}
+
+stop() {
+ ebegin "Stopping althttpd"
+ start-stop-daemon --retry 10 --stop --pidfile ${pidfile}
+ eend $? "Failed to stop althttpd"
+}