summaryrefslogtreecommitdiff
path: root/netzbon/setup-exchange.sh
diff options
context:
space:
mode:
Diffstat (limited to 'netzbon/setup-exchange.sh')
-rwxr-xr-xnetzbon/setup-exchange.sh22
1 files changed, 19 insertions, 3 deletions
diff --git a/netzbon/setup-exchange.sh b/netzbon/setup-exchange.sh
index 12dc2df..2b9457d 100755
--- a/netzbon/setup-exchange.sh
+++ b/netzbon/setup-exchange.sh
@@ -59,6 +59,9 @@ function die() {
# Just try if sudo works for diagnostics
sudo -i -u taler-exchange-offline id >/dev/null || die "Error: Unable to switch to taler-exchange-offline user"
+
+chmod a+r /etc/taler/taler.conf # FIXME-CG: Debian installation should set this
+
# Create master key as taler-exchange-offline *unless* user already
# set the MASTER_PUBLIC_KEY to some value we can use.
export MASTER_PRIV_DIR=.local/share/taler/exchange/offline-keys
@@ -75,7 +78,7 @@ if test -z "${MASTER_PUBLIC_KEY:-}"; then
"SECM_TOFU_FILE=\$HOME/${SECMOD_TOFU_FILE}\n"\
>/etc/taler/conf.d/offline-setup.conf
- MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline -LDEBUG setup)
+ MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline -c /etc/taler/taler.conf -LDEBUG setup)
echo "MASTER_PUBLIC_KEY=\"${MASTER_PUBLIC_KEY}\"" >>config/user.conf
if test -z "${DO_OFFLINE:-}"; then
# Set 'DO_OFFLINE'
@@ -85,7 +88,7 @@ if test -z "${MASTER_PUBLIC_KEY:-}"; then
else
say "Master public key is $MASTER_PUBLIC_KEY"
if test ${DO_OFFLINE:-y} == y; then
- MASTER_PUBLIC_KEY2=$(sudo -i -u taler-exchange-offline taler-exchange-offline setup)
+ MASTER_PUBLIC_KEY2=$(sudo -i -u taler-exchange-offline taler-exchange-offline -c /etc/taler/taler.conf setup)
if test "${MASTER_PUBLIC_KEY2}" != "${MASTER_PUBLIC_KEY}"; then
say "Error: master public key missmatch ${MASTER_PUBLIC_KEY2} does not match ${MASTER_PUBLIC_KEY}"
exit 1
@@ -124,6 +127,20 @@ ENABLE_CREDIT=YES
@inline-secret@ exchange-accountcredentials-default ../secrets/exchange-accountcredentials-default.secret.conf
EOF
+# FIXME-CG: def already in the Git, remove this
+# after the next .deb release
+cat << EOF > /etc/taler/conf.d/netzbon.conf
+[currency-netzbon]
+ENABLED=YES
+name=NetzBon
+code=NETZBON
+fractional_input_digits=2
+fractional_normal_digits=2
+fractional_trailing_zero_digits=2
+alt_unit_names = {"0":"NETZBON"}
+EOF
+chmod a+r /etc/taler/conf.d/netzbon.conf
+
cat << EOF > /etc/taler/secrets/exchange-db.secret.conf
[exchangedb-postgres]
CONFIG=postgres:///exchange
@@ -155,7 +172,6 @@ for SEC in $(taler-config -c /etc/taler/conf.d/"${CURRENCY}"-coins.conf -S | gre
taler-config -c /etc/taler/conf.d/"${CURRENCY}"-coins.conf -s "$SEC" -o CIPHER -V "RSA"
done
-chmod o+r /etc/taler/taler.conf # FIXME-CG: Debian installation should set this
# NOTE: already fixed in exchange.git, leaving in place
# until 0.9.4 release of fixed exchange Debian package. -CG
say "Initializing exchange database"