From 23c357eaac61020e0a54953913f4f161cb6da423 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 24 Nov 2018 17:23:00 -0500 Subject: [PATCH 01/10] fix watermark stuff --- contrib/backends/srndv2/src/srnd/nntp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index 61f2e55..74d88c0 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -854,7 +854,7 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string if err == nil { hi, lo, err = daemon.database.GetLastAndFirstForGroup(group) if err == nil { - conn.PrintfLine("211 %d %d %d %s list follows", count, lo, hi, group) + conn.PrintfLine("211 %d %d %d %s list follows", count, hi, lo, group) dw := conn.DotWriter() idx := lo for idx <= hi { @@ -1002,7 +1002,7 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string hi, low, err := daemon.database.GetLastAndFirstForGroup(group) if err == nil { // we gud - conn.PrintfLine("211 %d %d %d %s", number, low, hi, group) + conn.PrintfLine("211 %d %d %d %s", number, hi, low, group) } else { // wtf error log.Println(self.name, "error in GROUP command", err) @@ -1327,7 +1327,7 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn // check code if code == 211 { // success - es, lo, hi, _ := interpretGroupResult(ret) + es, hi, lo, _ := interpretGroupResult(ret) for { if lo > hi { // server indicated empty group From cbd7d30e8d8e4e482894a0282b950dcbd75102ba Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 24 Nov 2018 17:48:30 -0500 Subject: [PATCH 02/10] include more for previous commit --- contrib/backends/srndv2/src/srnd/nntp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index 74d88c0..e3cb4c5 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1175,7 +1175,7 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string dw := conn.DotWriter() for _, entry := range list { if ValidNewsgroup(entry[0]) { - io.WriteString(dw, fmt.Sprintf("%s %s %s y\r\n", entry[0], entry[1], entry[2])) + io.WriteString(dw, fmt.Sprintf("%s %s %s y\r\n", entry[0], entry[2], entry[1])) } } dw.Close() From d1c392ce2904f0960b3039e40a592fce0d7d7cae Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 24 Nov 2018 17:51:59 -0500 Subject: [PATCH 03/10] Revert "fix watermark stuff" This reverts commit 23c357eaac61020e0a54953913f4f161cb6da423. --- contrib/backends/srndv2/src/srnd/nntp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index e3cb4c5..87994c9 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -854,7 +854,7 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string if err == nil { hi, lo, err = daemon.database.GetLastAndFirstForGroup(group) if err == nil { - conn.PrintfLine("211 %d %d %d %s list follows", count, hi, lo, group) + conn.PrintfLine("211 %d %d %d %s list follows", count, lo, hi, group) dw := conn.DotWriter() idx := lo for idx <= hi { @@ -1002,7 +1002,7 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string hi, low, err := daemon.database.GetLastAndFirstForGroup(group) if err == nil { // we gud - conn.PrintfLine("211 %d %d %d %s", number, hi, low, group) + conn.PrintfLine("211 %d %d %d %s", number, low, hi, group) } else { // wtf error log.Println(self.name, "error in GROUP command", err) @@ -1327,7 +1327,7 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn // check code if code == 211 { // success - es, hi, lo, _ := interpretGroupResult(ret) + es, lo, hi, _ := interpretGroupResult(ret) for { if lo > hi { // server indicated empty group From 76f9d84fa0c3f04e6f840d4c79816c29512764a4 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 25 Nov 2018 07:09:34 -0500 Subject: [PATCH 04/10] add new route for board list --- contrib/backends/srndv2/src/srnd/null_cache.go | 6 ++++++ contrib/templates/placebo/frontpage.mustache | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/null_cache.go b/contrib/backends/srndv2/src/srnd/null_cache.go index b5bbcec..6af4724 100644 --- a/contrib/backends/srndv2/src/srnd/null_cache.go +++ b/contrib/backends/srndv2/src/srnd/null_cache.go @@ -97,6 +97,12 @@ func (self *nullHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + // board list page + if strings.ToLower(path) == "/b/" { + template.genBoardList(self.prefix, self.name, w, self.database, i18n) + return + } + if strings.HasPrefix(path, "/b/") { // board handler parts := strings.Split(path[3:], "/") diff --git a/contrib/templates/placebo/frontpage.mustache b/contrib/templates/placebo/frontpage.mustache index 7036869..5f52709 100644 --- a/contrib/templates/placebo/frontpage.mustache +++ b/contrib/templates/placebo/frontpage.mustache @@ -26,9 +26,10 @@
-

Enter

-

Board List

+

Board List

+ Firehose FAQ +