summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormrxx2018-11-26 20:41:20 +0100
committermrxx2018-11-26 20:41:20 +0100
commit1b1fbbc97b937bdd0548bcb93dc81dfac3d6a1ad (patch)
tree66ec46073759d153ec415bf04d900514165d89af
parent4529527fb7b356cd4e8c28a0ae3262c834a09c63 (diff)
downloadaur-1b1fbbc97b937bdd0548bcb93dc81dfac3d6a1ad.tar.gz
Update to 20181125; add SSL service
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD26
-rw-r--r--bozohttpd.install18
-rw-r--r--bozohttpd.service8
-rw-r--r--bozohttpd_ssl.service26
5 files changed, 75 insertions, 24 deletions
diff --git a/.SRCINFO b/.SRCINFO
index af49d46e97c..4b46e7b90bc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,29 +1,30 @@
-# Generated by mksrcinfo v8
-# Wed Feb 1 13:06:10 UTC 2017
pkgbase = bozohttpd
pkgdesc = A small and secure HTTP version 1.1 server
- pkgver = 20170201
+ pkgver = 20181125
pkgrel = 1
url = http://www.eterna.com.au/bozohttpd/
install = bozohttpd.install
arch = i686
arch = x86_64
+ arch = armv6h
license = BSD
depends = openssl
depends = lua
optdepends = php-cgi
- source = http://www.eterna.com.au/bozohttpd/bozohttpd-20170201.tar.bz2
+ source = http://www.eterna.com.au/bozohttpd/bozohttpd-20181125.tar.bz2
source = bozohttpd.service
+ source = bozohttpd_ssl.service
source = bozohttpd.install
source = sample.cgi
source = sample_perl.cgi
source = LICENSE
- md5sums = 0c9548ed0bde00f6d350335224a17f2f
- md5sums = ff9687a9c5e0c656e633b1c3a0809901
- md5sums = d1678187aba0c256e6f626cab677fe5c
- md5sums = 574f7bfc8a99c817bef1f26704bd8936
- md5sums = 911134dd7e4dbf7292a0c985986d8516
- md5sums = d9cf04c906c6c560dea10afd1a93eab0
+ sha1sums = 370dae99518869c7a169567e46d261d4c1cabe19
+ sha1sums = 22c306cdbffa58ffbfae881e4340de63fe01cd8d
+ sha1sums = 50a8baf7ae497f7a53ad932898d46843b06a4b06
+ sha1sums = 2d43c700f362125766a217e217a62cf65ce47dbb
+ sha1sums = 5db8e184731f377b5082e40c007e035b8af69197
+ sha1sums = 2f74e5454fa60885e95d56e9de6ce8ed0f984f86
+ sha1sums = 402919ba5582f744ad38585a9cfa99fa8f346cf1
pkgname = bozohttpd
diff --git a/PKGBUILD b/PKGBUILD
index 1658322975a..39264638208 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,35 +2,42 @@
# Contributors: Se7endAY, Nathan Owe <ndowens04 at gmail>
pkgname=bozohttpd
-pkgver=20170201
+pkgver=20181125
pkgrel=1
pkgdesc="A small and secure HTTP version 1.1 server"
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'armv6h')
url="http://www.eterna.com.au/bozohttpd/"
license=('BSD')
depends=('openssl' 'lua')
optdepends=('php-cgi')
source=("http://www.eterna.com.au/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
'bozohttpd.service'
+ 'bozohttpd_ssl.service'
'bozohttpd.install'
'sample.cgi'
'sample_perl.cgi'
'LICENSE'
)
-md5sums=('0c9548ed0bde00f6d350335224a17f2f'
- 'ff9687a9c5e0c656e633b1c3a0809901'
- 'd1678187aba0c256e6f626cab677fe5c'
- '574f7bfc8a99c817bef1f26704bd8936'
- '911134dd7e4dbf7292a0c985986d8516'
- 'd9cf04c906c6c560dea10afd1a93eab0')
+sha1sums=('370dae99518869c7a169567e46d261d4c1cabe19'
+ '22c306cdbffa58ffbfae881e4340de63fe01cd8d'
+ '50a8baf7ae497f7a53ad932898d46843b06a4b06'
+ '2d43c700f362125766a217e217a62cf65ce47dbb'
+ '5db8e184731f377b5082e40c007e035b8af69197'
+ '2f74e5454fa60885e95d56e9de6ce8ed0f984f86'
+ '402919ba5582f744ad38585a9cfa99fa8f346cf1')
install=bozohttpd.install
build()
{
cd "${pkgname}-${pkgver}"
+
cp Makefile.boot Makefile
sed -i 's/d_namlen/d_reclen/g' bozohttpd.c
- make LOCAL_CFLAGS= LDFLAGS=-llua || return 1
+
+ # Fix php-cgi regression
+ sed -i '592d' cgi-bozo.c
+
+ make CFLAGS= LDFLAGS=-llua CPPFLAGS="-DDO_HTPASSWD -D_GNU_SOURCE" CRYPTOLIBS="-lcrypto -lssl -lcrypt" || return 1
}
package()
@@ -43,6 +50,7 @@ package()
install -m644 bozohttpd.8 "${pkgdir}/usr/share/man/man8/"
cd "$srcdir"
install -Dm644 bozohttpd.service "${pkgdir}"/usr/lib/systemd/system/bozohttpd.service
+ install -Dm644 bozohttpd_ssl.service "${pkgdir}"/usr/lib/systemd/system/bozohttpd_ssl.service
install -D *.cgi "${pkgdir}/usr/lib/cgi-bin/"
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/bozohttpd.install b/bozohttpd.install
index c4d4a3aee14..661f032a52e 100644
--- a/bozohttpd.install
+++ b/bozohttpd.install
@@ -1,13 +1,29 @@
post_install() {
[ ! -f /srv/http/index.html ] && echo "<html><body><h2>Server online.</h2></body></html>" >/srv/http/index.html
[ ! -f /srv/http/index.php ] && echo "<?php phpinfo(); ?>" >/srv/http/index.php
+ if [ ! -f /etc/ssl/private/bozohttpd.crt ]; then
+ echo
+ openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout /etc/ssl/private/bozohttpd.key -out /etc/ssl/private/bozohttpd.crt -days 3650 -subj "/C=AU/ST=Victoria/L=Essendon/O=Eterna Enterprises/CN=$(hostname -f)"
+ chmod 600 /etc/ssl/private/bozohttpd.*
+ echo
+ echo "A self-signed TLS certificate has been generated for your machine '$(hostname -f)'."
+ echo
+ echo "You can generate a new one with the following commands (as root):"
+ echo "openssl req -x509 -nodes -newkey rsa:2048 -sha256 -keyout /etc/ssl/private/bozohttpd.key -out /etc/ssl/private/bozohttpd.crt -days 365"
+ echo "chmod 600 /etc/ssl/private/bozohttpd.*"
+ echo
+ echo "Note: The Common Name (CN) should be exactly the FQDN of the server."
+ echo "The validity can be extended by increasing the '-days' parameter value."
+ fi
+
echo
echo "*** USAGE ***"
echo
echo "'systemctl start bozohttpd.service' starts the web server."
+ echo "'systemctl start bozohttpd_ssl.service' starts the web server in SSL mode."
echo "Web server root is /srv/http. CGI dir is /usr/lib/cgi-bin."
echo "To enable CGI, PHP, Lua and dir indexing, modify"
- echo "/usr/lib/systemd/system/bozohttpd.service ."
+ echo "/usr/lib/systemd/system/bozohttpd.service or bozohttpd_ssl.service."
echo
}
diff --git a/bozohttpd.service b/bozohttpd.service
index 5d3203889e2..316d950d285 100644
--- a/bozohttpd.service
+++ b/bozohttpd.service
@@ -11,16 +11,16 @@ StandardOutput=null
ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid /srv/http
#
# Enable directory indexing:
-#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -X /srv/http
+#ExecStart=/usr/bin/bozohttpd -b -f -s -X -U nobody -P /run/bozohttpd.pid /srv/http
#
# Enable CGI:
-#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -c /usr/lib/cgi-bin /srv/http
+#ExecStart=/usr/bin/bozohttpd -b -f -s -c /usr/lib/cgi-bin -U nobody -P /run/bozohttpd.pid /srv/http
#
# Enable PHP and set default to index.php (instead of index.html):
-#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -x index.php -C .php /usr/bin/php-cgi /srv/http
+#ExecStart=/usr/bin/bozohttpd -b -f -s -C .php /usr/bin/php-cgi -x index.php -U nobody -P /run/bozohttpd.pid /srv/http
#
# Enable Lua scripting:
-#ExecStart=/usr/bin/bozohttpd -L rest /usr/lib/cgi-bin/printenv.lua -b -f -s -U nobody -P /run/bozohttpd.pid /srv/http
+#ExecStart=/usr/bin/bozohttpd -b -f -s -L rest /usr/lib/cgi-bin/printenv.lua -U nobody -P /run/bozohttpd.pid /srv/http
[Install]
WantedBy=multi-user.target
diff --git a/bozohttpd_ssl.service b/bozohttpd_ssl.service
new file mode 100644
index 00000000000..46e43fc3511
--- /dev/null
+++ b/bozohttpd_ssl.service
@@ -0,0 +1,26 @@
+[Unit]
+Description=the bozotic HTTP server (SSL)
+After=syslog.target
+After=network.target
+
+[Service]
+PIDFile=/run/bozohttpd_ssl.pid
+StandardOutput=null
+#
+# Simplest use:
+ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -I 443 -P /run/bozohttpd_ssl.pid -Z /etc/ssl/private/bozohttpd.crt /etc/ssl/private/bozohttpd.key /srv/http
+#
+# Enable directory indexing:
+#ExecStart=/usr/bin/bozohttpd -b -f -s -X -U nobody -I 443 -P /run/bozohttpd_ssl.pid -Z /etc/ssl/private/bozohttpd.crt /etc/ssl/private/bozohttpd.key /srv/http
+#
+# Enable CGI:
+#ExecStart=/usr/bin/bozohttpd -b -f -s -c /usr/lib/cgi-bin -U nobody -I 443 -P /run/bozohttpd_ssl.pid -Z /etc/ssl/private/bozohttpd.crt /etc/ssl/private/bozohttpd.key /srv/http
+#
+# Enable PHP and set default to index.php (instead of index.html):
+#ExecStart=/usr/bin/bozohttpd -b -f -s -C .php /usr/bin/php-cgi -x index.php -U nobody -I 443 -P /run/bozohttpd_ssl.pid -Z /etc/ssl/private/bozohttpd.crt /etc/ssl/private/bozohttpd.key /srv/http
+#
+# Enable Lua scripting:
+#ExecStart=/usr/bin/bozohttpd -b -f -s -L rest /usr/lib/cgi-bin/printenv.lua -U nobody -I 443 -P /run/bozohttpd_ssl.pid -Z /etc/ssl/private/bozohttpd.crt /etc/ssl/private/bozohttpd.key /srv/http
+
+[Install]
+WantedBy=multi-user.target