shithub: tcp80

Download patch

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

markdown

--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # To run the shithub software:
 
-```/rc/bin/service/tcp80```:
+`/rc/bin/service/tcp80`:
+
 ```
 #!/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
 
@@ -16,7 +17,8 @@
 }
 ```
 
-```/rc/bin/service/tcp443```:
+`/rc/bin/service/tcp443`:
+
 ```
 #!/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
 
@@ -32,34 +34,36 @@
 }
 ```
 
-```/lib/namespace.httpd```:
+`/lib/namespace.httpd`:
+
 ```
 bind /mnt/static /usr/web/static
 ```
 
-It is possible to redirect error pages by passing ```-e error```, like
-```tcp80 -e 404 -e 403```. This will send a ```301 Moved Permanently``` to
-e.g. ```/404``` or ```/403```. It will also append the path to it:
-Attempting to access ```http://server/nopage.html``` would redirect to
-```http://server/404/nopage.html```.
+It is possible to redirect error pages by passing `-e error`, like
+`tcp80 -e 404 -e 403`. This will send a `301 Moved Permanently` to
+e.g. `/404` or `/403`. It will also append the path to it:
+Attempting to access `http://server/nopage.html` would redirect to
+`http://server/404/nopage.html`.
 
 
 It is also possible to define a set of hostnames to change the bind mounts for
-```/usr/web``` based on the Host header. To use this feature, you pass
-```-h file``` to tcp80. The format of the file is the same as that for execfs,
+`/usr/web` based on the Host header. To use this feature, you pass
+`-h file` to tcp80. The format of the file is the same as that for execfs,
 a regex for the hostname, any number of tabs, with a path to be mounted over
-```/usr/web```.
+`/usr/web`.
 
 ```
 server1.domain.com          /usr/webroot/server1
 aardvark.different.org      /usr/webroot/aardvark
 ```
+
 This does not affect execfs scripts directly, although the bind mounts happen
 prior to their execution. If you are using the same scripts for multiple
-hostnames, you can check the environment using ```ns``` to find out what is
-mounted over ```/usr/web```. If you are using shithub, or anything similar which
-hooks on ```/index.html```, it will still take precedence over any static files.
+hostnames, you can check the environment using `ns` to find out what is
+mounted over `/usr/web`. If you are using shithub, or anything similar which
+hooks on `/index.html`, it will still take precedence over any static files.
 
-You can work around this by not hooking ```/index.html```, instead hook something
-like ```/shithub.html``` and then redirect to it.
+You can work around this by not hooking `/index.html`, instead hook something
+like `/shithub.html` and then redirect to it.