2023-05-24 News group peering

Oh boy, this is confusing! @tomasino and I are trying to set up peering for cosmic._ and campaignwiki._ groups from our respective news servers. User xwindows is helping us out on IRC, but it’s not easy to figure out what to do.

@tomasino

I’m setting things up for cosmic. I want to archive discussions for a few years. Who knows. I guess live conversation can happen on IRC. Cosmic uses 10 years, so I’m going to do the same. In “/etc/new/expire.ctl” I changed the two entries as follows:

/remember/:0


In “/etc/news/incoming.conf” I added:

peer cosmic {
  hostname:   "cosmic.voyage"
}

In “/etc/news/innfeed.conf” I added:

peer cosmic {
  ip-name:    cosmic.voyage
}

In “/etc/nntpsend.ctl” I added:

cosmic:cosmic.voyage:2m:-t 180

In “/etc/news/newsfeeds” I added:

innfeed!\
	:!*\
	:Tc,Wnm*:/usr/lib/news/bin/innfeed

cosmic\
      :*,!local,!local.*,!control,!control.*,!junk/!local\
      :Af,Ap,C20,G12,U5,<32768,Tm\
      :innfeed!

(This in addition to the “ME” and “controlchan” settings which I left as-is.)

In “/etc/news/readers.conf” I amended my config so that unauthenticated users can read the cosmic._ news groups:_

access "authenticatedpeople" {
    users: "*"
    newsgroups: "*,!junk,!control,!control.*"
}

access "readonly" {
    users: "<unauthenticated>"
    read: "local.*,campaignwiki.*,cosmic.*"
    post: "!*"
}

I created “/etc/news/server” with just one line for programs like “tin -r”:

campaignwiki.org

I created three cosmic._ groups with status “n” on my server:_

ctlinnd newgroup cosmic.general n
ctlinnd newgroup cosmic.worldbuilding n
ctlinnd newgroup cosmic.storyhelp n

This adds them to “/var/lib/news/active” in the correct format. Status n makes sure nobody can post.

I added them to “/var/lib/news/newsgroups” based on how they are listed on cosmic.voyage:

cosmic.general		General Discussion
cosmic.storyhelp	Help with storylines and characters
cosmic.worldbuilding	Expanding the universe

This makes them visible to users.

Then:

ctlinnd reload all

What’s missing now is that @tomasino needs to send a full history of his groups, with articles in the right order, before anybody gets to post in the cosmic._ groups on my server._

@tomasino

Double checking “/etc/news/inn.conf” and changing two more settings:

artcutoff:                   0
remembertrash:               true
# previously changed for regular operation
organization:                "Campaign Wiki"
pathhost:                    campaignwiki.org
domain:		             campaignwiki
complaints:                  alex@alexschroeder.ch

The other four I had changed before, see 2023-05-21 INN, again.

2023-05-21 INN, again

Restart it all:

systemctl restart inn2

At the same time, the `campaignwiki.*` newsgroups are now available and writable on cosmic.voyage.

The important part here is that we don’t just want to peer, we want to get each other’s archives. So don’t let the receiving host post anything in the empty groups until they’ve received all the old posts, in the right order. The numbering is important.

This is how user xwindows told Tomasino to proceed in order to get the old messages of the `cosmic.*` groups to campaignwiki.org.

First, a test using a single message (notice `head -1`). Run the following commands as root. As far as the “flush” command is concerned, “campaign” is what the peer is called.

find /var/spool/news/articles/cosmic/storyhelp/ -type f | sort -t / -k 8 -n | head -1 > storyhelp.lst
/usr/lib/news/bin/innxmit -d -l -s -v campaignwiki.org "`pwd`/storyhelp.lst"
/usr/lib/news/bin/ctlinnd flush campaign

The log files should say something like this: `campaignwiki.org stats offered 1 accepted 1 refused 0 rejected 0 missing 0 accsize 904 rejsize 0`

Verify using NNTP directly:

telnet campaignwiki.org 119
listgroup cosmic.storyhelp

Here’s how to push the rest of the newsgroup (notice `tail -n +2`). Run this in a temporary, empty directory, as root.

