Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

Commit b782172

Browse files
authored
Moved some options from httpd to chttpd (#659)
1 parent 6b44278 commit b782172

File tree

14 files changed

+205
-97
lines changed

14 files changed

+205
-97
lines changed

src/api/basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ specific request types are provided in the corresponding API call reference.
578578

579579
A document exceeds the configured :config:option:`couchdb/max_document_size`
580580
value or the entire request exceeds the
581-
:config:option:`httpd/max_http_request_size` value.
581+
:config:option:`chttpd/max_http_request_size` value.
582582

583583
- ``415 - Unsupported Media Type``
584584

src/api/database/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
before the response is sent, even if there are no results.
9696
Only applicable for :ref:`longpoll <changes/longpoll>` or
9797
:ref:`continuous <changes/continuous>` feeds.
98-
Default value is specified by :config:option:`httpd/changes_timeout`
98+
Default value is specified by :config:option:`chttpd/changes_timeout`
9999
configuration option. Note that ``60000`` value is also the default
100100
maximum timeout to prevent undetected dead connections.
101101
:query string view: Allows to use view functions as filters. Documents

src/api/server/authn.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ client can use for the next few requests to CouchDB. Tokens are valid until
7474
a timeout. When CouchDB sees a valid token in a subsequent request, it will
7575
authenticate the user by this token without requesting the password again. By
7676
default, cookies are valid for 10 minutes, but it's :config:option:`adjustable
77-
<couch_httpd_auth/timeout>`. Also it's possible to make cookies
78-
:config:option:`persistent <couch_httpd_auth/allow_persistent_cookies>`.
77+
<chttpd_auth/timeout>`. Also it's possible to make cookies
78+
:config:option:`persistent <chttpd_auth/allow_persistent_cookies>`.
7979

8080
To obtain the first token and thus authenticate a user for the first time, the
8181
`username` and `password` must be sent to the :ref:`_session API
@@ -290,13 +290,13 @@ This authentication method allows creation of a :ref:`userctx_object` for
290290
remotely authenticated user. By default, the client just needs to pass specific
291291
headers to CouchDB with related requests:
292292

293-
- :config:option:`X-Auth-CouchDB-UserName <couch_httpd_auth/x_auth_username>`:
293+
- :config:option:`X-Auth-CouchDB-UserName <chttpd_auth/x_auth_username>`:
294294
username;
295-
- :config:option:`X-Auth-CouchDB-Roles <couch_httpd_auth/x_auth_roles>`:
295+
- :config:option:`X-Auth-CouchDB-Roles <chttpd_auth/x_auth_roles>`:
296296
comma-separated (``,``) list of user roles;
297-
- :config:option:`X-Auth-CouchDB-Token <couch_httpd_auth/x_auth_token>`:
297+
- :config:option:`X-Auth-CouchDB-Token <chttpd_auth/x_auth_token>`:
298298
authentication token. When
299-
:config:option:`proxy_use_secret <couch_httpd_auth/proxy_use_secret>`
299+
:config:option:`proxy_use_secret <chttpd_auth/proxy_use_secret>`
300300
is set (which is strongly recommended!), this header provides an HMAC of the
301301
username to authenticate and the secret token to prevent requests from
302302
untrusted sources. (Use the SHA1 of the username and sign with the secret)

src/api/server/configuration.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ interact with the local node's configuration.
7878
"view_index_dir": "/var/lib/couchdb"
7979
},
8080
"chttpd": {
81+
"allow_jsonp": "false",
8182
"backlog": "512",
8283
"bind_address": "0.0.0.0",
8384
"port": "5984",
8485
"require_valid_user": "false",
8586
"socket_options": "[{sndbuf, 262144}, {nodelay, true}]",
86-
"server_options": "[{recbuf, undefined}]"
87+
"server_options": "[{recbuf, undefined}]",
88+
"secure_rewrites": "true"
8789
},
8890
"httpd": {
89-
"allow_jsonp": "false",
9091
"authentication_handlers": "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}",
9192
"bind_address": "192.168.0.2",
9293
"max_connections": "2048",
9394
"port": "5984",
94-
"secure_rewrites": "true"
9595
},
9696
"log": {
9797
"writer": "file",
@@ -155,13 +155,10 @@ interact with the local node's configuration.
155155
Server: CouchDB (Erlang/OTP)
156156
157157
{
158-
"allow_jsonp": "false",
159158
"authentication_handlers": "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}",
160159
"bind_address": "127.0.0.1",
161160
"default_handler": "{couch_httpd_db, handle_request}",
162-
"enable_cors": "false",
163-
"port": "5984",
164-
"secure_rewrites": "true"
161+
"port": "5984"
165162
}
166163
167164
.. _api/config/section/key:

src/config/auth.rst

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Server Administrators
106106
1.4 `PBKDF2` server-side hashed salted password support added, now as a
107107
synchronous call for the ``_config/admins`` API.
108108

109-
.. _config/couch_httpd_auth:
109+
.. _config/chttpd_auth:
110110

111111
Authentication Configuration
112112
============================
@@ -130,176 +130,210 @@ Authentication Configuration
130130
[chttpd]
131131
require_valid_user_except_for_up = false
132132

133-
.. config:section:: couch_httpd_auth :: Authentication Configuration
133+
.. config:section:: chttpd_auth :: Authentication Configuration
134+
135+
.. versionchanged:: 3.2 These options were moved to [chttpd_auth] section:
136+
`authentication_redirect`, `require_valid_user`, `timeout`,
137+
`auth_cache_size`, `allow_persistent_cookies`, `iterations`,
138+
`min_iterations`, `max_iterations`, `secret`, `users_db_public`,
139+
`x_auth_roles`, `x_auth_token`, `x_auth_username`,
140+
`cookie_domain`, `same_site`.
134141

135142
.. config:option:: allow_persistent_cookies :: Persistent cookies
136143
144+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
145+
137146
When set to ``true``, CouchDB will set the Max-Age and Expires attributes
138147
on the cookie, which causes user agents (like browsers) to preserve the cookie
139148
over restarts. ::
140149

141-
[couch_httpd_auth]
150+
[chttpd_auth]
142151
allow_persistent_cookies = true
143152

144153
.. config:option:: cookie_domain :: Cookie Domain
145154
146155
.. versionadded:: 2.1.1
156+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
147157

148158
Configures the ``domain`` attribute of the ``AuthSession`` cookie. By default the
149159
``domain`` attribute is empty, resulting in the cookie being set on CouchDB's domain. ::
150160

151-
[couch_httpd_auth]
161+
[chttpd_auth]
152162
cookie_domain = example.com
153163

154164
.. config:option:: same_site :: SameSite
155165
156166
.. versionadded:: 3.0.0
167+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
157168

158169
When this option is set to a non-empty value, a ``SameSite`` attribute is added to
159170
the ``AuthSession`` cookie. Valid values are ``none``, ``lax`` or ``strict``.::
160171

161-
[couch_httpd_auth]
172+
[chttpd_auth]
162173
same_site = strict
163174

164175
.. config:option:: auth_cache_size :: Authentication cache
165176
177+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
178+
166179
Number of :ref:`userctx_object` to cache in memory, to reduce disk
167180
lookups. ::
168181

169-
[couch_httpd_auth]
182+
[chttpd_auth]
170183
auth_cache_size = 50
171184

172185
.. config:option:: authentication_redirect :: Default redirect for authentication requests
173186
187+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
188+
174189
Specifies the location for redirection on successful authentication if
175190
a ``text/html`` response is accepted by the client (via an ``Accept``
176191
header). ::
177192

178-
[couch_httpd_auth]
193+
[chttpd_auth]
179194
authentication_redirect = /_utils/session.html
180195

181196
.. config:option:: iterations :: PBKDF2 iterations count
182197
183198
.. versionadded:: 1.3
199+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
184200

185201
The number of iterations for password hashing by the PBKDF2 algorithm.
186202
A higher number provides better hash durability, but comes at a cost
187203
in performance for each request that requires authentication. ::
188204

189-
[couch_httpd_auth]
205+
[chttpd_auth]
190206
iterations = 10000
191207

192208
.. config:option:: min_iterations :: Minimum PBKDF2 iterations count
193209
194210
.. versionadded:: 1.6
211+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
195212

196213
The minimum number of iterations allowed for passwords hashed by the
197214
PBKDF2 algorithm. Any user with fewer iterations is forbidden. ::
198215

199-
[couch_httpd_auth]
216+
[chttpd_auth]
200217
min_iterations = 100
201218

202219
.. config:option:: max_iterations :: Maximum PBKDF2 iterations count
203220
204221
.. versionadded:: 1.6
222+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
205223

206224
The maximum number of iterations allowed for passwords hashed by the
207225
PBKDF2 algorithm. Any user with greater iterations is forbidden. ::
208226

209-
[couch_httpd_auth]
227+
[chttpd_auth]
210228
max_iterations = 100000
211229

212230
.. config:option:: proxy_use_secret :: Force proxy auth to use secret token
213231
232+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
233+
214234
When this option is set to ``true``, the
215-
:option:`couch_httpd_auth/secret` option is required for
235+
:option:`chttpd_auth/secret` option is required for
216236
:ref:`api/auth/proxy`. ::
217237

218-
[couch_httpd_auth]
238+
[chttpd_auth]
219239
proxy_use_secret = false
220240

221241
.. config:option:: public_fields :: User documents public fields
222242
223243
.. versionadded:: 1.4
244+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
224245

225246
A comma-separated list of field names in user documents (in
226247
:option:`couchdb/users_db_suffix`) that can be read by any
227248
user. If unset or not specified, authenticated users can only retrieve
228249
their own document. ::
229250

230-
[couch_httpd_auth]
251+
[chttpd_auth]
231252
public_fields = first_name, last_name, contacts, url
232253

233254
.. note::
234255
Using the ``public_fields`` allowlist for user document properties
235-
requires setting the :option:`couch_httpd_auth/users_db_public`
256+
requires setting the :option:`chttpd_auth/users_db_public`
236257
option to ``true`` (the latter option has no other purpose)::
237258

238-
[couch_httpd_auth]
259+
[chttpd_auth]
239260
users_db_public = true
240261

241262
.. config:option:: require_valid_user :: Force user authentication
242263
264+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
265+
243266
When this option is set to ``true``, no requests are allowed from
244267
anonymous users. Everyone must be authenticated. ::
245268

246-
[couch_httpd_auth]
269+
[chttpd_auth]
247270
require_valid_user = false
248271

249272
.. config:option:: secret :: Authentication secret token
250273
274+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
275+
251276
The secret token is used for :ref:`api/auth/proxy` and for :ref:`api/auth/cookie`. ::
252277

253-
[couch_httpd_auth]
278+
[chttpd_auth]
254279
secret = 92de07df7e7a3fe14808cef90a7cc0d91
255280

256281
.. config:option:: timeout :: Session timeout
257282
283+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
284+
258285
Number of seconds since the last request before sessions will be
259286
expired. ::
260287

261-
[couch_httpd_auth]
288+
[chttpd_auth]
262289
timeout = 600
263290

264291
.. config:option:: users_db_public :: Publish user documents
265292
266293
.. versionadded:: 1.4
294+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
267295

268296
Allow all users to view user documents. By default, only admins may
269297
browse all users documents, while users may browse only their own
270298
document. ::
271299

272-
[couch_httpd_auth]
300+
[chttpd_auth]
273301
users_db_public = false
274302

275303
.. config:option:: x_auth_roles :: Proxy Auth roles header
276304
305+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
306+
277307
The HTTP header name (``X-Auth-CouchDB-Roles`` by default) that
278308
contains the list of a user's roles, separated by a comma. Used for
279309
:ref:`api/auth/proxy`. ::
280310

281-
[couch_httpd_auth]
311+
[chttpd_auth]
282312
x_auth_roles = X-Auth-CouchDB-Roles
283313

284314
.. config:option:: x_auth_token :: Proxy Auth token header
285315
316+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
317+
286318
The HTTP header name (``X-Auth-CouchDB-Token`` by default) containing
287319
the token used to authenticate the authorization. This token is an
288-
`HMAC-SHA1` created from the :option:`couch_httpd_auth/secret` and
289-
:option:`couch_httpd_auth/x_auth_username`. The secret key should be
320+
`HMAC-SHA1` created from the :option:`chttpd_auth/secret` and
321+
:option:`chttpd_auth/x_auth_username`. The secret key should be
290322
the same on the client and the CouchDB node. This token is optional if
291-
the value of the :option:`couch_httpd_auth/proxy_use_secret` option is
323+
the value of the :option:`chttpd_auth/proxy_use_secret` option is
292324
not ``true``. Used for :ref:`api/auth/proxy`. ::
293325

294-
[couch_httpd_auth]
326+
[chttpd_auth]
295327
x_auth_token = X-Auth-CouchDB-Token
296328

297329
.. config:option:: x_auth_username :: Proxy Auth username header
298330
331+
.. versionchanged:: 3.2 moved from [couch_httpd_auth] to [chttpd_auth] section
332+
299333
The HTTP header name (``X-Auth-CouchDB-UserName`` by default)
300334
containing the username. Used for :ref:`api/auth/proxy`. ::
301335

302-
[couch_httpd_auth]
336+
[chttpd_auth]
303337
x_auth_username = X-Auth-CouchDB-UserName
304338

305339
.. config:section:: jwt_auth :: JWT Authentication

src/config/couchdb.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Base CouchDB Options
146146
http request body sizes. For individual document updates via `PUT`
147147
that approximation was close enough, however that is not the case
148148
for `_bulk_docs` endpoint. After 2.1.0 a separate configuration
149-
parameter was defined: :config:option:`httpd/max_http_request_size`,
149+
parameter was defined: :config:option:`chttpd/max_http_request_size`,
150150
which can be used to limit maximum http request sizes. After upgrade,
151151
it is advisable to review those settings and adjust them accordingly.
152152

0 commit comments

Comments
 (0)