Pavel Cizinsky | e267787 | 2017-01-31 22:09:12 +0100 | [diff] [blame^] | 1 | {%- from "apt-cacher-ng/map.jinja" import server with context %} |
| 2 | # This is a configuration file for apt-cacher-ng, a smart caching proxy for |
| 3 | # software package downloads. It's supposed to be in a directory specified by |
| 4 | # the -c option of apt-cacher-ng, see apt-cacher-ng(8) for details. |
| 5 | # |
| 6 | # NOTE: command line switches and other configuration files matching the same |
| 7 | # file naming scheme (*.conf) can override values from this file. |
| 8 | |
| 9 | # Letter case in variable names does not matter, names and values should be |
| 10 | # separated with colons. For boolean variables, zero number is considered false, |
| 11 | # non-zero considered true. If a default value is not explicitly mentioned in |
| 12 | # the description, the commented value assignments mostly represent the default |
| 13 | # values of the particular variables. |
| 14 | |
| 15 | # Storage directory for downloaded data and related maintenance activity. |
| 16 | # |
| 17 | CacheDir: /var/cache/apt-cacher-ng |
| 18 | |
| 19 | # Log file directory, can be set empty to disable logging |
| 20 | # |
| 21 | LogDir: /var/log/apt-cacher-ng |
| 22 | |
| 23 | # A place to look for additional configuration and resource files if they are not |
| 24 | # found in the configuration directory |
| 25 | # |
| 26 | # SupportDir: /usr/lib/apt-cacher-ng |
| 27 | |
| 28 | # TCP server port for incoming http (or HTTP proxy) connections. |
| 29 | # Can be set to 9999 to emulate apt-proxy. |
| 30 | # |
| 31 | Port: {{ server.bind.port }} |
| 32 | |
| 33 | # Addresses or hostnames to listen on. Multiple addresses must be separated by |
| 34 | # spaces. Each entry must be an exact local address which is associated with a |
| 35 | # local interface. DNS resolution is performed using getaddrinfo(3) for all |
| 36 | # available protocols (IPv4, IPv6, ...). Using a protocol specific format will |
| 37 | # create binding(s) only on protocol specific socket(s), e.g. 0.0.0.0 will |
| 38 | # listen only to IPv4. |
| 39 | # |
| 40 | # Default: listens on all interfaces and protocols |
| 41 | # |
| 42 | # BindAddress: localhost 192.168.7.254 publicNameOnMainInterface |
| 43 | BindAddress {{ server.bind.address }} |
| 44 | # The specification of another HTTP proxy which shall be used for downloads. |
| 45 | # It can include user name and password but see the manual for limitations. |
| 46 | # |
| 47 | # Default: uses direct connection |
| 48 | # |
| 49 | # Proxy: http://www-proxy.example.net:3128 |
| 50 | # Proxy: https://username:proxypassword@proxy.example.net:3129 |
| 51 | |
| 52 | # Repository remapping. See manual for details. |
| 53 | # In this example, some backends files might be generated during package |
| 54 | # installation using information collected on the system. |
| 55 | # Examples: |
| 56 | Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives |
| 57 | Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives |
| 58 | Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives |
| 59 | Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here |
| 60 | Remap-sfnet: file:sfnet_mirrors # ; file:backends_sfnet # incomplete, please create this file or specify preferred mirrors here |
| 61 | Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux |
| 62 | Remap-fedora: file:fedora_mirrors # Fedora Linux |
| 63 | Remap-epel: file:epel_mirrors # Fedora EPEL |
| 64 | Remap-slrep: file:sl_mirrors # Scientific Linux |
| 65 | Remap-gentoo: file:gentoo_mirrors.gz /gentoo ; file:backends_gentoo # Gentoo Archives |
| 66 | |
| 67 | # This is usually not needed for security.debian.org because it's always the |
| 68 | # same DNS hostname. However, it might be enabled in order to use hooks |
| 69 | # or ForceManaged mode or special flags in this context. Not set by default. |
| 70 | # Remap-secdeb: security.debian.org |
| 71 | |
| 72 | # Virtual page accessible in a web browser to see statistics and status |
| 73 | # information, i.e. under http://localhost:3142/acng-report.html |
| 74 | # |
| 75 | # Default: not set, should be set by the system administrator |
| 76 | # |
| 77 | ReportPage: acng-report.html |
| 78 | |
| 79 | # Socket file for accessing through local UNIX socket instead of TCP/IP. Can be |
| 80 | # used with inetd bridge or cron client. |
| 81 | # Default: not set, UNIX socket bridge is disabled. |
| 82 | # |
| 83 | # SocketPath:/var/run/apt-cacher-ng/socket |
| 84 | |
| 85 | # If set to 1, makes log files be written to disk on every new line. Default |
| 86 | # is 0, buffers are flushed after the client disconnects. Technically, |
| 87 | # it's a convenience alias for the Debug option, see below for details. |
| 88 | # |
| 89 | # UnbufferLogs: 0 |
| 90 | |
| 91 | # Enables extended client information in log entries. When set to 0, only |
| 92 | # activity type, time and transfer sizes are logged. |
| 93 | # |
| 94 | # VerboseLog: 1 |
| 95 | |
| 96 | # Don't detach from the starting console. |
| 97 | # |
| 98 | # ForeGround: 0 |
| 99 | |
| 100 | # Store the pid of the daemon process in the specified text file. |
| 101 | # Default: disabled |
| 102 | # |
| 103 | # PidFile: /var/run/apt-cacher-ng/pid |
| 104 | |
| 105 | # Forbid outgoing connections and work without an internet connection or |
| 106 | # respond with 503 error where it's not possible. |
| 107 | # |
| 108 | # Offlinemode: 0 |
| 109 | |
| 110 | # Forbid downloads from locations that are directly specified in the user |
| 111 | # request, i.e. all downloads must be processed by the preconfigured remapping |
| 112 | # backends (see above). |
| 113 | # |
| 114 | # ForceManaged: 0 |
| 115 | |
| 116 | # Days before considering an unreferenced file expired (to be deleted). |
| 117 | # WARNING: if the value is set too low and particular index files are not |
| 118 | # available for some days (mirror downtime) then there is a risk of removal of |
| 119 | # still useful package files. |
| 120 | # |
| 121 | ExTreshold: 4 |
| 122 | |
| 123 | # Stop expiration when a critical problem appears, issue like a failed update |
| 124 | # of an index file in the preparation step. |
| 125 | # |
| 126 | # WARNING: don't set this option to zero or empty without considering possible |
| 127 | # consequences like a sudden and complete cache data loss. |
| 128 | # |
| 129 | # ExAbortOnProblems: 1 |
| 130 | |
| 131 | # Number of failed nightly expiration runs which are considered acceptable and |
| 132 | # do not trigger an error notification to the admin (e.g. via daily cron job) |
| 133 | # before the (day) count is reached. Might be useful with whacky internet |
| 134 | # connections. |
| 135 | # |
| 136 | # Default: a guessed value, 1 if ExTreshold is 5 or more, 0 otherwise. |
| 137 | # |
| 138 | # ExSuppressAdminNotification: 1 |
| 139 | |
| 140 | # Modify file names to work around limitations of some file systems. |
| 141 | # WARNING: experimental feature, subject to change |
| 142 | # |
| 143 | # StupidFs: 0 |
| 144 | |
| 145 | # Experimental feature for apt-listbugs: pass-through SOAP requests and |
| 146 | # responses to/from bugs.debian.org. |
| 147 | # Default: guessed value, true unless ForceManaged is enabled |
| 148 | # |
| 149 | # ForwardBtsSoap: 1 |
| 150 | |
| 151 | # There is a small in-memory cache for DNS resolution data, expired by |
| 152 | # this timeout (in seconds). Internal caching is disabled if set to a value |
| 153 | # less than zero. |
| 154 | # |
| 155 | # DnsCacheSeconds: 1800 |
| 156 | |
| 157 | ############################################################################### |
| 158 | # |
| 159 | # WARNING: don't modify thread and file matching parameters without a clear |
| 160 | # idea of what is happening behind the scene! |
| 161 | # |
| 162 | # Max. count of connection threads kept ready (for faster response in the |
| 163 | # future). Should be a sane value between 0 and average number of connections, |
| 164 | # and depend on the amount of spare RAM. |
| 165 | # MaxStandbyConThreads: 8 |
| 166 | # |
| 167 | # Hard limit of active thread count for incoming connections, i.e. operation |
| 168 | # is refused when this value is reached (below zero = unlimited). |
| 169 | # MaxConThreads: -1 |
| 170 | # |
| 171 | # Pigeonholing files with regular expressions (static/volatile). Can be |
| 172 | # overriden here but not should not be done permanently because future update |
| 173 | # of default settings would not be applied later. |
| 174 | # VfilePattern = (^|.*/)(Index|Packages(\.gz|\.bz2|\.lzma|\.xz)?|InRelease|Release|Release\.gpg|custom\.gpg|mirrors.txt|Sources(\.gz|\.bz2|\.lzma|\.xz)?|release|index\.db-.*\.gz|Contents-[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|meta-release[^/]*|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|((setup|setup-legacy)(\.ini|\.bz2|\.hint)(\.sig)?)|mirrors\.lst|repo(index|md)\.xml(\.asc|\.key)?|directory\.yast|products|content(\.asc|\.key)?|media|filelists\.xml\.gz|filelists\.sqlite\.bz2|repomd\.xml|packages\.[a-zA-Z][a-zA-Z]\.gz|info\.txt|license\.tar\.gz|license\.zip|.*\.(db|files|abs)(\.tar(\.gz|\.bz2|\.lzma|\.xz))?|metalink\?repo|.*prestodelta\.xml\.gz|repodata/.*\.(xml|sqlite)(\.gz|\.bz2|\.lzma|\.xz))$|/dists/.*/installer-[^/]+/[^0-9][^/]+/images/.* |
| 175 | # PfilePattern = .*(\.d?deb|\.rpm|\.drpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz)(\.gpg)?|\.diff(\.gz|\.bz2|\.lzma|\.xz)|\.jigdo|\.template|changelog|copyright|\.udeb|\.debdelta|\.diff/.*\.gz|(Devel)?ReleaseAnnouncement(\?.*)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*)$ |
| 176 | # |
| 177 | # Whitelist for expiration, file types not to be removed even when being |
| 178 | # unreferenced. Default: many parts from VfilePattern where no parent index |
| 179 | # exists or might be unknown. |
| 180 | # WfilePattern = (^|.*/)(Release|InRelease|Release\.gpg|custom\.gpg|(Packages|Sources)(\.gz|\.bz2|\.lzma|\.xz)?|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|.*\.xml|.*\.(db|files|abs)(\.tar(\.gz|\.bz2|\.lzma|\.xz))?|[a-z]+32.exe)$|/dists/.*/installer-.*/images/.* |
| 181 | # |
| 182 | ############################################################################### |
| 183 | |
| 184 | # A bitmask type value declaring the loging verbosity and behavior of the error |
| 185 | # log writing. Non-zero value triggers at least faster log file flushing. |
| 186 | # |
| 187 | # Some higher bits only working with a special debug build of apt-cacher-ng, |
| 188 | # see the manual for details. The setting has an alias named UnbufferLogs. |
| 189 | # |
| 190 | # WARNING: this can write significant amount of data into apt-cacher.err logfile. |
| 191 | # |
| 192 | # Default: 0 |
| 193 | # |
| 194 | # Debug:3 |
| 195 | |
| 196 | # Usually, general purpose proxies like Squid expose the IP address of the |
| 197 | # client user to the remote server using the X-Forwarded-For HTTP header. This |
| 198 | # behaviour can be optionally turned on with the Expose-Origin option. |
| 199 | # |
| 200 | # ExposeOrigin: 0 |
| 201 | |
| 202 | # When logging the originating IP address, trust the information supplied by |
| 203 | # the client in the X-Forwarded-For header. |
| 204 | # |
| 205 | # LogSubmittedOrigin: 0 |
| 206 | |
| 207 | # The version string reported to the peer, to be displayed as HTTP client (and |
| 208 | # version) in the logs of the mirror. |
| 209 | # |
| 210 | # WARNING: Expect side effects! Some archives use this header to guess |
| 211 | # capabilities of the client (i.e. allow redirection and/or https links) and |
| 212 | # change their behaviour accordingly but ACNG might not support the expected |
| 213 | # features. |
| 214 | # |
| 215 | # Default: |
| 216 | # |
| 217 | # UserAgent: Yet Another HTTP Client/1.2.3p4 |
| 218 | |
| 219 | # In some cases the Import and Expiration tasks might create fresh volatile |
| 220 | # data for internal use by reconstructing them using patch files. This |
| 221 | # by-product might be recompressed with bzip2 and with some luck the resulting |
| 222 | # file becomes identical to the *.bz2 file on the server which can be used by |
| 223 | # APT when requesting a complete version of this file. |
| 224 | # The downside of this feature is higher CPU load on the server during |
| 225 | # the maintenance tasks, and the outcome might have not much value in a LAN |
| 226 | # where all clients update their data often and regularly and therefore usually |
| 227 | # don't need the full version of the index file. |
| 228 | # |
| 229 | # RecompBz2: 0 |
| 230 | |
| 231 | # Network timeout for outgoing connections, in seconds. |
| 232 | # |
| 233 | # NetworkTimeout: 60 |
| 234 | |
| 235 | # Sometimes it makes sense to not store the data in cache and just return the |
| 236 | # package data to client while it comes in. The following DontCache* parameters |
| 237 | # can enable this behaviour for certain URL types. The tokens are extended |
| 238 | # regular expressions which the URLs are evaluated against. |
| 239 | # |
| 240 | # DontCacheRequested is applied to the URL as it comes in from the client. |
| 241 | # Example: exclude packages built with kernel-package for x86 |
| 242 | # DontCacheRequested: linux-.*_10\...\.Custo._i386 |
| 243 | # Example usecase: exclude popular private IP ranges from caching |
| 244 | # DontCacheRequested: 192.168.0 ^10\..* 172.30 |
| 245 | # |
| 246 | # DontCacheResolved is applied to URLs after mapping to the target server. If |
| 247 | # multiple backend servers are specified then it's only matched against the |
| 248 | # download link for the FIRST possible source (due to implementation limits). |
| 249 | # |
| 250 | # Example usecase: all Ubuntu stuff comes from a local mirror (specified as |
| 251 | # backend), don't cache it again: |
| 252 | # DontCacheResolved: ubuntumirror.local.net |
| 253 | # |
| 254 | # DontCache directive sets (overrides) both, DontCacheResolved and |
| 255 | # DontCacheRequested. Provided for convenience, see those directives for |
| 256 | # details. |
| 257 | # |
| 258 | # Example: |
| 259 | # DontCache: .*.local.university.int |
| 260 | |
| 261 | # Default permission set of freshly created files and directories, as octal |
| 262 | # numbers (see chmod(1) for details). |
| 263 | # Can by limited by the umask value (see umask(2) for details) if it's set in |
| 264 | # the environment of the starting shell, e.g. in apt-cacher-ng init script or |
| 265 | # in its configuration file. |
| 266 | # |
| 267 | # DirPerms: 00755 |
| 268 | # FilePerms: 00664 |
| 269 | |
| 270 | # It's possible to use use apt-cacher-ng as a regular web server with a limited |
| 271 | # feature set, i.e. directory browsing, downloads of any files, Content-Type |
| 272 | # based on /etc/mime.types, but without sorting, CGI execution, index page |
| 273 | # redirection and other funny things. |
| 274 | # To get this behavior, mappings between virtual directories and real |
| 275 | # directories on the server must be defined with the LocalDirs directive. |
| 276 | # Virtual and real directories are separated by spaces, multiple pairs are |
| 277 | # separated by semi-colons. Real directories must be absolute paths. |
| 278 | # NOTE: Since the names of that key directories share the same namespace as |
| 279 | # repository names (see Remap-...) it is administrator's job to avoid conflicts |
| 280 | # between them or explicitly create them. |
| 281 | # |
| 282 | # LocalDirs: woo /data/debarchive/woody ; hamm /data/debarchive/hamm |
| 283 | LocalDirs: acng-doc /usr/share/doc/apt-cacher-ng |
| 284 | |
| 285 | # Precache a set of files referenced by specified index files. This can be used |
| 286 | # to create a partial mirror usable for offline work. There are certain limits |
| 287 | # and restrictions on the path specification, see manual and the cache control |
| 288 | # web site for details. A list of (maybe) relevant index files could be |
| 289 | # retrieved via "apt-get --print-uris update" on a client machine. |
| 290 | # |
| 291 | # Example: |
| 292 | # PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages* |
| 293 | |
| 294 | # Arbitrary set of data to append to request headers sent over the wire. Should |
| 295 | # be a well formated HTTP headers part including newlines (DOS style) which |
| 296 | # can be entered as escape sequences (\r\n). |
| 297 | # |
| 298 | # RequestAppendix: X-Tracking-Choice: do-not-track\r\n |
| 299 | |
| 300 | # Specifies the IP protocol families to use for remote connections. Order does |
| 301 | # matter, first specified are considered first. Possible combinations: |
| 302 | # v6 v4 |
| 303 | # v4 v6 |
| 304 | # v6 |
| 305 | # v4 |
| 306 | # Default: use native order of the system's TCP/IP stack |
| 307 | # |
| 308 | # ConnectProto: v6 v4 |
| 309 | |
| 310 | # Regular expiration algorithm finds package files which are no longer listed |
| 311 | # in any index file and removes them of them after a safety period. |
| 312 | # This option allows to keep more versions of a package in the cache after |
| 313 | # safety period is over. |
| 314 | # |
| 315 | # KeepExtraVersions: 1 |
| 316 | |
| 317 | # Optionally uses TCP access control provided by libwrap, see hosts_access(5) |
| 318 | # for details. Daemon name is apt-cacher-ng. |
| 319 | # |
| 320 | # Default: guessed on startup by looking for explicit mention of apt-cacher-ng |
| 321 | # in /etc/hosts.allow or /etc/hosts.deny files. |
| 322 | # |
| 323 | # UseWrap: 0 |
| 324 | |
| 325 | # If many machines from the same local network attempt to update index files |
| 326 | # (apt-get update) at nearly the same time, the known state of these index file |
| 327 | # is temporarily frozen and multiple requests receive the cached response |
| 328 | # without contacting the remote server again. This parameter (in seconds) |
| 329 | # specifies the length of this period before these (volatile) files are |
| 330 | # considered outdated. |
| 331 | # Setting this value too low transfers more data and increases remote server |
| 332 | # load, setting this too high (more than a couple of minutes) increases the |
| 333 | # risk of delivering inconsistent responses to the clients. |
| 334 | # |
| 335 | # FreshIndexMaxAge: 27 |
| 336 | |
| 337 | # Usually the users are not allowed to specify custom TCP ports of remote |
| 338 | # mirrors in the requests, only the default HTTP port can be used (as |
| 339 | # workaround, proxy administrator can create Remap- rules with custom ports). |
| 340 | # This restriction can be disabled by specifying a list of allowed ports or 0 |
| 341 | # for any port. |
| 342 | # |
| 343 | # AllowUserPorts: 80 |
| 344 | |
| 345 | # Normally the HTTP redirection responses are forwarded to the original caller |
| 346 | # (i.e. APT) which starts a new download attempt from the new URL. This |
| 347 | # solution is ok for client configurations with proxy mode but doesn't work |
| 348 | # well with configurations using URL prefixes in sources.list. To work around |
| 349 | # this the server can restart its own download with a redirection URL, |
| 350 | # configured with the following option. The downside is that this might be used |
| 351 | # to circumvent download source policies by malicious users. |
| 352 | # The RedirMax option specifies how many such redirects the server is allowed |
| 353 | # to follow per request, 0 disables the internal redirection. |
| 354 | # Default: guessed on startup, 0 if ForceManaged is used and 5 otherwise. |
| 355 | # |
| 356 | # RedirMax: 5 |
| 357 | |
| 358 | # There some broken HTTP servers and proxy servers in the wild which don't |
| 359 | # support the If-Range header correctly and return incorrect data when the |
| 360 | # contents of a (volatile) file changed. Setting VfileUseRangeOps to zero |
| 361 | # disables Range-based requests while retrieving volatile files, using |
| 362 | # If-Modified-Since and requesting the complete file instead. Setting it to |
| 363 | # a negative value removes even If-Modified-Since headers. |
| 364 | # |
| 365 | # VfileUseRangeOps: 1 |
| 366 | |
| 367 | # Allow data pass-through mode for certain hosts when requested by the client |
| 368 | # using a CONNECT request. This is particularly useful to allow access to SSL |
| 369 | # sites (https proxying). The string is a regular expression which should cover |
| 370 | # the server name with port and must be correctly formated and terminated. |
| 371 | # Examples: |
| 372 | # PassThroughPattern: private-ppa\.launchpad\.net:443$ |
| 373 | # PassThroughPattern: .* # this would allow CONNECT to everything |
| 374 | |
| 375 | # It's possible that an evil client requests a volatile file but does not |
| 376 | # retrieve the response and keeps the connection effectively stuck over |
| 377 | # many hours, blocking the particular file for other download attempts (which |
| 378 | # leads to not reporting file changes on server side to other users). The work |
| 379 | # around is the use of alternative file descriptors inside of apt-cacher-ng, |
| 380 | # however this might cost some extra download traffic due to worse cache usage. |
| 381 | # The ResponseFreezeDetectTime value specifies when a file descriptor in the |
| 382 | # mentioned state is to be considered defect and will require special handling. |
| 383 | # Default time is 500 seconds. |
| 384 | # |
| 385 | # ResponseFreezeDetectTime: 500 |
| 386 | |
| 387 | # Keep outgoing connections alive and reuse them for later downloads from |
| 388 | # the same server as long as possible. |
| 389 | # |
| 390 | # ReuseConnections: 1 |
| 391 | |
| 392 | # Maximum number of requests sent in a batch to remote servers before the first |
| 393 | # response is expected. Using higher values can greatly improve average |
| 394 | # throughput depending on network latency and the implementation of remote |
| 395 | # servers. Makes most sense when also enabled on the client side, see apt.conf |
| 396 | # documentation for details. |
| 397 | # |
| 398 | # Default: 255 if ReuseConnections is set, 1 otherwise |
| 399 | # |
| 400 | # PipelineDepth: 255 |
| 401 | |
| 402 | # Path to the system directory containing trusted CA certificates used for |
| 403 | # outgoing connections, see OpenSSL documentation for details. |
| 404 | # |
| 405 | # CApath: /etc/ssl/certs |
| 406 | # |
| 407 | # Path to a single trusted trusted CA certificate used for outgoing |
| 408 | # connections, see OpenSSL documentation for details. |
| 409 | # |
| 410 | # CAfile: |
| 411 | |
| 412 | |
| 413 | # If this value is set to a (positive) number of seconds then the proxy host |
| 414 | # specified by Proxy setting will be ignored if a connection to this host |
| 415 | # could not be established within this time span. The connection will then |
| 416 | # be made without HTTP proxy for the life time of the particular download |
| 417 | # stream and it may also affect other users on multiuser systems. |
| 418 | # |
| 419 | # NOTE: this feature is highly experimental and is subject to change! It can |
| 420 | # interfere badly with the per-repository proxy setting. |
| 421 | # |
| 422 | # OptProxyTimeout: -1 |
| 423 | |