Compare commits
	
		
			10 Commits
		
	
	
		
			15ccb7ad50
			...
			f92f68c3cd
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					f92f68c3cd | ||
| 
						 | 
					77fe66c330 | ||
| 
						 | 
					ff8c3e915a | ||
| 
						 | 
					2f5f84da4b | ||
| 
						 | 
					477acabd19 | ||
| 
						 | 
					e2cbffea30 | ||
| 
						 | 
					0261f26043 | ||
| 
						 | 
					5381c7b2a4 | ||
| 
						 | 
					015c64139d | ||
| 
						 | 
					4b08919f75 | 
							
								
								
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
The MIT License (MIT)
 | 
					The MIT License (MIT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Copyright (c) 2015-2018 Jeff Becker
 | 
					Copyright (c) 2015-2020 Jeff Becker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
					Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
				
			||||||
of this software and associated documentation files (the "Software"), to deal
 | 
					of this software and associated documentation files (the "Software"), to deal
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1240,10 +1240,14 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string
 | 
				
			|||||||
										log.Println(self.name, "got reply to", reference, "but we don't have it")
 | 
															log.Println(self.name, "got reply to", reference, "but we don't have it")
 | 
				
			||||||
										go daemon.askForArticle(reference)
 | 
															go daemon.askForArticle(reference)
 | 
				
			||||||
									} else {
 | 
														} else {
 | 
				
			||||||
										h := daemon.store.GetMIMEHeader(reference)
 | 
															// get rootiest post
 | 
				
			||||||
										if strings.Trim(h.Get("References"), " ") == "" {
 | 
															ref := reference
 | 
				
			||||||
											hdr.Set("References", getMessageID(h))
 | 
															var h textproto.MIMEHeader	
 | 
				
			||||||
 | 
															for ref != "" {
 | 
				
			||||||
 | 
																h = daemon.store.GetMIMEHeader(ref)
 | 
				
			||||||
 | 
																ref = strings.Trim(h.Get("References"), " ")
 | 
				
			||||||
										}
 | 
															}
 | 
				
			||||||
 | 
															hdr.Set("References", getMessageID(h))
 | 
				
			||||||
									}
 | 
														}
 | 
				
			||||||
								} else if reference != "" {
 | 
													} else if reference != "" {
 | 
				
			||||||
									// bad message id
 | 
														// bad message id
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -204,7 +204,7 @@ func (self *PostgresDatabase) prepareStatements() {
 | 
				
			|||||||
		GetMessageIDByHash:              "SELECT message_id, message_newsgroup FROM Articles WHERE message_id_hash = $1 LIMIT 1",
 | 
							GetMessageIDByHash:              "SELECT message_id, message_newsgroup FROM Articles WHERE message_id_hash = $1 LIMIT 1",
 | 
				
			||||||
		CheckEncIPBanned:                "SELECT 1 FROM EncIPBans WHERE encaddr = $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",
 | 
							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",
 | 
							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",
 | 
							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",
 | 
							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",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -42,6 +42,7 @@ func HandleStartTLS(conn net.Conn, config *tls.Config) (econn *textproto.Conn, s
 | 
				
			|||||||
				econn = textproto.NewConn(tconn)
 | 
									econn = textproto.NewConn(tconn)
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
 | 
									log.Println("tls handshake error: ", err.Error())
 | 
				
			||||||
				certs := state.PeerCertificates
 | 
									certs := state.PeerCertificates
 | 
				
			||||||
				if len(certs) == 0 {
 | 
									if len(certs) == 0 {
 | 
				
			||||||
					log.Println("starttls failed, no peer certs provided")
 | 
										log.Println("starttls failed, no peer certs provided")
 | 
				
			||||||
@@ -53,6 +54,7 @@ func HandleStartTLS(conn net.Conn, config *tls.Config) (econn *textproto.Conn, s
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				tconn.Close()
 | 
									tconn.Close()
 | 
				
			||||||
 | 
									conn.Close()
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -555,3 +555,7 @@ background-repeat: repeat;
 | 
				
			|||||||
    font-size: 24pt;
 | 
					    font-size: 24pt;
 | 
				
			||||||
    float: right;
 | 
					    float: right;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.spam-button {
 | 
				
			||||||
 | 
					  display: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -76,10 +76,6 @@ var nntpchan_mod_action = function(mod_action, elem) {
 | 
				
			|||||||
            // http error
 | 
					            // http error
 | 
				
			||||||
            elem.innerHTML = "error: HTTP "+status;
 | 
					            elem.innerHTML = "error: HTTP "+status;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          // clear input
 | 
					 | 
				
			||||||
          if (input) {
 | 
					 | 
				
			||||||
            input.value = "";
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (mod_action.name) {
 | 
					      if (mod_action.name) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -853,3 +853,8 @@ th > label {
 | 
				
			|||||||
      :target {
 | 
					      :target {
 | 
				
			||||||
          background-color: #493769;
 | 
					          background-color: #493769;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .mod {
 | 
				
			||||||
 | 
					        display: none;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
@@ -38,7 +38,7 @@
 | 
				
			|||||||
            <b>Most of the rest of the wild west.</b>
 | 
					            <b>Most of the rest of the wild west.</b>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <center><b>{{board.Name}}</b></center>
 | 
					        <center><b>{{board.Name}}</b></center>
 | 
				
			||||||
        <center><button onclick="nntpchan_mod_commit_spam(this)">Moderate</button></center> 
 | 
					        <center><button class="spam-button" onclick="nntpchan_mod_commit_spam(this)">Moderate</button></center> 
 | 
				
			||||||
        <br />
 | 
					        <br />
 | 
				
			||||||
        {{{form}}}
 | 
					        {{{form}}}
 | 
				
			||||||
        {{#board.Threads}}
 | 
					        {{#board.Threads}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,7 +48,7 @@
 | 
				
			|||||||
            <b>Most of the rest of the wild west.</b>
 | 
					            <b>Most of the rest of the wild west.</b>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <center><b><a href="{{thread.BoardURL}}">{{thread.Board}}</a></b></center>
 | 
					        <center><b><a href="{{thread.BoardURL}}">{{thread.Board}}</a></b></center>
 | 
				
			||||||
        <center><button onclick="nntpchan_mod_commit_spam(this)">Moderate</button></center>
 | 
					        <center><button class="spam-button" onclick="nntpchan_mod_commit_spam(this)">Moderate</button></center>
 | 
				
			||||||
        <br />
 | 
					        <br />
 | 
				
			||||||
        {{{form}}}
 | 
					        {{{form}}}
 | 
				
			||||||
            {{#thread.BumpLock}}
 | 
					            {{#thread.BumpLock}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,7 @@
 | 
				
			|||||||
        <div class="sitetitle">
 | 
					        <div class="sitetitle">
 | 
				
			||||||
            <h2><a href="#">CHANGOLIA</a></h2>
 | 
					            <h2><a href="#">CHANGOLIA</a></h2>
 | 
				
			||||||
            <b>Most of the rest of the wild west.</b>
 | 
					            <b>Most of the rest of the wild west.</b>
 | 
				
			||||||
            <center><button onclick="nntpchan_mod_commit_spam(this)">Moderate</button></center> 
 | 
					            <center><button class="spam-button" onclick="nntpchan_mod_commit_spam(this)">Moderate</button></center> 
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div id="paginator">
 | 
					        <div id="paginator">
 | 
				
			||||||
            {{#prev}}
 | 
					            {{#prev}}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user