[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-sync] branch master updated: add liability limit to sync /config
From: |
gnunet |
Subject: |
[taler-sync] branch master updated: add liability limit to sync /config |
Date: |
Wed, 08 Sep 2021 17:09:33 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository sync.
The following commit(s) were added to refs/heads/master by this push:
new 52ed41d add liability limit to sync /config
52ed41d is described below
commit 52ed41d588082f2097473b1440fcc314a79dc4c4
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Wed Sep 8 17:09:30 2021 +0200
add liability limit to sync /config
---
src/sync/sync-httpd.c | 17 +++++++++++++++++
src/sync/sync-httpd.h | 7 ++++++-
src/sync/sync-httpd_config.c | 2 ++
src/sync/sync.conf | 3 +++
4 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/src/sync/sync-httpd.c b/src/sync/sync-httpd.c
index 3e13c31..0ec95e7 100644
--- a/src/sync/sync-httpd.c
+++ b/src/sync/sync-httpd.c
@@ -120,6 +120,11 @@ static char *apikey;
*/
static char *keypass;
+/**
+ * Amount of insurance.
+ */
+struct TALER_Amount SH_insurance;
+
/**
* A client has requested the given url using the given method
@@ -554,6 +559,18 @@ run (void *cls,
GNUNET_SCHEDULER_shutdown ();
return;
}
+ if (GNUNET_OK !=
+ TALER_config_get_amount (config,
+ "sync",
+ "INSURANCE",
+ &SH_insurance))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "sync",
+ "INSURANCE");
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
if (GNUNET_OK !=
TALER_config_get_amount (config,
"sync",
diff --git a/src/sync/sync-httpd.h b/src/sync/sync-httpd.h
index c129c7e..c24b67d 100644
--- a/src/sync/sync-httpd.h
+++ b/src/sync/sync-httpd.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2019 Taler Systems SA
+ Copyright (C) 2019-2021 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -153,6 +153,11 @@ extern char *SH_fulfillment_url;
*/
extern struct GNUNET_CURL_Context *SH_ctx;
+/**
+ * Amount of insurance.
+ */
+extern struct TALER_Amount SH_insurance;
+
/**
* Kick MHD to run now, to be called after MHD_resume_connection().
* Basically, we need to explicitly resume MHD's event loop whenever
diff --git a/src/sync/sync-httpd_config.c b/src/sync/sync-httpd_config.c
index 91c481c..b75c1d5 100644
--- a/src/sync/sync-httpd_config.c
+++ b/src/sync/sync-httpd_config.c
@@ -56,6 +56,8 @@ SH_handler_config (struct SH_RequestHandler *rh,
"sync"),
GNUNET_JSON_pack_uint64 ("storage_limit_in_megabytes",
SH_upload_limit_mb),
+ TALER_JSON_pack_amount ("liability_limit",
+ &SH_insurance),
TALER_JSON_pack_amount ("annual_fee",
&SH_annual_fee),
GNUNET_JSON_pack_string ("version",
diff --git a/src/sync/sync.conf b/src/sync/sync.conf
index 77f8070..c6b7aa7 100644
--- a/src/sync/sync.conf
+++ b/src/sync/sync.conf
@@ -28,6 +28,9 @@ DB = postgres
# Annual fee for an account
ANNUAL_FEE = TESTKUDOS:0.1
+# Insurance provided against loss
+INSURANCE = TESTKUDOS:0.0
+
# Upload limit per backup, in megabytes
UPLOAD_LIMIT_MB = 16
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-sync] branch master updated: add liability limit to sync /config,
gnunet <=