From owner-freebsd-doc@FreeBSD.ORG Thu Jan 22 18:23:13 2004 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4A3B16A4CE for ; Thu, 22 Jan 2004 18:23:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAA4943D39 for ; Thu, 22 Jan 2004 18:22:20 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0N2LAFR077129 for ; Thu, 22 Jan 2004 18:21:10 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0N2LAnX077128; Thu, 22 Jan 2004 18:21:10 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 22 Jan 2004 18:21:10 -0800 (PST) Resent-Message-Id: <200401230221.i0N2LAnX077128@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Christian S.J. Peron" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DFEB16A4CE for ; Thu, 22 Jan 2004 18:11:08 -0800 (PST) Received: from h24-77-20-99.wp.shawcable.net (h24-77-20-99.wp.shawcable.net [24.77.20.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D51443D4C for ; Thu, 22 Jan 2004 18:07:05 -0800 (PST) (envelope-from modulus@h24-77-20-99.wp.shawcable.net) Received: from h24-77-20-99.wp.shawcable.net (localhost [127.0.0.1]) i0N23VfP062498 for ; Fri, 23 Jan 2004 02:03:32 GMT (envelope-from modulus@h24-77-20-99.wp.shawcable.net) Received: (from root@localhost)i0N23VV9062497; Fri, 23 Jan 2004 02:03:31 GMT (envelope-from modulus) Message-Id: <200401230203.i0N23VV9062497@h24-77-20-99.wp.shawcable.net> Date: Fri, 23 Jan 2004 02:03:31 GMT From: "Christian S.J. Peron" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/61759: [patch] Document environment variables from fetch(3) in fetch(1) X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Christian S.J. Peron" List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2004 02:23:14 -0000 >Number: 61759 >Category: docs >Synopsis: [patch] Document environment variables from fetch(3) in fetch(1) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jan 22 18:20:00 PST 2004 >Closed-Date: >Last-Modified: >Originator: Christian S.J. Peron >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD movl 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sun Dec 14 22:05:47 GMT 2003 maneo@movl:/usr/src/sys/i386/compile/ROUTER i386 >Description: Although the environment variables supported by fetch are documented in fetch(3), it would be more convinient to have them documented in fetch(1), as this is the place users would expect to see them. >How-To-Repeat: N/A >Fix: --- usr.bin/fetch/fetch.1 Fri Jan 23 01:53:34 2004 +++ usr.bin/fetch/fetch.1.newer Fri Jan 23 01:50:33 2004 @@ -214,20 +214,116 @@ will attempt to retrieve them each of them in turn, and return zero only if they were all successfully retrieved. .Sh ENVIRONMENT -.Bl -tag -width HTTP_TIMEOUT -.It Ev FTP_TIMEOUT -maximum time, in seconds, to wait before aborting an -.Tn FTP -connection. -.It Ev HTTP_TIMEOUT -maximum time, in seconds, to wait before aborting an -.Tn HTTP -connection. +.Bl -tag -width ".Ev FETCH_BIND_ADDRESS" +.It Ev FETCH_BIND_ADDRESS +Specifies a hostname or IP address to which sockets used for outgoing +connections will be bound. +.It Ev FTP_LOGIN +Default FTP login if none was provided in the URL. +.It Ev FTP_PASSIVE_MODE +If set to anything but +.Ql no , +forces the FTP code to use passive mode. +.It Ev FTP_PASSWORD +Default FTP password if the remote server requests one and none was +provided in the URL. +.It Ev FTP_PROXY +URL of the proxy to use for FTP requests. +The document part is ignored. +FTP and HTTP proxies are supported; if no scheme is specified, FTP is +assumed. +If the proxy is an FTP proxy, +.Nm fetch +will send +.Ql user@host +as user name to the proxy, where +.Ql user +is the real user name, and +.Ql host +is the name of the FTP server. +.Pp +If this variable is set to an empty string, no proxy will be used for +FTP requests, even if the +.Ev HTTP_PROXY +variable is set. +.It Ev ftp_proxy +Same as +.Ev FTP_PROXY , +for compatibility. +.It Ev HTTP_AUTH +Specifies HTTP authorization parameters as a colon-separated list of +items. +The first and second item are the authorization scheme and realm +respectively; further items are scheme-dependent. +Currently, only basic authorization is supported. +.Pp +Basic authorization requires two parameters: the user name and +password, in that order. +.Pp +This variable is only used if the server requires authorization and +no user name or password was specified in the URL. +.It Ev HTTP_PROXY +URL of the proxy to use for HTTP requests. +The document part is ignored. +Only HTTP proxies are supported for HTTP requests. +If no port number is specified, the default is 3128. +.Pp +Note that this proxy will also be used for FTP documents, unless the +.Ev FTP_PROXY +variable is set. +.It Ev http_proxy +Same as +.Ev HTTP_PROXY , +for compatibility. +.It Ev HTTP_PROXY_AUTH +Specifies authorization parameters for the HTTP proxy in the same +format as the +.Ev HTTP_AUTH +variable. +.Pp +This variable is used if and only if connected to an HTTP proxy, and +is ignored if a user and/or a password were specified in the proxy +URL. +.It Ev HTTP_REFERER +Specifies the referrer URL to use for HTTP requests. +If set to +.Dq auto , +the document URL will be used as referrer URL. +.It Ev HTTP_USER_AGENT +Specifies the User-Agent string to use for HTTP requests. +This can be useful when working with HTTP origin or proxy servers that +differentiate between user agents. +.It Ev NETRC +Specifies a file to use instead of +.Pa ~/.netrc +to look up login names and passwords for FTP sites. +See +.Xr ftp 1 +for a description of the file format. +This feature is experimental. .El +.Sh EXAMPLES +To access a proxy server on +.Pa proxy.example.com +port 8080, set the +.Ev HTTP_PROXY +environment variable in a manner similar to this: +.Pp +.Dl HTTP_PROXY=http://proxy.example.com:8080 +.Pp +If the proxy server requires authentication, there are +two options available for passing the authentication data. +The first method is by using the proxy URL: +.Pp +.Dl HTTP_PROXY=http://:@proxy.example.com:8080 .Pp -All environment variables mentioned in the documentation for the -.Xr fetch 3 -library are supported. +The second method is by using the +.Ev HTTP_PROXY_AUTH +environment variable: +.Bd -literal -offset indent +HTTP_PROXY=http://proxy.example.com:8080 +HTTP_PROXY_AUTH=basic:*:: +.Ed .Sh SEE ALSO .Xr fetch 3 .Sh HISTORY >Release-Note: >Audit-Trail: >Unformatted: