🏡 go home...

🗃️ go back...

stargazer

created  2024/06/23
category info, internet
views    113

stargazer is a fast and easy to use gemini server with no runtime dependencies that has cgi script support compatible with other gemini servers

project page

documentation

🌌 the gemini protocol

configuration

store certificates in a hidden certificates directory under /var/gemini, also listen on the localhost/loopback ip address (i have stargazer behind a tcp reverse proxy anyway, so there's no need to listen on a public ip)

listen = 0.0.0.0
[:tls]
store = /var/gemini/.certificates

stargazer supports multiplexing, which is a fancy name for being able to act as the server for multiple websites/domain names, so every block is defined by a domain name, optionally followed by a matcher

[a.com]          → any url on the domain
[a.com=/a/b.gmi] → a specific path on the domain
[a.com~a?(wa)+]  → any path on the domain that matches the regex

pretty sure the regex matcher acts as if it had ^ before it (so your matcher must match the start of the path, not just some part in the middle of it)

the following will serve files from the example.com directory under /var/gemini, but not provide a directory listing for directories without an index.gmi file, and explicitly disable cgi scripts

[example.com]
root = /var/gemini/example.com
auto-index = off
cgi = off

this will generate a directory listing for any files and directories under /media, and explicitly disable cgi scripts

[example.com~/media]
root = /var/gemini/content
cgi = off
auto-index = on

this will make any files ending with the file extension .cgi execute as a script, the output of which will be returned as the response to the user's request. it also makes it so if a script takes longer then five seconds to execute the response times out

[example.com~(.*)\.cgi]
root = /var/gemini/example.com
cgi = on
cgi-timeout = 5

this will redirect anyone going to index.html back to the root of the directory, which will serve index.html anyway

[example.com~(.*)/index.gmi]
redirect = ./

developer's testing configuration