[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-deployment] branch master updated (009d693 -> baa1ef9)
From: |
gnunet |
Subject: |
[taler-deployment] branch master updated (009d693 -> baa1ef9) |
Date: |
Wed, 12 Apr 2023 15:36:52 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a change to branch master
in repository deployment.
from 009d693 netzbon: formatting
new 7870c13 netzbon: quoting
new baa1ef9 netzbon: shellcheck
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
netzbon/.shellcheckrc | 1 +
.../data/.exists => netzbon/config/internal.conf | 0
.../data/.exists => netzbon/config/user.conf | 0
netzbon/config_launch_libeufin.sh | 38 +++++++++---------
netzbon/functions.sh | 3 ++
netzbon/setup-exchange.sh | 45 +++++++++++-----------
6 files changed, 47 insertions(+), 40 deletions(-)
create mode 100644 netzbon/.shellcheckrc
copy depo/.taler/data/.exists => netzbon/config/internal.conf (100%)
copy depo/.taler/data/.exists => netzbon/config/user.conf (100%)
diff --git a/netzbon/.shellcheckrc b/netzbon/.shellcheckrc
new file mode 100644
index 0000000..e170f39
--- /dev/null
+++ b/netzbon/.shellcheckrc
@@ -0,0 +1 @@
+disable=SC2018,SC2019
diff --git a/depo/.taler/data/.exists b/netzbon/config/internal.conf
similarity index 100%
copy from depo/.taler/data/.exists
copy to netzbon/config/internal.conf
diff --git a/depo/.taler/data/.exists b/netzbon/config/user.conf
similarity index 100%
copy from depo/.taler/data/.exists
copy to netzbon/config/user.conf
diff --git a/netzbon/config_launch_libeufin.sh
b/netzbon/config_launch_libeufin.sh
index 1231378..d00e631 100755
--- a/netzbon/config_launch_libeufin.sh
+++ b/netzbon/config_launch_libeufin.sh
@@ -45,7 +45,7 @@ fi
# TODO: add sanity-checks for presence of other required env-vars
-if test ${ENABLE_TLS:-} == "y"; then
+if test "${ENABLE_TLS:-}" == "y"; then
PROTO="https"
else
PROTO="http"
@@ -65,10 +65,11 @@ echo
"LIBEUFIN_NEXUS_USERNAME=\"${LIBEUFIN_NEXUS_USERNAME}\"" >>config/internal.
# Load configuration with
# LIBEUFIN_NEXUS_DB_CONNECTION and
# LIBEUFIN_NEXUS_PORT
+# shellcheck disable=SC1091
source /etc/libeufin/nexus.env
export LIBEUFIN_NEXUS_DB_CONNECTION
-if test -z ${LIBEUFIN_NEXUS_DB_CONNECTION:-}; then
+if test -z "${LIBEUFIN_NEXUS_DB_CONNECTION:-}"; then
say "Error: /etc/libeufin/nexus.env does not specify
LIBEUFIN_NEXUS_DB_CONNECTION"
exit 1
fi
@@ -79,10 +80,11 @@ export
LIBEUFIN_NEXUS_URL="http://localhost:${LIBEUFIN_NEXUS_PORT}"
# Load configuration with
# LIBEUFIN_SANDBOX_DB_CONNECTION and
# LIBEUFIN_SANDBOX_PORT
+# shellcheck disable=SC1091
. /etc/libeufin/sandbox.env
export LIBEUFIN_SANDBOX_DB_CONNECTION
-if test -z ${LIBEUFIN_SANDBOX_DB_CONNECTION:-}; then
+if test -z "${LIBEUFIN_SANDBOX_DB_CONNECTION:-}"; then
say "Error: /etc/libeufin/sandbox.env does not specify
LIBEUFIN_SANDBOX_DB_CONNECTION"
exit 1
fi
@@ -105,7 +107,7 @@ sudo -E -u libeufin-sandbox \
--bank-debt-limit 1000000 \
--users-debt-limit 0 \
--without-signup-bonus \
- --currency ${CURRENCY} \
+ --currency "${CURRENCY}" \
default
say "DONE"
say "Start the bank..."
@@ -117,13 +119,13 @@ curl --max-time 25 \
--retry-connrefused \
--retry-delay 3 \
--retry 10 \
- ${SANDBOX_URL} &>/dev/null
+ "${SANDBOX_URL}" &>/dev/null
say "DONE"
say "Make one superuser at Nexus..."
sudo -E -u libeufin-nexus libeufin-nexus superuser \
${LIBEUFIN_NEXUS_USERNAME} \
- --password $NEXUS_EXCHANGE_PASSWORD
+ --password "$NEXUS_EXCHANGE_PASSWORD"
say "DONE"
say "Launching Nexus..."
@@ -135,7 +137,7 @@ curl --max-time 25 \
--retry-connrefused \
--retry-delay 3 \
--retry 10 \
- ${LIBEUFIN_NEXUS_URL} &>/dev/null
+ "${LIBEUFIN_NEXUS_URL}" &>/dev/null
say "DONE"
EXCHANGE_SANDBOX_USERNAME="exchange-at-sandbox"
@@ -147,28 +149,28 @@ export
LIBEUFIN_SANDBOX_PASSWORD="${SANDBOX_EXCHANGE_PASSWORD}"
# FIXME-MS: might be better to DELETE an existing
# account here instead!??
libeufin-cli \
- sandbox --sandbox-url ${SANDBOX_URL} \
+ sandbox --sandbox-url "${SANDBOX_URL}" \
demobank register || true
say "DONE"
say "Getting the exchange IBAN and Payto URI..."
EXCHANGE_DETAILS=$(libeufin-cli \
- sandbox --sandbox-url ${SANDBOX_URL} \
+ sandbox --sandbox-url "${SANDBOX_URL}" \
demobank info --bank-account ${LIBEUFIN_SANDBOX_USERNAME})
say "DONE"
-EXCHANGE_IBAN=$(echo $EXCHANGE_DETAILS | jq -r .iban)
-EXCHANGE_PAYTO=$(echo $EXCHANGE_DETAILS | jq -r .paytoUri)
+EXCHANGE_IBAN=$(echo "$EXCHANGE_DETAILS" | jq -r .iban)
+EXCHANGE_PAYTO=$(echo "$EXCHANGE_DETAILS" | jq -r .paytoUri)
# Communicating this to the exchange script, as the exchange
# needs it for the /wire response.
export EXCHANGE_IBAN
export EXCHANGE_PAYTO
-echo "EXCHANGE_IBAN=\"${EXCHANGE_IBAN}\"" >>${MY_DIR}/config/internal.conf
-echo "EXCHANGE_PAYTO=\"${EXCHANGE_PAYTO}\"" >>${MY_DIR}/config/internal.conf
+echo "EXCHANGE_IBAN=\"${EXCHANGE_IBAN}\"" >>"${MY_DIR}"/config/internal.conf
+echo "EXCHANGE_PAYTO=\"${EXCHANGE_PAYTO}\"" >>"${MY_DIR}"/config/internal.conf
say "Setting the default exchange at Sandbox..."
-libeufin-sandbox default-exchange "${PROTO}://exchange.$DOMAIN_NAME/"
$EXCHANGE_PAYTO
+libeufin-sandbox default-exchange "${PROTO}://exchange.$DOMAIN_NAME/"
"$EXCHANGE_PAYTO"
say "DONE"
export LIBEUFIN_SANDBOX_USERNAME="admin"
@@ -177,7 +179,7 @@ say "Create EBICS host at Sandbox..."
# Continue on failure, request is not idempotent...
# FIXME-MS: might be nicer to delete existing host first.
libeufin-cli sandbox \
- --sandbox-url ${SANDBOX_URL} \
+ --sandbox-url "${SANDBOX_URL}" \
ebicshost create --host-id ${EBICS_HOST_ID} || true
say "OK"
@@ -185,7 +187,7 @@ say "Create exchange EBICS subscriber at Sandbox..."
# Continue on failure, request is not idempotent...
# FIXME-MS: might be nicer to delete existing host first.
libeufin-cli sandbox \
- --sandbox-url ${SANDBOX_URL} \
+ --sandbox-url "${SANDBOX_URL}" \
demobank new-ebicssubscriber \
--host-id ${EBICS_HOST_ID} \
--user-id ${EBICS_USER_ID} \
@@ -226,13 +228,13 @@ say "Create the Taler facade at Nexus..."
# FIXME-MS: might be nicer to delete existing facade first.
libeufin-cli facades \
new-taler-wire-gateway-facade \
- --currency $CURRENCY \
+ --currency "$CURRENCY" \
--facade-name ${LIBEUFIN_TALER_FACADE} \
${EBICS_CONNECTION_NAME} ${LIBEUFIN_NEXUS_USERNAME} || true
say "OK"
export
WIRE_GATEWAY_URL="${LIBEUFIN_NEXUS_URL}/facades/${LIBEUFIN_TALER_FACADE}/taler-wire-gateway/"
-echo "WIRE_GATEWAY_URL=\"${WIRE_GATEWAY_URL}\""
>>${MY_DIR}/config/internal.conf
+echo "WIRE_GATEWAY_URL=\"${WIRE_GATEWAY_URL}\""
>>"${MY_DIR}"/config/internal.conf
say "Configuring the background jobs to submit/get transactions..."
# Tries every second.
diff --git a/netzbon/functions.sh b/netzbon/functions.sh
index 3938aca..753d846 100755
--- a/netzbon/functions.sh
+++ b/netzbon/functions.sh
@@ -18,7 +18,10 @@ function check_user() {
# status if distro not supported.
function detect_distro() {
unset DISTRO
+ # shellcheck disable=SC2034
uname -a | grep Ubuntu >/dev/null && DISTRO=ubuntu && return 0
+ # shellcheck disable=SC2034
uname -a | grep Debian >/dev/null && DISTRO=debian && return 0
+ echo "Unsupported distro, should be either ubuntu or debian" >&2
return 1
}
diff --git a/netzbon/setup-exchange.sh b/netzbon/setup-exchange.sh
index 1a031df..ab7da70 100755
--- a/netzbon/setup-exchange.sh
+++ b/netzbon/setup-exchange.sh
@@ -5,7 +5,7 @@
set -eu
notify_exit() {
- [[ $1 == 0 ]] || echo Script $0 failed, exit code $1
+ [[ $1 == 0 ]] || echo Script "$0" failed, exit code "$1"
}
notify_err() {
@@ -15,6 +15,7 @@ notify_err() {
trap '(exit 130)' INT
trap '(exit 143)' TERM
trap notify_err ERR
+# shellcheck disable=SC2154
trap 'rc=$?; notify_exit $rc; exit $rc' EXIT
# End of error handling setup
@@ -34,29 +35,29 @@ say "Beginning Exchange setup"
# - EXCHANGE_PAYTO (exchange account PAYTO)
# - ENABLE_TLS (http or https?)
-if test -z ${LIBEUFIN_NEXUS_USERNAME:-}; then
+if test -z "${LIBEUFIN_NEXUS_USERNAME:-}"; then
say "Failure: LIBEUFIN_NEXUS_USERNAME not set"
exit 1
fi
-if test -z ${NEXUS_EXCHANGE_PASSWORD:-}; then
+if test -z "${NEXUS_EXCHANGE_PASSWORD:-}"; then
say "Failure: NEXUS_EXCHANGE_PASSWORD not set"
exit 1
fi
-if test -z ${EXCHANGE_IBAN:-}; then
+if test -z "${EXCHANGE_IBAN:-}"; then
say "Failure: EXCHANGE_IBAN not set"
exit 1
fi
-if test -z ${WIRE_GATEWAY_URL:-}; then
+if test -z "${WIRE_GATEWAY_URL:-}"; then
say "Failure: WIRE_GATEWAY_URL not set"
exit 1
fi
-if test -z ${EXCHANGE_PAYTO:-}; then
+if test -z "${EXCHANGE_PAYTO:-}"; then
say "Failure: EXCHANGE_PAYTO not set"
exit 1
fi
function die() {
- say $1
+ say "$1"
exit 1
}
@@ -68,8 +69,8 @@ sudo -i -u taler-exchange-offline id >/dev/null || die
"Error: Unable to switch
export MASTER_PRIV_DIR=.local/share/taler/exchange/offline-keys
export MASTER_PRIV_FILE=${MASTER_PRIV_DIR}/master.priv
export SECMOD_TOFU_FILE=${MASTER_PRIV_DIR}/secm_tofus.pub
-if test -z ${MASTER_PUBLIC_KEY:-}; then
- if test ${DO_OFFLINE:-y} == n; then
+if test -z "${MASTER_PUBLIC_KEY:-}"; then
+ if test "${DO_OFFLINE:-y}" == n; then
say "Error: No MASTER_PUBLIC_KEY but DO_OFFLINE set to NO"
exit 1
fi
@@ -81,7 +82,7 @@ if test -z ${MASTER_PUBLIC_KEY:-}; then
MASTER_PUBLIC_KEY=$(sudo -i -u taler-exchange-offline taler-exchange-offline
-LDEBUG setup)
echo "MASTER_PUBLIC_KEY=\"${MASTER_PUBLIC_KEY}\"" >>config/user.conf
- if test -z ${DO_OFFLINE:-}; then
+ if test -z "${DO_OFFLINE:-}"; then
# Set 'DO_OFFLINE'
DO_OFFLINE=y
echo "DO_OFFLINE=y" >>config/user.conf
@@ -113,7 +114,7 @@ sudo -i -u postgres createdb -O taler-exchange-httpd
$EXCHANGE_DB || true
say "Configuring exchange"
-if test ${ENABLE_TLS} = "y"; then
+if test "${ENABLE_TLS}" = "y"; then
export EXCHANGE_BASE_URL="https://exchange.${DOMAIN_NAME}/"
else
export EXCHANGE_BASE_URL="http://exchange.${DOMAIN_NAME}/"
@@ -154,14 +155,14 @@ chmod 400
/etc/taler/secrets/exchange-accountcredentials-default.secret.conf
chown taler-exchange-wire:taler-exchange-db
/etc/taler/secrets/exchange-accountcredentials-default.secret.conf
taler-harness deployment gen-coin-config \
- --min-amount ${CURRENCY}:0.01 \
- --max-amount ${CURRENCY}:100 |
+ --min-amount "${CURRENCY}":0.01 \
+ --max-amount "${CURRENCY}":100 |
sed -e "s/FEE_DEPOSIT = ${CURRENCY}:0.01/FEE_DEPOSIT = ${CURRENCY}:0/" \
- >/etc/taler/conf.d/${CURRENCY}-coins.conf
+ >/etc/taler/conf.d/"${CURRENCY}"-coins.conf
# FIXME-DOLD: this belongs with taler-harness
-for SEC in $(taler-config -c /etc/taler/conf.d/${CURRENCY}-coins.conf -S |
grep COIN-); do
- taler-config -c /etc/taler/conf.d/${CURRENCY}-coins.conf -s $SEC -o CIPHER
-V "RSA"
+for SEC in $(taler-config -c /etc/taler/conf.d/"${CURRENCY}"-coins.conf -S |
grep COIN-); do
+ taler-config -c /etc/taler/conf.d/"${CURRENCY}"-coins.conf -s "$SEC" -o
CIPHER -V "RSA"
done
say "Initializing exchange database"
@@ -190,14 +191,14 @@ curl --max-time 2 \
--retry-connrefused \
--retry-delay 1 \
--retry 10 \
- ${EXCHANGE_BASE_URL}config &>/dev/null
+ "${EXCHANGE_BASE_URL}"config &>/dev/null
say "DONE"
say "Waiting for exchange management keys (this may take a while)..."
curl --max-time 30 \
--retry-delay 1 \
--retry 60 \
- ${EXCHANGE_BASE_URL}management/keys &>/dev/null
+ "${EXCHANGE_BASE_URL}"management/keys &>/dev/null
say "DONE"
if test ${DO_OFFLINE} == y; then
@@ -212,9 +213,9 @@ if test ${DO_OFFLINE} == y; then
sudo -i -u taler-exchange-offline \
taler-exchange-offline \
- enable-account ${EXCHANGE_PAYTO} \
- wire-fee now iban ${CURRENCY}:0 ${CURRENCY}:0 \
- global-fee now ${CURRENCY}:0 ${CURRENCY}:0 ${CURRENCY}:0 1h 6a 0 \
+ enable-account "${EXCHANGE_PAYTO}" \
+ wire-fee now iban "${CURRENCY}":0 "${CURRENCY}":0 \
+ global-fee now "${CURRENCY}":0 "${CURRENCY}":0 "${CURRENCY}":0 1h 6a 0 \
upload
fi
@@ -223,7 +224,7 @@ curl --max-time 2 \
--retry-connrefused \
--retry-delay 1 \
--retry 10 \
- ${EXCHANGE_BASE_URL}keys &>/dev/null
+ "${EXCHANGE_BASE_URL}"keys &>/dev/null
say "DONE"
say "Exchange setup finished"
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-deployment] branch master updated (009d693 -> baa1ef9),
gnunet <=