🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #85944

Re: Can't seem to get mixmin nntp newsserver to work on Ubuntu

#85944
From: Daniel Webster
Date: Sat, 28 Jun 2014 14:40
160 lines
7006 bytes
On Sat, 28 Jun 2014 06:57:51 -0500, whosbest54 wrote:

> Anyway, if you get it to work, let us know.

Thanks for all your help and advice!
I finally got mixmin to work with Pan 0.139 on Ubuntu.
See details below - and please explain what is incomprehensible to 
me, since I was mostly just shooting around blindly trying to get
it to work.

The trick was that multiple files had to be changed in multiple ways, 
few of which were intuitive - and - if we can believe Pan documentation
(which we can't), none of which should have been necessary in the first
place. 

But, Pan with SSL pointing to mixmin seems to be working now on Ubuntu.
So that others may follow in my footsteps in a straighter line, here
is the sequence that I followed (with all the dead ends and u-turns
removed).

EnablePan 0.139 to work with mixmin & stunnel 4.53 on Ubuntu 13.10:
$ sudo apt-get install pan

Note that the Pan for Ubuntu is (oddly) missing SSL, so add SSL:
$ sudo apt-get install stunnel

Take look at the readme and sample files:
$ view /etc/stunnel/README
$ view /usr/share/doc/stunnel4/examples/stunnel.conf-sample

Change the default to start stunnel4 automatically upon reboot:
$ sudo vi /etc/default/stunnel4
Changed: ENABLED=0 to ENABLED=1

You must copy the suggested configuration file for stunnel to work:
$ sudo cp /usr/share/doc/stunnel4/examples/stunnel.conf-sample /etc/stunnel/stunnel.conf

I was not sure what settings to change, but there's nothing for nntp
by default, so I added the following (arbitrarily found by googling):
$ sudo vi /etc/stunnel/stunnel.conf
options = NO_SSLv2   <=== I have no idea if this is necessary
sslVersion = SSLv3   <=== I have no idea what this does
cert = /etc/ssl/certs/stunnel.pem  <=== this doesn't even exist yet
chroot = /var/lib/stunnel4/ <=== who knows what this does?
setuid = stunnel4
setgid = stunnel4
pid = /stunnel4.pid
socket = l:TCP_NODELAY=1 <=== I don't know why this is here
socket = r:TCP_NODELAY=1 <=== Likewise, but it was suggested
compression = zlib   <=== I don't even know if this does anything useful
[nntp]  <=== this section is mandatory
client = yes  <=== I'm not sure why, but this is apparently required
accept = localhost:119 <=== this is the key unintuitive redirect
connect = news.mixmin.net:563  <=== this is the only line that makes sense

Most tutorials wholly omitted this step, so I'm not sure if it's necessary:
$ sudo vi /etc/hosts.allow 
nntp: 127.0.0.1

Interestingly, you have to make your own keys, so let's generate one:
$ mkdir /tmp/stunnel
$ cd /tmp/stunnel
$ openssl genrsa -out priv.pem
=> Generating RSA private key, 1024 bit long modulus
-> THIS creates ./priv.pem

I have no idea the implication of these keys, but, I'm just following steps:
$ openssl req -new -x509 -key priv.pem -out stunnel.pem -days 1095
=> Country Name (2 letter code) [AU]:
=> State or Province Name (full name) [Some-State]:.
=> Locality Name (eg, city) []:
=> Organization Name (eg, company) [Internet Widgits Pty Ltd]:
=> Organizational Unit Name (eg, section) []:
=> Common Name (e.g. server FQDN or YOUR name) []:
=> Email Address []:
-> THIS creates ./stunnel.pem

Who knows why, but, you need to combine the two keys generated:
$ vi stunnel.pem
-> CHANGE FROM:
-----BEGIN CERTIFICATE-----
[encoded certificate scrambled eggs]
-----END CERTIFICATE-----

->CHANGE TO:
-----BEGIN RSA PRIVATE KEY-----
[encoded key scrambled eggs]
-----END RSA PRIVATE KEY-----
[empty line]
-----BEGIN CERTIFICATE-----
[encoded certificate scrambled eggs]
-----END CERTIFICATE-----
[empty line]

Now that you made keys, put them where stunnel is expecting them:
$ sudo mv stunnel.pem /etc/ssl/certs/stunnel.pem
$ chmod 600 /etc/ssl/certs/stunnel.pem
$ ls -l /etc/ssl/certs/stunnel.pem
-rw------- 1 x x 1886 Jun 27 07:06 /etc/ssl/certs/stunnel.pem

Finally, it's time to start Stunnel4:
$ stunnel4 -version
$ sudo /etc/init.d/stunnel4 start
=> Starting SSL tunnels: [Started: /etc/stunnel/stunnel.conf] stunnel.

And, now you can start pan 0.139:
$ pan --version
$ /usr/bin/pan & 

Set up the Pan News Server:
Pan: Edit>Edit News Servers>Location>Address=localhost
Pan: Edit>Edit News Servers>Location>Port=119
Pan: Edit>Edit News Servers>Login>Username=blank
Pan: Edit>Edit News Servers>Login>Password=blank
Pan: Edit>Edit News Servers>Settings>Connection Limit=4
Pan: Edit>Edit News Servers>Settings>Expire Old Articles=After Three Months
Pan: Edit>Edit News Servers>Settings>Server Rank=Fallback

Set up the Pan Posting Profile:
Pan: Edit>Edit Posting Profiles>Profile Name=mixmin profile
Pan: Edit>Edit Posting Profiles>Full Name=Mix Min
Pan: Edit>Edit Posting Profiles>Email Address=mixmin@example.com
Pan: Edit>Edit Posting Profiles>Post Articles via:localhost

Doublecheck your work:
$ cat ~/.pan2/servers.xml
<?xml version="1.0" encoding="utf-8" ?>
<server-properties>
  <server id="1">
    <host>localhost</host>
    <port>119</port>
    <username></username>
    <password></password>
    <expire-articles-n-days-old>93</expire-articles-n-days-old>
    <connection-limit>4</connection-limit>
    <newsrc>newsrc-1</newsrc>
    <rank>1</rank>
    <use-ssl>0</use-ssl>
    <trust>0</trust>
    <cert></cert>
  </server>
</server-properties>

$ cat ~/.pan2/posting.xml
<?xml version="1.0" encoding="utf-8" ?>
<posting>
  <profiles>
    <profile name="mixmin profile">
      <username>Mix Min</username>
      <address>mixmin@example.com</address>
      <server>1</server>
      <xface></xface>
      <attribution>On %d, %n wrote:</attribution>
    </profile>
  </profiles>
</posting>

Once you've done those steps above, most of which I have no idea
what the impnlications are of, then, and only then, can you finally
post to a newsgroup using Mixmin with Pan 0.139 on Ubuntu 13.10.
Technical Details
Message-ID: <lomk5k$3fv$1@speranza.aioe.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail
References: <loikqq$lgi$1@speranza.aioe.org> <lojso1$oha$1@speranza.aioe.org > <lokou8$pe4$1@solani.org> <lokq4r$8md$1@speranza.aioe.org> < 20140628-115751.860.0@whosbest54.nntpswitch.blueworldhosting.com>

Show Full Headers
Complete Article Headers
Message-ID: <lomk5k$3fv$1@speranza.aioe.org>
Subject: Re: Can't seem to get mixmin nntp newsserver to work on Ubuntu
Date: Sat, 28 Jun 2014 14:40:53 +0000
From: Daniel Webster <daniel@webster.com>
References: <loikqq$lgi$1@speranza.aioe.org> <lojso1$oha$1@speranza.aioe.org > <lokou8$pe4$1@solani.org> <lokq4r$8md$1@speranza.aioe.org> < 20140628-115751.860.0@whosbest54.nntpswitch.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail
Newsgroups: news.software.nntp,alt.free.newsservers,alt.os.linux.ubuntu
Organization: Aioe.org NNTP Server
Lines: 160
NNTP-Posting-Host: A2BNq1Kn49Gyo8TapTxMxA.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
X-Notice: Filtered by postfilter v. 0.8.2