1.9 KiB
Configuration
Usage: %s [-v|--version] [-c|--config $file]
If no configuration file is provided, /etc/gophi.${proto}.conf
is the default path,
where ${proto}
is one of gemini
or gopher
depending on which version you compiled.
For configuration infomration, see: Example Configuration
Path Restrictions Regex
Path restrictions are parsed as a new-line separated list of regex statements:
/some/regex/statement.*
Internally the regex statements are parsed as (show as Python code):
/match_statement
regex = "(?m)" + "/match_statement".removeprefix("/") + "$"
Entries are parsed, compiled, and so matched-against in order. They are matched against relative paths so please bear this in mind if you have user directories enabled.
Request Remapping Regex
Request remapping is parsed as a new-line separated list of remap statements of form:
/regex/matched/against -> /regex/template
Internally, the request remapping statements are parsed as (shown as Python code):
/match_statement -> /template_statement
# Where the match statement is compiled using
regex = "(?m)" + "/match_statement".removeprefix("/") + "$"
# And the template is stored as
template = "/template_statement".removeprefix("/")
e.g. scripts within cgi-bin to the root directory:
/(?P<uri>[^/]+) -> /cgi-bin/$uri
Entries are parsed, compiled, and so matched-against in order. They are matched against relative paths so please bear this in mind if you have user directories enabled.
User server spaces
When user server spaces are enabled, they are accessed via the following gopher URL:
gopher://server.host:70/1/~user
Where the username supplied will then look for a user folder under:
/home/$user/$user_folder
For example:
User directory = public_gopher
gopher://server.host:70/1/~grufwub
Will fetch from the filesystem:
/home/grufwub/public_gopher