find /var/spool/news/articles/cosmic/storyhelp/ -type f | sort -t / -k 8 -n | tail -n +2 > storyhelp.lst
/usr/lib/news/bin/innxmit -d -l -s -v campaignwiki.org "`pwd`/storyhelp.lst"
/usr/lib/news/bin/ctlinnd flush campaign

For the remaining two groups, no test using a single message was needed. Again, use a temporary, empty directory for every group. Run as root. Verify using telnet and NNTP.

One group:

find /var/spool/news/articles/cosmic/general/ -type f | sort -t / -k 8 -n > general.lst
/usr/lib/news/bin/innxmit -d -l -s -v campaignwiki.org "`pwd`/general.lst"
/usr/lib/news/bin/ctlinnd flush campaign

Another group:

find /var/spool/news/articles/cosmic/worldbuilding/ -type f | sort -t / -k 8 -n > worldbuilding.lst
/usr/lib/news/bin/innxmit -d -l -s -v campaignwiki.org "`pwd`/worldbuilding.lst"
/usr/lib/news/bin/ctlinnd flush campaign

Do not make the groups active on the receiving end until peering in the other direction has been set up!

# /usr/lib/news/bin/ctlinnd newgroup cosmic.general y
# /usr/lib/news/bin/ctlinnd newgroup cosmic.worldbuilding y
# /usr/lib/news/bin/ctlinnd newgroup cosmic.storyhelp y

To do the peering for the `campaignwiki.*` newsgroups, same procedure. First, send the first message:

find /var/spool/news/articles/campaignwiki/games/ -type f | sort -t / -k 8 -n | head -1 > games.lst
/usr/lib/news/bin/innxmit -d -l -s -v cosmic.voyage "`pwd`/games.lst"
/usr/lib/news/bin/ctlinnd flush cosmic

Wait for a bit, then verify with the article’s message-id:

NNTPSERVER=cosmic.voyage lynx 'news:17fb.646c6370.75bdb@melanobombus.fritz.box'

If it worked, do it for the remaining articles:

find /var/spool/news/articles/campaignwiki/games/ -type f | sort -t / -k 8 -n | tail -n +2 > games.lst
/usr/lib/news/bin/innxmit -d -l -s -v cosmic.voyage "`pwd`/games.lst"
/usr/lib/news/bin/ctlinnd flush cosmic

Verify with another article’s message-id:

NNTPSERVER=cosmic.voyage lynx 'news:u4k8ft$2ptrf$1@sibirocobombus.campaignwiki'

At this point, the following groups are ready for peering (but not `campaignwiki.talk` – see below).

To enable live peering:

1. Edit CampaignWiki’s `/etc/news/newsfeeds`

