Skip to content

Instantly share code, notes, and snippets.

@mrjones-plip
Last active May 26, 2022 23:44
Show Gist options
  • Save mrjones-plip/7760b6a1a7e9cface3714a16fe60eb93 to your computer and use it in GitHub Desktop.
Save mrjones-plip/7760b6a1a7e9cface3714a16fe60eb93 to your computer and use it in GitHub Desktop.
Developer Install CHT - bare metal couchdb
# a quick way to install a CHT instance. Uses bare metal couchdb
# see docker based install here: https://gist.github.com/mrjones-plip/7bbe7b0a44ce7876a551b9730c6fc43d
#
sudo apt update
sudo apt dist-upgrade
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install v12
node -v&&npm -v
npm install -g grunt-cli
sudo snap install --channel=2.x couchdb # install snap of couchdb 2.x
sudo vim /var/snap/couchdb/5/etc/local.ini # edit bind port to be 0.0.0.0
sudo systemctl restart snap.couchdb.server.service # restart couchdb to use all interfaces
systemctl status snap.couchdb.server.service
sudo apt install xsltproc
curl -X GET "http://medic:password@localhost:5984/_membership" # double check node name
echo "export [email protected]">> ~/.bashrc
echo "export COUCH_URL=http://medic:password@localhost:5984/medic">> ~/.bashrc
. ~/.bashrc
echo $COUCH_NODE_NAME&& echo $COUCH_URL
git clone https://github.com/medic/cht-core
cd cht-core
npm ci
COUCH_URL=http://medic:password@localhost:5984/medic [email protected] grunt secure-couchdb
curl -X PUT "http://medic:password@localhost:5984/_node/$COUCH_NODE_NAME/_config/httpd/WWW-Authenticate" -d '"Basic realm=\"administrator\""' -H "Content-Type: application/json"
grunt # in current terminal
cd cht-core&&grunt dev-api # in 2nd terminal
cd cht-core&&grunt dev-sentinel # in 3rd terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment