-
-
Save indexzero/9376975 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
; Drop in $PREFIX/local.d/npm.ini | |
[couch_httpd_auth] | |
public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev | |
users_db_public = true | |
[httpd] | |
secure_rewrites = false | |
[couchdb] | |
delayed_commits = false |
This file contains hidden or 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
#!/bin/bash | |
# Read DB name | |
echo -n "Database Name [registry]: " | |
read database | |
if [ -z $database ]; then database="registry"; fi | |
# Read Username | |
echo -n "CouchDB Username [admin]: " | |
read username | |
if [ -z $username ]; then username="admin"; fi | |
# Read Password | |
echo -n "CouchDB Password: " | |
read -s password | |
echo | |
echo | |
# Per: https://github.com/npm/npmjs.org | |
git clone [email protected]:npm/npmjs.org.git | |
cd npmjs.org | |
npm install | |
# Create the database | |
registry=http://$username:$password@localhost:5984/$database | |
curl -X PUT $registry | |
npm set _npmjs.org:couch=$registry | |
# Sync the ddoc | |
npm start | |
# Load views | |
npm run load | |
# Ensure _design/app exists | |
curl -s -H 'Accept: application/json' -X PUT -d '{}' $registry/_design/app > /dev/null | |
# Install app | |
npm run copy | |
# Clean up | |
npm set _npmjs.org:couch= | |
cd ../ | |
rm -rf npmjs.org |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment