1.3 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 & Privilege Dropping
Gophi supports entering a chroot and dropping privileges itself for a number of reasons:
-
root privileges are required if you want to bind to a port < 1024
-
during server startup you can safely access files that require root privileges e.g. accessing LetsEncrypt generated TLS certs for gemini hosting
-
you can keep configuration files and certificates required during startup out of the chroot, which Gophi will load before it enters the chroot
Of course you are free to disable chroot (simply set chroot = ""
in config)
and execute the binary as you wish in a chroot, container, etc.
When executing CGI scripts from a chroot, you'll need to ensure you symlink appropriate virtual filesystems and libaries for your scripts / binaries to run.
A chroot is generally not compatible with user spaces, unless you bind mount the user spaces to directories within the chroot i.e.
/home/user/public_gopher -> /var/examplechroot/home/user/public_gopher
/home/user/public_gemini -> /var/examplechroot/home/user/public_gemini