gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-deployment] branch master updated: Avoid hardcoded p


From: gnunet
Subject: [GNUnet-SVN] [taler-deployment] branch master updated: Avoid hardcoded paths
Date: Sat, 08 Jun 2019 13:45:58 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new 611e60c  Avoid hardcoded paths
611e60c is described below

commit 611e60c3fa58fecc10a821d5b4e1d77eca5528a3
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Jun 8 13:45:41 2019 +0200

    Avoid hardcoded paths
---
 bin/taler-deployment-config-generate | 32 ++++++++++++++++----------------
 bin/taler-deployment-keyup           | 27 ++++++++++-----------------
 config/generate-config               |  2 ++
 3 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/bin/taler-deployment-config-generate 
b/bin/taler-deployment-config-generate
index 638098b..8dd5695 100755
--- a/bin/taler-deployment-config-generate
+++ b/bin/taler-deployment-config-generate
@@ -9,9 +9,7 @@
 
 set -eu
 
-base=$HOME
-
-export PATH="$base/deployment":$PATH
+export PATH="$HOME/deployment":$PATH
 
 if [[ -z ${TALER_CONFIG_ENV+x} ]]; then
   echo "TALER_CONFIG_ENV not set"
@@ -23,24 +21,26 @@ if [[ -z ${TALER_CONFIG_CURRENCY+x} ]]; then
   exit 1
 fi
 
-if [[ ! -f $HOME/shared-data/exchange/offline-keys/master.priv ]] ; then
-  mkdir -p $HOME/shared-data/exchange/offline-keys/
-  cp $base/deployment/private-keys/${TALER_CONFIG_ENV}-exchange-master.priv 
$HOME/shared-data/exchange/offline-keys/master.priv
-  chgrp ${TALER_CONFIG_ENV} $HOME/shared-data/exchange/offline-keys/master.priv
-  chmod g+rx $HOME/shared-data/exchange/offline-keys/master.priv
-fi
+EXCHANGE_MASTER_PRIV=$(taler-config -s exchange -o master_priv_file -f)
+AUDITOR_MASTER_PRIV=$(taler-config -s auditor -o auditor_priv_file -f)
 
-if [[ ! -f $HOME/shared-data/auditor/offline-keys/auditor.priv ]] ; then
-  mkdir -p $HOME/shared-data/auditor/offline-keys/
-  cp $base/deployment/private-keys/auditor.priv 
$HOME/shared-data/auditor/offline-keys/auditor.priv
-  chgrp ${TALER_CONFIG_ENV} $HOME/shared-data/auditor/offline-keys/auditor.priv
-  chmod g+rx $HOME/shared-data/auditor/offline-keys/auditor.priv
+if [[ ! -f $EXCHANGE_MASTER_PRIV ]] ; then
+  mkdir -p $(dirname $EXCHANGE_MASTER_PRIV)
+  cp $HOME/deployment/private-keys/${TALER_CONFIG_ENV}-exchange-master.priv 
$EXCHANGE_MASTER_PRIV
+  chgrp ${TALER_CONFIG_ENV} $EXCHANGE_MASTER_PRIV
+  chmod g+rx $EXCHANGE_MASTER_PRIV
 fi
 
-exchange_pub=$(gnunet-ecc -p 
$HOME/shared-data/exchange/offline-keys/master.priv)
+if [[ ! -f $AUDITOR_MASTER_PRIV ]] ; then
+  mkdir -p $(dirname $AUDITOR_MASTER_PRIV)
+  cp $HOME/deployment/private-keys/${TALER_CONFIG_ENV}-exchange-master.priv 
$AUDITOR_MASTER_PRIV
+  chgrp ${TALER_CONFIG_ENV} $AUDITOR_MASTER_PRIV
+  chmod g+rx $AUDITOR_MASTER_PRIV
+fi
 
+EXCHANGE_PUB=$(gnunet-ecc -p $EXCHANGE_MASTER_PRIV)
 $HOME/deployment/config/generate-config \
-  --exchange-pub "$exchange_pub" \
+  --exchange-pub "$EXCHANGE_PUB" \
   --currency "$TALER_CONFIG_CURRENCY" \
   --outdir $HOME/.config \
   --shared-outdir $HOME/shared-data \
diff --git a/bin/taler-deployment-keyup b/bin/taler-deployment-keyup
index 1fd7ce0..65d5f07 100755
--- a/bin/taler-deployment-keyup
+++ b/bin/taler-deployment-keyup
@@ -2,9 +2,6 @@
 
 # Generate denomination keys and get them
 # signed by the auditor.
-#
-#
-#
 
 set -eu
 
@@ -13,16 +10,19 @@ if test -z $TALER_CONFIG_ENV; then
   exit 1
 fi
 
-auditor_request_dir=${HOME}/shared-data/exchange/auditor-request/
+AUDITOR_REQUEST_DIR=$(taler-config -s exchange -o autitor_inputs -f)
+AUDITOR_BASE_DIR=$(taler-config -s exchangedb -o autitor_base_dir -f)
+EXHCANGE_PUB=$(taler-config -s exchange -o master_public_key)
+EXHCANGE_URL=$(taler-config -s exchange -o base_url)
 
 mkdir -p $auditor_request_dir
 taler-exchange-keyup \
-  -m ${HOME}/shared-data/exchange/offline-keys/master.priv \
-  -o $auditor_request_dir/auditor_request
+  -m $(taler-config -s exchange -o master_priv_file -f) \
+  -o $AUDITOR_REQUEST_DIR/auditor_request
 
 taler-auditor-exchange \
-  -m $(taler-config -s exchange -o master_public_key) \
-  -u $(taler-config -s exchange -o base_url)
+  -m $EXCHANGE_PUB \
+  -u $EXCHANGE_URL
 
 # Checks whether any denom key was generated, and
 # only sign it if so.
@@ -30,15 +30,8 @@ if [[ -s $auditor_request_dir/auditor_request ]]; then
   echo "Signing key material by auditor.."
   taler-auditor-sign \
     -u $TALER_ENV_URL_AUDITOR \
-    -m $(taler-config -s exchange -o master_public_key) \
+    -m $EXCHANGE_PUB \
     -r "$auditor_request_dir/auditor_request" \
-    -o "$(taler-config -s exchangedb -o auditor_base_dir -f)/$(date +%s%N)" \
+    -o "$AUDITOR_BASE_DIR/$(date +%s%N)" \
     -c ${HOME}/.config/taler.conf
 fi
-
-# Make sure the creator sets those permissions; or-ing
-# with 'true' is needed as when the other party will
-# execute this it will fail to chmod, but the permissions
-# are already right.
-chgrp -R ${TALER_CONFIG_ENV} ${HOME}/shared-data/exchange/live-keys/
-chmod -R g+rx ${HOME}/shared-data/exchange/live-keys/ || true
diff --git a/config/generate-config b/config/generate-config
index 2bc5e06..12fac57 100755
--- a/config/generate-config
+++ b/config/generate-config
@@ -150,6 +150,7 @@ def config(currency, envname, exchange_pub, standalone):
     cfg_put("auditor", "serve", "unix")
     cfg_put("auditor", "auditor_url", 
"https://auditor.{}.taler.net/service/".format(envname))
     cfg_put("auditor", "unixpath", "$HOME/sockets/auditor.http")
+    cfg_put("auditor", "reports", "${TALER_DEPLOYMENT_SHARED}/auditor/reports")
 
     cfg_put("exchange", "base_url", 
"https://exchange.{}.taler.net/".format(envname))
     cfg_put("exchange", "serve", "unix")
@@ -161,6 +162,7 @@ def config(currency, envname, exchange_pub, standalone):
 
     cfg_put("exchangedb", "auditor_base_dir", 
"${TALER_DEPLOYMENT_SHARED}/exchange/auditors/")
     cfg_put("exchangedb", "wirefee_base_dir", 
"${TALER_DEPLOYMENT_SHARED}/exchange/wirefees/")
+    cfg_put("exchangedb", "auditor_inputs", 
"${TALER_DEPLOYMENT_SHARED}/exchange/auditor-inputs/")
 
     if standalone:
         cfg_put("exchangedb-postgres", "db_conn_str", 
"postgres:///taler?host={}/sockets".format(os.getenv("HOME")))

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]