@@ -51,7 +51,7 @@ proxy: https://192.168.0.3:4544
5151proxy: http://192.168.0.27:8000
5252```
5353
54- or with specific checking (failing):
54+ or with specific url for checking (failing+avahi detection ):
5555```
5656dev@dev:~$ apt-proxy-detect.sh github.xyz
5757Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
@@ -135,7 +135,7 @@ Default locations per user in this order (in case this is not writable fall back
135135
136136# Debugging
137137
138- In case of issue you can set "DEBUG_APT_PROXY_DETECT" to get all details, like e.g.:
138+ In case of issues you can set "DEBUG_APT_PROXY_DETECT" to get all details, like e.g.:
139139```
140140export DEBUG_APT_PROXY_DETECT=1
141141sudo apt update
@@ -150,16 +150,20 @@ dev@dev:~$ sudo apt update
150150[ INFO][ 2]: ===--- apt-proxy-detect ---===
151151[ TEST-URL][ 18]: URL: http://packages.microsoft.com/repos/code/dists/stable/InRelease
152152[ HASH][ 42]: HASH: c0b917f192fa7cccb3f536f2c01b824d of (http://packages.microsoft.com)
153+
153154# no proxy known so search one...
154155[ AVAHI][ 52]: get cache entries for _apt_proxy._tcp
155156[ CHECK][ 110]: Checking found proxy (http://192.168.0.27:8000) with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease)
156157[ CHECK-PROXY][ 150]: Proxy (http://192.168.0.27:8000) works with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease).
158+
157159# register working proxy
158160[ ADD][ 161]: add proxy to working proxy list.
161+
159162# first proxy does work for url
160163Service[OK][Squid deb proxy on squid-deb-proxy]@http://192.168.0.27:8000
161164[ CHECK][ 209]: Checking found proxy (http://192.168.0.27:3142) with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease)
162165[ CHECK-PROXY][ 220]: Proxy (http://192.168.0.27:3142) failed with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease)
166+
163167# second proxy does not work for the url
164168Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
165169[ PROXY][ 223]: return :http://192.168.0.27:8000:
@@ -169,9 +173,11 @@ Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
169173[ TEST-URL][ 18]: URL: http://download.proxmox.com/debian/pve/dists/bookworm/InRelease
170174[ HASH][ 34]: HASH: 17b43db99b56eb6355d41861f4f304d0 of (http://download.proxmox.com)
171175[ CACHE][ 39]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
176+
172177# check if the once working proxy if fine
173178[ CHECK][ 44]: once working proxy: http://192.168.0.27:8000 for http://download.proxmox.com/debian/pve/dists/bookworm/InRelease
174179[ CHECK-PROXY][ 70]: Proxy (http://192.168.0.27:8000) works with testurl (http://download.proxmox.com/debian/pve/dists/bookworm/InRelease).
180+
175181# it is so no need to search again.
176182[ PROXY][ 72]: return :http://192.168.0.27:8000:
177183[ CACHE][ 75]: Store (http://192.168.0.27:8000) in cache file (/var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt)
@@ -181,8 +187,10 @@ Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
181187[ HASH][ 24]: HASH: 2bfbb1335aaf9d333a5c9498226eb208 of (http://local-repo.fritz.box)
182188[ CACHE][ 29]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
183189[ CHECK][ 31]: once working proxy: http://192.168.0.27:8000 for http://local-repo.fritz.box/local-repo/dists/trunk/InRelease
190+
184191# once working proxy failed
185192[ CHECK-PROXY][ 41]: Proxy (http://192.168.0.27:8000) failed with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
193+
186194# search again
187195[ AVAHI][ 46]: get cache entries for _apt_proxy._tcp
188196[ CHECK][ 91]: Checking found proxy (http://192.168.0.27:8000) with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
@@ -191,6 +199,7 @@ Service[ER][Squid deb proxy on squid-deb-proxy]@http://192.168.0.27:8000
191199[ CHECK][ 124]: Checking found proxy (http://192.168.0.27:3142) with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
192200[ CHECK-PROXY][ 134]: Proxy (http://192.168.0.27:3142) failed with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
193201Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
202+
194203# none found (as local repos are not allowed on the proxies)
195204[ PROXY][ 149]: return ::
196205[ CACHE][ 152]: Store (NONE) in cache file (/var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt)
@@ -274,6 +283,28 @@ dev@dev:~$ sudo apt update
274283[ WORKS][ 102]: give back cached proxy
275284[ PROXY][ 104]: return http://192.168.0.27:8000
276285
286+ Hit:1 http://local-repo.fritz.box/local-repo trunk InRelease
287+ Hit:2 http://deb.debian.org/debian bookworm InRelease
288+ Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
289+ Hit:4 http://download.proxmox.com/debian/pve bookworm InRelease
290+ Hit:5 http://deb.debian.org/debian bookworm-updates InRelease
291+ Hit:6 http://packages.microsoft.com/repos/code stable InRelease
292+ Hit:7 https://dl.google.com/linux/chrome/deb stable InRelease
293+ Reading package lists... Done
294+ Building dependency tree... Done
295+ Reading state information... Done
296+ 22 packages can be upgraded. Run 'apt list --upgradable' to see them.
297+
298+ ```
299+
300+ looks like (with default proxies run)
301+
302+ ```
303+ dev@dev:~$ export DEBUG_APT_PROXY_DETECT=1
304+ dev@dev:~$ sudo apt update
305+ # INFO-TAG MS : MESSAGE
306+
307+
277308Hit:1 http://local-repo.fritz.box/local-repo trunk InRelease
278309Hit:2 http://deb.debian.org/debian bookworm InRelease
279310Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
0 commit comments