summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoss Marco <bossm8@bfh.ch>2022-05-12 19:06:09 +0200
committerBoss Marco <bossm8@bfh.ch>2022-05-12 19:06:09 +0200
commit97e203555b491f69d9d59f263f624d4a3a5875ab (patch)
tree4325d8f2444a83db46fd28b0bbaafd4f3b5dbbe3
parent2843457523e451c9410b60737de9010731d485b2 (diff)
downloadgrid5k-97e203555b491f69d9d59f263f624d4a3a5875ab.tar.gz
grid5k-97e203555b491f69d9d59f263f624d4a3a5875ab.tar.bz2
grid5k-97e203555b491f69d9d59f263f624d4a3a5875ab.zip
auditor added to exchange
-rw-r--r--configs/usr/lib/systemd/system/taler-auditor-httpd.service1
-rw-r--r--experiment/scripts/auditor.sh24
-rwxr-xr-xexperiment/scripts/createusers.sh2
-rwxr-xr-xexperiment/scripts/exchange.sh6
-rwxr-xr-xexperiment/scripts/helpers.sh5
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" \