This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Clarify both that you need to start CouchDB as well as how to verify it. 2. Address the issues of setup created by the change in CouchDB 1.x vs. 2.x with a new script: initcouch2.sh
- Loading branch information
1 parent
c620552
commit 4d077f2
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
URL="localhost" | ||
PORT="5986" | ||
PORT2="5986" | ||
|
||
if [ -z "${1}" ] || [ -z "${2}" ]; then | ||
HOST="http://$URL:$PORT" | ||
curl -X PUT $HOST/_config/admins/couchadmin -d '"test"' | ||
SECUREHOST="http://127.0.0.1:test@$URL:$PORT" | ||
SECUREHOST2="http://127.0.0.1:test@$URL:$PORT2" | ||
else | ||
SECUREHOST="http://$1:$2@$URL:$PORT" | ||
SECUREHOST2="http://$1:$2@$URL:$PORT2" | ||
fi | ||
curl -X PUT $SECUREHOST2/_users/_security -d '{ "admins": { "names": [], "roles": ["admin"]}, "members": { "names": [], "roles": []}}' | ||
curl -X PUT $SECUREHOST/config | ||
curl -X PUT $SECUREHOST/config/_security -d '{ "admins": { "names": [], "roles": ["admin"]}, "members": { "names": [], "roles": []}}' | ||
curl -X PUT $SECUREHOST/main | ||
curl -X PUT $SECUREHOST/main/_security -d '{ "admins": { "names": [], "roles": ["admin"]}, "members": { "names": [], "roles": ["user"]}}' | ||
curl -X PUT $SECUREHOST2/_config/http/authentication_handlers -d '"{couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, proxy_authentification_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"' | ||
curl -X PUT $SECUREHOST2/_config/couch_httpd_oauth/use_users_db -d '"true"' | ||
curl -X PUT $SECUREHOST2/_users/org.couchdb.user:hradmin -d '{"name": "hradmin", "password": "test", "roles": ["System Administrator","admin","user"], "type": "user", "userPrefix": "p1"}' |
4d077f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks so much for this updated to the readme. I was literally troubleshooting for hours the other night because I had CouchDB 2.0 and the instructions before didn't work well with that setup.
🙏