Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 177 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,107 +1,233 @@

![le ebin logo](nntpchan.png "ebin logo")

![MIT License](https://img.shields.io/github/license/majestrate/nntpchan.svg)
![Logo is ebin](https://img.shields.io/badge/logo-ebin-brightgreen.svg)


**NNTPChan** (previously known as overchan) is a decentralized imageboard that uses the [NNTP protocol](https://en.wikipedia.org/wiki/Network_News_Transfer_Protocol) (network-news transfer protocol) to synchronize content between many different servers. It utilizes cryptographically signed posts to perform optional/opt-in decentralized moderation.

## Getting started Ubuntu 24.04 installation guide
## Getting started Ubuntu 24.04 installation guide

[This](doc) is a step-by-step guide for getting up-and-running with NNTPChan as well as documentation for developers who want to either work on NNTPChan directly or use NNTPChan in their aplications with the API. It works fine on ubuntu 24.04
Tested and working on Ubuntu 24.04.

### Step 1: Download Go 1.15 Tarball
### Step 1: Install dependencies

```bash
sudo apt-get update
sudo apt-get --no-install-recommends install -y \
imagemagick ffmpeg sox build-essential git ca-certificates \
postgresql postgresql-client golang
```
wget https://dl.google.com/go/go1.15.linux-amd64.tar.gz

### Step 2: Install Go 1.23+

Ubuntu 24.04 ships Go 1.22 which is too old. Install 1.23+ manually:

```bash
curl -L -o /tmp/go1.23.0.tar.gz https://dl.google.com/go/go1.23.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf /tmp/go1.23.0.tar.gz
export PATH=/usr/local/go/bin:$PATH
go version # should show go1.23.x
```

### Step 2: Extract the Tarball
Add to your shell profile to persist:

```bash
echo 'export PATH=/usr/local/go/bin:$PATH' >> ~/.bashrc
```
sudo tar -C /usr/local -xvzf go1.15.linux-amd64.tar.gz

### Step 3: Get the NNTPChan source

```bash
git clone https://github.com/tomoko-dev9/nntpchan
cd nntpchan
```

### Set Up Go Environment Variables
### Step 4: Build minify

The Makefile uses old `go get` syntax. Install minify manually:

```bash
GONOSUMDB=* GOPROXY=direct GOPATH=/root/nntpchan/go go install github.com/tdewolff/minify/v2/cmd/minify@latest
```
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

### Step 5: Fix the Makefile for modern Go

```bash
sed -i 's|GOPATH=$(REPO)|GO111MODULE=off GOPATH=/tmp/srnd-gopath|g' \
/root/nntpchan/contrib/backends/srndv2/Makefile
```

### Install the dependancies
Set up the GOPATH symlink:

sudo apt-get update
sudo apt-get --no-install-recommends install imagemagick ffmpeg sox build-essential git ca-certificates postgresql postgresql-client golang

```bash
mkdir -p /tmp/srnd-gopath/src
ln -s /root/nntpchan/contrib/backends/srndv2/src/srnd /tmp/srnd-gopath/src/srnd
```

### Get the NNTPChan source
git clone https://github.com/tomoko-dev9/nntpchan
cd nntpchan
### Step 6: Compile

### Now compile!
```bash
make
```

Run `make`:
If the srndv2 step fails, build it manually:

make
```bash
cd /root/nntpchan/contrib/backends/srndv2
GO111MODULE=off GOPATH=/tmp/srnd-gopath GOROOT=/usr/local/go /usr/local/go/bin/go build -v -o /root/nntpchan/srndv2 .
```

## now its time to create the database in postgres
### Step 7: Build the JavaScript bundle

```bash
curl -o /tmp/jquery.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js

cat /tmp/jquery.js \
/root/nntpchan/contrib/js/entry.js \
/root/nntpchan/contrib/js/nntpchan/local_storage.js \
/root/nntpchan/contrib/js/nntpchan/api.js \
/root/nntpchan/contrib/js/nntpchan/banner.js \
/root/nntpchan/contrib/js/nntpchan/theme.js \
/root/nntpchan/contrib/js/nntpchan/expand-image.js \
/root/nntpchan/contrib/js/nntpchan/expand-video.js \
/root/nntpchan/contrib/js/nntpchan/hide-post.js \
/root/nntpchan/contrib/js/nntpchan/post-reply.js \
/root/nntpchan/contrib/js/nntpchan/reply.js \
/root/nntpchan/contrib/js/nntpchan/report.js \
/root/nntpchan/contrib/js/nntpchan/captcha-reload.js \
/root/nntpchan/contrib/js/nntpchan/crypto.js \
/root/nntpchan/contrib/js/nntpchan/livechan.js \
> /root/nntpchan/contrib/static/nntpchan.js
```
CREATE DATABASE root;
CREATE USER root WITH PASSWORD 'root';
GRANT ALL PRIVILEGES ON DATABASE root TO root;

### Step 8: Set up PostgreSQL

```bash
sudo -u postgres psql -c "CREATE DATABASE root;"
sudo -u postgres psql -c "CREATE USER root WITH PASSWORD 'root';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE root TO root;"
sudo -u postgres psql -d root -c "GRANT ALL ON SCHEMA public TO root;"
sudo -u postgres psql -d root -c "ALTER SCHEMA public OWNER TO root;"
```
note this only allows db root and username root
not sure why but i will investigate oh and the default port is 5432
your gonna need it in the installation

Running NNTPChan
================
> **Note:** Default database, user, and password are all `root`. Default port is `5432`.

Once you have [built NNTPChan](building.md) and done [the initial setup you](setting-up.md) you can start NNTPChan.
### Step 9: Initial setup

Before running make sure you run the setup command, you only need to do this one time:
```bash
cd /root/nntpchan
./srndv2 setup
```

./srndv2 setup
Edit `srnd.ini` as needed. To disable captcha add `rapeme=omgyesplz` under `[frontend]`. To enable captcha only for new threads (not replies), leave it as `rapeme=no`.

You can now start the NNTPChan node (srndv2) by running:
### Step 10: Generate admin keypair

./srndv2 run
```bash
./srndv2 tool keygen
```

Now you can check out the web-interface by navigating to 127.0.0.1:18000 (default address - unless you have changed it in your `srnd.ini`) or you can [configure your newsreader](extras/configure-newsreader.md).
Save the secret key securely. Add the public key as admin:

```bash
./srndv2 tool mod add YOUR_PUBLIC_KEY
```

## Support chat
To post as admin, use your secret key in the name field:

https://discord.gg/Ydss9wTk7G
```
Admin#YOUR_SECRET_KEY
```

To show admin styling on posts, add this to your theme CSS (e.g. `krane.css`):

```css
[data-pubkey="YOUR_PUBLIC_KEY"] {
background-image: url('/static/admin.png');
background-size: 25%;
background-repeat: repeat;
}
```

### Step 11: Run as a systemd service

```bash
cat > /etc/systemd/system/nntpchan.service << 'SERVICE'
[Unit]
Description=nntpchan srndv2
After=network.target postgresql.service

[Service]
Type=simple
User=root
WorkingDirectory=/root/nntpchan
ExecStart=/root/nntpchan/srndv2 run
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
SERVICE

systemctl daemon-reload
systemctl enable nntpchan
systemctl start nntpchan
```

The web interface is available at `http://127.0.0.1:18000` by default (configurable in `srnd.ini`).

### Step 12: Set up .onion address (optional)

```bash
apt-get install -y tor
cat >> /etc/tor/torrc << 'TOR'
HiddenServiceDir /var/lib/tor/nntpchan/
HiddenServicePort 80 127.0.0.1:80
TOR
systemctl restart tor
cat /var/lib/tor/nntpchan/hostname
```

---

## What was fixed in this fork

- Fixed compilation for modern Go (1.23+)
- Fixed old-style GOPATH builds in the Makefile
- Added posts-per-day graph (overcock graph) to front page
- Added board stats table (Posts this Hour, Posts Today, Total)
- Fixed date offset bug in posts graph
- Built and fixed the JavaScript bundle (livechan, banners, post reply, etc.)
- Captcha only required for new threads, not replies
- Admin posts highlighted with admin.png via pubkey CSS
- Fixed pubkey not loading correctly in thread view
- Fixed PostgreSQL schema permissions for Ubuntu 24.04

---

## Support

[Discord](https://discord.gg)

## Bugs and issues

*PLEASE* report any bugs you find while building, setting-up or using NNTPChan on the [GitHub issue tracker](https://github.com/majestrate/nntpchan/issues), the [issue tracker on tor](http://git.psii2pdloxelodts.onion/psi/nntpchan/), the [issue tracker on i2p](http://git.psi.i2p/psi/nntpchan/) or on the [GitGud issue tracker](https://gitgud.io/jeff/nntpchan/issues) so that the probelms can be resolved or discussed.
Please report bugs on the [GitHub issue tracker](https://github.com/tomoko-dev9/nntpchan/issues).

## Clients

NNTP (confirmed working):

* Thunderbird

Web:

* [Yukko](https://github.com/faissaloo/Yukko): ncurses based nntpchan web ui reader
* [Yukko](https://github.com/faissaloo/Yukko) — ncurses-based nntpchan web UI reader

## History

* started in mid 2013 on anonet

This is a graph of the post flow of the `overchan.test` newsgroup over 4 years, quite a big network.

(thnx anon who made this btw)
* Started in mid 2013 on anonet

![network topology of 4 years](topology.png "changolia")

[source code for map generation](https://github.com/nilesr/nntpchan-mapper)


## Acknowledgements

* [Deavmi](https://deavmi.carteronline.net/) - Making the documentation beautiful.
* [Deavmi](https://deavmi.carteronline.net/) Making the documentation beautiful.