Compare commits
236 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85a968ad40 | ||
|
|
c169616471 | ||
|
|
c0d5800bd4 | ||
|
|
6bd5518249 | ||
|
|
b3da008694 | ||
|
|
3a2529561f | ||
|
|
110e607839 | ||
|
|
54fa915aeb | ||
|
|
273d28d237 | ||
|
|
ec56bbe8f9 | ||
|
|
9340b9088e | ||
|
|
329eca6af3 | ||
|
|
06d4535eaa | ||
|
|
9f78414098 | ||
|
|
97faee8d1d | ||
|
|
33d95c2ef3 | ||
|
|
97ee132989 | ||
|
|
ab3da1edee | ||
|
|
ba0f5471a3 | ||
|
|
9f84ab4ca9 | ||
|
|
3274536134 | ||
|
|
bc5b22f7a1 | ||
|
|
0199230489 | ||
|
|
98bb655a3c | ||
|
|
c4090303ec | ||
|
|
0be5982d39 | ||
|
|
c7975c67ef | ||
|
|
59173f055e | ||
|
|
0b8c977aad | ||
|
|
2c0426d1a4 | ||
|
|
e6de8a1d20 | ||
|
|
9ebe7d7c5d | ||
|
|
84626f6f96 | ||
|
|
3a35dc5575 | ||
|
|
13b8a18e21 | ||
|
|
4557503256 | ||
|
|
689ced2ae4 | ||
|
|
ccc5972e67 | ||
|
|
e07260d068 | ||
|
|
7854b0b81d | ||
|
|
177e0156cc | ||
|
|
10d47779d3 | ||
|
|
d26d6ecacb | ||
|
|
85200d9284 | ||
|
|
8bcd0b790c | ||
|
|
68e4e9162f | ||
|
|
05d1290344 | ||
|
|
d1bb6b59b0 | ||
|
|
64111298f6 | ||
|
|
6df6fd807a | ||
|
|
d140c9ee99 | ||
|
|
50fafb4531 | ||
|
|
5591b56df0 | ||
|
|
6041a7d608 | ||
|
|
111522d08e | ||
|
|
7d89ab06c7 | ||
|
|
cab35af8c4 | ||
|
|
5abbe123c3 | ||
|
|
404d9952f2 | ||
|
|
a6b7235b12 | ||
|
|
55f4461475 | ||
|
|
bb1c6890ac | ||
|
|
e545bab034 | ||
|
|
21ec8e5f3a | ||
|
|
35c6875b00 | ||
|
|
45f217fa78 | ||
|
|
e6ca1b07ed | ||
|
|
3e3680c9be | ||
|
|
7501dae72e | ||
|
|
93328cb480 | ||
|
|
ab69a2e9a4 | ||
|
|
a6da70e7d3 | ||
|
|
6e87271483 | ||
|
|
fed34ed622 | ||
|
|
eb5ca66330 | ||
|
|
81f11be7c5 | ||
|
|
2c9f332fb0 | ||
|
|
d6f3bdd9e8 | ||
|
|
e75cf64769 | ||
|
|
d030303ed3 | ||
|
|
9ad004e85f | ||
|
|
83a4102e38 | ||
|
|
57e2ebda6e | ||
|
|
24b6ad9276 | ||
|
|
0e28120697 | ||
|
|
775dc470e5 | ||
|
|
a929709924 | ||
|
|
c23696aae5 | ||
|
|
ed97ca881d | ||
|
|
ed041c1689 | ||
|
|
67bcbc6289 | ||
|
|
8eec2ce827 | ||
|
|
749bd5a72b | ||
|
|
d0ad0ae71d | ||
|
|
4bff278a8f | ||
|
|
6453d405a6 | ||
|
|
1614cef91f | ||
|
|
0004483395 | ||
|
|
d1d846e2fe | ||
|
|
2a267f93be | ||
|
|
3c8fa13ffe | ||
|
|
e50d145bbe | ||
|
|
f85eaf35ac | ||
|
|
d16921d727 | ||
|
|
8bb13354a2 | ||
|
|
4c9ec43d30 | ||
|
|
69ef6f2b71 | ||
|
|
39c6c6b963 | ||
|
|
5219bcefab | ||
|
|
322edd37cb | ||
|
|
edfca55b8f | ||
|
|
1c405795b9 | ||
|
|
8ebba42030 | ||
|
|
41643bc52a | ||
|
|
ad5dfca2ef | ||
|
|
a95ec269df | ||
|
|
dc3ec1c63d | ||
|
|
371256e147 | ||
|
|
edd4b13af4 | ||
|
|
b12f6421fd | ||
|
|
eb08ccb5d6 | ||
|
|
e18f91c7e5 | ||
|
|
0176f32bd4 | ||
|
|
ab83843ef6 | ||
|
|
a0823c13db | ||
|
|
26042749aa | ||
|
|
cde9c1c641 | ||
|
|
fdcd9181ad | ||
|
|
9b3c073692 | ||
|
|
ce74caabf9 | ||
|
|
70ff3f487f | ||
|
|
78025891df | ||
|
|
1044989070 | ||
|
|
34dcede98f | ||
|
|
363743ac0c | ||
|
|
92c7102c50 | ||
|
|
38085620dc | ||
|
|
320966cca3 | ||
|
|
4165a5c34b | ||
|
|
f7504c7425 | ||
|
|
8196274c0e | ||
|
|
32d4fe6307 | ||
|
|
b57778cdcf | ||
|
|
15b14980f8 | ||
|
|
82708039c2 | ||
|
|
f58f4258e8 | ||
|
|
68d011b42b | ||
|
|
fdaf1dd9da | ||
|
|
bf82420f99 | ||
|
|
6cbe15988e | ||
|
|
3094108e59 | ||
|
|
c084518622 | ||
|
|
4e3d66ad52 | ||
|
|
b9e2202d04 | ||
|
|
44b63a11a0 | ||
|
|
1ad84780a8 | ||
|
|
4c822ba2cd | ||
|
|
2212f61ff0 | ||
|
|
19198738c3 | ||
|
|
7aa769d52d | ||
|
|
e4a9d8ef8c | ||
|
|
2d45920bc7 | ||
|
|
ee7004fc42 | ||
|
|
e82058d961 | ||
|
|
086eec72d8 | ||
|
|
d3a423a72f | ||
|
|
0427135322 | ||
|
|
f0ceac8d28 | ||
|
|
e263ebde0b | ||
|
|
651bd33205 | ||
|
|
7051da0e91 | ||
|
|
8dc4667666 | ||
|
|
3eba7adc1c | ||
|
|
8a7efa9929 | ||
|
|
83f5855bba | ||
|
|
c497a01e2d | ||
|
|
56b716d584 | ||
|
|
688c9a746c | ||
|
|
7027b9e297 | ||
|
|
5d191c88bc | ||
|
|
91367983ec | ||
|
|
bbba16380f | ||
|
|
80e4d7beb4 | ||
|
|
a451a6b46e | ||
|
|
75c72e177c | ||
|
|
939472f5a4 | ||
|
|
cf033b03b6 | ||
|
|
b16b0c72b0 | ||
|
|
566c88dc28 | ||
|
|
4698f7a118 | ||
|
|
5e60d20222 | ||
|
|
6cbc367630 | ||
|
|
af85eae429 | ||
|
|
5420346b36 | ||
|
|
e11978a0d9 | ||
|
|
d94813ee36 | ||
|
|
1aa4f81ae7 | ||
|
|
270e72c8eb | ||
|
|
0d1c42b086 | ||
|
|
105b314ee7 | ||
|
|
7dfc1e3418 | ||
|
|
d5b45cb58e | ||
|
|
a9ea094144 | ||
|
|
f1037d888d | ||
|
|
2a9b1f3eac | ||
|
|
bf351294b1 | ||
|
|
f93256e0d8 | ||
|
|
c1ecf14258 | ||
|
|
80e12fe0f3 | ||
|
|
f6400b3cb5 | ||
|
|
04126b743c | ||
|
|
f7211600f8 | ||
|
|
25901e3d44 | ||
|
|
97ec36feaa | ||
|
|
c5f17cf048 | ||
|
|
0b7b248ea1 | ||
|
|
2f381e7052 | ||
|
|
f006b61c4e | ||
|
|
3a13943d49 | ||
|
|
ab15a2ff33 | ||
|
|
af582eb30b | ||
|
|
471377ff2e | ||
|
|
3c4e319f06 | ||
|
|
7845131544 | ||
|
|
91971f2f3e | ||
|
|
072e36915a | ||
|
|
fc23bea021 | ||
|
|
e88c8f78ba | ||
|
|
d249d373c1 | ||
|
|
ccbdd33b93 | ||
|
|
823af74633 | ||
|
|
95f425c31d | ||
|
|
0e0a9c3da9 | ||
|
|
cdc405f29e | ||
|
|
1a51354621 | ||
|
|
4e31910ed6 |
12
.gitignore
vendored
@@ -14,4 +14,14 @@
|
||||
articles
|
||||
|
||||
# generated files
|
||||
webroot
|
||||
webroot
|
||||
|
||||
# built binaries
|
||||
go
|
||||
srndv2
|
||||
|
||||
# private key
|
||||
*.key
|
||||
|
||||
# certificates
|
||||
certs
|
||||
23
README.md
@@ -6,24 +6,23 @@ This repository contains resources used by the core daemon which is located [her
|
||||
|
||||
## getting started ##
|
||||
|
||||
After you [built and installed the daemon](doc/build.md) and [set up your database](doc/database.md), clone this repository and start up the daemon
|
||||
Get the dependancies
|
||||
|
||||
# clone it
|
||||
git clone https://github.com/majestrate/nntpchan ~/nntpchan
|
||||
# get the latest stable release
|
||||
cd ~/nntpchan/
|
||||
git checkout tags/0.2.1
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install imagemagick libsodium-dev ffmpeg sox build-essential git golang ca-certificates
|
||||
|
||||
# set up the workspace
|
||||
srndv2 setup
|
||||
Check out this repo and build it
|
||||
|
||||
# run the daemon
|
||||
srndv2 run
|
||||
git clone https://github.com/majestrate/nntpchan
|
||||
cd nntpchan
|
||||
./build.sh
|
||||
|
||||
Now configure the database. [Next](doc/database.md)
|
||||
|
||||
|
||||
Then open http://127.0.0.1:18000/ukko.html in your browser.
|
||||
---
|
||||
|
||||
*PLEASE* report any bugs you find while setting up or building [(here)](https://github.com/majestrate/nntpchan/issues) so that the problems get fixed (^:
|
||||
*PLEASE* report any bugs you find while setting up or building [(here)](https://github.com/majestrate/nntpchan/issues) so that the problems get fixed :^)
|
||||
|
||||
For peering requests, questions or support find me on [rizon](https://qchat.rizon.net/?channels=#nntpchan) as \__uguu\__
|
||||
|
||||
|
||||
6
TODO.md
Normal file
@@ -0,0 +1,6 @@
|
||||
## TODO ##
|
||||
|
||||
* extra stylesheets
|
||||
* more alternative templates
|
||||
* javascript free mod panel
|
||||
* liveui
|
||||
8
build.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
root=$(readlink -e $(dirname $0))
|
||||
cd $root
|
||||
export GOPATH=$root/go
|
||||
mkdir -p $GOPATH
|
||||
go get -u github.com/majestrate/srndv2
|
||||
cp -a $GOPATH/bin/srndv2 $root
|
||||
76
contrib/doc/dusty_setup.md
Normal file
@@ -0,0 +1,76 @@
|
||||
Date: October 2015.
|
||||
|
||||
Getting the srndv2 tool
|
||||
|
||||
I am using debian, you should be able to use most any linux distro for this. Known to work are: debian, arch linux, <TODO: add more>.
|
||||
|
||||
Most commands should be done as a normal user, but some special commands need to be done as root. I find it useful to have two terminals open. I'll denote normal user level commands with '$' and root command with '#'.
|
||||
|
||||
Some dependencies you will need to install (as root) are:
|
||||
|
||||
# apt-get install build-essential golang git
|
||||
# apt-get install libsodium-dev ffmpegthumbnailer
|
||||
# apt-get install imagemagick ffmpegthumbnailer sox
|
||||
|
||||
The source code is in these two repos:
|
||||
|
||||
* https://github.com/majestrate/nntpchan
|
||||
* https://github.com/majestrate/srndv2
|
||||
|
||||
set up your GOPATH (notes on that here: https://golang.org/doc/code.html#GOPATH ) and then install and build it:
|
||||
|
||||
$ go get -u github.com/majestrate/srndv2
|
||||
|
||||
If that command didn't work read the errors and check if you lacked any dependencies.
|
||||
|
||||
Now you have the srndv2 tool which you can run, but it will not work yet: You need to step up an SQL database first.
|
||||
|
||||
--------------
|
||||
|
||||
Setting up an SQL database
|
||||
|
||||
* https://wiki.postgresql.org/wiki/Detailed_installation_guides
|
||||
|
||||
Install postgresql.
|
||||
|
||||
# apt-get install postgresql postgresql-client
|
||||
|
||||
Create a postgresql user called 'srnd' and a database 'srnd':
|
||||
|
||||
# su postgres
|
||||
$ whoami
|
||||
postgres
|
||||
$ psql -f nntpchan/nntp.psql
|
||||
|
||||
TODO: Get correct filename here.
|
||||
|
||||
Test if you can log in to that SQL user this way:
|
||||
|
||||
$ psql -d srnd -U srnd
|
||||
|
||||
If there is an issue with that try the following from the debian wiki:
|
||||
|
||||
------------
|
||||
edit pg_hba.conf in /etc/postgresql/X.Y/main/pg_hba.conf
|
||||
|
||||
local all all trust # replace ident or peer with trust
|
||||
|
||||
reload postgresql
|
||||
|
||||
# /etc/init.d/postgresql reload
|
||||
------------
|
||||
|
||||
hit Contol-D to get back your root terminal after doing this.
|
||||
|
||||
|
||||
Once SQL setup is successful..
|
||||
|
||||
|
||||
Now as your regular user that installed the srndv2 tool, you should be able to set up srndv2
|
||||
|
||||
First clone nntpchan and cd into it, then ask the srndv2 tool to setup your node:
|
||||
|
||||
$ git clone https://github.com/majestrate/nntpchan.git
|
||||
$ cd nntpchann
|
||||
ntpchan/$ srndv2 setup
|
||||
ntpchan/$ srndv2 tool keygen
|
||||
@@ -1,16 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title> nntpchan liveposting </title>
|
||||
<link rel="stylesheet" src="live.css" />
|
||||
<script type="text/javascript" src="live.js">
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<p>nntpchan liveposting is done entirly via javascript and websockets</P>
|
||||
<p>this frontend will not work without javascript enabled</p>
|
||||
</noscript>
|
||||
<div onload="nntpchan_load_ui(this)">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,83 +0,0 @@
|
||||
|
||||
function create_captcha_pane() {
|
||||
var elem = document.createElement("div");
|
||||
elem.setAttribute("class", "nntpchan_captcha_slash");
|
||||
|
||||
}
|
||||
|
||||
// create the base ui
|
||||
// pass in a function that does posting
|
||||
// return the model
|
||||
function create_ui(elem) {
|
||||
|
||||
var pane = document.createElement("div");
|
||||
|
||||
|
||||
var output = document.createElement("div");
|
||||
output.setAttribute("class", "nntpchan_output");
|
||||
|
||||
var output_elem = document.createElemen("div");
|
||||
output_elem.setAttribute("class", "nntpchan_output_root");
|
||||
output.appendChild(output_elem);
|
||||
|
||||
pane.appendChild(output);
|
||||
|
||||
var input = document.createElement("div");
|
||||
input.setAttribute("class", "nntpchan_input");
|
||||
|
||||
var input_elem = document.createElement("textarea");
|
||||
input_elem.setAttribute("class", "nntpchan_textarea");
|
||||
input.appendChild(input_elem);
|
||||
|
||||
var submit_elem = document.createElement("input");
|
||||
submit_elem.setAttrbute("type", "button");
|
||||
input.appendChild(submit_elem);
|
||||
|
||||
pane.appendChild(input);
|
||||
|
||||
|
||||
elem.appendChild(pane);
|
||||
|
||||
var captcha_elem = create_captcha_pane();
|
||||
|
||||
elem.appendChild(captcha_elem);
|
||||
|
||||
return {
|
||||
input: input_elem,
|
||||
submit: submit_elem,
|
||||
output: output_elem,
|
||||
captcha: captcha_elem
|
||||
}
|
||||
}
|
||||
|
||||
// load ui elements and start stuff up
|
||||
function nntpchan_load_ui(elem) {
|
||||
// check for websockets
|
||||
if (!("WebSocket" in window)) {
|
||||
elem.value = "websockets are needed for nntpchan liveposting";
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: make configurable url
|
||||
var url = "ws://" + location.hostname + ":18080/ws";
|
||||
|
||||
var socket = new WebSocket(url);
|
||||
|
||||
var send = function(obj) {
|
||||
socket.send(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
var ui = create_ui(elem);
|
||||
ui.submit.addEventListener("click", function(ev) {
|
||||
|
||||
});
|
||||
|
||||
socket.onopen = function() {
|
||||
|
||||
}
|
||||
|
||||
socket.onmessage = function() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
BIN
contrib/static/banner_0.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
contrib/static/banner_1.jpg
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
contrib/static/banner_2.jpg
Normal file
|
After Width: | Height: | Size: 66 KiB |
52
contrib/static/chen-chan-faq.html
Normal 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>
|
||||
7
contrib/static/chen-chan.css
Normal 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}
|
||||
@@ -1,7 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="site.css"></link>
|
||||
<title> NNTPChan Frequently Asked Questions</title>
|
||||
<link rel="stylesheet" href="site.css" />
|
||||
<title> NNTPChan Frequently Asked Questions </title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>NNTPChan faq </h2>
|
||||
|
||||
|
Before Width: | Height: | Size: 858 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -64,6 +64,23 @@ function nntpchan_key_add() {
|
||||
});
|
||||
}
|
||||
|
||||
function get_nntp_username() {
|
||||
var e = document.getElementById("nntpchan_nntp_username");
|
||||
return e.value;
|
||||
}
|
||||
|
||||
function get_nntp_passwd() {
|
||||
var e = document.getElementById("nntpchan_nntp_passwd");
|
||||
return e.value;
|
||||
}
|
||||
|
||||
function nntpchan_admin_nntp(method) {
|
||||
nntpchan_admin(method, {
|
||||
username: get_nntp_username(),
|
||||
passwd: get_nntp_passwd()
|
||||
})
|
||||
}
|
||||
|
||||
function nntpchan_admin_board(method) {
|
||||
nntpchan_admin(method, {
|
||||
newsgroup: get_board_target()
|
||||
|
||||
@@ -9,6 +9,18 @@ function nntpchan_backlink(shorthash)
|
||||
var elem = document.getElementById("postform_message");
|
||||
if ( elem )
|
||||
{
|
||||
elem.value += ">>" + shorthash + "\n";
|
||||
elem.value += ">>" + shorthash.substr(0,10) + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
var banner_count = 3;
|
||||
|
||||
// inject a banner into an element
|
||||
function nntpchan_inject_banners(elem, prefix) {
|
||||
var n = Math.floor(Math.random() * banner_count);
|
||||
var banner = prefix + "static/banner_"+n+".jpg";
|
||||
var e = document.createElement("img");
|
||||
e.src = banner;
|
||||
e.id = "nntpchan_banner";
|
||||
elem.appendChild(e);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
.thread {
|
||||
margin-bottom: 1em;
|
||||
display: inline-block;
|
||||
word-wrap: break-word;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.frontend , .subject {
|
||||
color: #928BFF;
|
||||
@@ -13,7 +7,6 @@
|
||||
color: #117743;
|
||||
}
|
||||
|
||||
|
||||
.name , .subject {
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -22,7 +15,6 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
input {
|
||||
width: 70%;
|
||||
}
|
||||
@@ -43,16 +35,39 @@ textarea {
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
pre > p {
|
||||
display: block-inline;
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
background: #3f3f3f;
|
||||
color: #d17600;
|
||||
display: inline-block;
|
||||
overflow-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.reply, th, .ukko_thread_header {
|
||||
td {
|
||||
background-color: #1C1C1C;
|
||||
}
|
||||
|
||||
.board_td {
|
||||
position: relative; left: 2px;
|
||||
}
|
||||
|
||||
.posts_td {
|
||||
position: relative; left: -2px;
|
||||
}
|
||||
|
||||
#overview_graph {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
background: #1C1C1C;
|
||||
}
|
||||
|
||||
.reply, .ukko_thread_header {
|
||||
background: #202331;
|
||||
}
|
||||
|
||||
tr {
|
||||
background: #202123;
|
||||
legend {
|
||||
/* background-color: #525252; */
|
||||
}
|
||||
|
||||
hr {
|
||||
@@ -62,17 +77,16 @@ hr {
|
||||
border-style: solid none none;
|
||||
}
|
||||
|
||||
|
||||
a:hover , a:visited:hover {
|
||||
color: #f13333;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #4A4AFF;
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #5E00A0;
|
||||
color: #0C2FF3;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
@@ -84,12 +98,11 @@ a:visited {
|
||||
z-index: 20;
|
||||
box-shadow: 0px 1px 20px rgba(0, 0, 0, 0.15);
|
||||
background: #202331;
|
||||
color: #616383;
|
||||
|
||||
color: lightgray;
|
||||
}
|
||||
|
||||
.navbar-sep {
|
||||
color: black;
|
||||
color: darkgray;
|
||||
}
|
||||
|
||||
#postform_container {
|
||||
@@ -103,15 +116,12 @@ a:visited {
|
||||
}
|
||||
|
||||
th {
|
||||
background: #4DA6BD;
|
||||
font-size: 10pt;
|
||||
padding-left: 10px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#captcha_img {
|
||||
background: #d3d3d3;
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
color: whitesmoke;
|
||||
background: #2d2d2d;
|
||||
@@ -121,7 +131,7 @@ input, textarea {
|
||||
|
||||
html {
|
||||
color: #ededed;
|
||||
background: #262230;
|
||||
background: black;
|
||||
height: 100%;
|
||||
font-family: arial,helvetica,sans-serif;
|
||||
font-size: 10pt;
|
||||
@@ -172,14 +182,14 @@ html {
|
||||
100% {background-color: green; color: white; }
|
||||
}
|
||||
|
||||
.psy > p {
|
||||
.psy {
|
||||
animation: psych 2s linear infinite;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
.memearrows {
|
||||
color: green;
|
||||
color: #29D029;
|
||||
}
|
||||
|
||||
.redtext {
|
||||
@@ -223,18 +233,12 @@ html {
|
||||
box-shadow: 1px 1px 3px black;
|
||||
}
|
||||
|
||||
.post_body > pre {
|
||||
background: #3f3f3f;
|
||||
color: #d17600;
|
||||
}
|
||||
|
||||
.post_body > p {
|
||||
margin: 0px 0px;
|
||||
}
|
||||
|
||||
.post_body {
|
||||
display: inline;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.post {
|
||||
@@ -242,6 +246,10 @@ html {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
#postform_attachment {
|
||||
max-width: 330px;
|
||||
}
|
||||
|
||||
#faq > div {
|
||||
margin-left: 20%;
|
||||
width: 50%;
|
||||
@@ -249,5 +257,72 @@ html {
|
||||
}
|
||||
|
||||
#captcha_img {
|
||||
background: grey;
|
||||
background: #4DA6BD;
|
||||
}
|
||||
|
||||
figure {
|
||||
float: left;
|
||||
margin: 1ex;
|
||||
}
|
||||
figure img {
|
||||
max-width:256px;
|
||||
max-height:128px;
|
||||
max-width:100%;
|
||||
}
|
||||
fieldset {
|
||||
overflow: auto;
|
||||
border-radius: 5px 0px 5px 0px;
|
||||
}
|
||||
|
||||
fieldset > img {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.thread {
|
||||
float: left;
|
||||
width: 90%;
|
||||
padding-left: 10px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #252525;
|
||||
}
|
||||
|
||||
.replybar {
|
||||
float: left;
|
||||
position: fixed;
|
||||
top: 2ex;
|
||||
right: 0;
|
||||
width: 34%
|
||||
}
|
||||
@media (max-width: 100ex) {
|
||||
.replybar, .thread {
|
||||
width: 100%;
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
|
||||
.hide-reply:checked ~ div {
|
||||
width: 100%;
|
||||
position: static;
|
||||
}
|
||||
|
||||
textarea#reply-text {
|
||||
width: 100%;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.hide-reply {
|
||||
float: right;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
#nntpchan_banner {
|
||||
align: center;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
put your custom stylesheet here
|
||||
*/
|
||||
27
contrib/templates/chen-chan/board.mustache
Normal 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>
|
||||
33
contrib/templates/chen-chan/boardlist.mustache
Normal 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>
|
||||
11
contrib/templates/chen-chan/frontpage.mustache
Normal 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>
|
||||
36
contrib/templates/chen-chan/graph_history.mustache
Normal 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>
|
||||
15
contrib/templates/chen-chan/keygen.mustache
Normal 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>
|
||||
7
contrib/templates/chen-chan/modlogin.mustache
Normal 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>
|
||||
9
contrib/templates/chen-chan/modlogin_result.mustache
Normal 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>
|
||||
79
contrib/templates/chen-chan/modpage.mustache
Normal 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>
|
||||
12
contrib/templates/chen-chan/navbar.mustache
Normal 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>
|
||||
1
contrib/templates/chen-chan/newboard.mustache
Normal file
@@ -0,0 +1 @@
|
||||
no apparently.
|
||||
7
contrib/templates/chen-chan/overview.mustache
Normal 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>
|
||||
15
contrib/templates/chen-chan/post.mustache
Normal 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>
|
||||
3
contrib/templates/chen-chan/post_fail.mustache
Normal 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>
|
||||
40
contrib/templates/chen-chan/post_retry.mustache
Normal 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>
|
||||
7
contrib/templates/chen-chan/post_success.mustache
Normal 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>
|
||||
20
contrib/templates/chen-chan/postform.mustache
Normal 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>
|
||||
7
contrib/templates/chen-chan/posts_graph.mustache
Normal 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>
|
||||
23
contrib/templates/chen-chan/thread.mustache
Normal 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>
|
||||
19
contrib/templates/chen-chan/ukko.mustache
Normal 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>
|
||||
@@ -14,7 +14,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{board.Prefix}}static/site.css"></link>
|
||||
<meta name="viewport" content="initial-scale=1" />
|
||||
<link rel="stylesheet" href="{{board.Prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{board.Prefix}}static/user.css" />
|
||||
<script type="text/javascript" src="{{board.Prefix}}static/nntpchan.js"></script>
|
||||
<title>{{board.Board}}</title>
|
||||
</head>
|
||||
@@ -22,7 +24,10 @@
|
||||
<!-- begin navbar -->
|
||||
{{{board.Navbar}}}
|
||||
<!-- end navbar -->
|
||||
|
||||
<center>
|
||||
<div id="nntpchan_banner">
|
||||
</div>
|
||||
</center>
|
||||
<!-- postform -->
|
||||
<div id="postform_container">
|
||||
{{{form}}}
|
||||
@@ -39,9 +44,13 @@
|
||||
<br />
|
||||
{{/Truncate.Replies}}
|
||||
</div>
|
||||
<br/>
|
||||
<hr/>
|
||||
{{/board.Threads}}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
var e = document.getElementById("nntpchan_banner");
|
||||
nntpchan_inject_banners(e, "{{board.Prefix}}");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
49
contrib/templates/default/boardlist.mustache
Normal file
@@ -0,0 +1,49 @@
|
||||
{{!
|
||||
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 )
|
||||
}}
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css"></link>
|
||||
<title> {{frontend}} board list </title>
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<div class="index-outer">
|
||||
<div class="index-inner">
|
||||
<table id="board_graph">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th> Board </th>
|
||||
<th> Post per Hour </th>
|
||||
<th> Post 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}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,9 @@
|
||||
{{!
|
||||
frontpage.mustache -- template for index.html
|
||||
template parameters:
|
||||
- graph ( a list of 4 string tuples: (board, posts_per_hour, posts_per_day, total_posts) )
|
||||
- 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 )
|
||||
@@ -9,7 +11,9 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<script src="{{prefix}}static/nntpchan.js" type="text/javascript"></script>
|
||||
<title> {{frontend}} on nntpchan </title>
|
||||
</head>
|
||||
<body>
|
||||
@@ -19,40 +23,61 @@
|
||||
<h1> {{frontend}} on nntpchan </h1>
|
||||
<h2>View the <a href="ukko.html">overboard</a></h2>
|
||||
<h3>Read the <a href="{{prefix}}static/faq.html">FAQ</a></h3>
|
||||
<h3>Join the <a href="https://qchat.rizon.net/?channels=#nntpchan">IRC</a></h3>
|
||||
<h3>Create a <a href="{{prefix}}new/">new board</a></h3>
|
||||
<h3>Join the IRC on <a href="https://qchat.rizon.net/?channels=#nntpchan">rizon</a> or <a href="irc://127.0.0.1:6668/overchan">irc2p</a></h3>
|
||||
<h3>Lurk on <a href="irc://allyour4nert7pkh.onion/overchan">URC</a></h3>
|
||||
<h3>Check out the <a href="{{prefix}}boards.html">board list</a></h3>
|
||||
<h3>Fork on github: <a href="https://github.com/majestrate/nntpchan/">frontend</a> and <a href="https://github.com/majestrate/srndv2/">core</a></h3>
|
||||
<h4>We've Had {{totalposts}} Posts Since August 01 2015 </h4>
|
||||
</div>
|
||||
<div id="nntpchan_banner">
|
||||
</div>
|
||||
<div class="index-inner">
|
||||
<table id="board_graph">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th> Board </th>
|
||||
<th> Post per Hour </th>
|
||||
<th> Post per Day </th>
|
||||
<th> Total </th>
|
||||
</tr>
|
||||
{{# graph}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{prefix}}{{Board}}-0.html">{{Board}}</a>
|
||||
<td class="posts_td">
|
||||
{{{postsgraph.Render}}}
|
||||
</td>
|
||||
<td>
|
||||
{{Hour}}
|
||||
</td>
|
||||
<td>
|
||||
{{Day}}
|
||||
</td>
|
||||
<td>
|
||||
{{All}}
|
||||
<td class="board_td">
|
||||
{{! todo: move boardgraph into its own file like postsgraph }}
|
||||
<table id="board_graph">
|
||||
<tbody>
|
||||
<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}}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{{/ graph}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{{overview.Render}}}
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
<script type="text/javascript">
|
||||
var e = document.getElementById("nntpchan_banner");
|
||||
nntpchan_inject_banners(e, "{{prefix}}");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
36
contrib/templates/default/graph_history.mustache
Normal 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}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/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>
|
||||
@@ -9,7 +9,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"></meta>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<title> here is a new tripcode </title>
|
||||
</head>
|
||||
<body>
|
||||
@@ -17,4 +18,4 @@
|
||||
<div id="secret_key">secret: {{secret}}</div><div id="public_key">public: {{public}}</div><div>tripcode: <span class="tripcode" id="capcode_key">{{{tripcode}}}</span></div>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link ref="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<title>login</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
- 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 )
|
||||
- fail ( present if the login failed ) // not yet added
|
||||
}}
|
||||
<html>
|
||||
<head>
|
||||
<link ref="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<meta http-equiv="refresh" content="1; {{mod_prefix}}"></meta>
|
||||
<title>login</title>
|
||||
</head>
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
}}
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<!-- yes it uses js -->
|
||||
<script type="text/javascript" src="{{prefix}}static/mod.js"></script>
|
||||
<title> nntpchan mod page </title>
|
||||
@@ -38,11 +39,32 @@
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div>
|
||||
<div> nntp login </div>
|
||||
<div>
|
||||
<label for="nntpchan_nntp_username">username:</label>
|
||||
<input id="nntpchan_nntp_username" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="nntpchan_nntp_passwd">password:</label>
|
||||
<input type="password" id="nntpchan_nntp_passwd" />
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="nntpchan_admin_nntp('nntp.login.add')">add user</button>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="nntpchan_admin_nntp('nntp.login.del')">remove user</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div>
|
||||
<div> board actions </div>
|
||||
<div>
|
||||
<label for="nntpchan_board_target">board name:</label>
|
||||
<input type="text" id="nntpchan_board_target" />
|
||||
<input id="nntpchan_board_target" />
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="nntpchan_admin_board('frontend.add')">add board</button>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="nntpchan_admin_board('frontend.regen')">regenerate</button>
|
||||
@@ -69,7 +91,7 @@
|
||||
<label>very load heavy actions, use with care</label>
|
||||
<div>
|
||||
<button onclick="nntpchan_admin('frontend.regen')">regenerate all pages</button>
|
||||
<button onclick="nntpchan_admin('thumbnail.regen', {threads:1})">regenerate all thumbnails</button>
|
||||
<button onclick="nntpchan_admin('thumbnail.regen')">regenerate all thumbnails</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="nntpchan_mod_result"></div>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<head>
|
||||
<title>create new board</title>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<script type="text/javascript" src="{{prefix}}static/newboard.js">
|
||||
</script>
|
||||
</head>
|
||||
@@ -27,7 +28,7 @@
|
||||
Comment
|
||||
</th>
|
||||
<td>
|
||||
<textarea id="postform_message" type="text" name="message" cols=40 rows=5></textarea>
|
||||
<textarea id="postform_message" name="message" cols=40 rows=5></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -52,4 +53,4 @@
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
25
contrib/templates/default/overview.mustache
Normal file
@@ -0,0 +1,25 @@
|
||||
{{! overview.mustache
|
||||
paramters:
|
||||
|
||||
- overview (list of PostModels in order of last posted)
|
||||
|
||||
}}
|
||||
|
||||
<table id="overview_graph">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Newsgroup</th>
|
||||
<th>Posted</th>
|
||||
<th>Subject</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#overview}}
|
||||
<tr>
|
||||
<td><a href="{{Prefix}}{{Board}}-0.html">{{Board}}</td>
|
||||
<td>{{Date}}</td>
|
||||
<td><a href="{{PostURL}}">{{Truncate.Subject}}</a></td>
|
||||
</tr>
|
||||
{{/overview}}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,52 +1,26 @@
|
||||
<div class="{{CSSClass}}" id="{{PostHash}}">
|
||||
<p class="intro">
|
||||
<label for="delete_{{PostHash}}">
|
||||
<span class="frontend">
|
||||
[[ {{Frontend}} ]]
|
||||
</span>
|
||||
<span class="origin">
|
||||
{{#IsI2P}}
|
||||
<img src="{{Prefix}}static/i2p.png" alt="post from i2p" />
|
||||
{{/IsI2P}}
|
||||
{{#IsTor}}
|
||||
<img src="{{Prefix}}static/tor.png" alt="post from tor" />
|
||||
{{/IsTor}}
|
||||
{{#IsClearnet}}
|
||||
<img src="{{Prefix}}static/clearnet.png" alt="post from clearnet" />
|
||||
{{/IsClearnet}}
|
||||
</span>
|
||||
<span class="subject">
|
||||
{{Subject}}
|
||||
</span>
|
||||
<span class="name">
|
||||
{{#Sage}}
|
||||
<a href="mailto:sage">
|
||||
{{Name}}
|
||||
</a>
|
||||
{{/Sage}}
|
||||
{{^Sage}}
|
||||
{{Name}}
|
||||
{{/Sage}}
|
||||
</span>
|
||||
<span class="postdate">
|
||||
{{Date}}
|
||||
</span>
|
||||
</label>
|
||||
<a onclick="nntpchan_backlink('{{ShortHash}}');">No. {{ShortHash}}</a>
|
||||
<a href="{{PostURL}}">[reply]</a>
|
||||
<span class="tripcode">{{{Pubkey}}}</span>
|
||||
</p>
|
||||
<div class="files">
|
||||
{{#Attachments}}
|
||||
<div class="file">
|
||||
<p class="file_info">
|
||||
<span>File: {{Filename}}</span>
|
||||
</p>
|
||||
<a target="_blank" class="file-link" href="{{Source}}" title="{{Filename}}">
|
||||
<img class="file-thumbnail" src="{{Thumbnail}}" alt="{{Filename}}" />
|
||||
</a>
|
||||
</div>
|
||||
{{/Attachments}}
|
||||
</div>
|
||||
<div class="post_body">{{{RenderBody}}}</div>
|
||||
</div>
|
||||
<fieldset>
|
||||
{{#IsI2P}}
|
||||
<img src="{{Prefix}}static/i2p.png" title="post from i2p" />
|
||||
{{/IsI2P}}
|
||||
{{#IsTor}}
|
||||
<img src="{{Prefix}}static/tor.png" title="post from tor" />
|
||||
{{/IsTor}}
|
||||
{{#IsClearnet}}
|
||||
<img src="{{Prefix}}static/clearnet.png" title="post from clearnet" />
|
||||
{{/IsClearnet}}
|
||||
<legend>
|
||||
<span class="subject">{{Subject}}</span> <span class="name">{{Name}}</span> {{Date}}
|
||||
No. <a onclick="nntpchan_backlink('{{ShortHash}}');" title="{{MessageID}}">{{ShortHash}}</a>
|
||||
<a href="{{PostURL}}">[reply]</a> <span class="tripcode">{{{Pubkey}}}</span><br />
|
||||
</legend>
|
||||
{{#Attachments}}
|
||||
<figure>
|
||||
<figcaption>
|
||||
<a href="{{Source}}" title="{{Filename}}" target="_blank"><img src="{{Thumbnail}}" alt="{{Filename}}" /></a>
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{/Attachments}}
|
||||
<label class="post_body">
|
||||
{{{RenderBody}}}
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<meta http-equiv="refresh" content="1; {{redirect_url}}" />
|
||||
<body>
|
||||
<p>post failed: {{reason}}</p>
|
||||
|
||||
48
contrib/templates/default/post_retry.mustache
Normal file
@@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<title> try again </title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
</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>
|
||||
@@ -6,7 +6,8 @@
|
||||
}}
|
||||
<html>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<meta http-equiv="refresh" content="2; {{redirect_url}}" />
|
||||
<body>
|
||||
<pre>posted as {{message_id}}</pre>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
- 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 )
|
||||
- files ( bool, do we allow attachments ? )
|
||||
}}
|
||||
<form action="{{post_url}}" enctype="multipart/form-data" name="post" method="post">
|
||||
<input type="hidden" name="reference" value="{{reference}}" />
|
||||
@@ -34,15 +35,25 @@
|
||||
Comment
|
||||
</th>
|
||||
<td>
|
||||
<textarea id="postform_message" type="text" name="message" cols=40 rows=5></textarea>
|
||||
<textarea id="postform_message" name="message" cols=40 rows=5></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
{{#files}}
|
||||
<tr>
|
||||
<th>
|
||||
File
|
||||
</th>
|
||||
<td>
|
||||
<input type="file" name="attachment" />
|
||||
<input id="postform_attachment" type="file" name="attachment" />
|
||||
</td>
|
||||
</tr>
|
||||
{{/files}}
|
||||
<tr>
|
||||
<th>
|
||||
Get Dubs
|
||||
</th>
|
||||
<td>
|
||||
<input type="checkbox" name="dubs" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -66,4 +77,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<div class="thread_reply" id="post_{{PostHash}}">
|
||||
<p class="intro">
|
||||
<label for="delete_{{PostHash}}">
|
||||
<span class="subject">
|
||||
{{Subject}}
|
||||
</span>
|
||||
<span class="name">
|
||||
{{#Sage}}
|
||||
<a href="mailto:sage">
|
||||
{{Name}}
|
||||
</a>
|
||||
{{/Sage}}
|
||||
{{^Sage}}
|
||||
{{Name}}
|
||||
{{/Sage}}
|
||||
</span>
|
||||
<time
|
||||
</label>
|
||||
<a href="{{PostURL}}" onclick="">
|
||||
No. {{PostHash}}
|
||||
</a>
|
||||
</p>
|
||||
<div class="files">
|
||||
{{#Image}}
|
||||
<a class="file" href="{{Source}}">
|
||||
<img class="file-thumbnail" src="{{Thumbnail}}" />
|
||||
</a>
|
||||
{{/Image}}
|
||||
</div>
|
||||
<div class="thread_reply_body">
|
||||
{{{RenderBody}}}
|
||||
</div>
|
||||
</div>
|
||||
25
contrib/templates/default/posts_graph.mustache
Normal file
@@ -0,0 +1,25 @@
|
||||
{{!
|
||||
posts graph.mustache -- post frequence graph
|
||||
parameters:
|
||||
|
||||
* graph - a postsGraph instance (see srnd/model.go)
|
||||
}}
|
||||
|
||||
<table id="posts_graph">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Day</th>
|
||||
<th>Posts</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#graph.Scale}}
|
||||
<tr>
|
||||
<td>{{Day}}</td>
|
||||
<td>{{Num}}</td>
|
||||
<td>{{OvercockGraph}}</td>
|
||||
</tr>
|
||||
{{/graph.Scale}}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -14,8 +14,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{thread.Prefix}}static/site.css"></link>
|
||||
<script type="text/javascript" src="{{thread.Prefix}}static/nntpchan.js"></script>
|
||||
<meta name="viewport" content="initial-scale=1" />
|
||||
<link rel="stylesheet" href="{{thread.Prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{thread.Prefix}}static/user.css" />
|
||||
<script src="{{thread.Prefix}}static/nntpchan.js" type="text/javascript"></script>
|
||||
<title> {{thread.OP.Subject}} </title>
|
||||
</head>
|
||||
<body>
|
||||
@@ -23,7 +25,10 @@
|
||||
<!-- begin navbar -->
|
||||
{{{thread.Navbar}}}
|
||||
<!-- end navbar -->
|
||||
|
||||
<center>
|
||||
<div id="nntpchan_banner">
|
||||
</div>
|
||||
</center>
|
||||
<!-- postform -->
|
||||
<div id="postform_container">
|
||||
{{{form}}}
|
||||
@@ -39,6 +44,11 @@
|
||||
{{/ thread.Replies}}
|
||||
</div>
|
||||
<br/>
|
||||
<hr/>
|
||||
<script type="text/javascript">
|
||||
var e = document.getElementById("nntpchan_banner");
|
||||
nntpchan_inject_banners(e, "{{thread.Prefix}}");
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -8,15 +8,22 @@
|
||||
<head>
|
||||
<title> ukko / overboard </title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css"></link>
|
||||
<link rel="stylesheet" href="{{prefix}}static/site.css" />
|
||||
<link rel="stylesheet" href="{{prefix}}static/user.css" />
|
||||
<script type="text/javascript" src="{{prefix}}static/nntpchan.js"></script>
|
||||
</head>
|
||||
</head>
|
||||
<body>
|
||||
<div id="ukko_threads" class="threads_container">
|
||||
<center>
|
||||
<div id="nntpchan_banner">
|
||||
</div>
|
||||
</center>
|
||||
<div id="ukko_threads">
|
||||
{{#threads}}
|
||||
<!--
|
||||
<div class="ukko_thread_header">
|
||||
<p> Posted on <a href="{{{BoardURL}}}"><span class="ukko_boardname">{{OP.Board}}</span></a></p>
|
||||
</div>
|
||||
-->
|
||||
<div class="thread" id="thread_{{OP.PostHash}}">
|
||||
<div clsss="thread_header">
|
||||
</div>
|
||||
@@ -26,8 +33,12 @@
|
||||
<br />
|
||||
{{/Truncate.Replies}}
|
||||
</div>
|
||||
<hr/>
|
||||
{{/threads}}
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" >
|
||||
var e = document.getElementById("nntpchan_banner");
|
||||
nntpchan_inject_banners(e, "{{prefix}}");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
44
contrib/tools/api/post.js
Normal file
@@ -0,0 +1,44 @@
|
||||
var http = require('http');
|
||||
|
||||
req = {
|
||||
message: "test api",
|
||||
frontend: "benis.tld",
|
||||
name: "benisname",
|
||||
subject: "ayyyyyy testing api",
|
||||
/*
|
||||
file: {
|
||||
name: "benis.gif",
|
||||
type: "image/gif",
|
||||
data: // base64'd string here
|
||||
},
|
||||
*/
|
||||
email: "sage",
|
||||
ip: "8.8.8.8",
|
||||
dubs: false,
|
||||
newsgroup: "overchan.test",
|
||||
|
||||
// only include if we are replying to someone
|
||||
reference: "<b7dee1453564515@benis.tld>"
|
||||
}
|
||||
|
||||
j = JSON.stringify(req);
|
||||
|
||||
var r = http.request({
|
||||
port: 8800,
|
||||
method: "POST",
|
||||
path: "/api/post",
|
||||
auth: "user:pass",
|
||||
headers: {
|
||||
"Content-Type": "text/json",
|
||||
"Content-Length": j.length
|
||||
}
|
||||
}, function (res) {
|
||||
res.on('data', function (chunk) {
|
||||
var r = chunk.toString();
|
||||
var rj = JSON.parse(r);
|
||||
console.log(rj.id);
|
||||
});
|
||||
});
|
||||
|
||||
r.write(j);
|
||||
r.end();
|
||||
180
contrib/tools/archive/nntparchive/archiver.py
Executable file
@@ -0,0 +1,180 @@
|
||||
#!/usr/bin/env python3.4
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup as BS
|
||||
|
||||
import datetime
|
||||
import io
|
||||
import nntplib
|
||||
import time
|
||||
import urllib.parse
|
||||
import base64
|
||||
import random
|
||||
|
||||
class Article:
|
||||
"""
|
||||
an nntp article
|
||||
"""
|
||||
|
||||
timeFormat = '%a, %d %b %Y %H:%M:%S +0000'
|
||||
|
||||
def __init__(self, j, board, site):
|
||||
"""
|
||||
construct article
|
||||
:param j: json object
|
||||
"""
|
||||
self.j = j
|
||||
self.board = board
|
||||
self.site = site
|
||||
self.messageID = self.genMessageID(j['no'])
|
||||
|
||||
def formatDate(self):
|
||||
return datetime.datetime.utcfromtimestamp(self.j['time']).strftime(self.timeFormat)
|
||||
|
||||
def message(self):
|
||||
m = ''
|
||||
# for each line
|
||||
for p in BS(self.j['com']).find_all('p'):
|
||||
# clean it
|
||||
m += p.text
|
||||
m += '\n'
|
||||
if len(m.rstrip('\n')) > 0:
|
||||
return m
|
||||
|
||||
def subject(self):
|
||||
if 'subject' in self.j:
|
||||
return self.j['subject']
|
||||
|
||||
def name(self):
|
||||
return self.j['name']
|
||||
|
||||
def group(self):
|
||||
return 'overchan.archive.{}.{}'.format(self.site, self.board)
|
||||
|
||||
def genMessageID(self, no):
|
||||
return '<{}.{}@{}>'.format(self.board, no, self.site)
|
||||
|
||||
def header(self):
|
||||
hdr = ("Subject: {}\n"+\
|
||||
"From: {} <archiver@srndv2.tools>\n"+\
|
||||
"Date: {}\n"+\
|
||||
"Newsgroups: {}\n"+\
|
||||
"Message-ID: {}\n"+\
|
||||
"Path: {}\n").format(self.subject(), self.name(), self.formatDate(), self.group(), self.messageID, self.site)
|
||||
if self.j['resto'] > 0:
|
||||
hdr += "References: {}\n".format(self.genMessageID(self.j['resto']))
|
||||
if 'filename' in self.j:
|
||||
hdr += 'Mime-Version: 1.0\n'
|
||||
hdr += 'Content-Type: multipart/mixed; boundary="{}"\n'.format(self.boundary)
|
||||
else:
|
||||
hdr += 'Content-Type: text/plain; encoding="UTF-8"\n'
|
||||
return hdr
|
||||
|
||||
def bodyPlain(self):
|
||||
msg = self.message()
|
||||
if msg:
|
||||
return "{}\n{}".format(self.header(), msg)
|
||||
|
||||
def bodyMultipart(self):
|
||||
self.boundary = '========{}'.format(random.randint(0, 10000000))
|
||||
msg = self.header() + '\n'
|
||||
msg += '--{}\n'.format(self.boundary)
|
||||
msg += 'Content-Type: text/plain; encoding=UTF-8\n'
|
||||
msg += '\n'
|
||||
msg += self.message() + '\n'
|
||||
msg += '--{}\n'.format(self.boundary)
|
||||
mtype = 'image'
|
||||
if self.j['ext'] in ['.mp4', '.webm']:
|
||||
mtype = 'video'
|
||||
msg += 'Content-Type: {}/{}\n'.format(mtype, self.j['ext'])
|
||||
msg += 'Content-Disposition: form-data; filename="{}{}"; name="import"\n'.format(self.j['filename'], self.j['ext'])
|
||||
msg += 'Content-Transfer-Encoding: base64\n'
|
||||
msg += '\n'
|
||||
url = 'https://{}/{}/src/{}{}'.format(self.site, self.board, self.j['tim'], self.j['ext'])
|
||||
print ('obtain {}'.format(url))
|
||||
|
||||
r = requests.get(url)
|
||||
if r.status_code == 200:
|
||||
msg += base64.b64encode(r.content).decode('ascii')
|
||||
msg += '\n'
|
||||
else:
|
||||
print ('failed to obtain attachment: {} != 200'.format(r.status_code))
|
||||
return
|
||||
msg += '\n--{}--\n'.format(self.boundary)
|
||||
return msg
|
||||
|
||||
def body(self):
|
||||
if 'filename' in self.j:
|
||||
return self.bodyMultipart()
|
||||
else:
|
||||
return self.bodyPlain()
|
||||
|
||||
class Poster:
|
||||
|
||||
def __init__(self, host, port):
|
||||
self.host, self.port = host, port
|
||||
|
||||
def post(self, articles):
|
||||
"""
|
||||
post 1 or more articles
|
||||
"""
|
||||
if isinstance(articles, Article):
|
||||
return self.post([articles])
|
||||
else:
|
||||
n = nntplib.NNTP(self.host, self.port)
|
||||
for article in articles:
|
||||
body = article.body()
|
||||
if body:
|
||||
print("posting {}".format(article.messageID))
|
||||
try:
|
||||
body = io.BytesIO(body.encode('utf-8'))
|
||||
n.ihave(article.messageID, body)
|
||||
except Exception as e:
|
||||
print('failed: {}'.format(e))
|
||||
n.quit()
|
||||
|
||||
|
||||
def url_parse(url):
|
||||
return urllib.parse.urlparse(url)
|
||||
|
||||
class Getter:
|
||||
|
||||
def __init__(self, url):
|
||||
self.url = url
|
||||
self.site = url_parse(url).hostname
|
||||
self.board = url_parse(url).path.split('/')[1]
|
||||
|
||||
def get(self):
|
||||
"""
|
||||
yield a bunch of articles
|
||||
"""
|
||||
r = requests.get(self.url)
|
||||
if r.status_code == 200:
|
||||
try:
|
||||
j = r.json()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
if 'threads' in j:
|
||||
for t in j['threads']:
|
||||
posts = t['posts']
|
||||
for post in posts:
|
||||
yield Article(post, self.board, self.site)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument('--server', type=str, required=True)
|
||||
ap.add_argument('--port', type=int, required=True)
|
||||
ap.add_argument('--board', type=str, required=True)
|
||||
args = ap.parse_args()
|
||||
poster = Poster(args.server, args.port)
|
||||
for n in range(10):
|
||||
getter = Getter('https://8ch.net/{}/{}.json'.format(args.board, n))
|
||||
poster.post(getter.get())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
10
contrib/tools/keys/keys.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# script to make sql file for inserting all "currently trusted" keys
|
||||
#
|
||||
|
||||
root=$(readlink -e $(dirname $0))
|
||||
touch $root/keys.sql
|
||||
for key in $(cat $root/keys.txt) ; do
|
||||
echo "insert into modprivs(pubkey, newsgroup, permission) values('$key', 'overchan', 'all');" >> keys.sql ;
|
||||
done
|
||||
10
contrib/tools/keys/keys.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('039a876792db66966241e63140e7df79df488033360064b67d890635814e925e', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('286650cac49fc540507a2b6593fa7aba7c5101e4314b6e5cfee1e64810a85bb7', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('c85aed0939fa1677bf9f354d8ac3dc9b1132cabea22b152247fa59cfc3d42d4f', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('fcd5fdffdb742a696a6d4df3a06d5c180aa523f2900b13fe893556832a1171f4', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('7227245429c46262baabfc3ce8e27b584b22262ad5c074bac4f05e0c7e2d9106', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('0c701740b6f6e799fb08354150265e19553535d2bd168f55067134d4a61449ac', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('ce39e0ea3c056e02e086063296c12fd36b8bf9530ab694bc645b48684004f946', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('d03da6ab445729f5f38f478fbefc5226bb1d58393a3b5a6852ec89c3ababc314', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('ce39e0ea3c056e02e086063296c12fd36b8bf9530ab694bc645b48684004f946', 'overchan', 'all');
|
||||
insert into modprivs(pubkey, newsgroup, permission) values('6440e2e383a802f2d487c71d2018b9dc53529e5d234e668c156aec97dae8fe6b', 'overchan', 'all');
|
||||
10
contrib/tools/keys/keys.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
039a876792db66966241e63140e7df79df488033360064b67d890635814e925e
|
||||
286650cac49fc540507a2b6593fa7aba7c5101e4314b6e5cfee1e64810a85bb7
|
||||
c85aed0939fa1677bf9f354d8ac3dc9b1132cabea22b152247fa59cfc3d42d4f
|
||||
fcd5fdffdb742a696a6d4df3a06d5c180aa523f2900b13fe893556832a1171f4
|
||||
7227245429c46262baabfc3ce8e27b584b22262ad5c074bac4f05e0c7e2d9106
|
||||
0c701740b6f6e799fb08354150265e19553535d2bd168f55067134d4a61449ac
|
||||
ce39e0ea3c056e02e086063296c12fd36b8bf9530ab694bc645b48684004f946
|
||||
d03da6ab445729f5f38f478fbefc5226bb1d58393a3b5a6852ec89c3ababc314
|
||||
ce39e0ea3c056e02e086063296c12fd36b8bf9530ab694bc645b48684004f946
|
||||
6440e2e383a802f2d487c71d2018b9dc53529e5d234e668c156aec97dae8fe6b
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# shell script for regenerating thumbnails
|
||||
#
|
||||
|
||||
if [ "$1" == "" ] ; then
|
||||
echo "usage: $0 webroot_dir"
|
||||
else
|
||||
cd $1/img
|
||||
echo "regenerate missing thumbs in $(pwd)"
|
||||
find . \
|
||||
-type f \
|
||||
-regextype posix-extended \
|
||||
-iregex '.*\.(png|jpg|gif)$' \
|
||||
-not -execdir test -f '../thm/{}' \; \
|
||||
-exec echo 'generating missing thumb for {}' \; \
|
||||
-exec mogrify \
|
||||
-define jpeg:size=500x500 \
|
||||
-thumbnail '250>x250>' \
|
||||
-path '../thm/{}.jpg' \
|
||||
-strip \
|
||||
'{}' \;
|
||||
fi
|
||||
11
doc/api.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# nntpchan jsonrpc api
|
||||
|
||||
To enable set the following in `srnd.ini` section `frontend`
|
||||
|
||||
[frontend]
|
||||
...
|
||||
json-api = 1
|
||||
json-api-username = something-really-long
|
||||
json-api-password = somethine-different-but-also-very-long
|
||||
|
||||
see the example tool at `contrib/tools/api/post.js`
|
||||
47
doc/build.md
@@ -4,7 +4,7 @@
|
||||
## requirements ##
|
||||
|
||||
* linux or freebsd
|
||||
* go 1.4 or higher
|
||||
* go 1.3 or higher
|
||||
* libsodium 1.0 or higher
|
||||
* imagemagick
|
||||
* ffmpegthumbnailer
|
||||
@@ -12,46 +12,17 @@
|
||||
|
||||
## debian ##
|
||||
|
||||
Debian Jessie has go 1.3, we need 1.4 or higher to build the nntpchan daemon so let's do that first, assumes 64bit linux:
|
||||
|
||||
#
|
||||
# --->> DO NOT RUN AS ROOT <<---
|
||||
# (you probably will break stuff really bad if you do)
|
||||
#
|
||||
Get the dependancies
|
||||
|
||||
# make directory for go's packages
|
||||
mkdir -p $HOME/go
|
||||
|
||||
# set up a directory for our go distribution
|
||||
mkdir -p $HOME/local
|
||||
cd $HOME/local
|
||||
|
||||
# obtain and unpack go binary distribution
|
||||
wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz -O go-stable.tar.gz
|
||||
tar -xzvf go-stable.tar.gz
|
||||
|
||||
# set up environmental variables for go
|
||||
export GOROOT=$HOME/local/go
|
||||
export GOPATH=$HOME/go
|
||||
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
|
||||
|
||||
# put environmental variables in bash_alises for later
|
||||
echo 'export GOROOT=$HOME/local/go' >> $HOME/.bash_aliases
|
||||
echo 'export GOPATH=$HOME/go' >> $HOME/.bash_aliases
|
||||
echo 'export PATH=$GOROOT/bin:$GOPATH/bin:$PATH' >> $HOME/.bash_aliases
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install imagemagick libsodium-dev ffmpegthumbnailer sox build-essential git golang ca-certificates
|
||||
|
||||
|
||||
We'll also need to install some dependancies that come with debian:
|
||||
Check out the repo and build it
|
||||
|
||||
# as root
|
||||
|
||||
apt update
|
||||
apt install imagemagick libsodium-dev ffmpegthumbnailer sox
|
||||
|
||||
Now build the daemon:
|
||||
|
||||
go get github.com/majestrate/srndv2
|
||||
go install github.com/majestrate/srndv2
|
||||
|
||||
It will create an executable at $GOPATH/bin/srndv2 which is already in our $PATH so it can be run by typing ``srndv2``
|
||||
git clone https://github.com/majestrate/nntpchan
|
||||
cd nntpchan
|
||||
./build.sh
|
||||
|
||||
Now configure the database. [next](database.md)
|
||||
|
||||
20
doc/cli.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# command line interface
|
||||
|
||||
# rebuild all thumbnails
|
||||
srndv2 tool rethumb
|
||||
|
||||
# generate a new tripcode keypair
|
||||
# print out to stdout
|
||||
srndv2 tool keygen
|
||||
|
||||
# add an nntp login
|
||||
srndv2 tool nntp add-login username password
|
||||
|
||||
# remove an nntp login
|
||||
srndv2 tool nntp del-login username
|
||||
|
||||
# add public key to moderation trust
|
||||
srndv2 tool mod add publickeygoeshere
|
||||
|
||||
# remove public key from moderation trust
|
||||
srndv2 tool mod del publickeygoeshere
|
||||
9
doc/configuration.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Configuration #
|
||||
|
||||
In nntpchan's stack there are currently 2 configuration files.
|
||||
|
||||
All config files are auto generated with sane defaults if the files are not present.
|
||||
|
||||
[feeds.ini](feeds.md) is for all your nntp outfeeds
|
||||
|
||||
[srnd.ini](srnd.md) is for the core daemon
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
Postgres on Debian:
|
||||
Postgres on Debian (as root)
|
||||
|
||||
|
||||
# install
|
||||
apt-get install postgresql postgresql-client
|
||||
# install as root
|
||||
apt-get install --no-install-recommends postgresql postgresql-client
|
||||
|
||||
|
||||
Setting up postgres (as root)
|
||||
@@ -11,13 +10,19 @@ Setting up postgres (as root)
|
||||
# become postgres user
|
||||
su postgres
|
||||
# spawn postgres admin shell
|
||||
psql
|
||||
psql
|
||||
|
||||
You'll get a prompt, enter the following:
|
||||
|
||||
CREATE ROLE srnduser WITH LOGIN PASSWORD 'srndpassword';
|
||||
CREATE DATABASE srnd WITH ENCODING 'UTF8' OWNER srnduser;
|
||||
CREATE ROLE srnd WITH LOGIN PASSWORD 'srnd';
|
||||
CREATE DATABASE srnd WITH ENCODING 'UTF8' OWNER srnd;
|
||||
\q
|
||||
|
||||
Change the username and password as desired.
|
||||
For demo purposes we'll use these credentials.
|
||||
These are default values, please change them later.
|
||||
|
||||
## important
|
||||
|
||||
these credentials assume you are going to run using a user called `srnd`, if your username you plan to run the daemon as is different please change `srnd` to your username.
|
||||
|
||||
Now run it, [next](running.md)
|
||||
|
||||
180
doc/feeds.md
Normal file
@@ -0,0 +1,180 @@
|
||||
# feeds.ini #
|
||||
|
||||
## Peering ##
|
||||
|
||||
In order to actually be distributed, you need another person to sync posts with, otherwise what's the point right?
|
||||
|
||||
### Peering over the regular internet with tls ###
|
||||
|
||||
Requirements:
|
||||
|
||||
* Each Side's server must have a domain name
|
||||
* Each Side must have each other's certificates (.crt files) in the `certs` folder
|
||||
* Each Side's `srnd.ini` crypto section must have entry `tls-hostname = domain.tld` where domain.tld is the domain name of the server it is on
|
||||
* Each Side's `srnd.ini` nntp section must have entry `require_tls = 1`
|
||||
|
||||
|
||||
If Alice owns `nntp.alice.net` and Bob owns `nntp.bob.com` and are both using port 1199 the configs for each side are as follows:
|
||||
|
||||
# alice's srnd.ini crypto section
|
||||
...
|
||||
[crypto]
|
||||
tls-hostname = nntp.alice.net
|
||||
tls-trust-dir = certs
|
||||
tls-keyname = overchan-alice
|
||||
|
||||
|
||||
# alice's feeds.ini
|
||||
[feed-bob]
|
||||
host = nntp.bob.com
|
||||
port = 1199
|
||||
|
||||
[bob]
|
||||
overchan.* = 1
|
||||
ctl = 1
|
||||
|
||||
|
||||
|
||||
# bob's srnd.ini crypto section
|
||||
...
|
||||
[crypto]
|
||||
tls-hostname = nntp.bob.com
|
||||
tls-trust-dir = certs
|
||||
tls-keyname = overchan-bob
|
||||
|
||||
|
||||
|
||||
# bob's feeds.ini
|
||||
[feed-alice]
|
||||
host = nntp.alice.net
|
||||
port = 1199
|
||||
|
||||
[alice]
|
||||
overchan.* = 1
|
||||
ctl = 1
|
||||
|
||||
each side's `certs` directory contains 2 files:
|
||||
|
||||
* overchan-alice-nntp.alice.net.crt (alice's certificate)
|
||||
* overchan-bob-nntp.bob.com.crt (bob's certificate)
|
||||
|
||||
Alice keeps `overchan-alice-nntp.alice.net.key` secret and never shares it
|
||||
|
||||
Bob keeps `overchan-bob-nntp.bob.com.key` secret and never shares it
|
||||
|
||||
|
||||
### Peering Authentication with passwords ###
|
||||
|
||||
adding / removing credentials via the command line:
|
||||
|
||||
# add an nntp login via command line
|
||||
srndv2 tool nntp add-login user-name-here pass-word-here
|
||||
|
||||
# remove an nntp login via command line
|
||||
srndv2 tool nntp del-login user-name-here
|
||||
|
||||
exmaple feeds.ini:
|
||||
|
||||
# section pair in feeds.ini
|
||||
# connects to nntp.something.tld:1199 and authenticates with a username and password
|
||||
# sync = 1 makes you download all applicable posts from the remote server on startup
|
||||
|
||||
[feed-authenticated]
|
||||
host = nntp.something.tld
|
||||
port = 1199
|
||||
username = user-user-here
|
||||
password = pass-word-here
|
||||
sync = 1
|
||||
|
||||
[authenticated]
|
||||
overchan.* = 1
|
||||
ctl = 1
|
||||
|
||||
|
||||
### Peering over tor ###
|
||||
|
||||
Install tor
|
||||
|
||||
apt-get install tor
|
||||
|
||||
Make a tor hidden service point from outside port 119 to port 1199
|
||||
Add to /etc/tor/torrc:
|
||||
|
||||
HiddenServiceDir /var/lib/tor/nntp_feed
|
||||
HiddenServicePort 119 127.0.0.1:1199
|
||||
|
||||
restart/reload tor then
|
||||
|
||||
cat /var/lib/tor/nntp_feed/hostname
|
||||
|
||||
This is your in feed address
|
||||
|
||||
If you use an onion with tls, `srnd.ini` crypto section should have the entry `tls-hostname = youroniongoeshere.onion`. If you don't use tls NEVER disclose the onion address to anyone not trusted.
|
||||
|
||||
Then to peer with someone over tor add this to you feeds.ini
|
||||
|
||||
[feed-ourpeer.onion]
|
||||
host=PeersOnionAddress.onion
|
||||
port=119
|
||||
proxy-type=socks4a
|
||||
proxy-host=127.0.0.1
|
||||
proxy-port=9050
|
||||
|
||||
[ourpeer.onion]
|
||||
overchan=1
|
||||
ctl=1
|
||||
|
||||
|
||||
## Options ##
|
||||
|
||||
#### You need one connection and one settings block for each connection ####
|
||||
|
||||
Here is an example entry in feeds.ini
|
||||
|
||||
[feed-them.onion]
|
||||
host=aabbccddeeff2233.onion
|
||||
port=119
|
||||
proxy-type=socks4a
|
||||
proxy-host=127.0.0.1
|
||||
proxy-port=9050
|
||||
username=somerandomusername
|
||||
password=somerandompassword
|
||||
|
||||
[them.onion]
|
||||
overchan=1
|
||||
ano.paste=0
|
||||
ctl=1
|
||||
|
||||
But what does it mean?
|
||||
|
||||
[feed-them.onion]
|
||||
|
||||
Connection settings for a peer
|
||||
|
||||
host=aabbccddeeff2233.onion
|
||||
port=119
|
||||
proxy-type=socks4a
|
||||
proxy-host=127.0.0.1
|
||||
proxy-port=9050
|
||||
|
||||
Proxy settings, straight forward. Supported proxy types are `socks4a` and `none`
|
||||
|
||||
[them.onion]
|
||||
|
||||
nntp synchronization settings
|
||||
|
||||
overchan=1
|
||||
|
||||
Sync all boards, use
|
||||
|
||||
overchan.bad=0
|
||||
|
||||
to prevent certain boards from syncing with certain peers. It can be used to keep bad boards out or keep exclusive boards in
|
||||
|
||||
ano.paste=0
|
||||
|
||||
This WILL be the nntpchan pastebin, but it's not implimented yet
|
||||
|
||||
ctl=1
|
||||
|
||||
Allows you to recieve moderation notifications from other boards, it's also used for decentralized moderation
|
||||
@@ -1,52 +0,0 @@
|
||||
## peering with other nodes ##
|
||||
|
||||
In order to actually be distributed, you need another person to sync posts with, otherwise what's the point right?
|
||||
|
||||
Right now peering information is private, there is no link level authenticatio (yet) so everything is done via either a vpn tunnel or a tor hidden service.
|
||||
|
||||
### Peering via cjdns vpn tunnel ###
|
||||
|
||||
Set up cjdns, read more [here](https://github.com/cjdelisle/cjdns/blob/master/doc/configure.md#connection-interfaces)
|
||||
|
||||
git clone https://github.com/cjdelisle/cjdns
|
||||
cd cjdns && ./do
|
||||
./cjdroute --genconf >> cjdroute.conf
|
||||
./cjdroute < cjdroute.conf
|
||||
|
||||
Get your ipv6 address for cjdns
|
||||
|
||||
ip addr show tun0
|
||||
|
||||
Edit srnd.ini to bind nntp on that ipv6 address, make sure to use the square brances `[` and `]`
|
||||
|
||||
[nntp]
|
||||
...
|
||||
bind=[xxxx:xxxx:xxxx:xxx:xx....]:1199
|
||||
|
||||
|
||||
say you have 2 friends at fc33:3:3::aadd and fc03:9f:123::a3df. right now feeds.ini can't take raw ipv6 addresses so add them to `/etc/hosts`
|
||||
|
||||
# add these lines to /etc/hosts
|
||||
fc33:3:3::aadd bob
|
||||
fc03:9f:123::a3df charlie
|
||||
|
||||
then add to feeds.ini the following:
|
||||
|
||||
|
||||
[feed-bob]
|
||||
proxy-type=none
|
||||
|
||||
[bob]
|
||||
overchan.*=1
|
||||
ctl=1
|
||||
|
||||
[feed-charlie]
|
||||
proxy-type=none
|
||||
|
||||
[charlie]
|
||||
overchan.*=1
|
||||
ctl=1
|
||||
|
||||
then restart srndv2
|
||||
|
||||
**TODO:** firewalling
|
||||
335
doc/protocol.md
Normal file
@@ -0,0 +1,335 @@
|
||||
Overchan is a newsgroup meant to be served on web frontends in an effort to create a decentralized imageboard. Moderation takes place on each frontend itself. Message and image transport is using MIME multipart messages and Base64 as encoding for Images. All messages need to be valid NNTP messages, the transport of messages need to follow NNTP specifications. It is possible to use an existing NNTP daemon like INN or to implement the NNTP sync part as well.
|
||||
|
||||
# Sync Protocol (NNTP)
|
||||
|
||||
## Article Format
|
||||
|
||||
### Monopart
|
||||
|
||||
Message without images can be sent without delimiting the message.
|
||||
|
||||
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
From: anonymous <foo@bar.ano>
|
||||
Date: Thu, 02 May 2013 12:16:44 +0000
|
||||
Message-ID: <pmc8xpmgyf2@foo.bar>
|
||||
Newsgroups: overchan.test
|
||||
Subject: none
|
||||
References: <referenced message-id>
|
||||
Path: hschan.ano
|
||||
X-Sage: optional
|
||||
|
||||
some visible message text
|
||||
|
||||
|
||||
### Multipart
|
||||
|
||||
This is necessary for posting files.
|
||||
|
||||
Mime-Version: 1.0
|
||||
Content-Type: multipart/mixed; boundary="abcdEFGH-1234"
|
||||
From: anonymous <foo@bar.ano>
|
||||
Date: Thu, 02 May 2013 12:16:44 +0000
|
||||
Message-ID: <pmc8xpmgyf2@foo.bar>
|
||||
Newsgroups: overchan.test
|
||||
Subject: none
|
||||
References: <referenced message-id>
|
||||
Path: hschan.ano
|
||||
X-Sage: optional
|
||||
|
||||
This is a multi-part message in MIME format.
|
||||
--abcdEFGH-1234
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
some visible message text
|
||||
--abcdEFGH-1234
|
||||
Content-Type: image/jpeg; name="RosenFessel_LM_030-lg.jpg"
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Disposition: attachment; filename="RosenFessel_LM_030-lg.jpg"
|
||||
/9j/4AAQSkZJRgABAQAAAQABAAD//gA8Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJ
|
||||
SkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gMTAwCv/bAEMAAQEBAQEBAQEBAQEBAQEBAQEBAQEB
|
||||
[..]
|
||||
e3ykVkO1lOwlSMkfvDngbSOmRuqaDQo2Kqi5yUwfKPXkk8kAjIA5B4wPUVi8TKblJ1Oy969r
|
||||
ea8+nXc6I4WnFLROMVZRai1L4bK+vdfM/9k=
|
||||
--abcdEFGH-1234-
|
||||
Content-Type boundary="$IDENTIFIER"
|
||||
|
||||
|
||||
Where ``$identifier`` should be a rather long random string (at least 0-9, a-z, A-Z, - are allowed). The ``$identifier`` should not occur in the message text itself, so it usually begins with multiple - characters because these will never occur in base64. The content type ``multipart/mixed`` allows to have different parts inside a message body. The first part would be the actual message, the second part could be a Base64 encoded picture. See also: MIME
|
||||
|
||||
|
||||
In ~~2013~~ 2015 we can send UTF-8 messages, although this is not part of the old testament.
|
||||
|
||||
### Date
|
||||
|
||||
It is recommend to use ``UTC (+0000)`` as timezone for new messages. If a received message is not already in UTC, the date may be converted to UTC for display purposes.
|
||||
|
||||
### Message-ID: (see RFC 3977)
|
||||
|
||||
"A message-id MUST begin with "<", end with ">", and MUST NOT contain the latter except at the end."
|
||||
"A message-id MUST be between 3 and 250 octets in length."
|
||||
"A message-id MUST NOT contain octets other than printable US-ASCII characters."
|
||||
a possible valid message-id could be in the format <{random}{timestamp}@${frontend}> where:
|
||||
${random} == a random 10 char ascii value
|
||||
${timestamp} == the current unix_timestamp
|
||||
${frontend} == web.hschan.ano
|
||||
|
||||
Which would result in ``jbUdn73KxN1369733675@web.hschan.ano`` This format makes it easier to block massive spam/inapropiate content based on the frontend and a timespan.
|
||||
|
||||
### References
|
||||
|
||||
If reference is not given or empty, the message is considered an original (root) post.
|
||||
|
||||
### X-Sage
|
||||
|
||||
If ``X-Sage`` is given, the message shall not bump the corresponding thread.
|
||||
|
||||
## Transport Format
|
||||
|
||||
NNTP requires line endings with ``\r\n``
|
||||
|
||||
### Sending
|
||||
|
||||
if a line in the message body starts with `.` in needs another `.` prepended. the last line must be a single `.\r\n`
|
||||
|
||||
### Receiving:
|
||||
|
||||
If a line in the message body starts with `.` but is not `.\r\n` the `.` needs to be removed.
|
||||
|
||||
|
||||
# Frontend
|
||||
|
||||
## Postnumbers
|
||||
|
||||
The first ten characters of a sha1sum of field message-id. The probability for a unique post number (at time of generation) on a board with a maximum of 30k messages is:
|
||||
|
||||
(1-(1/16^10))^30000 = 0.99999997271515937221
|
||||
|
||||
In case of several message forgers exhaust obscure post numbers, it will become much more likely for a quote to be 'shadowed'.
|
||||
|
||||
There was a hash collision on October 13 2015, the post hash has been bumped from 10 to 18 bytes.
|
||||
|
||||
### Quotes
|
||||
|
||||
Quotes reference postnumbers and work across all boards on overchan. The comment field may contain serveral lines such as:
|
||||
|
||||
\>>postnumber
|
||||
|
||||
to quote someone.
|
||||
|
||||
Valid quotes match this regex: `>+ ?[0-9a-f]+`
|
||||
|
||||
#### Optional
|
||||
|
||||
* Resolve quotes to corresponding articles and append them to references - this will aid newsreaders.
|
||||
* Parse message IDs as quotes
|
||||
|
||||
## Implementations
|
||||
|
||||
Because of the decentralized nature of Overchan, many different entry points to using the service can exist. In the following we discuss different implementations all serving from the newsgroup 'overchan'.
|
||||
|
||||
### negromancy.ano
|
||||
|
||||
negromancy.ano uses `breaking-news`, a web frontend compiler for imageboards, pastebins, etc.
|
||||
|
||||
`breaking-news` consists of an Happstack application and a daemon that will generate static html from NNTP files. It depends on InterNetNews (INN) and a load balancer that can distinguish between POST and GET, preferably nginx. Furthermore it relies on imagemagick (mogrify) for generation of thumbnails. Hchloride are bindings to libsodium in haskell that breaking-news uses for singing messages.
|
||||
|
||||
It utilizes blaze-html for fast Html templating and happstack-lite for serving POST requests.
|
||||
|
||||
You can visit http://boards.negromancy.ano/
|
||||
|
||||
for browsing the imageboard.
|
||||
|
||||
#### GET request
|
||||
|
||||
nginx will serve a static html from dir.
|
||||
|
||||
#### POST request
|
||||
|
||||
nginx will reverse to the happstack web application which generates and sends a NNTP message to a local INN daemon. INNd will place the new article in dir and feed it to its configured peers. Pictures are encoded in base64 or base91a. Root posting will not work without attaching an image.
|
||||
|
||||
#### Generation of Html
|
||||
|
||||
The daemon will poll for new articles in dir. If new files are found, it generates 10 main pages ranging from 0.html to 9.html and a html each for any altered threads. For each new article the corresponding thread, starting with the original post, will be bumped to the first page (0.html). For new posts, corresponding pictures are created and 'thumbnailed' through mogrify.
|
||||
|
||||
### overchan.sfor.ano
|
||||
|
||||
overchan.sfor.ano uses SRNd, a complete NNTP server implemented in Python.
|
||||
|
||||
It provides a plugin interface (among other hook possibilities) which loads plug-in overchan and postman. Plug-in overchan is notified about new messages in `overchan.*` and creates static HTML files. Plug-in postman receives new messages via HTTP POST request and adds those messages to SRNd where they are send to configured outfeeds. It depends on a reverse proxy like nginx which delivers generated HTML files and proxies POST requests back to postman.
|
||||
|
||||
You can visit http://overchan.sfor.ano
|
||||
|
||||
for browsing the imageboard and ``git clone git://git.sfor.ano/SRNd.git`` for source.
|
||||
|
||||
#### GET request
|
||||
|
||||
nginx will serve a static html or image from dir.
|
||||
|
||||
#### POST request
|
||||
|
||||
nginx will proxy to postman which generates and delivers a NNTP message to SRNd which then will notify overchan plugin about the new message and also deliver it to its configured NNTP peers (which can run SRNd or another NNTPd software like INN). Pictures are encoded in base64.
|
||||
|
||||
#### Generation of Html
|
||||
|
||||
Plugin overchan is notified by SRNd about new articles and (re)generates `thread-$id.html` and its parent board with up to 10 root posts for each site. For each new article without `X-sage` header the corresponding thread will be bumped to the first page. For new posts, corresponding pictures are created and thumbnailed.
|
||||
|
||||
### NNTP News reader applications
|
||||
|
||||
Through the use of the standard MIME format, news reader applications like Mozilla Thunderbird can also read and post directly to the chan newsserver. Each chan will appear as a root post, while additional posts will appear as replies directly to the root post.
|
||||
|
||||
News readers have some features the chan software may not have: multiple attachments, non-image attachments, subject, posts referencing non-root posts, HTML text.
|
||||
|
||||
Open question: how should this be handled by the chan software for viewing?
|
||||
|
||||
# Extensions
|
||||
|
||||
## Control suggestion
|
||||
|
||||
A control suggestion is a single message containing lines with commands, message-ID and extra information separated by spaces.
|
||||
|
||||
### Commands
|
||||
|
||||
sticky: sticky this thread
|
||||
delete-x-all: delete all attachments from this article
|
||||
delete: delete the whole article
|
||||
|
||||
|
||||
### Format
|
||||
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
From: anonymous <foo@bar.ano>
|
||||
Date: Thu, 02 May 2013 12:16:44 +0000
|
||||
Message-ID: <h2cykk1lwlmuqao2qiy@foo.bar>
|
||||
Newsgroups: ctl
|
||||
Subject: none
|
||||
Path: censorship.fleet
|
||||
X-Sage: optional
|
||||
|
||||
delete-x-all <message-ID>
|
||||
delete <message-ID>
|
||||
delete <message-ID>
|
||||
|
||||
|
||||
Messages to control are separated by at least one line break.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
Delete all attachments from message with ID ``message-ID``
|
||||
|
||||
delete-x-all <message-ID>
|
||||
|
||||
Please sticky thread with OP ``message-ID`` till UNIX timestamp ``1380000000``
|
||||
|
||||
sticky <message-ID> unix_timestamp 1380000000
|
||||
|
||||
|
||||
|
||||
|
||||
### Convention
|
||||
|
||||
We send control suggestions to newsgroup ``ctl``. Full deletion of a root post results in removal of corresponding thread.
|
||||
|
||||
### Signatures
|
||||
|
||||
As users give their secret key to the frontend they expect every form field to be verified on all ends. This includes the comment field and headers. In the following we suggest a protocol to sign optional headers.
|
||||
|
||||
We sign a SHA512 hash of the message body using primitive Ed25519 as defined by SUPERCOP and libsodium. Therefore this system does not inherit any collision resilience from Ed25519, a hash collision is a signature collision.
|
||||
|
||||
Signing M vs. Signing H(M)
|
||||
|
||||
method space time
|
||||
|
||||
S(M) O(n) O(n)
|
||||
|
||||
S(H(M)) O(1) O(n)
|
||||
|
||||
S: Sign
|
||||
H: Hash
|
||||
M: Message
|
||||
|
||||
|
||||
Input for block based hashing algorithms like SHA-512 can be streamed, only keeping a fixed blocked size in memory instead of all blocks. In case of SHA-512 these message blocks are 1024 bit and the hash to sign 512 bit. Optimized ``S(H(M))`` implementations require a constant amount memory as opposed to a linear requirement in ``S(M)``.
|
||||
|
||||
### Format for signing messages (RFC 822)
|
||||
|
||||
Outer headers start with ``Content-Type: message/rfc822`` when there are signed headers or at least an attachment,
|
||||
which requires ``Content-Type: multipart/mixed`` to be signed as well as an inner header.
|
||||
Otherwise you can use ``Content-Type: text/plain``, in which case you just sign the body.
|
||||
Outer headers include ``X-pubkey-ed25519`` and ``X-signature-ed25519-sha512``, inner headers need verification.
|
||||
``X-pubkey-ed25519`` is 64 characters long, 32 byte public key in base 16: ``Base16(PK)``
|
||||
``X-signature-ed25519-sha512`` is 128 characters long, 64 byte signature in base 16: ``Base16(S(SK,H(M)))``
|
||||
The signed message equals body of the outer message. It begins at first inner header (in this example ``Content-Type: text/plain``) and includes the inner body. Lines are separated by ``<CRLF>``.
|
||||
Please include a ``Content-Type`` header in the inner message as suggested by RFC822.
|
||||
|
||||
Symbol Function
|
||||
|
||||
Base16 function that will take an arbitrary amount of octets and encode them to Base 16 with character set "0123456789abcdef"
|
||||
SK 64 bytes secret key
|
||||
PK 32 bytes public key, can be generated from signSeedKeypair(take32(SK))
|
||||
M message body
|
||||
H function that will hash an arbitrary amount of octets using SHA-512, returning 64 bytes
|
||||
S(SK,M) function that will sign an arbitrary amount of octets M using Ed25519 with secret key SK, returning only the first 64 bytes
|
||||
take32 function that takes any amount of binary data and returns the first 32 bytes
|
||||
|
||||
|
||||
#### Example
|
||||
|
||||
Content-Type: message/rfc822; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
From: anonymous <foo@bar.ano>
|
||||
Date: Thu, 02 May 2013 12:16:44 +0000
|
||||
Message-ID: <h2cykk1lwlmuqao2qiy@foo.bar>
|
||||
Newsgroups: ctl
|
||||
Subject: none
|
||||
Path: censorship.fleet
|
||||
X-pubkey-ed25519: 37c16fa40c2bade813b53b65107a064d02becfa5635acf3241003a61cb137ea3
|
||||
X-signature-ed25519-sha512: a850ccd788d71ed19de8dfa061b9f1f4f506810a01ed1391433e893a3e6305b4944168760d97f2517bcfe786aef1ccfc34fb7bb1b77531 82aebf2bdd0303150f
|
||||
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Date: Thu, 02 May 2013 12:16:44 +0000
|
||||
|
||||
delete-x-all <message-ID>
|
||||
delete <message-ID>
|
||||
|
||||
delete <message-ID
|
||||
|
||||
|
||||
In this example header Date needs verification, too.
|
||||
The following part is signed:
|
||||
|
||||
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Date: Thu, 02 May 2013 12:16:44 +0000
|
||||
|
||||
delete-x-all <message-ID>
|
||||
delete <message-ID>
|
||||
|
||||
delete <message-ID
|
||||
|
||||
|
||||
Above example in octets:
|
||||
|
||||
Content-Type: text/plain; charset=UTF-8\\r\\nDate: Thu, 02 May 2013 12:16:44 +0000\\r\\n\\r\\ndelete-x-all <message-ID>\\r\\ndelete <message-ID>\\r\\n\\r\\ndelete <message-ID>
|
||||
|
||||
# Glossary
|
||||
|
||||
## chan specific
|
||||
|
||||
### root post
|
||||
original post
|
||||
|
||||
### OP
|
||||
original post
|
||||
|
||||
### thread
|
||||
a collection of messages starting with the original post followed by messages referencing it ordered by date
|
||||
|
||||
### bump
|
||||
newest post will be shown first with corresponding thread
|
||||
|
||||
### sticky
|
||||
thread is temporarily 'bumped' by the frontend and sticks there regardless of newer posts
|
||||
39
doc/running.md
Normal file
@@ -0,0 +1,39 @@
|
||||
## Running
|
||||
|
||||
After you have [built the daemon](build.md) and [configured the database](database.md) you can run the daemon.
|
||||
|
||||
|
||||
check out the nntpchan repo and build the daemon if you already haven't
|
||||
|
||||
git clone https://github.com/majestrate/nntpchan
|
||||
cd nntpchan
|
||||
./build.sh
|
||||
|
||||
set up the daemon:
|
||||
|
||||
./srndv2 setup
|
||||
|
||||
generate admin keys, don't loose them.
|
||||
|
||||
./srndv2 tool keygen
|
||||
|
||||
add yourself as admin by adding your ``public key`` to the ``frontend`` section of ``srnd.ini``
|
||||
|
||||
...
|
||||
[frontend]
|
||||
enable=1
|
||||
admin_key=yourpublickeygoeshere
|
||||
... # leave the rest of the config values alone for now
|
||||
|
||||
|
||||
|
||||
run it:
|
||||
|
||||
./srndv2 run
|
||||
|
||||
|
||||
Now open the browser up to http://127.0.0.1:18000/
|
||||
|
||||
To access the mod panel go to the [mod panel](http://127.0.0.1:18000/mod/) and use your ``private key`` to log in
|
||||
|
||||
Now read about [peering](feeds.md)
|
||||
3
doc/srnd.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# srnd.ini
|
||||
|
||||
todo: document this file
|
||||