commit 0563af54534fa37bb8153209fd6fe6d70a495eb2
parent 9af4c893d44d7d4d5ca87748cd06048f6ae46ee3
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Sat, 20 Dec 2025 23:12:57 +0900
update gana using script; remove submodule; clone from git+ssh
Diffstat:
5 files changed, 135 insertions(+), 14 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "third_party/gana"]
- path = third_party/gana
- url = https://git.gnunet.org/git/gana
diff --git a/Makefile.in b/Makefile.in
@@ -31,13 +31,7 @@ format:
${GO} fmt ./pkg/rest/*.go
gana:
- BUILDDIR=$(pwd)
- cd third_party/gana/gnu-taler-error-codes && make taler_error_codes.go
- cd ${BUILDDIR}
- cp third_party/gana/gnu-taler-error-codes/taler_error_codes.go internal/gana/
- cd third_party/gana/gnunet-signatures && make taler_signatures.go
- cd ${BUILDDIR}
- cp third_party/gana/gnunet-signatures/taler_signatures.go internal/gana/
+ ./contrib/gana_update.sh
dist:
git archive --format=tar.gz -o taler-mailbox-${GITVER}.tar.gz --prefix=taler-mailbox-${GITVER}/ HEAD
diff --git a/contrib/gana_update.sh b/contrib/gana_update.sh
@@ -0,0 +1,59 @@
+# This is more portable than `which' but comes with
+# the caveat of not(?) properly working on busybox's ash:
+MAILBOX_SRC_ROOT=$PWD
+if [ ! -f $MAILBOX_SRC_ROOT/contrib/gana_update.sh ]; then
+ echo "Please run this script from the root of the source tree!"
+ exit 1
+fi
+
+COMMIT_HASH=""
+if [ ! -z $1 ]; then
+ COMMIT_HASH=$1
+fi
+
+cleanup() {
+ if [ -d $GANA_TMP ]; then
+ rm -rf $GANA_TMP
+ fi
+ cd $MAILBOX_SRC_ROOT
+}
+
+# This is more portable than `which' but comes with
+# the caveat of not(?) properly working on busybox's ash:
+existence()
+{
+ type "$1" >/dev/null 2>&1
+}
+
+gana_update()
+{
+ echo "Updating GANA..."
+ if ! existence git; then
+ echo "Script requires git"
+ exit 1
+ fi
+ if ! existence recfmt; then
+ echo "Script requires recutils"
+ exit 1
+ fi
+ GANA_TMP=`mktemp -d`
+ cd $GANA_TMP || exit 1
+ git clone git+ssh://git@git.gnunet.org/gana.git || exit 1
+ cd gana || exit 1
+ if [ ! -z "${COMMIT_HASH}" ]; then
+ git checkout "${COMMIT_HASH}" || exit 1
+ fi
+ # GNS
+ echo "Updating Taler error codes"
+ make -C gnu-taler-error-codes taler_error_codes.go >/dev/null && \
+ cp gnu-taler-error-codes/taler_error_codes.go $MAILBOX_SRC_ROOT/internal/gana/ || exit 1
+ echo "Updating Taler signatures"
+ make -C gnunet-signatures taler_signatures.go >/dev/null && \
+ cp gnunet-signatures/taler_signatures.go $MAILBOX_SRC_ROOT/internal/gana/ || exit 1
+
+ echo "GANA finished"
+ cd $MAILBOX_SRC_ROOT
+}
+
+trap cleanup EXIT
+gana_update
diff --git a/internal/gana/taler_error_codes.go b/internal/gana/taler_error_codes.go
@@ -747,6 +747,54 @@ const (
/**
+ * The process to generate a PDF from a template failed. A likely cause is a syntactic error in the template. This needs to be investigated by the exchange operator.
+ * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ EXCHANGE_GENERIC_TYPST_TEMPLATE_FAILURE = 1044
+
+
+ /**
+ * A process to combine multiple PDFs into one larger document failed. A likely cause is a resource exhaustion problem on the server. This needs to be investigated by the exchange operator.
+ * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ EXCHANGE_GENERIC_PDFTK_FAILURE = 1045
+
+
+ /**
+ * The process to generate a PDF from a template crashed. A likely cause is a bug in the Typst software. This needs to be investigated by the exchange operator.
+ * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ EXCHANGE_GENERIC_TYPST_CRASH = 1046
+
+
+ /**
+ * The process to combine multiple PDFs into a larger document crashed. A likely cause is a bug in the pdftk software. This needs to be investigated by the exchange operator.
+ * Returned with an HTTP status code of #MHD_HTTP_INTERNAL_SERVER_ERROR (500).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ EXCHANGE_GENERIC_PDFTK_CRASH = 1047
+
+
+ /**
+ * One of the binaries needed to generate the PDF is not installed. If this feature is required, the system administrator should make sure Typst and pdftk are both installed.
+ * Returned with an HTTP status code of #MHD_HTTP_NOT_IMPLEMENTED (501).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ EXCHANGE_GENERIC_NO_TYPST_OR_PDFTK = 1048
+
+
+ /**
+ * The exchange is not aware of the given target account. The specified account is not a customer of this service.
+ * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ EXCHANGE_GENERIC_TARGET_ACCOUNT_UNKNOWN = 1049
+
+
+ /**
* The exchange did not find information about the specified transaction in the database.
* Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404).
* (A value of 0 indicates that the error is generated client-side).
@@ -2363,6 +2411,14 @@ const (
/**
+ * The unit referenced in the request is not known to the backend.
+ * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ MERCHANT_GENERIC_UNIT_UNKNOWN = 2004
+
+
+ /**
* The proposal is not known to the backend.
* Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404).
* (A value of 0 indicates that the error is generated client-side).
@@ -2587,6 +2643,14 @@ const (
/**
+ * The unit referenced in the request is builtin and cannot be modified or deleted.
+ * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ MERCHANT_GENERIC_UNIT_BUILTIN = 2033
+
+
+ /**
* The exchange failed to provide a valid answer to the tracking request, thus those details are not in the response.
* Returned with an HTTP status code of #MHD_HTTP_OK (200).
* (A value of 0 indicates that the error is generated client-side).
@@ -2835,11 +2899,11 @@ const (
/**
- * Legacy stuff. Remove me with protocol v1.
- * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0).
+ * The refund request is too late because it is past the wire transfer deadline of the order. The merchant must find a different way to pay back the money to the customer.
+ * Returned with an HTTP status code of #MHD_HTTP_GONE (410).
* (A value of 0 indicates that the error is generated client-side).
*/
- DEAD_QQQ_PAY_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE = 2169
+ MERCHANT_PRIVATE_POST_REFUND_AFTER_WIRE_DEADLINE = 2169
/**
@@ -4691,6 +4755,14 @@ const (
/**
+ * The order could not be found. Maybe the merchant deleted it.
+ * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0).
+ * (A value of 0 indicates that the error is generated client-side).
+ */
+ WALLET_MERCHANT_ORDER_NOT_FOUND = 7049
+
+
+ /**
* We encountered a timeout with our payment backend.
* Returned with an HTTP status code of #MHD_HTTP_GATEWAY_TIMEOUT (504).
* (A value of 0 indicates that the error is generated client-side).
diff --git a/third_party/gana b/third_party/gana
@@ -1 +0,0 @@
-Subproject commit a20eac9cf4150d1093df48cae9d01ec7ff0b7bde