diff --git a/contrib/backends/srndv2/src/srnd/frontend_http.go b/contrib/backends/srndv2/src/srnd/frontend_http.go index 186dc60..4953e48 100644 --- a/contrib/backends/srndv2/src/srnd/frontend_http.go +++ b/contrib/backends/srndv2/src/srnd/frontend_http.go @@ -553,7 +553,16 @@ func (self *httpFrontend) handle_postform(wr http.ResponseWriter, r *http.Reques } } - sess, _ := self.store.Get(r, self.name) + sess, err := self.store.Get(r, self.name) + if err != nil { + errmsg := fmt.Sprintf("session store error: %s", err.Error()) + if sendJson { + json.NewEncoder(wr).Encode(map[string]interface{}{"error": errmsg}) + } else { + io.WriteString(wr, errmsg) + } + return + } if checkCaptcha && len(captcha_id) == 0 { cid, ok := sess.Values["captcha_id"] if ok { @@ -736,8 +745,7 @@ func (self *httpFrontend) handle_postRequest(pr *postRequest, b bannedFunc, e er } } - // always lower case newsgroups - board := strings.ToLower(pr.Group) + board := pr.Group // post fail message banned, err = self.daemon.database.NewsgroupBanned(board) diff --git a/contrib/backends/srndv2/src/srnd/postgres.go b/contrib/backends/srndv2/src/srnd/postgres.go index 64c7ffd..5251c8d 100644 --- a/contrib/backends/srndv2/src/srnd/postgres.go +++ b/contrib/backends/srndv2/src/srnd/postgres.go @@ -204,7 +204,7 @@ func (self *PostgresDatabase) prepareStatements() { GetMessageIDByHash: "SELECT message_id, message_newsgroup FROM Articles WHERE message_id_hash = $1 LIMIT 1", CheckEncIPBanned: "SELECT 1 FROM EncIPBans WHERE encaddr = $1", GetFirstAndLastForGroup: "WITH x(min_no, max_no) AS ( SELECT MIN(message_no) AS min_no, MAX(message_no) AS max_no FROM ArticleNumbers WHERE newsgroup = $1) SELECT CASE WHEN min_no IS NULL THEN 0 ELSE min_no END AS min_no FROM x UNION SELECT CASE WHEN max_no IS NULL THEN 1 ELSE max_no END AS max_no FROM x", - GetNewsgroupList: "SELECT newsgroup, min(message_no), max(message_no) FROM ArticleNumbers GROUP BY newsgroup ORDER BY newsgroup", + GetNewsgroupList: "SELECT newsgroup, min(message_no), max(message_no) FROM ArticleNumbers WHERE newsgroup NOT IN ( SELECT newsgroup FROM bannedgroups ) GROUP BY newsgroup ORDER BY newsgroup", GetMessageIDForNNTPID: "SELECT message_id FROM ArticleNumbers WHERE newsgroup = $1 AND message_no = $2 LIMIT 1", GetNNTPIDForMessageID: "SELECT message_no FROM ArticleNumbers WHERE newsgroup = $1 AND message_id = $2 LIMIT 1", IsExpired: "WITH x(msgid) AS ( SELECT message_id FROM Articles WHERE message_id = $1 INTERSECT ( SELECT message_id FROM ArticlePosts WHERE message_id = $1 ) ) SELECT COUNT(*) FROM x", diff --git a/contrib/backends/srndv2/src/srnd/store.go b/contrib/backends/srndv2/src/srnd/store.go index 930e885..f8c907c 100644 --- a/contrib/backends/srndv2/src/srnd/store.go +++ b/contrib/backends/srndv2/src/srnd/store.go @@ -26,8 +26,17 @@ import ( var ErrOversizedMessage = errors.New("oversized message") -// ~ 10 MB unbased64'd -const DefaultMaxMessageSize = 1024 * 1024 * 10 +// (cathugger) +// my test showed that 8MiB of attachments split in 5 parts +// plus some text produce something close to typhical big message +// resulted in 11483923 bytes. +// that's consistent with rough size calculation mentioned in +// +// ((origlen * 1.37) + 814) +// which resulted in 11493206 bytes for 8MiB of data. +// previous default of 10MiB (10485760) was too low in practice. +// use 11MiB (11534336) to leave some space for longer than usual texts. +const DefaultMaxMessageSize = 11 * 1024 * 1024 // HARD max message size const MaxMessageSize = 1024 * 1024 * 1024 diff --git a/contrib/static/krane.css b/contrib/static/krane.css index d2ced68..580767c 100644 --- a/contrib/static/krane.css +++ b/contrib/static/krane.css @@ -555,3 +555,7 @@ background-repeat: repeat; font-size: 24pt; float: right; } + +.spam-button { + display: none; +} \ No newline at end of file diff --git a/contrib/static/newboard.js b/contrib/static/newboard.js index 99b1a2f..153dc1e 100644 --- a/contrib/static/newboard.js +++ b/contrib/static/newboard.js @@ -2,7 +2,7 @@ function createBoard() { var form = document.getElementById("postform"); var e = document.getElementById("boardname"); var board = e.value; - if ( ! board.startsWith("overchan.") ) { + if ( board.indexOf(".") == -1 ) { board = "overchan." + board; } form.action = form.action + board; diff --git a/contrib/static/overchan.js b/contrib/static/overchan.js index 5b2391a..6d8eadb 100644 --- a/contrib/static/overchan.js +++ b/contrib/static/overchan.js @@ -76,10 +76,6 @@ var nntpchan_mod_action = function(mod_action, elem) { // http error elem.innerHTML = "error: HTTP "+status; } - // clear input - if (input) { - input.value = ""; - } } } if (mod_action.name) { diff --git a/contrib/static/site.css b/contrib/static/site.css index c7ca52f..6b9f62e 100644 --- a/contrib/static/site.css +++ b/contrib/static/site.css @@ -853,3 +853,8 @@ th > label { :target { background-color: #493769; } + + + .mod { + display: none; + } \ No newline at end of file diff --git a/contrib/templates/placebo/board.mustache b/contrib/templates/placebo/board.mustache index 80aa05b..5501a78 100644 --- a/contrib/templates/placebo/board.mustache +++ b/contrib/templates/placebo/board.mustache @@ -38,7 +38,7 @@ Most of the rest of the wild west.
{{board.Name}}
-
+

{{{form}}} {{#board.Threads}} diff --git a/contrib/templates/placebo/thread.mustache b/contrib/templates/placebo/thread.mustache index 5f4d118..a5c41d9 100644 --- a/contrib/templates/placebo/thread.mustache +++ b/contrib/templates/placebo/thread.mustache @@ -48,7 +48,7 @@ Most of the rest of the wild west.
{{thread.Board}}
-
+

{{{form}}} {{#thread.BumpLock}} diff --git a/contrib/templates/placebo/ukko.mustache b/contrib/templates/placebo/ukko.mustache index 8303cda..d1105ec 100644 --- a/contrib/templates/placebo/ukko.mustache +++ b/contrib/templates/placebo/ukko.mustache @@ -31,7 +31,7 @@

CHANGOLIA

Most of the rest of the wild west. -
+
{{#prev}} diff --git a/doc/building.md b/doc/building.md index 9670fbf..88ae975 100644 --- a/doc/building.md +++ b/doc/building.md @@ -15,7 +15,7 @@ Dependancies: * imagemagick * ffmpeg * sox -* go 1.9 +* go * GNU make ## Debian instructions @@ -24,7 +24,7 @@ These are installation instructions for Debian. ### Install Go -Install the Go programming language version _1.9_ from the [Go website](https://golang.org/dl/). +Install the latest version of the Go programming language from the [Go website](https://golang.org/dl/). ### Install the dependancies