summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-15 19:23:40 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-15 19:23:40 +0100
commit7e22337069177c935c34d5aae5b295d072f64bf3 (patch)
treec1c2ab382a2336336c05e601919bb106761bf5ed
parentaf2c3cb13875a202504c49b3adbda5a89bd201dd (diff)
parent5cf9e1c08ee579fa4f668c540e28b7551f009428 (diff)
downloaddeployment-7e22337069177c935c34d5aae5b295d072f64bf3.tar.gz
deployment-7e22337069177c935c34d5aae5b295d072f64bf3.tar.bz2
deployment-7e22337069177c935c34d5aae5b295d072f64bf3.zip
Merge branch 'master' of git+ssh://git.taler.net/deployment
-rwxr-xr-xbin/taler-deployment-auditor-sign12
-rwxr-xr-xbin/taler-deployment-prepare50
2 files changed, 38 insertions, 24 deletions
diff --git a/bin/taler-deployment-auditor-sign b/bin/taler-deployment-auditor-sign
deleted file mode 100755
index 3058fc5..0000000
--- a/bin/taler-deployment-auditor-sign
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-if test -z $TALER_ENV_NAME; then
- echo Please run 'source ~/activate' beforehand.
- exit 1
-fi
-
-taler-auditor-sign \
- -m $(taler-config -s exchange -o MASTER_PUBLIC_KEY) \
- -u $TALER_ENV_URL_AUDITOR \
- -o "$(taler-config -s exchangedb -o AUDITOR_BASE_DIR -f)/signed_denoms" \
- -r "$HOME/shared-data/exchange/auditor-request/auditor_request"
diff --git a/bin/taler-deployment-prepare b/bin/taler-deployment-prepare
index b3ddd4b..8319161 100755
--- a/bin/taler-deployment-prepare
+++ b/bin/taler-deployment-prepare
@@ -1,7 +1,7 @@
#!/bin/bash
# Prepare a deployment for execution:
-# * generate the configuration
+# * generate the configuration and setup database
# * put keys in the right place
# * set bank password for the exchange
# * sign the exchange's wire response
@@ -9,7 +9,7 @@
set -eu
-source $HOME/activate
+source "$HOME/activate"
if [[ -z ${TALER_ENV_NAME+x} ]]; then
echo "TALER_ENV_NAME not set"
@@ -22,14 +22,14 @@ if [[ -z ${TALER_CONFIG_CURRENCY+x} ]]; then
fi
function generate_config() {
- EXCHANGE_PUB=$(gnunet-ecc -p $HOME/deployment/private-keys/${TALER_ENV_NAME}-exchange-master.priv)
+ EXCHANGE_PUB=$(gnunet-ecc -p "$HOME/deployment/private-keys/${TALER_ENV_NAME}-exchange-master.priv")
- mkdir -p $HOME/.config
+ mkdir -p "$HOME/.config"
- $HOME/deployment/bin/taler-config-generate \
+ "$HOME/deployment/bin/taler-config-generate" \
--exchange-pub "$EXCHANGE_PUB" \
--currency "$TALER_CONFIG_CURRENCY" \
- --outdir $HOME/.config \
+ --outdir "$HOME/.config" \
--envname "$TALER_ENV_NAME"
}
@@ -47,21 +47,46 @@ case $TALER_ENV_NAME in
esac
##
+## Step 1b: initialize database
+##
+
+taler-exchange-dbinit
+
+##
## Step 2: Copy key material and update denom keys
##
+case $TALER_ENV_NAME in
+ demo|test|int)
+ EXCHANGE_PUB=$(gnunet-ecc -p "$HOME/deployment/private-keys/${TALER_ENV_NAME}-exchange-master.priv")
+ EXCHANGE_PRIV_FILE=$(taler-config -f -s exchange -o master_priv_file)
+ if [[ -e "$EXCHANGE_PRIV_FILE" ]]; then
+ EXCHANGE_PUB2=$(gnunet-ecc -p "$EXCHANGE_PRIV_FILE")
+ if [[ "$EXCHANGE_PUB" != "$EXCHANGE_PUB2" ]]; then
+ echo "Warning: Different exchange private key already exists, not copying"
+ fi
+ else
+ mkdir -p "$(dirname "$EXCHANGE_PRIV_FILE")"
+ cp "$HOME/deployment/private-keys/${TALER_ENV_NAME}-exchange-master.priv" "$EXCHANGE_PRIV_FILE"
+ fi
+ ;;
+ *)
+ echo "Not copying key material for env $TALER_ENV_NAME"
+ ;;
+esac
+
EXCHANGE_MASTER_PUB=$(taler-config -s exchange -o master_public_key)
taler-auditor-exchange \
- -m $EXCHANGE_MASTER_PUB \
- -u $(taler-config -s exchange -o base_url) || true
+ -m "$EXCHANGE_MASTER_PUB" \
+ -u "$(taler-config -s exchange -o base_url)" || true
rm -f auditor.in
taler-exchange-keyup -o auditor.in
-taler-auditor-sign -m $EXCHANGE_MASTER_PUB -r auditor.in -o auditor.out || true
+taler-auditor-sign -m "$EXCHANGE_MASTER_PUB" -r auditor.in -o auditor.out || true
rm -f auditor.in auditor.out # we don't actually use the auditor's signatures in the demo!
# Make configuration accessible to auditor
-chmod 750 $HOME/.config
+chmod 750 "$HOME/.config"
##
## Step 3: Sign the exchange's wire information
@@ -70,15 +95,16 @@ chmod 750 $HOME/.config
WIRE_RESPONSE=$(taler-config -s exchange-account-1 -o wire_response -f)
taler-exchange-wire
-chmod 770 $WIRE_RESPONSE
+chmod 770 "$WIRE_RESPONSE"
##
-## Step 4:
+## Step 4: Set up the bank
##
case $TALER_ENV_NAME in
demo|test|int)
+ taler-bank-manage django provide_accounts
taler-bank-manage django changepassword_unsafe Exchange x
;;
*)