\input texinfo @documentencoding UTF-8 @settitle SGBlog @copying Copyright @copyright{} 2020 @email{stargrave@@stargrave.org, Sergey Matveev} @end copying @node Top @top SGBlog is minimalistic and simple Git-backed CGI/inetd @url{https://en.wikipedia.org/wiki/Blog, blogging} and @url{https://en.wikipedia.org/wiki/Phlog, phlogging} engine with email-backed comments support, written on @url{https://golang.org/, Go}. Its main competitive features: @itemize @item Single binary, responsible for both blog and phlog @item @url{https://git-scm.com/, Git} DVCS as a storage for posts and comments @item Single small @url{https://hjson.github.io/, Hjson} configuration file @item Uses @url{https://en.wikipedia.org/wiki/Common_Gateway_Interface, CGI} interface (simplicity, remember?) for dealing with HTTP-server @item Uses @url{https://en.wikipedia.org/wiki/Inetd, inetd}/@url{http://cr.yp.to/ucspi-tcp.html, UCSPI-TCP} interface for working as @url{https://en.wikipedia.org/wiki/Gopher_(protocol), Gopher} server @item Topics (tags/categories) support @item Supports on the fly generation of @url{https://en.wikipedia.org/wiki/Atom_(feed), Atom} feeds for posts, comments and per-post comments @item Single binary for email-backed comments posting @item If access is granted, then everyone can easily create an offline copy of your blog/phlog! @end itemize All of that, except for comments, topics and phlog, could be achieved with some Git viewer like @url{https://git.zx2c4.com/cgit/about/, cgit}. But SGBlog also is able to: @itemize @item Convert URLs to clickable links @item Convert SHA1-like hashes to blog links itself @item Include relative @code{} links for ease of navigation in some browsers @item @url{https://en.wikipedia.org/wiki/Gzip, gzip} compress both HTML pages and Atom feeds @item Respect @url{https://en.wikipedia.org/wiki/HTTP_ETag, ETag} caching for both of them above @end itemize @url{http://blog.stargrave.org/example/, Here} is an example blog. SGBlog is free software, licenced under @url{https://www.gnu.org/licenses/agpl-3.0.html, GNU AGPLv3}: see the file COPYING for copying conditions. @menu * Comments:: * Topics:: * Installation:: * Configuration:: @end menu @node Comments @unnumbered Comments Comments are posted through the email interface, just by sending the message to special address. For example: @example $ mutt "mailto:comment@@blog.example.com?subject=BlaBlaBla%20(576540a5b98517b46d0efc791bb90b9121bf147e)" < "/path/to/sgblog") cgi.assign = ("sgblog" => "/path/to/sgblog") setenv.add-environment = ( "SGBLOG_CFG" => "/path/to/example.hjson", ) @} @} @end example And be sure that you have read access to the Git repository, for example by placing @code{lighttpd} user into @code{git} group. Example @command{inetd} configuration (for phlog): @example gopher stream tcp6 nowait lighttpd /path/to/sgblog sgblog -gopher /path/to/gopher.hjson @end example Example @command{UCSPI-TCP} service running under @url{http://cr.yp.to/daemontools.html, daemontools}: @example # mkdir -p /var/service/.phlog-ipv6/log # cd /var/service/.phlog-ipv6 # cat > run < log/run < GitURLs: [ git://git.example.com/blog.git https://git.example.com/git/blog.git ] # If that ref is set, then comments will be loaded from it CommentsNotesRef: refs/notes/comments # Display link for comment writing, if email is set CommentsEmail: something@@example.com # If that ref is set, then topics will be loaded from it TopicsNotesRef: refs/notes/topics # Optional file for topics state caching TopicsCachePath: /path/to/sgblog-topics-cache.gob @} @end example Gopher configuration can use the same file, but it requires much less options: @example @{ GitPath: /home/sgblog/blog.git Branch: refs/heads/example Title: "Example blog" GopherDomain: phlog.example.com AboutURL: http://blog.example.com/ # Both are optional CommentsNotesRef: refs/notes/comments CommentsEmail: something@@example.com # Both are optional too TopicsNotesRef: refs/notes/topics TopicsCachePath: /path/to/sgblog-topics-cache.gob @} @end example @bye