summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-03-05 15:56:02 +0100
committerAzul <azul@leap.se>2013-03-06 12:12:49 +0100
commitc3bf76fcacb9576f674895a57fd3a47a2872fd8e (patch)
tree8d8c938da498851fbb6a6e31560c591023213cd1
parenta285e20602bbffbf1436be2036ecf103bb898dfb (diff)
setup user and restrict db access
-rw-r--r--.travis.yml6
-rw-r--r--config/couchdb.yml.admin (renamed from config/couchdb.yml)1
-rw-r--r--config/couchdb.yml.user5
3 files changed, 12 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 63b69b1..445be1a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,8 +3,14 @@ services:
notifications:
email: false
before_script:
+ - "mv config/couchdb.yml.admin config/couchdb.yml"
- "bundle exec rake couchrest:migrate_with_proxies"
- "bundle exec rake couchrest:migrate_with_proxies" # looks like this needs to run twice
- 'HOST="http://localhost:5984"'
+ - "curl -HContent-Type:application/json -vXPUT $HOST/_users/org.couchdb.user:me --data-binary '{\"_id\": \"org.couchdb.user:me\",\"name\": \"me\",\"roles\": [],\"type\": \"user\",\"password\": \"pwd\"}'"
- "curl -X PUT $HOST/sessions"
+ - "curl -vX PUT $HOST/sessions/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'"
+ - "curl -vX PUT $HOST/users/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'"
+ - "curl -vX PUT $HOST/tickets/_security -Hcontent-type:application/json --data-binary '{\"admins\":{\"names\":[],\"roles\":[]},\"members\":{\"names\":[\"me\"],\"roles\":[]}}'"
- "curl -X PUT $HOST/_config/admins/anna -d '\"secret\"'"
+ - "mv config/couchdb.yml.user config/couchdb.yml"
diff --git a/config/couchdb.yml b/config/couchdb.yml.admin
index 2345dc3..d3cb72c 100644
--- a/config/couchdb.yml
+++ b/config/couchdb.yml.admin
@@ -1,2 +1,3 @@
test:
auto_update_design_doc: false
+ prefix: ""
diff --git a/config/couchdb.yml.user b/config/couchdb.yml.user
new file mode 100644
index 0000000..9c8b67b
--- /dev/null
+++ b/config/couchdb.yml.user
@@ -0,0 +1,5 @@
+test:
+ auto_update_design_doc: false
+ username: "me"
+ password: "pwd"
+ prefix: ""