-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Please read README.md
- Loading branch information
Ivo Woltring
committed
May 1, 2015
1 parent
165b328
commit 1090ddd
Showing
12 changed files
with
82 additions
and
36 deletions.
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
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,8 @@ | ||
#!/usr/bin/env bash | ||
echo ======================================================================== | ||
echo == CouchDB - all users | ||
echo ======================================================================== | ||
source ./login.sh "Please login as an administrator" | ||
|
||
read -p "Database to show: " DATABASE | ||
curl --cookie cookies.txt --user-agent Mozilla/4.0 -X GET $COUCHDB/$DATABASE/_all_docs |
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,7 @@ | ||
#!/usr/bin/env bash | ||
echo ======================================================================== | ||
echo == CouchDB - all users | ||
echo ======================================================================== | ||
source ./login.sh "Please login as an administrator" | ||
|
||
curl --cookie cookies.txt --user-agent Mozilla/4.0 -X GET $COUCHDB/_users/_all_docs |
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,16 @@ | ||
#!/usr/bin/env bash | ||
source ./settings.sh | ||
echo "CouchDB login:" | ||
read -p "Username: " USER | ||
read -s -p "Password: " PASSWORD | ||
|
||
USRPWD='name='$USER'&password='$PASSWORD | ||
|
||
#use -vX for mor info | ||
curl --cookie $COUCHDB_COOKIE --cookie-jar $COUCHDB_COOKIE --user-agent Mozilla/4.0 -X POST $COUCHDB/_session --data "$USRPWD" -H 'Content-Type:application/x-www-form-urlencoded' | ||
|
||
|
||
#With the following command you can reuse the cookie. | ||
#curl --cookie cookies.txt --user-agent Mozilla/4.0 -X GET $HOST/... | ||
#Depending on the rights of your user you can do stuff. | ||
#if you want to login as a different user just use this script again |
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 |
---|---|---|
@@ -1,17 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
echo ======================================================================== | ||
echo == CouchDB - Create a database... | ||
echo ======================================================================== | ||
source ./login.sh "Please login as an administrator" | ||
|
||
|
||
echo "First login to CouchDB as an admin..." | ||
read -p "Admin Username: " ADMIN | ||
read -s -p "Admin Password: " ADMPWD | ||
echo | ||
COUCH=http://$ADMIN:$ADMPWD@localhost:5984 | ||
|
||
|
||
echo -p "Database name : " DATABASE | ||
curl -X PUT $COUCH/$DATABASE | ||
read -p "Database name : " DATABASE | ||
curl --cookie cookies.txt --user-agent Mozilla/4.0 -X PUT $COUCHDB/$DATABASE |
Empty file.
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,6 @@ | ||
#!/usr/bin/env bash | ||
source ./settings.sh | ||
if [ ! -f cookies.txt ]; then | ||
echo $1 | ||
source cookie-authentication.sh | ||
fi |
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,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
COUCHDB="http://127.0.0.1:5984" | ||
COUCHDB_COOKIE=cookies.txt | ||
|
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