[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-grid5k] 10/141: update bank config, add dns and bank scripts
From: |
gnunet |
Subject: |
[taler-grid5k] 10/141: update bank config, add dns and bank scripts |
Date: |
Thu, 18 Nov 2021 14:49:11 +0100 |
This is an automated email from the git hooks/post-receive script.
marco-boss pushed a commit to branch master
in repository grid5k.
commit 45a08a72bfc16685e99866c4d12cb2431b379e43
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Sun Oct 3 16:15:45 2021 +0200
update bank config, add dns and bank scripts
---
etc/taler/conf.d/exchange-business.conf | 9 +------
etc/taler/conf.d/fake-bank.conf | 5 ++++
.../exchange-accountcredentials.secret.conf | 2 +-
image/taler-debian11.yaml | 4 ++--
jfed/env | 4 ++++
jfed/setup.sh | 2 ++
jfed/taler-perf.rspec | 22 +++++++++++++----
scripts/bank.sh | 3 +++
scripts/database.sh | 2 +-
scripts/dns.sh | 3 +++
scripts/exchange.sh | 28 ++++++++++++++++++----
11 files changed, 63 insertions(+), 21 deletions(-)
diff --git a/etc/taler/conf.d/exchange-business.conf
b/etc/taler/conf.d/exchange-business.conf
index 4cc10a7..0e6dd1e 100755
--- a/etc/taler/conf.d/exchange-business.conf
+++ b/etc/taler/conf.d/exchange-business.conf
@@ -20,13 +20,6 @@ BASE_URL = <BASE_URL_HERE>
# TERMS_ETAG =
# PRIVACY_ETAG =
-[bank]
-HTTP_PORT = 8082
-SERVE = http
-MAX_DEBT = KUDOS:100000000000.0
-MAX_DEBT_BANK = KUDOS:1000000000000000.0
-
-
# Bank accounts used by the exchange should be specified here:
[exchange-account-1]
@@ -36,7 +29,7 @@ enable_debit = yes
# Account identifier in the form of an RFC-8905 payto:// URI.
# For SEPA, looks like payto://sepa/$IBAN?receiver-name=$NAME
# Make sure to URL-encode spaces in $NAME!
-payto_uri = payto://x-taler-bank/localhost/Exchnage
+payto_uri = payto://x-taler-bank/<BANK_HOST_HERE>/Exchange
# Credentials to access the account are in a separate
# config file with restricted permissions.
diff --git a/etc/taler/conf.d/fake-bank.conf b/etc/taler/conf.d/fake-bank.conf
new file mode 100644
index 0000000..3b8634a
--- /dev/null
+++ b/etc/taler/conf.d/fake-bank.conf
@@ -0,0 +1,5 @@
+[bank]
+HTTP_PORT = 80
+SERVE = http
+MAX_DEBT = KUDOS:100000000000.0
+MAX_DEBT_BANK = KUDOS:1000000000000000.0
diff --git a/etc/taler/secrets/exchange-accountcredentials.secret.conf
b/etc/taler/secrets/exchange-accountcredentials.secret.conf
index 5c7e6e1..e9f3e35 100755
--- a/etc/taler/secrets/exchange-accountcredentials.secret.conf
+++ b/etc/taler/secrets/exchange-accountcredentials.secret.conf
@@ -13,5 +13,5 @@
wire_gateway_auth_method = basic
password = x
username = Exchange
-wire_gateway_url = http://localhost:8082/Exchange/
+wire_gateway_url = http://<BANK_HOST_HERE>/Exchange/
diff --git a/image/taler-debian11.yaml b/image/taler-debian11.yaml
index 23e29da..edc09d3 100644
--- a/image/taler-debian11.yaml
+++ b/image/taler-debian11.yaml
@@ -20,7 +20,7 @@ global:
## Environment description customization
## Author
- g5k_author: "grothoff@gnu.org"
+ g5k_author: "bossm8@bfh.ch"
## Version
g5k_version: 2
## Environment image path and compression
@@ -67,7 +67,7 @@ setup:
systemctl daemon-reload
systemctl stop nginx postgresql bind9
systemctl disable nginx postgresql bind9
- - add_g5k_repo:
+ - add_taler_g5k_repo:
- exec_in: |
cd /root
git clone git://git.taler.net/grid5k.git
diff --git a/jfed/env b/jfed/env
index 6e6f592..d03a43e 100644
--- a/jfed/env
+++ b/jfed/env
@@ -1,8 +1,12 @@
DATABASE_HOSTS=
EXCHANGE_HOSTS=
+BANK_HOSTS=
+DNS_HOST=
WALLET_HOSTS=
DB_HOST=
+BANK_HOST=
+
DB_PORT=
DB_NAME=
DB_USER=
diff --git a/jfed/setup.sh b/jfed/setup.sh
index 8420a57..0a085fe 100755
--- a/jfed/setup.sh
+++ b/jfed/setup.sh
@@ -18,6 +18,8 @@ HOST=$(hostname)
case "$HOST" in
${DATABASE_HOSTS}) exec ${G5K_HOME}/scripts/database.sh || echo
"DATABASE";;
${EXCHANGE_HOSTS}) exec ${G5K_HOME}/scripts/exchange.sh || echo
"EXCHANGE";;
+ ${BANK_HOSTS}) exec ${G5K_HOME}/scripts/bank.sh || echo "BANK";;
+ ${DNS_HOST}) exec ${G5K_HOME}/scripts/dns.sh || echo "DNS";;
${WALLET_HOSTS}) exec ${G5K_HOME}/scripts/wallet.sh || echo "WALLET";;
esac
diff --git a/jfed/taler-perf.rspec b/jfed/taler-perf.rspec
index f4dd697..fdacac2 100644
--- a/jfed/taler-perf.rspec
+++ b/jfed/taler-perf.rspec
@@ -1,24 +1,38 @@
<?xml version='1.0'?>
-<rspec xmlns="http://www.geni.net/resources/rspec/3" type="request"
generated_by="jFed RSpec Editor" generated="2021-10-02T22:46:35.648+02:00"
xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"
xmlns:delay="http://www.protogeni.net/resources/rspec/ext/delay/1"
xmlns:jfed-command="http://jfed.iminds.be/rspec/ext/jfed-command/1"
xmlns:client="http://www.protogeni.net/resources/rspec/ext/client/1"
xmlns:jfed-ssh-keys="http://jfed.iminds.be/rspec/ext/jfed-ssh-keys/1" xmlns:
[...]
+<rspec xmlns="http://www.geni.net/resources/rspec/3" type="request"
generated_by="jFed RSpec Editor" generated="2021-10-03T00:20:28.563+02:00"
xmlns:emulab="http://www.protogeni.net/resources/rspec/ext/emulab/1"
xmlns:delay="http://www.protogeni.net/resources/rspec/ext/delay/1"
xmlns:jfed-command="http://jfed.iminds.be/rspec/ext/jfed-command/1"
xmlns:client="http://www.protogeni.net/resources/rspec/ext/client/1"
xmlns:jfed-ssh-keys="http://jfed.iminds.be/rspec/ext/jfed-ssh-keys/1" xmlns:
[...]
<node client_id="DB" exclusive="true"
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am"
component_id="urn:publicid:IDN+am.grid5000.fr+node+%2F3.0%2Fsites%2Fnancy%2Fclusters%2Fgros%2Fnodes%2Fgros-38">
<sliver_type name="raw-pc">
<disk_image
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
</sliver_type>
<hardware_type name="gros-nancy"/>
- <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1"
x="354.33333333333337" y="89.66666666666666"/>
+ <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="298.0"
y="207.5"/>
</node>
<node client_id="Exchange" exclusive="true"
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am">
<sliver_type name="raw-pc">
<disk_image
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
</sliver_type>
<hardware_type name="graphite-nancy"/>
- <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="551.5"
y="231.5"/>
+ <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="420.0"
y="341.5"/>
</node>
<node client_id="Wallet" exclusive="true"
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am">
<sliver_type name="raw-pc">
<disk_image
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
</sliver_type>
<hardware_type name="gros-nancy"/>
- <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="762.5"
y="384.5"/>
+ <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="422.5"
y="481.5"/>
+ </node>
+ <node client_id="Bank" exclusive="true"
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am">
+ <sliver_type name="raw-pc">
+ <disk_image
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
+ </sliver_type>
+ <hardware_type name="grcinq-nancy"/>
+ <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="569.0"
y="208.5"/>
+ </node>
+ <node client_id="DNS" exclusive="true"
component_manager_id="urn:publicid:IDN+am.grid5000.fr+authority+am">
+ <sliver_type name="raw-pc">
+ <disk_image
name="http://public.lyon.grid5000.fr/~bfhch01/taler-debian11.dsc"/>
+ </sliver_type>
+ <hardware_type name="grisou-nancy"/>
+ <location xmlns="http://jfed.iminds.be/rspec/ext/jfed/1" x="784.0"
y="338.5"/>
</node>
</rspec>
\ No newline at end of file
diff --git a/scripts/bank.sh b/scripts/bank.sh
new file mode 100755
index 0000000..0ca681f
--- /dev/null
+++ b/scripts/bank.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+taler-fakebank-run -c /etc/taler/taler.conf & disown
diff --git a/scripts/database.sh b/scripts/database.sh
index ab4b738..6c4e497 100755
--- a/scripts/database.sh
+++ b/scripts/database.sh
@@ -1,7 +1,7 @@
#!/bin/bash
echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf
-echo "host all all 172.16.0.0/16 trust" >> /etc/postgresql/13/main/pg_hba.conf
+echo "host all all 172.16.0.0/16 md5" >> /etc/postgresql/13/main/pg_hba.conf
systemctl start postgresql
diff --git a/scripts/dns.sh b/scripts/dns.sh
new file mode 100755
index 0000000..5cba4ad
--- /dev/null
+++ b/scripts/dns.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+systemctl enable bind9
diff --git a/scripts/exchange.sh b/scripts/exchange.sh
index 0c62f8a..c5e2791 100755
--- a/scripts/exchange.sh
+++ b/scripts/exchange.sh
@@ -1,9 +1,27 @@
#!/bin/bash
-sed -i
"s\<DB_URL_HERE>\postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}\g"
/etc/taler/secrets/exchange-db.secret.conf
+sed -i
"s\<DB_URL_HERE>\postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}\g"
\
+ /etc/taler/secrets/exchange-db.secret.conf
+
+sed -i "s/<BANK_HOST_HERE>/${BANK_HOST}\g" \
+ /etc/taler/secrets/exchange-accountcredentials.secret.conf
+sed -i "s/<BANK_HOST_HERE>/${BANK_HOST}/g" \
+ /etc/taler/conf.d/exchange-business.conf
sudo -u taler-exchange-httpd taler-exchange-dbinit
+until PGPASSWORD="${DB_PASSWORD}" psql
+ -U "${DB_USER}" \
+ -h "${DB_HOST}" \
+ -p "${DB_PORT}" \
+ -d "${DB_NAME}" \
+ -c '\q';
+do
+ echo "Database not ready yet"
+ sleep 5
+done
+
+
su taler-exchange-httpd -s /bin/bash << EOF
PGPASSWORD=${DB_PASSWORD} psql -U ${DB_USER} -h ${DB_HOST} -p ${DB_PORT} -d
${DB_NAME}
GRANT SELECT,INSERT,UPDATE ON ALL TABLES IN SCHEMA public TO
"taler-exchange-aggregator";
@@ -16,10 +34,10 @@ EOF
MASTER_KEY=$(sudo -u taler-exchange-offline taler-exchange-offline setup)
-sed -i "s/<MASTER_KEY_HERE>/${MASTER_KEY}/g"
/etc/taler/conf.d/exchange-business.conf
-sed -i "s\<BASE_URL_HERE>\http://$(hostname)\g"
/etc/taler/conf.d/exchange-business.conf
-
-taler-fakebank-run -c /etc/taler/taler.conf &
+sed -i "s/<MASTER_KEY_HERE>/${MASTER_KEY}/g" \
+ /etc/taler/conf.d/exchange-business.conf
+sed -i "s\<BASE_URL_HERE>\http://$(hostname)\g" \
+ /etc/taler/conf.d/exchange-business.conf
systemctl start taler-exchange.target nginx
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-grid5k] branch master updated (74d0f38 -> 2554db5), gnunet, 2021/11/18
- [taler-grid5k] 12/141: fix sed command, gnunet, 2021/11/18
- [taler-grid5k] 06/141: add env variable template, gnunet, 2021/11/18
- [taler-grid5k] 08/141: make pq accesible, gnunet, 2021/11/18
- [taler-grid5k] 11/141: fix exch script, gnunet, 2021/11/18
- [taler-grid5k] 09/141: fix overwriting, gnunet, 2021/11/18
- [taler-grid5k] 01/141: add new version of image, gnunet, 2021/11/18
- [taler-grid5k] 02/141: rename jobs, gnunet, 2021/11/18
- [taler-grid5k] 07/141: update db script, gnunet, 2021/11/18
- [taler-grid5k] 10/141: update bank config, add dns and bank scripts,
gnunet <=
- [taler-grid5k] 04/141: add dummy scripts and some etc files, gnunet, 2021/11/18
- [taler-grid5k] 58/141: update wallet script, gnunet, 2021/11/18
- [taler-grid5k] 05/141: update init scripts, gnunet, 2021/11/18
- [taler-grid5k] 43/141: dynamically update grafana datasources, gnunet, 2021/11/18
- [taler-grid5k] 68/141: update clearing of dns, gnunet, 2021/11/18
- [taler-grid5k] 44/141: fix function name, gnunet, 2021/11/18
- [taler-grid5k] 52/141: fix dns entries for wallets, gnunet, 2021/11/18
- [taler-grid5k] 49/141: add node exporter, gnunet, 2021/11/18
- [taler-grid5k] 50/141: add node-exporters, gnunet, 2021/11/18
- [taler-grid5k] 21/141: remove default pg port, gnunet, 2021/11/18