#!/bin/bash # Prepare a deployment for execution: # * generate the configuration # * put keys in the right place # * set bank password for the exchange # * sign the exchange's wire response # * run some sanity checks (FIXME: not done yet!) set -eu source $HOME/activate if [[ -z ${TALER_ENV_NAME+x} ]]; then echo "TALER_ENV_NAME not set" exit 1 fi if [[ -z ${TALER_CONFIG_CURRENCY+x} ]]; then echo "TALER_CONFIG_CURRENCY not set" exit 1 fi function generate_config() { EXCHANGE_PUB=$(gnunet-ecc -p $HOME/deployment/private-keys/${TALER_ENV_NAME}-exchange-master.priv) mkdir -p $HOME/.config $HOME/deployment/bin/taler-config-generate \ --exchange-pub "$EXCHANGE_PUB" \ --currency "$TALER_CONFIG_CURRENCY" \ --outdir $HOME/.config \ --envname "$TALER_ENV_NAME" } ## ## Step 1: Generate config ## case $TALER_ENV_NAME in demo|test|int) generate_config ;; *) echo "Not generating config for env $TALER_ENV_NAME" ;; esac ## ## Step 2: Copy key material and update denom keys ## taler-auditor-exchange \ -m $(taler-config -s exchange -o master_public_key) \ -u $(taler-config -s exchange -o base_url) || true rm -f auditor.in taler-exchange-keyup -o auditor.in taler-auditor-sign -r auditor.in -o auditor.out rm -f auditor.in auditor.out # we don't actually use the auditor's signatures in the demo! ## ## Step 3: Sign the exchange's wire information ## WIRE_RESPONSE=$(taler-config -s exchange-account-1 -o wire_response -f) taler-exchange-wire chmod 770 $WIRE_RESPONSE ## ## Step 4: ## case $TALER_ENV_NAME in demo|test|int) taler-bank-manage django changepassword_unsafe Exchange x ;; *) echo "Not setting unsafe Exchange bank account password for env $TALER_ENV_NAME" ;; esac