Re: The ftp scheme doesn't seem to be supported anymore whilst the manpage still mentions it.

From: Baptiste Daroussin <bapt_at_freebsd.org>
Date: Mon, 23 Oct 2023 19:14:39 UTC
On Sat, Oct 21, 2023 at 07:15:11PM +0200, Pascal Pype wrote:
> Greetings,
> 
> I was trying to set up a custom repository built via poudriere.
> The jail is: 13_2-RELEASE-amd64 with version 13.2-RELEASE-p4.
> The ports collection is: local and comes from quarterly: 2023Q3.
> 
> The poudriere buid was done on a FreeBSD build server with full OS information:
> 
> FreeBSD fBsdSrvr 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64
> 
> A FreeBSD client is used with full OS information:
> 
> FreeBSD fBsdClnt 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64
> 
> On that client an additional repository configuration file was created.
> /usr/local/etc/pkg/repos/fBsdSrvr.conf
> 
> The content of that repository configuration file was:
> 
> fBsdSrvr: {
>   url: "ftp://fBsdSrvr/13_2-RELEASE-amd64-local",
>   enabled: yes,
>   mirror_type: NONE
> }
> 
> FreeBSD: { 
>   enabled: no 
> }
> 
> The command 'pkg update' was invoked on fBsdClnt.
> This resulted in the error massages:
> 
> pkg: invalid scheme ftp
> pkg: Cannot parse configuration file!
> 
> The fBsdSrvr stanza was commented out in the configuration file.
> 
> The command 'pkg config VALID_URL_SCHEME' was invoked on fBsdClnt.
> The response was:
> 
> pkg+http
> pkg+https
> https
> http
> file
> ssh
> tcp
> 
> The 'ftp' scheme doesn't appear in the list of supported schemes.
> 
> Yet the man page 'pkg.conf(5)' still states:

This is a bug, it should be removed from the manpage, yes ftp support has been
removed and annonced via multiple canals, but apparently, not loudly enough :(
> 
> For a MIRROR_TYPE of NONE, any of the URL schemes supported by
> libfetch(3) can be used, including: http://, https://, ftp://, or
> file://.  In addition a ssh:// URL scheme is also supported.  Where
> MIRROR_TYPE is SRV, you should use a pkg+http:// or pkg+https:// (etc.)
> URL scheme.  Using an http:// URL implies that the hostname part is a
> simple hostname according to RFC 2616, and is no longer accepted.
> 
> As you can see, the scheme ftp:// is mentioned as being supported by
> the pkg program, whilst is isn't the case anymore.
> 
> The configuration file on the cient (fBsdClnt) was changed to
> 
> fBsdSrvr: {
>   url: "ssh://fBsdSrvr/usr/local/poudriere/data/packages/13_2-RELEASE-amd64-local",
>   enabled: yes,
>   mirror_type: NONE
> }
> 
> FreeBSD: { 
>  enabled: no 
> }
> 
> This solved the problem.
> 
> When using pkg on fBsdClnt, it asks the root password of fBsdSrvr on each invocation.
> 
> Is there a way to register the root password of fBsdSrvr that pkg asks in fBsdClnt ?

Using an ssh key is the way to go.

Best regards,
Bapt