/*
-SGBlog -- Git-backed CGI/inetd blogging/phlogging engine
+SGBlog -- Git-backed CGI/UCSPI blogging/phlogging/gemlogging engine
Copyright (C) 2020-2021 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Git-backed CGI/inetd blogging/phlogging engine
+// Git-backed CGI/UCSPI blogging/phlogging/gemlogging engine
package main
import (
"flag"
"fmt"
"io/ioutil"
+ "log"
"regexp"
"strings"
func main() {
gopherCfgPath := flag.String("gopher", "", "Path to gopher-related configuration file")
+ geminiCfgPath := flag.String("gemini", "", "Path to gemini-related configuration file")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), `Usage of sgblog:
sgblog -- run CGI HTTP backend
sgblog -gopher /path/to/cfg.hjson -- run UCSPI/inetd Gopher backend
+ sgblog -gemini /path/to/cfg.hjson -- run UCSPI+tlss Gemini backend
`)
}
flag.Parse()
+ log.SetFlags(log.Lshortfile)
if *gopherCfgPath != "" {
serveGopher(*gopherCfgPath)
+ } else if *geminiCfgPath != "" {
+ serveGemini(*geminiCfgPath)
} else {
serveHTTP()
}