Thread View: linux.debian.bugs.dist
2 messages
2 total messages
Started by samy
Sat, 14 Nov 2026 21:20
Bug#1154000: auto-apt-proxy does not check for running server using srv dns
Author: samy
Date: Sat, 14 Nov 2026 21:20
Date: Sat, 14 Nov 2026 21:20
38 lines
3089 bytes
3089 bytes
Package: auto-apt-proxy Version: 14.1 Severity: normal X-Debbugs-Cc: samy2014@free.fr Dear Maintainer, I am trying to setup an apt cache for my servers. Ideally, they would check the cache server, and if it is unavailable, directly download packages from official mirrors. In most cases, auto-apt-proxy should handle that since it check if the server is running. However, when setting the srv dns record, it does not. The comments in the code reason that it does not need to guess that it is a correct caching server, but the possibility of checking if the server is up to potentially fall back on an other does not seem do have been considered. I would appreciate if this beheaviour could be changed. Please note that while I am reporting for an old version of the package, the beheaviour is still present in its latest version. Best regards -- System Information: Debian Release: 12.15 APT prefers oldstable-updates APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable') Architecture: amd64 (x86_64) Kernel: Linux 7.0.14-20-pve (SMP w/1 CPU thread; PREEMPT) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) Versions of packages auto-apt-proxy depends on: ii apt 2.6.2 Versions of packages auto-apt-proxy recommends: ii iproute2 6.1.0-3 auto-apt-proxy suggests no packages. -- no debconf information
Bug#1154000: auto-apt-proxy does not check for running server using srv dns
Author: samy
Date: Tue, 24 Nov 2026 19:00
Date: Tue, 24 Nov 2026 19:00
173 lines
8637 bytes
8637 bytes
This is a multi-part message in MIME format.
--------------qYny2ejfSZd0LkprOhy3LZHo
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hello,
I would like to inform you that I have fixed my problem by patching the
code myself. The patch is as follows:
```
# ...
result=$(
/usr/lib/apt/apt-helper srv-lookup ${service}.${d} |
awk -F'\t' 'BEGIN{srand()}{print $0 "\t" rand() }' |
sort -t "$(printf '\t')" -k2n -k3n -k5n |
awk '/^[^#]/{print "http://" $1 ":" $4}'
)
for proxy in $result; do
log_debug "Testing proxy $proxy"
if hit "$proxy" | grep -q -i 'HTTP.*406'; then
log_debug "Successfully tested $proxy"
set_proxy "${proxy}"
return 0
else
log_debug "Error while testing $proxy"
fi
done
# ...
```
This should handle the SRV records priority, weight, shuffle records
with the same priority and weight, test them in order and select the
first one that works, while not setting a proxy if none work.
Note that I have not tested thoroughly my code for security
vulnerabilities. I still hope this code snippet can be useful for someone.
Best Regards
On 14/11/2026 22:08, samy wrote:
> Package: auto-apt-proxy
> Version: 14.1
> Severity: normal
> X-Debbugs-Cc:samy2014@free.fr
>
> Dear Maintainer,
>
> I am trying to setup an apt cache for my servers. Ideally, they would check the cache server, and if it is unavailable, directly download packages from official mirrors.
> In most cases, auto-apt-proxy should handle that since it check if the server is running. However, when setting the srv dns record, it does not. The comments in the code reason that it does not need to guess that it is a correct caching server, but the possibility of checking if the server is up to potentially fall back on an other does not seem do have been considered.
>
> I would appreciate if this beheaviour could be changed.
>
> Please note that while I am reporting for an old version of the package, the beheaviour is still present in its latest version.
>
> Best regards
>
>
> -- System Information:
> Debian Release: 12.15
> APT prefers oldstable-updates
> APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 7.0.14-20-pve (SMP w/1 CPU thread; PREEMPT)
> Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
> Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
> Shell: /bin/sh linked to /usr/bin/dash
> Init: systemd (via /run/systemd/system)
>
> Versions of packages auto-apt-proxy depends on:
> ii apt 2.6.2
>
> Versions of packages auto-apt-proxy recommends:
> ii iproute2 6.1.0-3
>
> auto-apt-proxy suggests no packages.
>
> -- no debconf information
--------------qYny2ejfSZd0LkprOhy3LZHo
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<p>Hello,</p>
<p>I would like to inform you that I have fixed my problem by
patching the code myself. The patch is as follows:</p>
<p>```</p>
<p># ...<br>
result=$(<br>
/usr/lib/apt/apt-helper srv-lookup ${service}.${d} |<br>
awk -F'\t' 'BEGIN{srand()}{print $0 "\t" rand() }'
|<br>
sort -t "$(printf '\t')" -k2n -k3n -k5n |<br>
awk '/^[^#]/{print "http://" $1 ":" $4}'<br>
)<br>
for proxy in $result; do<br>
log_debug "Testing proxy $proxy"<br>
if hit "$proxy" | grep -q -i 'HTTP.*406'; then<br>
log_debug "Successfully tested $proxy"<br>
set_proxy "${proxy}"<br>
return 0<br>
else<br>
log_debug "Error while testing $proxy"<br>
fi<br>
done</p>
<p># ...</p>
<p>```</p>
<p>This should handle the SRV records priority, weight, shuffle
records with the same priority and weight, test them in order and
select the first one that works, while not setting a proxy if none
work.</p>
<p>Note that I have not tested thoroughly my code for security
vulnerabilities. I still hope this code snippet can be useful for
someone.</p>
<p>Best Regards</p>
<div class="moz-cite-prefix">On 14/11/2026 22:08, samy wrote:<br>
</div>
<blockquote type="cite"
cite="mid:179469052343.36484.13057488585209115052.reportbug@frigg.rennes">
<pre wrap="" class="moz-quote-pre">Package: auto-apt-proxy
Version: 14.1
Severity: normal
X-Debbugs-Cc: <a class="moz-txt-link-abbreviated" href="mailto:samy2014@free.fr">samy2014@free.fr</a>
Dear Maintainer,
I am trying to setup an apt cache for my servers. Ideally, they would check the cache server, and if it is unavailable, directly download packages from official mirrors.
In most cases, auto-apt-proxy should handle that since it check if the server is running. However, when setting the srv dns record, it does not. The comments in the code reason that it does not need to guess that it is a correct caching server, but the possibility of checking if the server is up to potentially fall back on an other does not seem do have been considered.
I would appreciate if this beheaviour could be changed.
Please note that while I am reporting for an old version of the package, the beheaviour is still present in its latest version.
Best regards
-- System Information:
Debian Release: 12.15
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 7.0.14-20-pve (SMP w/1 CPU thread; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages auto-apt-proxy depends on:
ii apt 2.6.2
Versions of packages auto-apt-proxy recommends:
ii iproute2 6.1.0-3
auto-apt-proxy suggests no packages.
-- no debconf information
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>
--------------qYny2ejfSZd0LkprOhy3LZHo--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads