gnunet-svn
[Top][All Lists]
Advanced

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

[taler-grid5k] 16/48: auditor added to exchange


From: gnunet
Subject: [taler-grid5k] 16/48: auditor added to exchange
Date: Sat, 28 May 2022 12:11:36 +0200

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

marco-boss pushed a commit to branch master
in repository grid5k.

commit 97e203555b491f69d9d59f263f624d4a3a5875ab
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Thu May 12 19:06:09 2022 +0200

    auditor added to exchange
---
 .../lib/systemd/system/taler-auditor-httpd.service |  1 +
 experiment/scripts/auditor.sh                      | 24 +++++++++++++---------
 experiment/scripts/createusers.sh                  |  2 +-
 experiment/scripts/exchange.sh                     |  6 +++++-
 experiment/scripts/helpers.sh                      |  5 +++--
 5 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/configs/usr/lib/systemd/system/taler-auditor-httpd.service 
b/configs/usr/lib/systemd/system/taler-auditor-httpd.service
index 9aefab6..75ffdf2 100644
--- a/configs/usr/lib/systemd/system/taler-auditor-httpd.service
+++ b/configs/usr/lib/systemd/system/taler-auditor-httpd.service
@@ -4,6 +4,7 @@ After=postgres.service network.target
 
 [Service]
 User=taler-auditor-httpd
+Group=www-data
 Type=simple
 Restart=on-failure
 ExecStart=/usr/bin/taler-auditor-httpd -c /etc/taler/taler.conf
diff --git a/experiment/scripts/auditor.sh b/experiment/scripts/auditor.sh
index 11349a4..b3e5f11 100644
--- a/experiment/scripts/auditor.sh
+++ b/experiment/scripts/auditor.sh
@@ -14,7 +14,7 @@ init:
 cd /tmp
 
 function create_users() {
-  for USER in auditor sync helper auditor-ingress auditor-wire; do
+  for USER in auditor sync auditor-ingress auditor-wire; do
     adduser --quiet --home /tmp/${USER} ${USER} || true
   done
 }
@@ -64,13 +64,13 @@ EOF
 }
 
 function setup_exchange_replication() {
-  sudo -u auditor-ingress << EOF
+  su auditor-ingress << EOF
   taler-config -s exchange -o DB -V "postgres"
   taler-config -s exchangedb-postgres -o CONFIG -V 
"postgres:///exchange-ingress"
   taler-exchange-dbinit
 EOF
 
-  sudo -u postgres << EOF
+  su postgres << EOF
   createuser --replication egress
   psql -tAc "ALTER ROLE egress WITH PASSWORD '${DB_PASSWORD}';
   psql -d taler-exchange -tAc "CREATE REPLICATION taler-perf FOR ALL TABLES;
@@ -96,17 +96,21 @@ function setup_config() {
   wait_for_keys ${EXCHANGE_GW_DOMAIN}
 
   sed -i -e "s/<AUDITOR_PUB_KEY_HERE>/${PUB_KEY}/g" \
-         -e "s|<AUDITOR_URL_HERE>|http://${NODE_NAME}.${DNS_ZONE}/|g"
+         -e "s|<AUDITOR_URL_HERE>|http://${NODE_NAME}.${DNS_ZONE}/|g" \
       /etc/taler/conf.d/auditor.conf
 
+  enable_webservice
+
   sudo -u auditor taler-auditor-dbinit
-  sudo -u auditor taler-auditor-exchange -m $(get_exchange_masterkey) -u 
https://${EXCHANGE_GW_DOMAIN}/
-  sudo -u helper taler-auditor-offline download > input.json
-  sudo -u taler-auditor-offline taler-auditor-offline show < input.json
-  sudo -u taler-auditor-offline taler-auditor-offline sign < input.json > 
output.json
-  sudo -u helper taler-auditor-offline upload < output.json
+  sudo -u auditor taler-auditor-exchange -m $(get_exchange_masterkey) -u 
"https://${EXCHANGE_GW_DOMAIN}/";
 
-  enable_webservice
+  ssh -o StrictHostKeyChecking=no ${PRIMARY_EXCHANGE} \
+    "/bin/bash ~/scripts/exchange.sh add-auditor '${PUB_KEY}' 
'http://${NODE_NAME}.${DNS_ZONE}/' '${NODE_NAME}'"
+
+  taler-auditor-offline download > input.json
+  taler-auditor-offline show < input.json
+  taler-auditor-offline sign < input.json > output.json
+  taler-auditor-offline upload < output.json
 
   setup_exchange_replication
 }
diff --git a/experiment/scripts/createusers.sh 
b/experiment/scripts/createusers.sh
index 8803356..4ef9d9a 100755
--- a/experiment/scripts/createusers.sh
+++ b/experiment/scripts/createusers.sh
@@ -29,7 +29,7 @@ MERCHGROUPNAME=www-data
 AUDITCONFIG_FILE="/etc/default/taler-auditor"
 AUDITTALER_HOME="/var/lib/taler-auditor"
 AUDITUSERNAME=taler-auditor-httpd
-AUDITGROUPNAME=taler-auditor-httpd
+AUDITGROUPNAME=www-data
 AOUSERNAME=taler-auditor-offline
 AOGROUPNAME=taler-auditor-offline
 
diff --git a/experiment/scripts/exchange.sh b/experiment/scripts/exchange.sh
index 12a5f8d..9ea2992 100755
--- a/experiment/scripts/exchange.sh
+++ b/experiment/scripts/exchange.sh
@@ -35,7 +35,7 @@ function setup_primary_config() {
   rm -rf /var/lib/taler/exchange-offline/*
 
   # Setup the base configuration (helpers.sh)
-  setup_exchange_config_without_master_key
+  setup_exchange_config_without_master_key 
"http://${NODE_NAME}.${DNS_ZONE}:10000/";
 
   MASTER_KEY=$(sudo -u taler-exchange-offline taler-exchange-offline setup)
   
@@ -142,6 +142,10 @@ case $1 in
   stop)
     stop_exchanges $2
     ;;
+  add-auditor)
+    taler-exchange-offline enable-auditor $2 $3 "$4" > auditor.json
+    taler-exchange-offline upload < auditor.json
+    ;;
   *)
     taler_perf_help $0 "$INFO_MSG" "$OPT_MSG"
     ;;
diff --git a/experiment/scripts/helpers.sh b/experiment/scripts/helpers.sh
index 9c57025..0278519 100755
--- a/experiment/scripts/helpers.sh
+++ b/experiment/scripts/helpers.sh
@@ -127,7 +127,7 @@ function get_exchange_masterkey() {
 # master public key from the exchange API 
 function setup_exchange_config_master_key_from_api() {
 
-  setup_exchange_config_without_master_key
+  setup_exchange_config_without_master_key "http://${EXCHANGE_GW_DOMAIN}/";
 
   wait_for_keys "${PRIMARY_EXCHANGE}:10000"
 
@@ -139,6 +139,7 @@ function setup_exchange_config_master_key_from_api() {
 
 # Setup taler.conf for any exchange-* process, does not configure
 # the master key
+# $1: Exchange base url
 function setup_exchange_config_without_master_key() {
 
   AGGREGATOR_SHARD_SIZE=$(echo "2^(30-${NUM_AGGREGATOR_PROCESSES})" | bc)
@@ -156,7 +157,7 @@ function setup_exchange_config_without_master_key() {
        /etc/taler/secrets/exchange-accountcredentials.secret.conf
 
   sed -i -e "s/<BANK_HOST_HERE>/bank.${DNS_ZONE}/g" \
-         -e "s\<BASE_URL_HERE>\http://${EXCHANGE_GW_DOMAIN}/\g"; \
+         -e "s|<BASE_URL_HERE>|${1}|g" \
          -e "s/<MAX_REQUESTS_HERE>/${EXCHANGE_MAX_REQUESTS:-8192}/g" \
          -e "s/<AGGREGATOR_SHARD_SIZE_HERE>/${AGGREGATOR_SHARD_SIZE}/g" \
         -e "s/<SHARD_DOMAIN_HERE>/${DNS_ZONE}/g" \

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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