Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -722,16 +722,10 @@ properties:
"session_cookie_name": "CustomName1",
"server": "http://localhost:8091",
"bucket": "bucket-1",
"users": {
"user_1": {"password":"1234"}
},
"db2": {
"session_cookie_name": "CustomName2",
"server": "http://localhost:8091",
"bucket": "bucket-2",
"users": {
"adam_2": {"password":"5678"}
}
"bucket": "bucket-2"
}
}
}
Expand Down
87 changes: 40 additions & 47 deletions modules/ROOT/assets/attachments/rest-api-admin-database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1144,20 +1144,34 @@ definitions:

sync:
$ref: '#/definitions/sync_function_model'

users:
#
# users:
# type: object
# title: user_configuration_model
# description: |+
# Defines the user(s) for this Sync Gateway database
# $ref: "#/definitions/user_configuration_model"

# roles:
# type: object
# title: role_configuration_model
# description: |+
# Defines the role(s) for this Sync Gateway database
# $ref: "#/definitions/role_configuration_model"

guest:
type: object
title: user_configuration_model
description: |+
Defines the user(s) for this Sync Gateway database
$ref: "#/definitions/user_configuration_model"
Defines whether a GUEST user is available and able to interacted, unauthenticated, with the Public REST API
properties:
disabled:
type: boolean
default: true
description: |+
Set `disabled` = `false` to allow GUEST

roles:
type: object
title: role_configuration_model
description: |+
Defines the role(s) for this Sync Gateway database
$ref: "#/definitions/role_configuration_model"
For example:
```curl -X PUT username:password@localhost:4985/db/_config -H "Content-Type: application/json" --data-binary '{"guest": {"disabled":false}}```

revs_limit:
type: integer
Expand Down Expand Up @@ -1240,11 +1254,8 @@ definitions:
{
"databases": {
"db": {
"server": "http://localhost:8091",
"bucket": "default",
"password": "password",
"import_docs": true,
"enable_shared_bucket_access": true,
"import_filter": `
function(doc) {
if (doc.type != "mobile") {
Expand Down Expand Up @@ -1782,23 +1793,23 @@ definitions:
The default is `7776000` seconds (90 days).
default: 7776000

enable_shared_bucket_access:
type: boolean
description: |+
**Deprecated at 3.0**
# enable_shared_bucket_access:
# type: boolean
# description: |+
# **Deprecated at 3.0**

use the `enable_shared_bucket_access` property to define whether to use extended attributes to store sync metadata; this is required to enable mobile-to-server data sync (_mobile convergence_).
# use the `enable_shared_bucket_access` property to define whether to use extended attributes to store sync metadata; this is required to enable mobile-to-server data sync (_mobile convergence_).

You can learn more about this functionality in [Syncing with Couchbase Server](sync-with-couchbase-server.html)
# You can learn more about this functionality in [Syncing with Couchbase Server](sync-with-couchbase-server.html)

This property works in conjunction with the ```import_docs``` property, which determines whether a node participates in import processing.
# This property works in conjunction with the ```import_docs``` property, which determines whether a node participates in import processing.

Set `enable_shared_bucket_access` to `true` on all nodes participating in such a configuration.
# Set `enable_shared_bucket_access` to `true` on all nodes participating in such a configuration.

On start-up, Sync Gateway will generate the mobile-specific metadata for all the pre-existing documents in the Couchbase Server bucket. From then on, documents can be inserted on the Server directly (with N1QL or SDKs) or through the Sync Gateway REST API.
# On start-up, Sync Gateway will generate the mobile-specific metadata for all the pre-existing documents in the Couchbase Server bucket. From then on, documents can be inserted on the Server directly (with N1QL or SDKs) or through the Sync Gateway REST API.

Change initiates a database restart
default: 'false'
# Change initiates a database restart
# default: 'false'

session_cookie_secure:
type: boolean
Expand All @@ -1823,23 +1834,13 @@ definitions:

```json
{
"interface":":4984",
"log":["*"],
"databases": {
"db1": {
"session_cookie_name": "CustomName1",
"server": "http://localhost:8091",
"bucket": "bucket-1",
"users": {
"user_1": {"password":"1234"}
},
"db2": {
"db2": {
"session_cookie_name": "CustomName2",
"server": "http://localhost:8091",
"bucket": "bucket-2",
"users": {
"adam_2": {"password":"5678"}
}
}
}
}
Expand Down Expand Up @@ -1943,18 +1944,10 @@ definitions:

```json
{
"logging": {
"console": {
"log_keys": ["*"]
}
},
"databases": {
"db": {
"server": "http://localhost:8091",
"bucket": "default",
"users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
"allow_conflicts": false,
"revs_limit": 20,
# ... any other config required ...
"delta_sync": {
"enabled": true,
"rev_max_age_seconds": 86400
Expand All @@ -1968,9 +1961,9 @@ definitions:

-- Use of Delta Sync incurs additional bucket storage requirements which can be tuned with the [`rev_max_age_seconds`](#databases-this_db-delta_sync-rev_max_age_seconds) property.

-- Delta Sync is automatically enabled for peer-to-peer sync between Couchbase Lite clients.
-- Delta Sync is automatically enabled for peer-to-peer sync (where available) between Couchbase Lite clients.

-- Delta sync is disabled for Couchbase Lite database replicas.
-- Delta sync is disabled for Couchbase Lite database replicas (where available).

-- Push replications do not use Delta Sync when pushing to a pre-2.8 target.

Expand Down
76 changes: 28 additions & 48 deletions modules/ROOT/assets/attachments/rest-api-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ consumes:
- application/json
produces:
- application/json

paths:
/:
get:
Expand Down Expand Up @@ -297,9 +296,8 @@ paths:

```
{
"server":"http://localhost:8091",<br>
"bucket": "todo_app",<br>
"users": {"john": {"password": "pass", "admin_channels": ["*"]}}
"name": "todo_db"
"bucket": "todo_app"
}
```

Expand All @@ -315,7 +313,6 @@ paths:

delete:
tags:
- 'Database Configuration'
- 'Database Management'
summary: Delete database
description: Delete database
Expand Down Expand Up @@ -2673,6 +2670,20 @@ definitions:
# Defines the role(s) for this Sync Gateway database
# $ref: "#/definitions/role_configuration_model"

guest:
type: object
description: |+
Defines whether a GUEST user is available and able to interacted, unauthenticated, with the Public REST API
properties:
disabled:
type: boolean
default: true
description: |+
Set `disabled` = `false` to allow GUEST

For example:
```curl -X PUT username:password@localhost:4985/db/_config -H "Content-Type: application/json" --data-binary '{"guest": {"disabled":false}}```

revs_limit:
type: integer
description: |+
Expand Down Expand Up @@ -2746,7 +2757,7 @@ definitions:
import_filter:
type: string
description: |+
The `import_filter` property holds a Javascript function that cpntrols whether a document written to the Couchbase Server bucket should be made available to Couchbase Mobile clients (that is, it should be imported).
The `import_filter` property holds a Javascript function that controls whether a document written to the Couchbase Server bucket should be made available to Couchbase Mobile clients (that is, it should be imported).

This JavaScript filter function is provisioned using the Admin Rest API Endpoint ```put {db}/_config/import_filter```.
Add function as plain javascript in the request body, with the ```content-Type: application/javascript``` header.
Expand All @@ -2757,20 +2768,15 @@ definitions:
{
"databases": {
"db": {
"server": "http://localhost:8091",
"bucket": "default",
"password": "password",
"import_docs": true,
"enable_shared_bucket_access": true,
"import_filter": `
function(doc) {
if (doc.type != "mobile") {
return false
}
return true
}
`,
}
"import_filter": `
function(doc) {
if (doc.type != "mobile") {
return false
}
return true
}
`,
}
}
}
```
Expand Down Expand Up @@ -3340,23 +3346,14 @@ definitions:

```json
{
"interface":":4984",
"log":["*"],
"databases": {
"db1": {
"session_cookie_name": "CustomName1",
"server": "http://localhost:8091",
"bucket": "bucket-1",
"users": {
"user_1": {"password":"1234"}
"bucket": "bucket-1"
},
"db2": {
"session_cookie_name": "CustomName2",
"server": "http://localhost:8091",
"bucket": "bucket-2",
"users": {
"adam_2": {"password":"5678"}
}
"bucket": "bucket-2"
}
}
}
Expand Down Expand Up @@ -3460,18 +3457,8 @@ definitions:

```json
{
"logging": {
"console": {
"log_keys": ["*"]
}
},
"databases": {
"db": {
"server": "http://localhost:8091",
"bucket": "default",
"users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
"allow_conflicts": false,
"revs_limit": 20,
"delta_sync": {
"enabled": true,
"rev_max_age_seconds": 86400
Expand Down Expand Up @@ -4092,13 +4079,6 @@ definitions:
description: Role name









ActiveTaskResponseBody:
type: object
properties:
Expand Down
Loading