2. Go to a line that started with `cosmic\`

3. Then, on the next line, look for `:*` at the beginning

4. Replace that part with `:campaignwiki.games,cosmic.*` (without quotes)

5. Save the file

6. Run following 5 commands:/usr/lib/news/bin/ctlinnd reload newsfeeds "Resuming outgoing link to cosmic.voyage, with just campaignwiki.games,cosmic.* newsgroups" /usr/lib/news/bin/ctlinnd begin cosmic /usr/lib/news/bin/ctlinnd changegroup cosmic.general y /usr/lib/news/bin/ctlinnd changegroup cosmic.storyhelp y /usr/lib/news/bin/ctlinnd changegroup cosmic.worldbuilding y

Send a test message to `campaignwiki.games` and see whether it got sent.

If it worked, Tomasino on the other end can enable the group, too:

/usr/lib/news/bin/ctlinnd changegroup campaignwiki.games y

And add an entry to `/var/lib/news/newsgroups` file, to make it visible, if that entry doesn’t exist, yet.

And now for the last group. You know the drill. Begin with the first article. Order is important.

find /var/spool/news/articles/campaignwiki/talk/ -type f | sort -t / -k 8 -n | head -1 > talk.lst
/usr/lib/news/bin/innxmit -d -l -s -v cosmic.voyage "`pwd`/talk.lst"
/usr/lib/news/bin/ctlinnd flush cosmic

Now verify using `lynx`, with the message-id of the first article:

NNTPSERVER=cosmic.voyage lynx 'news:2cc9.6469fa55.e4e71@melanobombus.fritz.box'

If it worked, do the remaining articles:

find /var/spool/news/articles/campaignwiki/talk/ -type f | sort -t / -k 8 -n | tail -n +2 > talk.lst
/usr/lib/news/bin/innxmit -d -l -s -v cosmic.voyage "`pwd`/talk.lst"
/usr/lib/news/bin/ctlinnd flush cosmic

Wait for a bit, verify again with another article’s message-id:

NNTPSERVER=cosmic.voyage lynx 'news:8a1f.647712af.6f3ad@melanobombus.fritz.box'

If all of that worked, we can re-enable the outgoing leg:

1. Edit `/etc/news/newsfeeds`

2. Go to a line that started with `cosmic\`

3. Then, on the next line, look for `:campaignwiki.games` at the beginning

4. Replace that part with `:campaignwiki.*` (without quotes)

5. Save the file

6. Run the following command:/usr/lib/news/bin/ctlinnd reload newsfeeds "Re-enabling outgoing transport of campaignwiki.talk newsgroup to cosmic.voyage"

Verify with a new test article.

If that worked, the news admin on the remote end can enable the group for posting.

Now we can undo some of the settings we made:

And after the steps above were performed, you should be able to change the netnews server settings we’ve temporarily changed to accommodate push-feeding back to their normal values. This process is unrelated to push-feeding itself, you may apply these at your own pace...

1. Edit `/etc/news/inn.conf`

2. Find a line that starts with `remembertrash:`

3. Change the value of that line back to `true`

4. Find a line that starts with `artcutoff:`

5. Change the value of that line back to `10`

6. Save the file

7. Edit `/etc/news/expire.ctl`

8. Find a line that starts with `/remember/:`

9. Change the number after that back to `11`

10. Save the file

11. Restart your netnews server to apply the changes

From now on, the cosmic._ and campaignwiki._ groups are equals. If either me or Tomasino want to add more newsgroups in the `campaignwiki.*` namespace, create it in local-readonly fashion first, using something like this:

/usr/lib/news/bin/ctlinnd newgroup campaignwiki.whatever n

Then coordinate with Tomasino to create the same group on the other side, with the same read-only `n` flag, *before* ever posting anything in that new newsgroup. And verifying that the other side has the newsgroup, change the flag on my side to `y` using something like this:

/usr/lib/news/bin/ctlinnd changegroup campaignwiki.whatever y

Post a test article. Verify that it got mirrored correctly.

When happy, both sides add the new group to the `/var/lib/news/newsgroups` file to make it visible and both sides make the group active using `ctlinnd changegroup campaignwiki.whatever y`.

Compare:

alex@melanobombus ~> **telnet campaignwiki.org 119**
Trying 2a02:418:6a04:178:209:50:237:1...
Connected to campaignwiki.org.
Escape character is '^]'.
200 campaignwiki.org InterNetNews NNRP server INN 2.6.4 ready (posting ok)

381 Enter password

205 Bye!
Connection closed by foreign host.

And now:

alex@melanobombus ~> **gnutls-cli campaignwiki.org:563**
...
200 campaignwiki.org InterNetNews server INN 2.6.4 ready (transit mode)

502 Authentication will fail

205 Bye!
- Peer has closed the GnuTLS connection

What’s the reason for this? My “/etc/news/readers.conf” with all the comments stripped:

auth "foreignokay" {
    auth: "ckpasswd -f /var/lib/news/newsusers"
    default: "<unauthenticated>"
}

access "authenticatedpeople" {
    users: "*"
    newsgroups: "*,!junk,!control,!control.*"
}

access "readonly" {
    users: "<unauthenticated>"
    read: "local.*,campaignwiki.*,cosmic.*"
    post: "!*"
}

I guess I need stunnel to start nnrpd instead? Yikes.

My “/etc/stunnel/nntps.conf” file now:

[nntps]
accept  = 563
setuid  = news
setgid  = news
exec    = /usr/lib/news/bin/nnrpd
key     = /etc/apache2/md/domains/campaignwiki.org/privkey.pem
cert    = /etc/apache2/md/domains/campaignwiki.org/pubcert.pem
apt purge stunnel4
apt install stunnel4

I had to enable to the service by adding `ENABLE=1` to `/etc/default/stunnel4`.

And now it seems to work! I added `debug=info` to the top of `/etc/stunnel/nntps.conf` and `journalctl --unit stunnel4` now prints some interesting information.

I think adding `ENABLE=1` was the critical piece of information I needed.