File: README.md

package info (click to toggle)
auto-apt-proxy 17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: sh: 428; makefile: 11
file content (114 lines) | stat: -rw-r--r-- 4,389 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# NAME

auto-apt-proxy - autodetect common APT proxy setups

# USAGE

**auto-apt-proxy**

**auto-apt-proxy** *[COMMAND [ARGS ...]]*

# DESCRIPTION

**auto-apt-proxy** is an APT proxy autodetector, and detects common setups by
checking localhost, your gateway and other "interesting" machines on your
network for well-known APT proxies such as apt-cacher-ng and others.

When called with no arguments, **auto-apt-proxy** simply prints the address of
a detected proxy to the standard output. This package installs an APT
configuration file that makes APT use **auto-apt-proxy** to detect a proxy on
every invocation of APT.

When called with arguments, they are assumed to be a command. Such command will
be executed with the common environment variables used for specifying HTTP
proxies (*http_proxy*, *HTTP_PROXY*) set to the detected proxy. This way the
executed command will be able to transparently use any detected APT proxy. Note
that for this to work, any programs invoked by the given command must have
their own support for detecting HTTP proxies from those environment variables,
and for using them.

# CONFIGURATION

When your apt proxy is installed on localhost or your default gateway,
it should Just Work.  If you install it somewhere else, you can create
an explicit SRV record to tell **auto-apt-proxy** about it.

Suppose your corporate domain is "example.com", and
`apt-cacher-ng` is installed on "apt-cacher-ng.example.com", and
**auto-apt-proxy** is installed on "alices-laptop.example.com".

The appropriate SRV record in dnsmasq.conf would look like this:

    srv-host=_apt_proxy._tcp.example.com,apt-cacher-ng.example.com,3142

The appropriate nsd/bind zonefile entry would look like this (untested):

    _apt_proxy._tcp.@  IN SRV 0 0 3142 apt-cacher-ng.@

As an alternative to an SRV record, one can also define a special hostname
which needs to be resolved via DNS or local */etc/hosts* file, called
**apt-proxy**.  For example, if your network has a local apt proxy at 9.9.9.9,
then add this line to */etc/hosts*:

    9.9.9.9    apt-proxy

If `avahi-browse` is installed, then **auto-apt-proxy** will try to
find any proxies announced via mDNS. If, for some reason, you would prefer the
name of the announced proxy to be resolved via NSS rather than the somewhat
arbitrary order provided by Avahi, you can set `AUTO_APT_PROXY_AVAHI_NAME`
environment variable to any non-empty string. `AUTO_APT_PROXY_AVAHI_NAME` does
not change which proxy is used if multiple mDNS provided proxies are available.

# PRECEDENCE BETWEEN MULTIPLE POSSIBLE PROXIES

**auto-apt-proxy** will look for possible proxies in the following order:

- A locally running proxy on 127.0.0.1
- A locally running proxy on other local addresses
- A proxy running on the host `apt-proxy`, according to /etc/hosts.
- A proxy on the network default gateway
- A proxy running on the host `apt-proxy`, according to DNS.
- A proxy running in the host and port declared in the `_apt_proxy_` SRV DNS
  record
- A proxy running and announced via mDNS (avahi).

# CACHING

By default, **auto-apt-proxy** will cache its results for 60 seconds.

To disable the cache, set the `AUTO_APT_PROXY_NO_CACHE` environment variable to
any non-empty string.

# DEBUGGING ISSUES

By default, **auto-apt-proxy** operates silently and will only output any
detected proxy to `stdout`, as `apt` expects. To enable logging, set the
`AUTO_APT_PROXY_DEBUG` environment variable to a non-empty string and
**auto-apt-proxy** will log debugging messages to `stderr`.

# EXAMPLES

$ **auto-apt-proxy**

Just prints the detected APT proxy

$ **auto-apt-proxy** debootstrap sid /my/chroot

Creates a new Debian *chroot* downloading packages from the local proxy.

# COPYRIGHT

Copyright (C) 2016-2020 Antonio Terceiro

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.