[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-deployment] branch master updated: copy keys with checks, make sh
From: |
gnunet |
Subject: |
[taler-deployment] branch master updated: copy keys with checks, make shellcheck happier |
Date: |
Mon, 09 Mar 2020 09:09:58 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository deployment.
The following commit(s) were added to refs/heads/master by this push:
new 8e54662 copy keys with checks, make shellcheck happier
8e54662 is described below
commit 8e546625f9e2d85159b1eeec425b98d2bcde9de6
Author: Florian Dold <address@hidden>
AuthorDate: Mon Mar 9 13:39:48 2020 +0530
copy keys with checks, make shellcheck happier
---
bin/taler-deployment-prepare | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/bin/taler-deployment-prepare b/bin/taler-deployment-prepare
index b3ddd4b..20d737b 100755
--- a/bin/taler-deployment-prepare
+++ b/bin/taler-deployment-prepare
@@ -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"
}
@@ -50,18 +50,36 @@ esac
## 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
+ 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,7 +88,7 @@ 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"
##
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-deployment] branch master updated: copy keys with checks, make shellcheck happier,
gnunet <=