summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile.am4
-rw-r--r--contrib/exchange-template/config/exchange-common.conf4
-rwxr-xr-xcontrib/taler-bank-manage-testing30
3 files changed, 35 insertions, 3 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index dfe37429e..58b00812e 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,9 +1,11 @@
SUBDIRS = . tos pp
+bin_SCRIPTS = \
+ taler-bank-manage-testing
+
EXTRA_DIST = \
auditor-report.tex.j2 \
coverage.sh \
gnunet.tag \
microhttpd.tag \
render.py
-
diff --git a/contrib/exchange-template/config/exchange-common.conf b/contrib/exchange-template/config/exchange-common.conf
index 425bb92b2..922726ec2 100644
--- a/contrib/exchange-template/config/exchange-common.conf
+++ b/contrib/exchange-template/config/exchange-common.conf
@@ -52,8 +52,8 @@ PLUGIN = taler_bank
# We also may need authentication data.
TALER_BANK_AUTH_METHOD = "none" # or basic
-# TALER_BANK_USERNAME = user
-# TALER_BANK_PASSWORD = pass
+# TALER_TALER_TESTING_BANK_USERNAME = user
+# TALER_TALER_TESTING_BANK_PASSWORD = pass
# Accounts need to be enabled for the aggregator to debit them.
ENABLE_DEBIT = YES
diff --git a/contrib/taler-bank-manage-testing b/contrib/taler-bank-manage-testing
new file mode 100755
index 000000000..196a02d5e
--- /dev/null
+++ b/contrib/taler-bank-manage-testing
@@ -0,0 +1,30 @@
+#!/bin/sh
+# This file is in the public domain
+# Wrapper around 'taler-bank-manage' to first configure the required
+# testing accounts before launching the bank properly.
+#
+# Takes 3 arguments:
+# $1: the configuration file name
+# $2: the database name
+# $3: serve-http or serve-uwsgi
+
+set -eu
+
+# Reset database, provide starting accounts
+taler-bank-manage -c $1 --with-db $2 django flush --no-input
+taler-bank-manage -c $1 --with-db $2 django provide_accounts
+
+# This is 'x' hashed by Django
+PW_HASH='pbkdf2_sha256$180000$RBYjEO0WzE1z$x2Avt35TkOL2pMHvts3B1U1NIJalXZf95WnJhGFOAUs='
+
+# hack password hash directly into the database:
+echo "UPDATE auth_user SET password='$PW_HASH'" | psql -Aqt $2
+
+# Note that calling
+# taler-bank-manage -c $1 --with-db $2 django changepassword Bank x
+# does not work: (1) it always insists on going interactive, and (2)
+# rejects 'x' as a password.
+
+
+# Now run Django for good
+exec taler-bank-manage -c $1 --with-db $2 $3 \ No newline at end of file