Merge branch 'master' of ssh://git.taler.net/exchange

This commit is contained in:
Özgür Kesim 2023-07-23 15:58:31 +02:00
commit e230eaad76
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7
2 changed files with 21 additions and 8 deletions

View File

@ -658,6 +658,9 @@ TALER_MHD_legal_load (const struct GNUNET_CONFIGURATION_Handle *cfg,
if (lang[0] == '.') if (lang[0] == '.')
continue; continue;
if (0 == strcmp (lang,
"locale"))
continue;
load_language (legal, load_language (legal,
path, path,
lang); lang);

View File

@ -244,7 +244,7 @@ if [ "1" = "$START_SANDBOX" ]
then then
# #
LIBEUFIN_SANDBOX_DB_CONNECTION=$(taler-config -c "$CONF" -s "libeufin-sandbox" -o "DB_CONNECTION") LIBEUFIN_SANDBOX_DB_CONNECTION=$(taler-config -c "$CONF" -s "libeufin-sandbox" -o "DB_CONNECTION")
if [ ! -z "$PGHOST" ] if [ ! -z "${PGHOST:+}" ]
then then
EHOST=$(echo $PGHOST | sed -e "s/\//\\\\\//g") EHOST=$(echo $PGHOST | sed -e "s/\//\\\\\//g")
LIBEUFIN_SANDBOX_DB_CONNECTION=$(echo $LIBEUFIN_SANDBOX_DB_CONNECTION | sed -e "s/\/var\/run\/postgresql/$EHOST/") LIBEUFIN_SANDBOX_DB_CONNECTION=$(echo $LIBEUFIN_SANDBOX_DB_CONNECTION | sed -e "s/\/var\/run\/postgresql/$EHOST/")
@ -254,6 +254,8 @@ then
# Create the default demobank. # Create the default demobank.
echo -n "Configuring sandbox at ${LIBEUFIN_SANDBOX_DB_CONNECTION} " echo -n "Configuring sandbox at ${LIBEUFIN_SANDBOX_DB_CONNECTION} "
# libeufin-sandbox reset-tables \
# &> libeufin-sandbox-reset.log
libeufin-sandbox config \ libeufin-sandbox config \
--currency "$CURRENCY" \ --currency "$CURRENCY" \
--users-debt-limit 99999999 \ --users-debt-limit 99999999 \
@ -344,13 +346,15 @@ then
# to the exchange. # to the exchange.
LIBEUFIN_NEXUS_DB_CONNECTION=$(taler-config -c "$CONF" -s "libeufin-nexus" -o "DB_CONNECTION") LIBEUFIN_NEXUS_DB_CONNECTION=$(taler-config -c "$CONF" -s "libeufin-nexus" -o "DB_CONNECTION")
if [ ! -z "$PGHOST" ] if [ ! -z "${PGHOST:+}" ]
then then
EHOST=$(echo $PGHOST | sed -e "s/\//\\\\\//g") EHOST=$(echo $PGHOST | sed -e "s/\//\\\\\//g")
LIBEUFIN_NEXUS_DB_CONNECTION=$(echo $LIBEUFIN_NEXUS_DB_CONNECTION | sed -e "s/\/var\/run\/postgresql/$EHOST/") LIBEUFIN_NEXUS_DB_CONNECTION=$(echo $LIBEUFIN_NEXUS_DB_CONNECTION | sed -e "s/\/var\/run\/postgresql/$EHOST/")
taler-config -c "$CONF" -s "libeufin-nexus" -o "DB_CONNECTION" -V "$LIBEUFIN_NEXUS_DB_CONNECTION" taler-config -c "$CONF" -s "libeufin-nexus" -o "DB_CONNECTION" -V "$LIBEUFIN_NEXUS_DB_CONNECTION"
fi fi
export LIBEUFIN_NEXUS_DB_CONNECTION export LIBEUFIN_NEXUS_DB_CONNECTION
# libeufin-nexus reset-tables \
# &> libeufin-nexus-reset.log
# For convenience, username and password are # For convenience, username and password are
# identical to those used at the Sandbox. # identical to those used at the Sandbox.
@ -446,7 +450,13 @@ if [ "1" = "$START_EXCHANGE" ]
then then
echo -n "Starting exchange ..." echo -n "Starting exchange ..."
EXCHANGE_PORT=$(taler-config -c "$CONF" -s EXCHANGE -o PORT) EXCHANGE_PORT=$(taler-config -c "$CONF" -s EXCHANGE -o PORT)
SERVE=$(taler-config -c "$CONF" -s EXCHANGE -o SERVE)
if [ "${SERVE}" = "unix" ]
then
EXCHANGE_URL=$(taler-config -c "$CONF" -s EXCHANGE -o BASE_URL)
else
EXCHANGE_URL="http://localhost:${EXCHANGE_PORT}/" EXCHANGE_URL="http://localhost:${EXCHANGE_PORT}/"
fi
MASTER_PRIV_FILE=$(taler-config -f -c "${CONF}" -s "EXCHANGE-OFFLINE" -o "MASTER_PRIV_FILE") MASTER_PRIV_FILE=$(taler-config -f -c "${CONF}" -s "EXCHANGE-OFFLINE" -o "MASTER_PRIV_FILE")
MASTER_PRIV_DIR=$(dirname "$MASTER_PRIV_FILE") MASTER_PRIV_DIR=$(dirname "$MASTER_PRIV_FILE")
mkdir -p "${MASTER_PRIV_DIR}" mkdir -p "${MASTER_PRIV_DIR}"
@ -568,7 +578,7 @@ then
--timeout=1 \ --timeout=1 \
--user admin \ --user admin \
--password secret \ --password secret \
"http://localhost:8082/" \ "http://localhost:${BANK_PORT}/" \
-o /dev/null \ -o /dev/null \
-O /dev/null >/dev/null || continue -O /dev/null >/dev/null || continue
OK="1" OK="1"
@ -641,7 +651,7 @@ then
echo -n "Wait for exchange /management/keys to be ready " echo -n "Wait for exchange /management/keys to be ready "
OK="0" OK="0"
LAST_RESPONSE=$(mktemp tmp-last-response.XXXXXXXX) LAST_RESPONSE=$(mktemp tmp-last-response.XXXXXXXX)
for n in $(seq 1 50) for n in $(seq 1 10)
do do
echo -n "." echo -n "."
sleep "$DEFAULT_SLEEP" sleep "$DEFAULT_SLEEP"
@ -649,8 +659,8 @@ then
wget \ wget \
--tries=3 \ --tries=3 \
--waitretry=0 \ --waitretry=0 \
--timeout=1 \ --timeout=30 \
"http://localhost:8081/management/keys"\ "${EXCHANGE_URL}management/keys"\
-o /dev/null \ -o /dev/null \
-O "$LAST_RESPONSE" \ -O "$LAST_RESPONSE" \
>/dev/null || continue >/dev/null || continue
@ -704,7 +714,7 @@ then
wget \ wget \
--tries=1 \ --tries=1 \
--timeout=1 \ --timeout=1 \
"http://localhost:8081/keys" \ "${EXCHANGE_URL}keys" \
-o /dev/null \ -o /dev/null \
-O "$LAST_RESPONSE" \ -O "$LAST_RESPONSE" \
>/dev/null || continue >/dev/null || continue