Skip to content

Commit 2e68781

Browse files
committed
Use socks5 proxy on Whonix Gateway to fix onion urls resolution
When sys-whonix is used as updatevm, with repositories set to onion addresses, DNF (or rather curl) refuse to resolve the addresses, even though it is talking to Tor. See curl/curl#11125 Fix this by setting socks proxy explicitly. Use socks5h:// protocol to really delegate hostname resolution to the server. Do the same in qvm-template-repo-query (qubes.TemplateSearch and qubes.TemplateDownload services), as they also use dnf. QubesOS/qubes-issues#10253
1 parent 05f2ea1 commit 2e68781

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

package-managers/qubes-download-dom0-updates.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ while [ -n "$1" ]; do
6464
shift
6565
done
6666

67+
if [ -e /run/qubes-service/whonix-gateway ]; then
68+
# DNF (or rather curl) refuses to resolve onion addresses directly, use
69+
# socks proxy to avoid the issue
70+
OPTS+=( --setopt=proxy=socks5h://127.0.0.1:9050/ )
71+
# for stream isolation
72+
OPTS+=( --setopt=proxy_username=dom0updates --setopt=proxy_password=dom0updates )
73+
fi
74+
6775
if [ -z "$UPDATE_ACTION" ]; then
6876
UPDATE_ACTION=upgrade
6977
fi

qubes-rpc/qvm-template-repo-query

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ fi
5757

5858
OPTS+=(-y "--setopt=reposdir=${repodir}" --quiet)
5959

60+
if [ -e /run/qubes-service/whonix-gateway ]; then
61+
# DNF (or rather curl) refuses to resolve onion addresses directly, use
62+
# socks proxy to avoid the issue
63+
OPTS+=( --setopt=proxy=socks5h://127.0.0.1:9050/ )
64+
# for stream isolation
65+
OPTS+=( --setopt=proxy_username=dom0updates --setopt=proxy_password=dom0updates )
66+
fi
67+
6068
if ! $DNF5; then
6169
# use vendored 'downloadurl' dnf-plugin (fork of 'download' plugin), to print
6270
# all mirrors

0 commit comments

Comments
 (0)