Skip to content

Instantly share code, notes, and snippets.

@indexzero
Forked from totherik/npmjs.ini
Created March 5, 2014 21:27
Show Gist options
  • Save indexzero/9376975 to your computer and use it in GitHub Desktop.
Save indexzero/9376975 to your computer and use it in GitHub Desktop.
; CouchDB Config
; Drop in PREFIX/local.d/npmjs.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
#!/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