Guest Access on Sync_Gateway

40 views
Skip to first unread message

Todd Freese

unread,
Mar 6, 2014, 6:33:46 PM3/6/14
to mobile-c...@googlegroups.com
I'm trying to setup sync_gateway on Mac with the walrus store for testing. For now, I want to turn on guest access and having troubles. 

Here is how I am starting sync_gateway: 

./sync_gateway -url="walrus:" -interface=":4984" -verbose=true -pretty 

Then I use this to turn on guest access per the docs: 

curl -X PUT localhost:4985/$DB/_user/GUEST --data '{"disabled":false, "admin_channels":[“public”]}' 

And I get this log from the sync_gateway: 

16:13:29.827065 HTTP:  #001: PUT //_user/GUEST  (ADMIN) 
16:13:29.827130 HTTP:  #001:     --> 404 unknown URL 

And I get this from the curl command: 

{"error":"not_found","reason":"unknown URL"} 

Am I going about this the correct way? 

Todd

Jens Alfke

unread,
Mar 6, 2014, 6:47:28 PM3/6/14
to mobile-c...@googlegroups.com

On Mar 6, 2014, at 3:33 PM, Todd Freese <to...@filmworkers.com> wrote:

curl -X PUT localhost:4985/$DB/_user/GUEST --data '{"disabled":false, "admin_channels":[“public”]}' 

And I get this log from the sync_gateway: 

16:13:29.827065 HTTP:  #001: PUT //_user/GUEST  (ADMIN) 
16:13:29.827130 HTTP:  #001:     --> 404 unknown URL 

Looks like you typed “$DB” literally on the command line. That’s supposed to be a placeholder for the actual database name.

Also, it’s easier to enable guest access by using a config file with a ‘user’ dictionary. Here’s one I often use:

{
"databases": {
"db": {
"server": "walrus:",
"users": {
"GUEST": {"disabled": false, "admin_channels": ["*"] }
}
}
}
}

Then you just run “sync_gateway $CONFIG_FILE”
where $CONFIG_FILE is the path to the config file ;-)

—Jens

Todd Freese

unread,
Mar 6, 2014, 7:04:34 PM3/6/14
to mobile-c...@googlegroups.com
Thank you as always. This group's and your responsiveness are truly awesome!

Todd
Reply all
Reply to author
Forward
0 new messages