diff options
author | KatolaZ <katolaz@freaknet.org> | 2018-07-23 16:28:14 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2018-07-23 16:28:14 +0100 |
commit | 6ebc6b6d4fbd63428ea7c3e9f8e3bc18407600d9 (patch) | |
tree | dca42882b11806fc3579033f5bde69cb1e49b01c | |
parent | 1df435313418065be6eb6ab2f7aaf47b9a3876e6 (diff) |
.gph files are now rendered as gophermaps
-rw-r--r-- | README.md | 20 | ||||
-rwxr-xr-x | gosher | 6 |
2 files changed, 24 insertions, 2 deletions
@@ -16,7 +16,10 @@ to modify the values of the variables `NETCAT` and `STYLE` in `gosher` If the selector is a directory, `gosher` will look for a file named `gophermap` to render the submenu. If a `gophermap` does not exist, `gosher` looks for the index.gph gopherfile in the folder and, if it -exists, renders it as a gophermap. +exists, renders it as a gophermap. If the required selector has a '.gph' +extension, `gosher` will treat it as a gopherpile, and render it as a +gophermap. + ## Which netcat? @@ -47,6 +50,21 @@ combination for your version of `netcat`: **N.B.: Using STYLE='pipe' is preferable, since the '-c' option used by the 'fork' mode is a potential security risk** + +## Running `gosher` under `chroot` + +In general, it makes sense to run a server in a `chroot` environment, to +reduce the risks connected with remote exploits. If you would like to +run `gosher` under `chroot` be sure to have the following binaries (and +the corresponding libs) available in the chroot-ed environment: + +``` + basename cat cut mkfifo netcat realpath rm sed sh +``` + +Obviously, `netcat` will be your preferred `netcat` implementation. + + ## Why `gosher`? Just for fun. There are only a few TCP/IP application protocols left @@ -209,7 +209,11 @@ case $selector in if [ "${RP1}" = "${RP2}" ]; then if [ -f "${RP1}" ]; then - serve_selector "${RP1}" + if [ -n "$(echo $RP1 | sed -n '/\.gph$/p')" ]; then + serve_index $RP1 + else + serve_selector "${RP1}" + fi elif [ -d "${RP1}" ]; then [ -f "${RP1}/gophermap" ] && serve_selector "${RP1}/gophermap" [ -f "${RP1}/index.gph" ] && serve_index "${RP1}/index.gph" |