@@ -11,6 +11,11 @@ Issues:
1111* No check if the found proxy works for the requested target.
1212* No longer active maintained (deprecated warnings all over the place)
1313
14+ What do you get?
15+ - [X] detect via avahi
16+ - [X] caching of URL specific working proxy (or none if none works)
17+ - [X] caching over reboot if possible
18+
1419# How does it look?
1520
1621Example output:
@@ -59,11 +64,17 @@ looks like:
5964dev@dev:~$ curl -s https://raw.githubusercontent.com/hastmu/apt-proxy-detect/main/install.sh | sudo bash
6065- check dependencies...
6166- download latest to: /usr/local/bin/apt-proxy-detect.sh
67+ - BRANCH [main]
6268- set permissions to a+rx
6369- create/updating /etc/apt/apt.conf.d/30apt-proxy-detect.conf
6470
6571```
6672
73+ if you like to specify a branch do it like:
74+ ```
75+ curl -s https://raw.githubusercontent.com/hastmu/apt-proxy-detect/main/install.sh | sudo BRANCH=main bash
76+ ```
77+
6778or you just download the install.sh and run it locally.
6879
6980# How does it work?
@@ -78,8 +89,8 @@ right or outdated for the new stuff to be checked out.
7889
7990In case a proxy is not serving the URL it is drop for this dedicated URL.
8091
81- The found (via avahi-browse _ apt_proxy._ tcp) proxies are cached under /tmp/.apt-proxy.$username
82- in case this has the wrong owner it is ignored and a waring is issued.
92+ The found (via avahi-browse _ apt_proxy._ tcp) proxies are cached in case this has the
93+ wrong owner it is ignored and a waring is issued.
8394
8495Thats it. Enjoy.
8596
@@ -103,41 +114,47 @@ looks like
103114```
104115dev@dev:~$ export DEBUG_APT_PROXY_DETECT=1
105116dev@dev:~$ sudo apt update
106- [ INFO]: apt-proxy-detect
107- [ CACHE]: stored under: /tmp/.apt-proxy._apt
108- [ TEST-URL]: URL: http://packages.microsoft.com/repos/code/dists/stable/InRelease
109- [ AVAHI]: get cache entries for _apt_proxy._tcp
110- [ AVAHI]: get non-cache entries for _apt_proxy._tcp
111- [ CHECK]: Checking found proxy (http://192.168.0.27:3142) with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease)
112- Service[ER][apt-cacher-ng proxy on squid-deb-proxy]@http://192.168.0.27:3142
113- [ CHECK]: Checking found proxy (http://192.168.0.27:8000) with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease)
114- [ CACHE]: Store (http://192.168.0.27:8000) in cache file (/tmp/.apt-proxy._apt)
115- Service[OK][Squid deb proxy on squid-deb-proxy]@http://192.168.0.27:8000
116- [ PROXY]: return http://192.168.0.27:8000
117- [ INFO]: apt-proxy-detect
118- [ CACHE]: stored under: /tmp/.apt-proxy._apt
119- [ TEST-URL]: URL: http://download.proxmox.com/debian/pve/dists/bookworm/InRelease
120- [ CHECK]: Checking cached proxy (http://192.168.0.27:8000) with testurl (http://download.proxmox.com/debian/pve/dists/bookworm/InRelease)
121- [ WORKS]: give back cached proxy
122- [ PROXY]: return http://192.168.0.27:8000
123- [ INFO]: apt-proxy-detect
124- [ CACHE]: stored under: /tmp/.apt-proxy._apt
125- [ TEST-URL]: URL: http://local-repo.fritz.box/local-repo/dists/trunk/InRelease
126- [ CHECK]: Checking cached proxy (http://192.168.0.27:8000) with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
127- [ WORKS]: give back cached proxy
128- [ PROXY]: return http://192.168.0.27:8000
129- [ INFO]: apt-proxy-detect
130- [ CACHE]: stored under: /tmp/.apt-proxy._apt
131- [ TEST-URL]: URL: http://security.debian.org/debian-security/dists/bookworm-security/InRelease
132- [ CHECK]: Checking cached proxy (http://192.168.0.27:8000) with testurl (http://security.debian.org/debian-security/dists/bookworm-security/InRelease)
133- [ WORKS]: give back cached proxy
134- [ PROXY]: return http://192.168.0.27:8000
135- [ INFO]: apt-proxy-detect
136- [ CACHE]: stored under: /tmp/.apt-proxy._apt
137- [ TEST-URL]: URL: http://deb.debian.org/debian/dists/bookworm/InRelease
138- [ CHECK]: Checking cached proxy (http://192.168.0.27:8000) with testurl (http://deb.debian.org/debian/dists/bookworm/InRelease)
139- [ WORKS]: give back cached proxy
140- [ PROXY]: return http://192.168.0.27:8000
117+ # INFO-TAG MS : MESSAGE
118+ [ INFO][ 2]: ===--- apt-proxy-detect ---===
119+ [ TEST-URL][ 16]: URL: http://packages.microsoft.com/repos/code/dists/stable/InRelease
120+ [ HASH][ 25]: HASH: c0b917f192fa7cccb3f536f2c01b824d of (http://packages.microsoft.com)
121+ [ CACHE][ 30]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
122+ [ CACHE-AGE][ 33]: age: 687 sec
123+ [ CHECK-PROXY][ 35]: Checking proxy (http://192.168.0.27:8000) with testurl (http://packages.microsoft.com/repos/code/dists/stable/InRelease)
124+ [ WORKS][ 127]: give back cached proxy
125+ [ PROXY][ 131]: return http://192.168.0.27:8000
126+ [ INFO][ 3]: ===--- apt-proxy-detect ---===
127+ [ TEST-URL][ 20]: URL: http://download.proxmox.com/debian/pve/dists/bookworm/InRelease
128+ [ HASH][ 34]: HASH: 17b43db99b56eb6355d41861f4f304d0 of (http://download.proxmox.com)
129+ [ CACHE][ 41]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
130+ [ CACHE-AGE][ 44]: age: 687 sec
131+ [ CHECK-PROXY][ 47]: Checking proxy (http://192.168.0.27:8000) with testurl (http://download.proxmox.com/debian/pve/dists/bookworm/InRelease)
132+ [ WORKS][ 461]: give back cached proxy
133+ [ PROXY][ 464]: return http://192.168.0.27:8000
134+ [ INFO][ 3]: ===--- apt-proxy-detect ---===
135+ [ TEST-URL][ 17]: URL: http://local-repo.fritz.box/local-repo/dists/trunk/InRelease
136+ [ HASH][ 25]: HASH: 2bfbb1335aaf9d333a5c9498226eb208 of (http://local-repo.fritz.box)
137+ [ CACHE][ 32]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
138+ [ CACHE-AGE][ 37]: age: 687 sec
139+ [ CHECK-PROXY][ 39]: Checking proxy (http://192.168.0.27:8000) with testurl (http://local-repo.fritz.box/local-repo/dists/trunk/InRelease)
140+ [ WORKS][ 57]: give back cached proxy
141+ [ PROXY][ 60]: return http://192.168.0.27:8000
142+ [ INFO][ 2]: ===--- apt-proxy-detect ---===
143+ [ TEST-URL][ 19]: URL: http://security.debian.org/debian-security/dists/bookworm-security/InRelease
144+ [ HASH][ 28]: HASH: 3b68f7b6590a2da8625ff71f01d38ffb of (http://security.debian.org)
145+ [ CACHE][ 36]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
146+ [ CACHE-AGE][ 39]: age: 688 sec
147+ [ CHECK-PROXY][ 41]: Checking proxy (http://192.168.0.27:8000) with testurl (http://security.debian.org/debian-security/dists/bookworm-security/InRelease)
148+ [ WORKS][ 93]: give back cached proxy
149+ [ PROXY][ 95]: return http://192.168.0.27:8000
150+ [ INFO][ 2]: ===--- apt-proxy-detect ---===
151+ [ TEST-URL][ 24]: URL: http://deb.debian.org/debian/dists/bookworm/InRelease
152+ [ HASH][ 33]: HASH: efbfa0e2acaaa513c457b6698de83118 of (http://deb.debian.org)
153+ [ CACHE][ 41]: using stored under: /var/lib/apt/lists/auxfiles/.apt-proxy-detect._apt
154+ [ CACHE-AGE][ 44]: age: 687 sec
155+ [ CHECK-PROXY][ 47]: Checking proxy (http://192.168.0.27:8000) with testurl (http://deb.debian.org/debian/dists/bookworm/InRelease)
156+ [ WORKS][ 145]: give back cached proxy
157+ [ PROXY][ 147]: return http://192.168.0.27:8000
141158Hit:1 http://local-repo.fritz.box/local-repo trunk InRelease
142159Hit:2 http://deb.debian.org/debian bookworm InRelease
143160Hit:3 http://security.debian.org/debian-security bookworm-security InRelease
0 commit comments