gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: more checks


From: gnunet
Subject: [taler-wallet-core] branch master updated: more checks
Date: Wed, 04 Aug 2021 22:43:14 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new dadf7a94 more checks
dadf7a94 is described below

commit dadf7a943c7d48acb6641aa943e849488ed99415
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Aug 4 22:43:09 2021 +0200

    more checks
---
 packages/taler-wallet-cli/src/lint.ts | 64 ++++++++++++++++++++++++++++-------
 1 file changed, 51 insertions(+), 13 deletions(-)

diff --git a/packages/taler-wallet-cli/src/lint.ts 
b/packages/taler-wallet-cli/src/lint.ts
index 66257190..61b6d622 100644
--- a/packages/taler-wallet-cli/src/lint.ts
+++ b/packages/taler-wallet-cli/src/lint.ts
@@ -14,19 +14,27 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
+/**
+ * The deployment linter implements checks for a deployment
+ * of the GNU Taler exchange.  It is meant to help sysadmins
+ * when setting up an exchange.
+ *
+ * The linter does checks in the configuration and uses
+ * various tools of the exchange in test mode (-t).
+ *
+ * To be able to run the tools as the right user, the linter should be
+ * run as root.
+ *
+ * @author Florian Dold <dold@taler.net>
+ */
+
 /**
  * Imports.
  */
 import {
-  buildCodecForObject,
-  Codec,
-  codecForAny,
   codecForExchangeKeysJson,
   codecForKeysManagementResponse,
-  codecForList,
-  codecForString,
   Configuration,
-  durationFromSpec,
 } from "@gnu-taler/taler-util";
 import {
   decodeCrock,
@@ -382,6 +390,7 @@ export async function checkExchangeHttpd(
     }
   }
 
+  // Check if we can use /keys already
   {
     const keysUrl = new URL("keys", baseUrl);
 
@@ -393,18 +402,47 @@ export async function checkExchangeHttpd(
           "Make sure to sign and upload denomination and signing keys " +
           "with taler-exchange-offline.",
       );
-      process.exit(1);
+      if (!context.cont) {
+        console.log("Aborting further checks.");
+        process.exit(1);
+      }
+    } else {
+      const keys = await readSuccessResponseJsonOrThrow(
+        resp,
+        codecForExchangeKeysJson(),
+      );
+
+      if (keys.master_public_key !== pubConf.masterPublicKey) {
+        console.log(
+          "error: master public key of exchange does not match public key of 
live exchange",
+        );
+      }
     }
+  }
 
-    const keys = await readSuccessResponseJsonOrThrow(
-      resp,
-      codecForExchangeKeysJson(),
-    );
+  // Check /wire
+  {
+    const keysUrl = new URL("wire", baseUrl);
 
-    if (keys.master_public_key !== pubConf.masterPublicKey) {
+    const resp = await Promise.race([httpLib.get(keysUrl.href), 
delayMs(2000)]);
+
+    if (!resp) {
       console.log(
-        "error: master public key of exchange does not match public key of 
live exchange",
+        "error: request to /wire timed out. " +
+          "Make sure to sign and upload accounts and wire fees " +
+          "using the taler-exchange-offline tool.",
       );
+      if (!context.cont) {
+        console.log("Aborting further checks.");
+        process.exit(1);
+      }
+    } else {
+      if (resp.status !== 200) {
+        console.log(
+          "error:  Can't access exchange /wire.  Please check " +
+            "the logs of taler-exchange-httpd for further information.",
+        );
+      }
     }
   }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]