Signed-off-by: kim (grufwub) <grufwub@gmail.com>
1.2 KiB
Encoding
By default, URLs are parsed as having standard (HTTP) URL encoding. All other parsed text content are treated as UTF-8, as this is the default encoding scheme Go strings. Support for more encoding schemes is planned for the future
Chroots and Privilege Dropping
Previously, chrooting to server directory and dropping privileges was supported
by using Go C bindings. This is not officially supported due to weird behaviour
with .Set{U,G}id()
under Linux. As such, the feature has been dropped for
now.
There is a near 10 year ongoing tracked issue (https://github.com/golang/go/issues/1435), and as soon as this patch gets merged I'll add support: https://go-review.googlesource.com/c/go/+/210639
In place of removing this, request sanitization has been majorly improved and checks are in place to prevent running Gophor as root.
If you run into issues binding to a lower port number due to insufficient permissions then there are a few alternatives:
-
set gophor process capabilities: e.g.
setcap 'cap_net_bind_service=+ep' /usr/local/bin/gophor
-
use Docker (or some other solution) and configure port forwarding on the host
-
start gopher in it's own namespace in a chroot