Page MenuHomeFreeBSD

bsdinstall: add a dialog for network proxy setup
Needs ReviewPublic

Authored by khorben_defora.org on Oct 27 2023, 4:06 PM.
Tags
None
Referenced Files
F101594385: D42381.diff
Thu, Oct 31, 6:12 PM
Unknown Object (File)
Wed, Oct 16, 6:43 PM
Unknown Object (File)
Tue, Oct 15, 12:24 PM
Unknown Object (File)
Sun, Oct 13, 7:41 PM
Unknown Object (File)
Sat, Oct 12, 12:24 AM
Unknown Object (File)
Thu, Oct 10, 6:01 PM
Unknown Object (File)
Thu, Oct 10, 7:37 AM
Unknown Object (File)
Tue, Oct 8, 12:33 PM
Subscribers

Details

Reviewers
bapt
emaste
jrtc27
Summary

This adds the possibility in the installer to setup an HTTP, FTP, and/or SOCKS5 network proxy, as well as a list of exceptions. This is implemented within a single dialog, once the networking setup is performed. The default action confirms the setup if any proxy is already set, or skips this step otherwise.

The default value for the HTTP proxy is obtained from bsdconfig's httpProxy variable; when not set, the default value for this setting as well as for the FTP and SOCKS5 proxies and the list of exceptions are obtained from the corresponding environment variable. (If set)

When confirmed, these values are exported back to the environment, as expected by fetch(3) in the subsequent distfetch phase.

This should help fix PR #214390.

Test Plan

I have created a stand-alone copy of usr.sbin/bsdinstall, slightly modified in order to allow local testing without requiring a new installation image for every change.

$ git clone --branch khorben/proxy https://github.com/khorben/bsdinstall.git
$ cd bsdinstall
$ less README.md
[...]
$ cat > test.sh << EOF
#!/bin/sh

BSDINSTALLDIR="\$PWD"
DESTDIR="\$BSDINSTALLDIR/destdir"
BSDINSTALL_DISTDIR="\$DESTDIR/usr/freebsd-dist"; export BSDINSTALL_DISTDIR
SRCDIR="/usr/src"

TMPDIR="\$(mktemp -d)"; export TMPDIR
for target in "\$@"; do
    BSDCFG_SHARE="\$SRCDIR/usr.sbin/bsdconfig/share" \
        BSDINSTALL_CHROOT="\$DESTDIR" \
        BSDINSTALL_CONFIGCURRENT="yes" \
        BSDINSTALL_SCRIPTS="\$BSDINSTALLDIR/scripts" \
        LOCAL_DISTRIBUTIONS="base.txz kernel.txz lib32.txz" \
        DISTRIBUTIONS="lib32-dbg.txz" \
        ./bsdinstall "\$target"
done
EOF
$ sh test.sh auto
[choose a network interface and do not configure IPv4 nor IPv6]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped