shithub: tcp80

Download patch

ref: 38a5bd73c3c37cd87dbe13dcbc34b159efe47bb9
parent: f552e6b0b45aad9f5ca62cef708dc0a591e88b1b
author: grobe0ba <grobe0ba@tcp80.org>
date: Mon Aug 1 16:10:12 EDT 2022

use auth/box

--- a/README.md
+++ b/README.md
@@ -2,18 +2,34 @@
 
 ```/rc/bin/service/tcp80```:
 ```
-#!/bin/rc
+#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib/ -r/usr/ori -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
 
-bind /usr/web /mnt/static
-exec /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
+<[3]/srv/clone{
+	d=`{<[0=3]read}
+	bind /srv/$d /srv
+	# ugly, but we don't want to leak the clone fd into
+	# procs that may stick around.
+	<[3=0]{
+		bind /usr/web /mnt/static
+        exec /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
+	}
+}
 ```
 
 ```/rc/bin/service/tcp443```:
 ```
-#!/bin/rc
+#!/bin/auth/box -r/mnt -r/usr/git -r/sys/lib/ -r/usr/ori -r/usr/web -r/sys/lib/shithub -r/n -r/dev -eMa -s
 
-bind /usr/web /mnt/static
-exec tlssrv -c/sys/lib/tls/cert.pem -lhttpd -r`{cat $3/remote} /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
+<[3]/srv/clone{
+	d=`{<[0=3]read}
+	bind /srv/$d /srv
+	# ugly, but we don't want to leak the clone fd into
+	# procs that may stick around.
+	<[3=0]{
+		bind /usr/web /mnt/static
+        exec tlssrv -c/sys/lib/tls/cert.pem -lhttpd -r`{cat $3/remote} /bin/tcp80 -r /sys/lib/tcp80 >>[2]/sys/log/httpd/log
+	}
+}
 ```
 
 ```/lib/namespace.httpd```: