Skip to content

Instantly share code, notes, and snippets.

@jchris
Last active December 15, 2015 05:29
Show Gist options
  • Save jchris/5209449 to your computer and use it in GitHub Desktop.
Save jchris/5209449 to your computer and use it in GitHub Desktop.
./sync_gateway ~/code/CouchChat-iOS/sync-gateway-config.json
16:23:39.792740 Enabling logging: [CRUD REST+]
Sync Gateway starting with config settings:
{
"Interface": ":4984",
"AdminInterface": ":4985",
"Persona": {
"Origin": "http://animal.local:4984/"
},
"Log": [
"CRUD",
"REST+"
],
"Pretty": false,
"Databases": {
"sync_gateway": {
"Server": "walrus:/Users/jchris/code/syncdata",
"Bucket": "sync_gateway",
"Pool": "default",
"Sync": "\n\nfunction(doc, oldDoc, userCtx, secObj) {\n if (doc.channel_id) {\n // doc belongs to a channel\n channel(\"ch-\"+doc.channel_id);\n // this document describes a channel\n if (doc.channel_id == doc._id) {\n // magic document, treat it carefully\n if (oldDoc && oldDoc.owners.indexOf(userCtx.name) == -1) {\n throw({unauthorized:\"you are not a channel owner\"});\n }\n // grants access to the channel to all members and owners\n var them = doc.owners.concat(doc.members);\n access(doc.owners, \"ch-\"+doc._id);\n access(doc.members, \"ch-\"+doc._id);\n\n // notify members of the new channel\n // TODO this can be removed once\n // https://github.com/couchbaselabs/sync_gateway/issues/31\n // is fixed\n for (var i = 0; i \u003c them.length; i++) {\n channel(\"chs-\"+them[i]);\n };\n\n }\n }\n if (doc.type == \"profile\") {\n channel(\"profiles\");\n var user = doc._id.substring(doc._id.indexOf(\":\")+1);\n access(user, \"profiles\");\n // TODO remove when #31 is fixed\n access(user, \"chs-\"+user);\n }\n}\n\n",
"Users": {
"GUEST": "eyJkaXNhYmxlZCI6IHRydWV9"
},
"Roles": null
}
}
}
16:23:39.793648 Opening Walrus database sync_gateway on <walrus:/Users/jchris/code/syncdata>
2013/03/20 16:23:39 Walrus: Loaded bucket from /Users/jchris/code/syncdata/sync_gateway.walrus
16:23:39.807568 Connected to <walrus:/Users/jchris/code/syncdata>, pool default, bucket sync_gateway
2013/03/20 16:23:39 Walrus: View("sync_gateway", "access") ...
2013/03/20 16:23:39 Walrus: ... view returned 0 rows
16:23:39.866354 CRUD: Computed channels for "": {}
16:23:39.866428 Reset guest user to config
16:23:39.867606 Starting auth server on :4985
16:23:39.867980 Starting server on :4984 ...
2013/03/20 16:23:41 Walrus: Saving bucket to /Users/jchris/code/syncdata/sync_gateway.walrus
./sync_gateway --help
Server configuration (overrides any config files)
-adminInterface=":4985": Address to bind admin interface to
-help=false: This help message
-interface=":4984": Address to bind to
-log="": Log keywords, comma separated. Options include: Auth, Attach, CRUD, HTTP, HTTP+, and Changes
-personaOrigin="": Base URL that clients use to connect to the server
-pretty=false: Pretty-print JSON responses
-verbose=false: Log more info about HTTP requests
Database configuration (ignored if a config file is used)
-bucket="sync_gateway": Name of Couchbase Server bucket
-dbname="": Name of CouchDB database (defaults to name of bucket)
-help=false: This help message
-pool="default": Name of pool
-url="http://localhost:8091": Address of Couchbase Server
Pass paths to config files on the command line after all flags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment