InterNetNews / inn

INN (InterNetNews) Usenet server
https://www.isc.org/othersoftware/#INN
Other
72 stars 13 forks source link

Use of http(s) external sources with actsyncd #312

Closed Julien-Elie closed 1 month ago

Julien-Elie commented 2 months ago

actsyncd currently only supports the FTP and NNTP protocol to synchronize from external sources. As for FTP, the use case is fetching files from ftp.isc.org. As support for FTP will soon be discontinued for the ftp.isc.org service, in favour of HTTP(S), we need to update actsyncd to make use of these protocols.

At the same time, update our documentation with downloads.isc.org instead of ftp.isc.org. Though ftp.isc.org will remain as an alias, better switch to the new name.

Julien-Elie commented 1 month ago

For the record, in case someone looks here because his actsyncd cron job no longer works with ftp.isc.org, here are the steps to follow to make it work again.

A/ If actsyncd is not used at all, or used but with the NNTP protocol to get the active file of another news server, then there's nothing to do. This will go on working.

B/ If actsyncd is used with the following actsync.cfg parameters:

  host=ftp.isc.org
  ftppath=/pub/usenet/CONFIG/active.gz

then there is something to change. Here are some possibilities.

1/ The fastest is to just change the upstream FTP site. The Free University of Berlin still has an FTP server and provide the data. So just changing actsync.cfg to:

   host=ftp.fu-berlin.de
   ftppath=/doc/usenet/config/active.gz 

will be enough: actsyncd will go on synchronizing the data using the FTP protocol. Naturally, this change will work as long as this FTP site is still alive. Otherwise, you'll need finding another FTP site or switching to an HTTP(S) site.

2/ You can install a version of INN generated after 2024-10-07 (INN 2.7.3, snapshot, etc.). Then just update your installation and change the above parameters in actsync.cfg to:

  host=downloads.isc.org
  path=/pub/usenet/CONFIG/active.gz
  protocol=https

That's all, it should normally work out of the box. If that's not the case, read on (you may miss the wget package).

3/ You have wget installed, or can install it. Then you have to:

a/ replace your \/actsyncd program by this one: https://raw.githubusercontent.com/InterNetNews/inn/refs/heads/main/backends/actsyncd.in with its first and second lines changed to match the first and second lines of your current actsyncd program. Then rename actsyncd.in to actsyncd.

b/ open \/innshellvars and go to the line where GETFTP is defined:

  GETFTP="/usr/bin/wget"

Install wget if not already installed, and put its path in GETFTP. Then add a second line below to finally have something like:

  GETFTP="/usr/bin/wget"
  GETHTTP="/usr/bin/wget"

c/ update actsync.cfg like it was done in 2/. That's it.

4/ So... you don't have wget and cannot install it. Then you have to:

a/ replace your \/simpleftp program by this one: https://raw.githubusercontent.com/InterNetNews/inn/refs/heads/main/scripts/simpleftp.in with its first line changed to match the first line of your current simpleftp program. Then rename simpleftp.in to simpleftp.

b/ open \/innshellvars and go to the line where GETFTP is defined:

  GETFTP="/usr/bin/simpleftp"

You may see ncftpget or ncftp instead of simpleftp. You can then keep the GETFTP line with that program. But you'll need simpleftp in GETHTTP. Add a second line below to finally have something like:

  GETFTP="/usr/bin/simpleftp"
  GETHTTP="/usr/bin/simpleftp"

c/ update actsync.cfg like it was done in 2/.

d/ update actsyncd like it was done in 3/a.

e/ if you have at least Perl 5.14.0 (released in 2011), then simpleftp should work out of the box because the HTTP::Tiny module it uses has been a Perl core module since that version. If you have an older Perl version, then you need installing HTTP::Tiny from CPAN. It just requires at least Perl 5.6.0 which you already have because otherwise INN won't be working either.

I think all the use cases are covered. I bet most people fall in A/ and for the few ones in B/, probably B/1 will be possible. B/3 and B/4 are most complex cases, and maybe nobody currently falls in these categories, but were it the case, the instructions are above 🙂