blob: 7d49b92ed5895344053e0dc81f04d2868d91ac4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#!/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
usage() {
echo "Usage: $0"
}
if [ -z ${1+x} ]; then
usage
exit 1
fi
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
taler-deployment-keyup
##
## Step 2: Copy key material and update denom keys
##
case $TALER_ENV_NAME in
demo|test|int)
;;
*)
echo "Not copying private keys for env $TALER_ENV_NAME"
;;
esac
taler-exchange-keyup
##
## Step 3: Sign the exchange's wire information
##
WIRE_RESPONSE=$(taler-config -s exchange-account-1 -o wire_response -f)
if test -e "$WIRE_RESPONSE"; then
echo "Will not override that wire response file ($WIRE_RESPONSE); exiting."
exit 0
fi
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
|