Archived
1
0
This commit is contained in:
no 2016-01-06 16:18:34 -05:00
commit 689ced2ae4
22 changed files with 435 additions and 1 deletions

6
.gitignore vendored
View File

@ -14,4 +14,8 @@
articles
# generated files
webroot
webroot
# built binaries
go
srndv2

View File

@ -0,0 +1,52 @@
<!doctype html><html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>nntpchan faq</title></head><body>
<audio loop controls><source src="/static/about.mp3" type="audio/mpeg">[can't play audio.]</audio>
<p>nntpchan faq</p>
<dl>
<dt>What is nntpchan?</dt>
<dd>NNTPCchan is a federated imageboard that spans across several networks including tor, i2p and anonet. There are no central servers so that as long as 1 server is left the forum will continue to function.</dd>
<br>
<dt>How is this different from *chan?</dt>
<dd>NNTPChan is by design invulnerable to global censorship. All moderation is local to each server.</dd>
<br>
<dt>How does moderation work then?</dt>
<dd>Moderation is done with our special tripcodes (ed25519-sha512 signed posts). Anyone can give moderation suggestions, but that doesn't mean anyone will accept them. Those who trust the actions of a moderator can have their frontend whitelist the moderation actions and have them performed without oversight by another moderator.</dd>
<br>
<dt>How can I remove content from nntpchan completely?</dt>
<dd>‾\(._.)/‾ I don't know. You probably can't unless every server agrees to remove the content, even then, nothing prevents someone from reposting it. You can't delete what you post on the internet.</dd>
<br>
<dt>do you allow child porn?</dt>
<dd>no.</dd>
<br>
<dt>Do you allow XYZ content?</dt>
<dd>If it violates USA Law or causes problems with my host, no. Otherwise, probably.</dd>
<br>
<dt>Someone posted something I don't like but it's not illegal</dt>
<dd>That is not my problem. All posts on this site are the responsibility of the individual poster and not the administration of this server</dd>
<br>
<dt>code, bugs, feature requests</dt>
<dd><a href="https://github.com/majestrate/nntpchan/">frontend</a> <a href="https://github.com/majestrate/srndv2/">core</a></dd>
<br></dl>
<p>Please send any gripes/questions/inqueries/suggestions/complaints to ampernand [|at\] gmail {dot} com with subject starting with "nntpchan question"</p>
<hr>
<p>ucavviu7wl6azuw7.onion frontend specific</p>
<dl>
<dt>admin's pubkey</dt>
<dd>06833a90237c61f59558c1726fbe71c63e972722b2cf1147867be286cb020b32<br>
▆☃►☐▣◼◡♵☕◘♁◲◯☾◱♆▾☗▧▢☲♏░◇☆◻♢☆♋▂▋▲</dd>
<br>
<dt>peering</dt>
<dd>just open a thread for now.</dd>
<br>
<dt>rules</dt>
<dd>basically no stuff that will fuck with the functioning of the site.<br>
- stuff that will get me in trouble like cp.<br>
- flood/spam. duplicate posts may also get baleeted.
</dd>
<br>
<dt>guidelines and things to keep in mind</dt>
<dd>
- i don't owe you shiieet. you don't owe me shieet.<br>
- administration style: benevolent dictatorship.
</dd>
</dl>
</body></html>

View File

@ -0,0 +1,7 @@
body{font-family:monospace}
dl{max-width:84ch}
dd{margin-left:4ch;overflow:auto}
.memearrows{color:green}
pre{margin: 0 0 0 0}
table,th,td{border:1px solid gray}
table {border-collapse:collapse}

View File

@ -0,0 +1,27 @@
{{!
board.mustache, displays the contents of page N of the board
template parameters:
- board ( the model of the current page )
- page ( the page number of the current page )
board has the properties:
- Prefix ( absolute path like //site.tld/ or /path/ )
- Board ( the name of the board )
- Navbar ( a function that renders the navbar, should not be escaped )
- Threads ( a list of Thread Models with the last few replies )
}}
<!doctype html><html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>{{board.Board}}</title></head><body>
{{{board.Navbar}}}
{{{form}}}
<dl>
<hr>
{{#board.Threads}}
{{{OP.Truncate.RenderPost}}}
{{#Truncate.Replies}}
{{{Truncate.RenderPost}}}
{{/Truncate.Replies}}
<hr>
{{/board.Threads}}
</dl>
</body></html>

View File

@ -0,0 +1,33 @@
{{!
boardlist.mustache -- full list of every board
template parameters:
- graph ( a list of 4 string tuples: (board, posts_per_hour, posts_per_day, total_posts) )
- frontend ( the name of the frontend )
- prefix ( the site's prefix )
}}
<!doctype html><html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>{{frontend}} boards</title></head><body>
<table>
<tr>
<th>board</th>
<th>posts per hour</th>
<th>posts per day</th>
<th>total</th>
</tr>
{{# graph}}
<tr>
<td>
<a href="{{prefix}}{{Board}}-0.html">{{Board}}</a>
</td>
<td>
{{Hour}}
</td>
<td>
{{Day}}
</td>
<td>
{{All}}
</td>
</tr>
{{/ graph}}
</table>
</body></html>

View File

@ -0,0 +1,11 @@
{{!
frontpage.mustache -- template for index.html
template parameters:
- boardgraph ( a boardPageRows instance, see srnd/model.go )
- postgraph ( a postsGraph instance , see srnd/model.go )
- overview ( an overviewModel instance, see srnd/model.go )
- totalposts ( the number of total posts we have ever seen )
- frontend ( the name of the frontend )
- prefix ( the site's prefix )
}}
<!doctype html><html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>{{frontend}} on nntpchan</title></head><body><p>{{frontend}} on nntpchan</p><p><a href="ukko.html">overboard</a> <a href="{{prefix}}boards.html">boards</a> <a href="{{prefix}}static/chen-chan-faq.html">faq</a></p><dl><dt>last posts:</dt><dd>{{{overview.Render}}}</dd></dl><dl><dt>board stats:</dt><dd><table><tr><th>board</th><th>posts this hour</th><th>posts today</th><th>total</th></tr>{{# boardgraph}}<tr><td><a href="{{prefix}}{{Board}}-0.html">{{Board}}</a></td><td>{{Hour}}</td><td>{{Day}}</td><td>{{All}}</td></tr>{{/ boardgraph}}</table></dd></dl><dl><dt>total stats:</dt><dd>{{{postsgraph.Render}}}</dd></dl><p>{{totalposts}} posts total since 2015-12-23</p></body></html>

View File

@ -0,0 +1,36 @@
{{!
graph_history.mustache
template parameters:
- history ( a list of PostEntry instances, see srnd/model.go )
}}
<html>
<head>
<meta charset="utf-8"></meta>
<link rel="stylesheet" href="{{prefix}}site.css" />
<link rel="stylesheet" href="{{prefix}}user.css" />
<title> Post History</title>
</head>
<body>
<td>
<table id="history_graph">
<thead>
<tr>
<th>Month</th>
<th>Posts</th>
<th></th>
</tr>
</thead>
<tbody>
{{#history.Scale}}
<tr>
<td>{{Date}}</td>
<td class="history_num">{{Num}}</td>
<td>{{OvercockGraph}}</td>
</tr>
{{/history.Scale}}
</tbody>
</table>
</td>
</body>
</html>

View File

@ -0,0 +1,15 @@
{{!
keygen.mustache -- page containing a newly generated tripcode
template parameters:
- prefix ( the site prefix )
- public ( the public key in hex )
- secret ( the secret key in hex )
- tripcode ( html version of the public key )
}}
<!doctype html><html><head><title>new tripcode</title></head><body><pre>
new tripcode
secret: {{secret}}
public: {{public}}
tripcode: {{{tripcode}}}
</pre></body></html>

View File

@ -0,0 +1,7 @@
<!doctype html><html><head><link rel="stylesheet" href="{{prefix}}static/chen-chan.css"><title>login</title></head><body>
<form action="login" method="POST" name="modlogin">
<label for="mod_key">secret</label>
<input type="password" id="mod_key" name="privkey">
<input type="submit" value="login">
</form>
</body></html>

View File

@ -0,0 +1,9 @@
{{!
modlogin_result.mustache -- shows the result of a login attempt
template parameters:
- prefix ( the site prefix )
- mod_prefix ( the prefix to the mod panel, could be something like https://mod.site.tld/ or /mod/ )
- message ( the message returned from the login attempt )
- fail ( present if the login failed ) // not yet added
}}
<!doctype html><html><head><meta http-equiv="refresh" content="1; {{mod_prefix}}"><title>login</title></head><body><p>{{message}}</p></body></html>

View File

@ -0,0 +1,79 @@
{{!
modpage.mustache -- the moderator panel when logged in
template parameters:
- prefix ( the site's prefix )
}}
<!doctype html><html><head>
<link rel="stylesheet" href="{{prefix}}static/chen-chan.css">
<!-- yes it uses js -->
<script src="{{prefix}}static/mod.js"></script>
<title>nntpchan mod page</title>
</head><body>
<dl>
<dt>post actions</dt>
<dd>
<div>
<label for="nntpchan_mod_target">target</label>
<input id="nntpchan_mod_target" type="text">
</div>
<div>
<button onclick="nntpchan_ban()">ban (url)</button>
<button onclick="nntpchan_delete()">delete (url)</button>
<button onclick="nntpchan_unban()">unban (ip)</button>
</div>
</dd>
</dl>
<dl>
<dt>key actions</dt>
<dd>
<div>
<label for="nntpchan_board_target">pubkey:</label>
<input type="text" id="nntpchan_key_target" />
</div>
<div>
<button onclick="nntpchan_key_add()">add key</button>
<button onclick="nntpchan_key_del()">remove key</button>
</div>
</dd>
</dl>
<dl>
<dt>board actions</dt>
<dd>
<div>
<label for="nntpchan_board_target">board name:</label>
<input type="text" id="nntpchan_board_target">
</div>
<div>
<button onclick="nntpchan_admin_board('frontend.add')">add board</button>
<button onclick="nntpchan_admin_board('frontend.regen')">regenerate</button>
<button onclick="nntpchan_admin_board('frontend.ban')">ban</button>
<button onclick="nntpchan_admin_board('frontend.unban')">unban</button>
<button onclick="nntpchan_admin_board('frontend.nuke')">nuke</button>
</div>
</dd>
</dl>
<dl>
<dt>lightweight actions</dt>
<dd>
<button onclick="nntpchan_admin('template.reload')">reload all templates</button>
</dd>
</dl>
<dl>
<dt>very load heavy actions, use with care</dt>
<dd>
<div>
<button onclick="nntpchan_admin('frontend.regen')">regenerate all pages</button>
<button onclick="nntpchan_admin('thumbnail.regen')">regenerate all thumbnails</button>
</div>
</dd>
</dl>
<dl>
<dt>status</dt>
<dd>
<div id="nntpchan_mod_result"></div>
<noscript>
<b>enable js to use the mod panel kthx</b>
</noscript>
</dd>
</dl>
</body></html>

View File

@ -0,0 +1,12 @@
{{!
navbar.mustache -- element on the top of each nod-mod page
TODO: make this not suck, have a board list, have board page list
template parameters:
- name ( the name of whatever resource we are on, board/thread )
- frontend ( the name of the frontend we are on )
- links ( a list of Link Models to display )
- prefix ( site prefix )
}}
<p>{{name}} on {{frontend}} | {{# links}} <a href="{{LinkURL}}">{{Text}}</a> {{/ links}} | <a href="{{prefix}}">front page</a> <a href="{{prefix}}ukko.html">overboard</a></p>

View File

@ -0,0 +1 @@
no apparently.

View File

@ -0,0 +1,7 @@
{{! overview.mustache
paramters:
- overview (list of PostModels in order of last posted)
}}
<table><tr><th>date</th><th>board</th><th>subject</th></tr>{{#overview}}<tr><td>{{Date}}</td><td><a href="{{Prefix}}{{Board}}-0.html">{{Board}}</a></td><td><a href="{{PostURL}}">{{Truncate.Subject}}</a></td></tr>{{/overview}}</table>

View File

@ -0,0 +1,15 @@
<dt id="{{PostHash}}">
<a onclick="nntpchan_backlink('{{ShortHash}}');" title="{{MessageID}}">{{ShortHash}}</a>
{{Date}}
{{#IsI2P}}i2p{{/IsI2P}}{{#IsTor}}tor{{/IsTor}}{{#IsClearnet}}clr{{/IsClearnet}}
{{Subject}}
{{Name}}
{{{Pubkey}}}
<a href="{{PostURL}}">[reply]</a>
</dt>
<dd>
{{{RenderBody}}}
{{#Attachments}}
file: <a href="{{Source}}" target="_blank">{{Filename}}</a><br><br>
{{/Attachments}}
</dd>

View File

@ -0,0 +1,3 @@
<!doctype html><html><head>
<meta http-equiv="refresh" content="1; {{redirect_url}}"></head>
<body><p>fail: {{reason}}</p></body></html>

View File

@ -0,0 +1,40 @@
<html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>try again</title></head><body>
<form enctype="multipart/form-data" name="post" method="post">
{{#attachment}}
<input type="hidden" name="attachment_data" value="{{attachment}}">
<input type="hidden" name="attachment_filename" value="{{attachment_filename}}">
<input type="hidden" name="attachment_mime" value="{{attachment_type}}">
{{/attachment}}
<input type="hidden" name="reference" value="{{reference}}">
<input type="hidden" name="name" value="{{name}}">
<input type="hidden" name="subject" value="{{subject}}">
<input type="hidden" name="captcha_id" value="{{captcha_id}}">
<input type="hidden" name="message" value="{{message}}">
<div id="postform-outer">
<div id="postform-inner">
<div>{{fail_message}}</div>
<table class="postform">
<tbody>
<tr>
<th>
Captcha
</th>
<td>
<img id="captcha_img" src="{{prefix}}captcha/{{captcha_id}}.png" alt="captcha" />
</td>
</tr>
<tr>
<th>
Solution
</th>
<td>
<input type="text" name="captcha" />
<input type="submit" value="Post" class="button" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
</form>
</body></html>

View File

@ -0,0 +1,7 @@
{{!
post_success.mustache -- shown when we do a successful post
template parameters:
- redirect_url ( the url of the next page we should redirect to )
- message_id ( the value of the Message-ID header in the post we made, the truncated sha1 of this is the >>posthash )
}}
<!doctype html><html><head><meta http-equiv="refresh" content="2; {{redirect_url}}"></head><body><pre>posted as {{message_id}}</pre></body></html>

View File

@ -0,0 +1,20 @@
{{!
postform.mustache -- the form for posting
template parameters:
- post_url ( the url of the post form )
- reference ( the post we are replying to, or empty string if it's an op )
- button ( the text for the reply button )
}}
<form action="{{post_url}}" enctype="multipart/form-data" name="post" method="post" style="overflow:auto">
<input type="hidden" name="reference" value="{{reference}}">
<textarea id="postform_message" name="message" placeholder="text" cols="40" rows="10" style="float:left" ></textarea><br>
<div style="float:left">
<input type="file" name="attachment"><br>
<input type="text" name="subject" placeholder="subject"><br>
<input type="text" name="name" placeholder="name"><br>
<input type="text" name="captcha" placeholder="captcha"><br>
<input type="submit" value="{{button}}" class="button"><br>
</div>
<img id="captcha_img" src="{{prefix}}captcha/img" alt="captcha" style="float:left">
</form>

View File

@ -0,0 +1,7 @@
{{!
posts graph.mustache -- post frequence graph
parameters:
* graph - a postsGraph instance (see srnd/model.go)
}}
<table><tr><th>date</th><th>posts</th><th>cock</th></tr>{{#graph.Scale}}<tr><td>{{Day}}</td><td>{{Num}}</td><td>{{OvercockGraph}}</td></tr>{{/graph.Scale}}</table>

View File

@ -0,0 +1,23 @@
{{!
thread.mustache -- renders to a thread-*.html page, shows the entire thread
template parameters:
- board ( the Board Model of the board this thread was posted in )
- thread ( the Thread Model of the current thread being rendered )
- form ( the post form markup )
Thread Model attributes:
- OP , the Post Model of the original poster
- Replies , a list of all the replies or empty if none
- Board , the name of the Board this thread is on
- BoardURL , the url that points to the board index page
}}
<!doctype html><html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>{{thread.OP.Subject}}</title><script src="{{thread.Prefix}}static/nntpchan.js"></script></head><body>
{{{thread.Navbar}}}
{{{form}}}
<dl>
{{{thread.OP.RenderPost}}}
{{# thread.Replies}}
{{{RenderPost}}}
{{/ thread.Replies}}
</dl>
</body></html>

View File

@ -0,0 +1,19 @@
{{!
ukko.mustache -- overboard, contains the last threads posted regardless of newsgroup
template parameters:
- prefix ( site prefix )
- threads ( a list of Thread Models that represent the latest threads )
}}
<!doctype html><html><head><link rel="stylesheet" href="/static/chen-chan.css"><title>ukko/overboard</title></head><body>
<a href="/">frontpage</a>
{{#threads}}
<hr>
<p>posted on <a href="{{{BoardURL}}}">{{OP.Board}}</a></p>
<dl>
{{{OP.Truncate.RenderPost}}}
{{#Truncate.Replies}}
{{{Truncate.RenderPost}}}
{{/Truncate.Replies}}
</dl>
{{/threads}}
</body></html>