2024-07-12 Sending files via NNCP

Let's assume that you want to send me a file via NNCP. What do you need to do?

You need to add my server to your `/etc/nncp.hjson` file, in the `neigh` section.

In the following examples, you want to change "alex" to your own username.

    sibirocobombus: {
      id:       CCAIPFSAZWYICBQ5BIURX4UMEJIXVSZFIING7HRUFTDOFV5XISVQ
      exchpub:  NGEIDPDVZ2I6CTRKCBT734VV4W2YFVTV6YFBU5UGB6IHBA3QDJUQ
      signpub:  VXBMWXS74IGAYQCLJY4UPAXXQXPT3K53QI5XCFHOAKL4I2FQNLKQ
      noisepub: MGGBAOHRHEWEC6CGT47GA2DOQXQFZUAKJ66PD734Y5WNWP364UXQ
      addrs: {
        internet: "alexschroeder.ch:5400"
      }
      incoming: "/home/alex/incoming/sibirocobombus"
      exec: {
        rsmtp: ["/usr/sbin/sendmail", "-bS"]
      }
      calls: [
        {
          cron: "12 * * * *"
        }
      ]
    }

What does it mean?

1. you know how to contact my server via the `.addrs.internet` key – you need this, but you can specify `campaignwiki.org` instead, if your prefer

2. you allow my server to save incoming files in a directory via the `.incoming` key – you only need this if you want to receive files (the directory must exist and the `nncp` group must be allowed to write to it)

3. you allow my server to send mail to local users via the `.exec.rsmtp` key – this is not necessary if you don't want to receive mail

4. you connect to my server every now and then via the `calls[0].cron` entry – this is not necessary if you don't mind using `nncp-call` every now and then

Note that my server allows sending mail but doesn't have an "incoming" directory. Basically, you need to get the public keys for my laptop from me, and set that up as well.

    melanobombus: {
      id:       R23WEIHB52TMA4EKGJPKUDBFSYP2HG4HHW2HGJ3RJATCCRLYDUZQ
      exchpub:  EGP2MMLQJQUKWTHI22JTIRMR2UV3BA2ATE3AYLVOFODMTNRGAMEA
      signpub:  YO6SZXVEIU77OQQRKMAUFUT4V3NJER4U7LQE5JI7JORJXKXY5FBA
      noisepub: 6ECO4WXJNDED6WHJ6SM2HGRQMUO75X65ALT2YRKZ3YGGBDXRNV4A
      via:      ["sibirocobombus"]
      incoming: "/home/alex/incoming/melanobombus"
      exec: {
        rsmtp:  ["/usr/sbin/sendmail", "-bS"]
      }
    }

What does it mean?

1. you know how to contact my laptop via my server using the `.via[0]` key – you need this and the name needs to match the name you used for my server

2. you allow the laptop to save incoming files in a directory via the `.incoming` key – you only need this if you want to receive files (the directory must exist and the `nncp` group must be allowed to write to it)

3. you allow the laptop to send mail to local users via the `.exec.rsmtp` key – this is not necessary if you don't want to receive mail

You also need to send me two things:

1. your system's public keys so that I can set up similar entries on my laptop and my server

2. your system's internet address – unless only you can call my server

If your system doesn't have a public internet address, no problem. My server will enqueue stuff for your system without ever sending it. It will wait for you there until your system calls. You would do this as follows:

sudo -u nncp nncp-call sibirocobombus

Now, to send me a README file, you'd run:

sudo -u nncp nncp-file README melanobombus:
2024-07-12T18:12:15Z Tx README 486 B/486 B 100% (73 KiB/sec)
2024-07-12T18:12:15Z File README (282 B) is sent to melanobombus:README

At this point, the file is in the queue.

You need to `sudo -u nncp nncp-call sibirocobombus` to actually send the files unless you have set up regular calls via the `calls[0].cron` key in your `/etc/nncp.hjson`. My server will receive the packets encrypted and addressed to my laptop and enqueue it again. The next time my laptop calls my server, it'll get them.

You probably want to let me know about the channel via another channel, be it IRC, regular mail – or mail via NNCP!

​#Administration ​#NNCP