Add about page

This commit is contained in:
Romain de Laage 2021-03-03 10:41:25 +01:00
parent 293c53c502
commit 6b31080c17
Signed by: rdelaage
GPG Key ID: 534845FADDF0C329
1 changed files with 18 additions and 1 deletions

View File

@ -103,7 +103,7 @@ func handleConn(conn *tls.Conn, baseURL, title, home_message string) {
// home
if path == "" || path == "/" {
_, err = fmt.Fprintf(conn, "20 text/gemini\r\n# " + title + "\n\n" + home_message)
_, err = fmt.Fprintf(conn, "20 text/gemini\r\n# " + title + "\n\n" + home_message + "\n\n=> /about About MastoGem")
if err != nil {
log.Println("send error: %s", err)
return
@ -147,6 +147,23 @@ func handleConn(conn *tls.Conn, baseURL, title, home_message string) {
log.Println("Received request for thread " + path)
printThread(conn, baseURL, path)
} /* about */ else if strings.HasPrefix(path, "/about") {
const page = `# About MastoGem
This capsule is running MastoGem, a free (as in free speech, not as in free beer) and open source software. It is released under AGPLv3 License (a copy a the license is available below). This software was written by Romain de Laage in 2021 during his free time. You can get a copy of the sources of this software here :
=> https://git.rdelaage.ovh/rdelaage/mastoGem Gitea repository (web)
Feel free to contribute, send feedback or share ideas.
# AGPLv3 License
=> http://www.gnu.org/licenses/agpl-3.0.txt AGPLv3 License text`
_, err = fmt.Fprintf(conn, "20 text/gemini\r\n" + page)
if err != nil {
log.Println("send: %s", err)
return
}
} else {
_, err = fmt.Fprintf(conn, "59 Invalid request\r\n")
if err != nil {