exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit fbb3b3ca4b5d00635a83376bfabbdfa4dedb1694
parent 150e0ed551209484e6f5955dd6e7511e09d66a72
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 15 Nov 2024 23:32:41 +0100

split taler-config into taler-exchange-config and taler-merchant-config; separate resource files cleanly between taler-exchange and taler-merchant

Diffstat:
Mcontrib/Makefile.am.in | 10+++++-----
Ddebian/etc-libtalerexchange/taler/taler.conf | 49-------------------------------------------------
Ddebian/etc-taler-auditor/taler/conf.d/auditor-system.conf | 13-------------
Ddebian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf | 10----------
Rdebian/etc-taler-exchange/taler/conf.d/exchange-business.conf -> debian/etc-taler-exchange/taler-exchange/conf.d/exchange-business.conf | 0
Rdebian/etc-taler-exchange/taler/conf.d/exchange-coins.conf -> debian/etc-taler-exchange/taler-exchange/conf.d/exchange-coins.conf | 0
Rdebian/etc-taler-exchange/taler/conf.d/exchange-system.conf -> debian/etc-taler-exchange/taler-exchange/conf.d/exchange-system.conf | 0
Rdebian/etc-libtalerexchange/taler/overrides.conf -> debian/etc-taler-exchange/taler-exchange/overrides.conf | 0
Rdebian/etc-taler-exchange/taler/secrets/exchange-accountcredentials-1.secret.conf -> debian/etc-taler-exchange/taler-exchange/secrets/exchange-accountcredentials-1.secret.conf | 0
Rdebian/etc-taler-exchange/taler/secrets/exchange-db.secret.conf -> debian/etc-taler-exchange/taler-exchange/secrets/exchange-db.secret.conf | 0
Adebian/etc-taler-exchange/taler-exchange/taler-exchange.conf | 38++++++++++++++++++++++++++++++++++++++
Mdebian/libtalerexchange.install | 9---------
Mdebian/taler-auditor.install | 17+++++++----------
Mdebian/taler-auditor.taler-auditor-httpd.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-aggregation.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-coins.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-deposits.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-purses.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-reserves.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-transfer.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-wire-credit.service | 2+-
Mdebian/taler-auditor.taler-helper-auditor-wire-debit.service | 2+-
Mdebian/taler-exchange-database.install | 2+-
Mdebian/taler-exchange-offline.taler-exchange-offline.service | 2+-
Mdebian/taler-exchange.install | 47+++++++----------------------------------------
Mdebian/taler-exchange.taler-exchange-aggregator.service | 2+-
Mdebian/taler-exchange.taler-exchange-aggregator@.service | 2+-
Mdebian/taler-exchange.taler-exchange-closer.service | 2+-
Mdebian/taler-exchange.taler-exchange-expire.service | 2+-
Mdebian/taler-exchange.taler-exchange-httpd.service | 2+-
Mdebian/taler-exchange.taler-exchange-httpd@.service | 2+-
Mdebian/taler-exchange.taler-exchange-secmod-cs.service | 2+-
Mdebian/taler-exchange.taler-exchange-secmod-eddsa.service | 2+-
Mdebian/taler-exchange.taler-exchange-secmod-rsa.service | 2+-
Mdebian/taler-exchange.taler-exchange-transfer.service | 2+-
Mdebian/taler-exchange.taler-exchange-wirewatch.service | 2+-
Mdebian/taler-exchange.taler-exchange-wirewatch@.service | 2+-
Mdebian/taler-terms-generator.install | 2+-
Mdoc/Makefile.am | 74++++++++++++++++++++++++++++++++++++++------------------------------------
Msrc/Makefile.am | 6+++---
Msrc/auditor/Makefile.am | 2+-
Msrc/auditor/auditor.conf | 2+-
Msrc/auditor/report-lib.c | 5+++--
Msrc/auditor/taler-auditor-dbinit.c | 2+-
Msrc/auditor/taler-auditor-httpd.c | 8++++++--
Msrc/auditor/taler-auditor-httpd_spa.c | 3++-
Msrc/auditor/taler-auditor-sync.c | 4++--
Msrc/auditor/taler-helper-auditor-aggregation.c | 2+-
Msrc/auditor/taler-helper-auditor-coins.c | 2+-
Msrc/auditor/taler-helper-auditor-deposits.c | 2+-
Msrc/auditor/taler-helper-auditor-purses.c | 2+-
Msrc/auditor/taler-helper-auditor-reserves.c | 2+-
Msrc/auditor/taler-helper-auditor-transfer.c | 2+-
Msrc/auditor/taler-helper-auditor-wire-credit.c | 27++++++++++++++-------------
Msrc/auditor/taler-helper-auditor-wire-debit.c | 26++++++++++++++------------
Msrc/auditordb/Makefile.am | 6+++---
Msrc/auditordb/auditordb-postgres.conf | 4++--
Msrc/auditordb/auditordb_plugin.c | 10++++++----
Msrc/auditordb/plugin_auditordb_postgres.c | 2+-
Msrc/auditordb/test-auditor-db-postgres.conf | 2+-
Msrc/auditordb/test_auditordb.c | 2+-
Msrc/auditordb/test_auditordb_checkpoints.c | 2+-
Msrc/bank-lib/taler-fakebank-run.c | 3++-
Msrc/benchmark/taler-aggregator-benchmark.c | 1+
Msrc/benchmark/taler-bank-benchmark.c | 1+
Msrc/benchmark/taler-exchange-benchmark.c | 1+
Msrc/exchange-tools/Makefile.am | 2+-
Msrc/exchange-tools/taler-auditor-offline.c | 3++-
Msrc/exchange-tools/taler-exchange-kyc-trigger.c | 1+
Msrc/exchange-tools/taler-exchange-offline.c | 1+
Msrc/exchange/Makefile.am | 10++++++++--
Msrc/exchange/taler-exchange-aggregator.c | 4++--
Msrc/exchange/taler-exchange-closer.c | 7+++----
Msrc/exchange/taler-exchange-httpd.c | 3++-
Msrc/exchange/taler-exchange-httpd_kyc-upload.c | 2++
Msrc/exchange/taler-exchange-httpd_spa.c | 6++++--
Msrc/exchange/taler-exchange-router.c | 7+++----
Msrc/exchangedb/Makefile.am | 15+++++++++++----
Msrc/exchangedb/exchangedb-postgres.conf | 2+-
Msrc/exchangedb/exchangedb.conf | 10----------
Msrc/exchangedb/exchangedb_plugin.c | 10++++++----
Msrc/exchangedb/plugin_exchangedb_postgres.c | 1+
Msrc/exchangedb/test-exchange-db-postgres.conf | 4++--
Msrc/extensions/age_restriction/Makefile.am | 2+-
Msrc/include/taler_mhd_lib.h | 4+++-
Msrc/include/taler_templating_lib.h | 4++--
Msrc/include/taler_util.h | 20++++++++++++++++++--
Msrc/kyclogic/Makefile.am | 4++--
Msrc/kyclogic/taler-exchange-helper-measure-freeze | 2+-
Msrc/kyclogic/taler-exchange-kyc-tester.c | 2+-
Msrc/mhd/mhd_spa.c | 5+++--
Asrc/taler-exchange.conf | 2++
Dsrc/taler.conf | 2--
Msrc/templating/templating_api.c | 9++++-----
Msrc/testing/Makefile.am | 3---
Msrc/testing/taler-unified-setup.sh | 83++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Msrc/testing/test-taler-exchange-aggregator-postgres.conf | 4+---
Msrc/testing/test-taler-exchange-wirewatch-postgres.conf | 4+---
Msrc/testing/test_bank_api.conf | 6+++++-
Msrc/testing/test_exchange_api.conf | 19+++++++++++++------
Msrc/testing/test_exchange_api_age_restriction.conf | 2+-
Msrc/testing/test_exchange_api_conflicts.conf | 2+-
Dsrc/testing/test_exchange_api_home/.local/share/taler/auditor/offline-keys/auditor.priv | 0
Dsrc/testing/test_exchange_api_home/.local/share/taler/exchange-offline/master.priv | 0
Msrc/testing/test_exchange_api_keys_cherry_picking.conf | 9++++++---
Msrc/testing/testing_api_cmd_get_auditor.c | 87++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
Msrc/testing/testing_api_cmd_run_fakebank.c | 1+
Msrc/util/.gitignore | 2++
Msrc/util/Makefile.am | 30+++++++++++++++++++++---------
Asrc/util/auditor-paths.conf | 29+++++++++++++++++++++++++++++
Msrc/util/config.c | 5+++--
Asrc/util/exchange-paths.conf | 29+++++++++++++++++++++++++++++
Msrc/util/os_installation.c | 73++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
Dsrc/util/paths.conf | 29-----------------------------
Asrc/util/taler-auditor-config.c | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/util/taler-config.c | 73-------------------------------------------------------------------------
Asrc/util/taler-exchange-config.c | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
117 files changed, 701 insertions(+), 523 deletions(-)

diff --git a/contrib/Makefile.am.in b/contrib/Makefile.am.in @@ -2,7 +2,7 @@ SUBDIRS = . -tmplpkgdatadir = $(datadir)/taler/exchange/templates/ +tmplpkgdatadir = $(datadir)/taler-exchange/templates/ dist_tmplpkgdata_DATA = \ kycaid-invalid-request.en.must \ kyc-proof-already-done.en.must \ @@ -25,7 +25,7 @@ dist_tmplpkgdata_DATA = \ persona-kyc-failed.en.must \ persona-provider-failure.en.must -termsdir=$(datadir)/taler/terms/ +termsdir=$(datadir)/taler-exchange/terms/ terms_DATA = \ exchange-tos-v0.rst \ exchange-tos-bfh-v0.rst \ @@ -62,8 +62,8 @@ EXTRA_DIST = \ # prebuilt branch. These MUST be present, they will # be used by code generated by 'bootstrap'! -amlspapkgdatadir = $(prefix)/share/taler/exchange/aml-spa/ +amlspapkgdatadir = $(prefix)/share/taler-exchange/aml-spa/ -auditorspapkgdatadir = $(prefix)/share/taler/auditor/spa/ +auditorspapkgdatadir = $(prefix)/share/taler-auditor/spa/ -kycspapkgdatadir = $(prefix)/share/taler/exchange/kyc-spa/ +kycspapkgdatadir = $(prefix)/share/taler-exchange/kyc-spa/ diff --git a/debian/etc-libtalerexchange/taler/taler.conf b/debian/etc-libtalerexchange/taler/taler.conf @@ -1,49 +0,0 @@ -# Main entry point for the GNU Taler configuration. -# -# Structure: -# - taler.conf is the main configuration entry point -# used by all Taler components (the file you are currently -# looking at. -# - overrides.conf contains configuration overrides that are -# set by some tools that help with the configuration, -# and should not be edited by humans. Comments in this file -# are not preserved. -# - conf.d/ contains configuration files for -# Taler components, which can be read by all -# users of the system and are included by the main -# configuration. -# - secrets/ contains configuration snippets -# with secrets for particular services. -# These files should have restrictive permissions -# so that only users of the relevant services -# can read it. All files in it should end with -# ".secret.conf". - -[taler] - -# Currency of the Taler deployment. This setting applies to all Taler -# components that only support a single currency. -#currency = KUDOS - -# Smallest currency unit handled by the underlying bank system. Taler payments -# can make payments smaller than this units, but interactions with external -# systems is always rounded to this unit. -#currency_round_unit = KUDOS:0.01 - -# Monthly amount that mandatorily triggers an AML check -#AML_THRESHOLD = KUDOS:10000000 - -[paths] - -TALER_HOME = /var/lib/taler/ -TALER_RUNTIME_DIR = /run/taler/ -TALER_CACHE_HOME = /var/cache/taler/ -TALER_CONFIG_HOME = /etc/taler/ -TALER_DATA_HOME = /var/lib/taler/ - - -# Inline configurations from all Taler components. -@inline-matching@ conf.d/*.conf - -# Overrides from tools that help with configuration. -@inline@ overrides.conf diff --git a/debian/etc-taler-auditor/taler/conf.d/auditor-system.conf b/debian/etc-taler-auditor/taler/conf.d/auditor-system.conf @@ -1,13 +0,0 @@ -# Configuration settings for system parameters of the auditor. -# -# Read secret sections into configuration, but only -# if we have permission to do so. -@inline-secret@ auditordb-postgres ../secrets/auditor-db.secret.conf - -[auditor] - -# Only supported database is Postgres right now. -DATABASE = postgres - -SERVE = unix -UNIXPATH_MODE = 666 diff --git a/debian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf b/debian/etc-taler-auditor/taler/secrets/auditor-db.secret.conf @@ -1,10 +0,0 @@ -# Database configuration for the Taler auditor. - -[auditordb-postgres] - -# Typically, there should only be a single line here, of the form: - -CONFIG=postgres:///taler-auditor - -# The details of the URI depend on where the database lives and how -# access control was configured. diff --git a/debian/etc-taler-exchange/taler/conf.d/exchange-business.conf b/debian/etc-taler-exchange/taler-exchange/conf.d/exchange-business.conf diff --git a/debian/etc-taler-exchange/taler/conf.d/exchange-coins.conf b/debian/etc-taler-exchange/taler-exchange/conf.d/exchange-coins.conf diff --git a/debian/etc-taler-exchange/taler/conf.d/exchange-system.conf b/debian/etc-taler-exchange/taler-exchange/conf.d/exchange-system.conf diff --git a/debian/etc-libtalerexchange/taler/overrides.conf b/debian/etc-taler-exchange/taler-exchange/overrides.conf diff --git a/debian/etc-taler-exchange/taler/secrets/exchange-accountcredentials-1.secret.conf b/debian/etc-taler-exchange/taler-exchange/secrets/exchange-accountcredentials-1.secret.conf diff --git a/debian/etc-taler-exchange/taler/secrets/exchange-db.secret.conf b/debian/etc-taler-exchange/taler-exchange/secrets/exchange-db.secret.conf diff --git a/debian/etc-taler-exchange/taler-exchange/taler-exchange.conf b/debian/etc-taler-exchange/taler-exchange/taler-exchange.conf @@ -0,0 +1,38 @@ +# Main entry point for the GNU Taler configuration. +# +# Structure: +# - taler-exchange.conf is the main configuration entry point +# used by all Taler components (the file you are currently +# looking at. +# - overrides.conf contains configuration overrides that are +# set by some tools that help with the configuration, +# and should not be edited by humans. Comments in this file +# are not preserved. +# - conf.d/ contains configuration files for +# Taler components, which can be read by all +# users of the system and are included by the main +# configuration. +# - secrets/ contains configuration snippets +# with secrets for particular services. +# These files should have restrictive permissions +# so that only users of the relevant services +# can read it. All files in it should end with +# ".secret.conf". + +[exchange] + +#currency = KUDOS + +# Smallest currency unit handled by the underlying bank system. Taler payments +# can make payments smaller than this units, but interactions with external +# systems is always rounded to this unit. +#currency_round_unit = KUDOS:0.01 + +# Monthly amount that mandatorily triggers an AML check +#AML_THRESHOLD = KUDOS:10000000 + +# Inline configurations from all Taler components. +@inline-matching@ conf.d/*.conf + +# Overrides from tools that help with configuration. +@inline@ overrides.conf diff --git a/debian/libtalerexchange.install b/debian/libtalerexchange.install @@ -1,10 +1 @@ usr/lib/*/libtaler*.so.* - -# FIXME: All this should eventually go into taler-base. -usr/share/taler/config.d/paths.conf -usr/share/taler/config.d/currencies.conf -usr/share/taler/config.d/taler.conf -debian/etc-libtalerexchange/* etc/ -usr/bin/taler-config -usr/share/man/man5/taler.conf.5 -usr/share/man/man1/taler-config* diff --git a/debian/taler-auditor.install b/debian/taler-auditor.install @@ -1,23 +1,20 @@ usr/bin/taler-auditor -usr/bin/taler-auditor-dbconfig -usr/bin/taler-auditor-dbinit -usr/bin/taler-auditor-httpd -usr/bin/taler-auditor-offline -usr/bin/taler-auditor-sync +usr/bin/taler-auditor-* usr/bin/taler-helper-auditor-* -usr/lib/*/taler/libtaler_plugin_auditor*.so +usr/lib/*/taler-auditor/libtaler_plugin_auditor*.so usr/lib/*/libauditor* usr/lib/*/libtalerauditordb* usr/share/man/man1/taler-auditor* usr/share/man/man1/taler-helper-auditor* +usr/share/man/man5/taler-auditor* usr/share/info/taler-auditor* -usr/share/taler/config.d/auditor* -usr/share/taler/sql/auditor/* -usr/share/taler/auditor/spa/* +usr/share/taler-auditor/config.d/auditor* +usr/share/taler-auditor/sql/* +usr/share/taler-auditor/spa/* -# Configuration +# Debian-specific configuration files for /etc/ debian/etc-taler-auditor/* etc/ diff --git a/debian/taler-auditor.taler-auditor-httpd.service b/debian/taler-auditor.taler-auditor-httpd.service @@ -16,7 +16,7 @@ RestartPreventExitStatus=9 StartLimitBurst=5 StartLimitInterval=5s -ExecStart=/usr/bin/taler-auditor-httpd -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-auditor-httpd -c /etc/taler-auditor/taler-auditor.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-auditor.taler-helper-auditor-aggregation.service b/debian/taler-auditor.taler-helper-auditor-aggregation.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-aggregation -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-aggregation -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-coins.service b/debian/taler-auditor.taler-helper-auditor-coins.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-coins -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-coins -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-deposits.service b/debian/taler-auditor.taler-helper-auditor-deposits.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-deposits -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-deposits -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-purses.service b/debian/taler-auditor.taler-helper-auditor-purses.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-purses -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-purses -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-reserves.service b/debian/taler-auditor.taler-helper-auditor-reserves.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-reserves -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-reserves -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-transfer.service b/debian/taler-auditor.taler-helper-auditor-transfer.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-transfer -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-transfer -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-wire-credit.service b/debian/taler-auditor.taler-helper-auditor-wire-credit.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-wire-credit -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-wire-credit -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-auditor.taler-helper-auditor-wire-debit.service b/debian/taler-auditor.taler-helper-auditor-wire-debit.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-helper-auditor-wire-debit -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-helper-auditor-wire-debit -c /etc/taler-auditor/taler-auditor.conf -L INFO PrivateTmp=yes PrivateDevices=yes ProtectSystem=full diff --git a/debian/taler-exchange-database.install b/debian/taler-exchange-database.install @@ -3,6 +3,6 @@ usr/bin/taler-exchange-dbinit usr/lib/*/taler/libtaler_plugin_exchange*.so usr/share/man/man1/taler-exchange-dbconfig.1 usr/share/man/man1/taler-exchange-dbinit.1 -usr/share/taler/sql/exchange/* +usr/share/taler-exchange/sql/* usr/share/taler/config.d/exchangedb.conf usr/share/taler/config.d/exchangedb-postgres.conf diff --git a/debian/taler-exchange-offline.taler-exchange-offline.service b/debian/taler-exchange-offline.taler-exchange-offline.service @@ -19,5 +19,5 @@ StandardError=journal PrivateTmp=yes PrivateDevices=yes -Environment="REGIO_CURRENCY=$(taler-config -s taler -o CURRENCY)" +Environment="REGIO_CURRENCY=$(taler-exchange-config -s exchange -o CURRENCY)" ExecStart=bash -c 'taler-exchange-offline download sign wire-fee now iban "${REGIO_CURRENCY}":0 "${REGIO_CURRENCY}":0 wire-fee now x-taler-bank "${REGIO_CURRENCY}":0 "${REGIO_CURRENCY}":0 global-fee now "${REGIO_CURRENCY}:0" "${REGIO_CURRENCY}:0" "${REGIO_CURRENCY}:0" 4weeks 6years 4 upload' diff --git a/debian/taler-exchange.install b/debian/taler-exchange.install @@ -1,43 +1,10 @@ -usr/bin/taler-exchange-aggregator -usr/bin/taler-exchange-closer -usr/bin/taler-exchange-drain -usr/bin/taler-exchange-expire -usr/bin/taler-exchange-httpd -usr/bin/taler-exchange-kyc-aml-pep-trigger.sh -usr/bin/taler-exchange-kyc-oauth2-challenger.sh -usr/bin/taler-exchange-kyc-kycaid-converter.sh -usr/bin/taler-exchange-helper-measure-test-form -usr/bin/taler-exchange-kyc-persona-converter.sh -usr/bin/taler-exchange-router -usr/bin/taler-exchange-secmod-cs -usr/bin/taler-exchange-secmod-eddsa -usr/bin/taler-exchange-secmod-rsa -usr/bin/taler-exchange-transfer -usr/bin/taler-exchange-wirewatch -usr/bin/taler-exchange-wire-gateway-client -usr/lib/*/taler/libtaler_plugin_kyclogic_*.so -usr/lib/*/taler/libtaler_extension_*.so -usr/share/man/man1/taler-exchange-aggregator* -usr/share/man/man1/taler-exchange-closer* -usr/share/man/man1/taler-exchange-dbconfig* -usr/share/man/man1/taler-exchange-dbinit* -usr/share/man/man1/taler-exchange-drain* -usr/share/man/man1/taler-exchange-expire* -usr/share/man/man1/taler-exchange-httpd* -usr/share/man/man1/taler-exchange-kyc-trigger* -usr/share/man/man1/taler-exchange-kyc-aml-pep-trigger* -usr/share/man/man1/taler-exchange-router* -usr/share/man/man1/taler-exchange-secmod-cs* -usr/share/man/man1/taler-exchange-secmod-eddsa* -usr/share/man/man1/taler-exchange-secmod-rsa* -usr/share/man/man1/taler-exchange-transfer* -usr/share/man/man1/taler-exchange-wire-gateway-client* -usr/share/man/man1/taler-exchange-wirewatch* +usr/bin/taler-exchange-* +usr/lib/*/taler-exchange/libtaler_plugin_kyclogic_*.so +usr/lib/*/taler-exchange/libtaler_extension_*.so +usr/share/man/man1/taler-exchange-* +usr/share/man/man5/taler-exchange.conf.5 usr/share/info/taler-exchange* -usr/share/taler/config.d/* -usr/share/taler/exchange/templates/*.must -usr/share/taler/exchange/aml-spa/* -usr/share/taler/exchange/kyc-spa/* +usr/share/taler-exchange/* -# configuration files in /etc/taler +# Debian-specific configuration files for /etc/taler debian/etc-taler-exchange/* etc/ diff --git a/debian/taler-exchange.taler-exchange-aggregator.service b/debian/taler-exchange.taler-exchange-aggregator.service @@ -10,7 +10,7 @@ Restart=always RestartMode=direct RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-exchange.taler-exchange-aggregator@.service b/debian/taler-exchange.taler-exchange-aggregator@.service @@ -14,7 +14,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-exchange.taler-exchange-closer.service b/debian/taler-exchange.taler-exchange-closer.service @@ -10,7 +10,7 @@ Restart=always RestartMode=direct RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-closer -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-closer -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-exchange.taler-exchange-expire.service b/debian/taler-exchange.taler-exchange-expire.service @@ -10,7 +10,7 @@ Restart=always RestartMode=direct RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-expire -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-expire -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-exchange.taler-exchange-httpd.service b/debian/taler-exchange.taler-exchange-httpd.service @@ -23,7 +23,7 @@ RestartPreventExitStatus=9 StartLimitBurst=5 StartLimitInterval=5s -ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=no diff --git a/debian/taler-exchange.taler-exchange-httpd@.service b/debian/taler-exchange.taler-exchange-httpd@.service @@ -21,7 +21,7 @@ Restart=always RestartSec=1ms RestartPreventExitStatus=9 EnvironmentFile=/etc/environment -ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-httpd -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=no diff --git a/debian/taler-exchange.taler-exchange-secmod-cs.service b/debian/taler-exchange.taler-exchange-secmod-cs.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=100ms RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-secmod-cs -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-secmod-cs -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=no diff --git a/debian/taler-exchange.taler-exchange-secmod-eddsa.service b/debian/taler-exchange.taler-exchange-secmod-eddsa.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=100ms RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-secmod-eddsa -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-secmod-eddsa -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=no diff --git a/debian/taler-exchange.taler-exchange-secmod-rsa.service b/debian/taler-exchange.taler-exchange-secmod-rsa.service @@ -9,7 +9,7 @@ Type=simple Restart=always RestartSec=100ms RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-secmod-rsa -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-secmod-rsa -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=no diff --git a/debian/taler-exchange.taler-exchange-transfer.service b/debian/taler-exchange.taler-exchange-transfer.service @@ -10,7 +10,7 @@ Restart=always RestartMode=direct RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-transfer -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-transfer -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-exchange.taler-exchange-wirewatch.service b/debian/taler-exchange.taler-exchange-wirewatch.service @@ -11,7 +11,7 @@ RestartMode=direct RestartSec=1s RestartPreventExitStatus=9 RuntimeMaxSec=3600s -ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-exchange.taler-exchange-wirewatch@.service b/debian/taler-exchange.taler-exchange-wirewatch@.service @@ -15,7 +15,7 @@ Type=simple Restart=always RestartSec=1s RestartPreventExitStatus=9 -ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler/taler.conf -L INFO +ExecStart=/usr/bin/taler-exchange-wirewatch -c /etc/taler-exchange/taler-exchange.conf -L INFO StandardOutput=journal StandardError=journal PrivateTmp=yes diff --git a/debian/taler-terms-generator.install b/debian/taler-terms-generator.install @@ -2,7 +2,7 @@ usr/share/man/man1/taler-terms-generator.1 usr/bin/taler-terms-generator # Terms of service / privacy policy templates -usr/share/taler/terms/*.rst +usr/share/taler-exchange/terms/*.rst # Translations of ToS/PP usr/share/locale/*/LC_MESSAGES/*.po diff --git a/doc/Makefile.am b/doc/Makefile.am @@ -7,47 +7,49 @@ AM_MAKEINFOHTMLFLAGS = $(TEXINFO_HTMLFLAGS) infoimagedir = $(infodir)/images man_MANS = \ - prebuilt/man/taler.conf.5 \ - prebuilt/man/taler-config.1 \ prebuilt/man/taler-aggregator-benchmark.1 \ - prebuilt/man/taler-auditor.1 \ - prebuilt/man/taler-auditor-dbinit.1 \ - prebuilt/man/taler-auditor-httpd.1 \ - prebuilt/man/taler-auditor-offline.1 \ - prebuilt/man/taler-auditor-sign.1 \ - prebuilt/man/taler-auditor-sync.1 \ - prebuilt/man/taler-bank-benchmark.1 \ - prebuilt/man/taler-exchange-aggregator.1 \ - prebuilt/man/taler-exchange-benchmark.1 \ - prebuilt/man/taler-exchange-closer.1 \ - prebuilt/man/taler-exchange-dbconfig.1 \ - prebuilt/man/taler-exchange-dbinit.1 \ - prebuilt/man/taler-exchange-drain.1 \ - prebuilt/man/taler-exchange-expire.1 \ - prebuilt/man/taler-exchange-httpd.1 \ + prebuilt/man/taler-auditor.1 \ + prebuilt/man/taler-auditor-config.1 \ + prebuilt/man/taler-auditor-dbinit.1 \ + prebuilt/man/taler-auditor-httpd.1 \ + prebuilt/man/taler-auditor-offline.1 \ + prebuilt/man/taler-auditor-sign.1 \ + prebuilt/man/taler-auditor-sync.1 \ + prebuilt/man/taler-bank-benchmark.1 \ + prebuilt/man/taler-exchange.conf.5 \ + prebuilt/man/taler-exchange-aggregator.1 \ + prebuilt/man/taler-exchange-benchmark.1 \ + prebuilt/man/taler-exchange-closer.1 \ + prebuilt/man/taler-exchange-config.1 \ + prebuilt/man/taler-exchange-dbconfig.1 \ + prebuilt/man/taler-exchange-dbinit.1 \ + prebuilt/man/taler-exchange-drain.1 \ + prebuilt/man/taler-exchange-expire.1 \ + prebuilt/man/taler-exchange-httpd.1 \ prebuilt/man/taler-exchange-kyc-aml-pep-trigger.1 \ - prebuilt/man/taler-exchange-kyc-tester.1 \ - prebuilt/man/taler-exchange-kyc-trigger.1 \ - prebuilt/man/taler-exchange-offline.1 \ - prebuilt/man/taler-exchange-router.1\ - prebuilt/man/taler-exchange-secmod-cs.1\ - prebuilt/man/taler-exchange-secmod-eddsa.1\ - prebuilt/man/taler-exchange-secmod-rsa.1 \ - prebuilt/man/taler-exchange-transfer.1\ + prebuilt/man/taler-exchange-kyc-tester.1 \ + prebuilt/man/taler-exchange-kyc-trigger.1 \ + prebuilt/man/taler-exchange-offline.1 \ + prebuilt/man/taler-exchange-router.1 \ + prebuilt/man/taler-exchange-secmod-cs.1 \ + prebuilt/man/taler-exchange-secmod-eddsa.1 \ + prebuilt/man/taler-exchange-secmod-rsa.1 \ + prebuilt/man/taler-exchange-transfer.1 \ prebuilt/man/taler-exchange-wire-gateway-client.1\ - prebuilt/man/taler-exchange-wirewatch.1 \ - prebuilt/man/taler-fakebank-run.1 \ + prebuilt/man/taler-exchange-wirewatch.1 \ + prebuilt/man/taler-fakebank-run.1 \ prebuilt/man/taler-helper-auditor-aggregation.1 \ - prebuilt/man/taler-helper-auditor-coins.1\ + prebuilt/man/taler-helper-auditor-coins.1 \ prebuilt/man/taler-helper-auditor-deposits.1\ - prebuilt/man/taler-helper-auditor-purses.1\ + prebuilt/man/taler-helper-auditor-purses.1 \ prebuilt/man/taler-helper-auditor-reserves.1\ - prebuilt/man/taler-helper-auditor-wire.1 \ - prebuilt/man/taler-terms-generator.1 \ + prebuilt/man/taler-helper-auditor-wire-credit.1 \ + prebuilt/man/taler-helper-auditor-wire-debit.1 \ + prebuilt/man/taler-terms-generator.1 \ prebuilt/man/taler-unified-setup.1 info_TEXINFOS = \ - prebuilt/texinfo/taler-auditor.texi \ + prebuilt/texinfo/taler-auditor.texi \ prebuilt/texinfo/taler-developer-manual.texi \ prebuilt/texinfo/taler-exchange.texi @@ -61,11 +63,11 @@ install-info-local: echo " $(INSTALL_DATA) kyc-process.png exchange-db.png '$(DESTDIR)$(infodir)/taler-exchange-figures'"; \ $(INSTALL_DATA) '$(srcdir)/prebuilt/texinfo/taler-exchange-figures/kyc-process.png' '$(srcdir)/prebuilt/texinfo/taler-exchange-figures/exchange-db.png' "$(DESTDIR)$(infodir)/taler-exchange-figures" || exit 1; -EXTRA_DIST = \ - $(man_MANS) \ +EXTRA_DIST = \ + $(man_MANS) \ doxygen/taler.doxy \ - $(info_TEXINFOS) \ - prebuilt/texinfo/taler-auditor-figures/auditor-db.png \ + $(info_TEXINFOS) \ + prebuilt/texinfo/taler-auditor-figures/auditor-db.png \ prebuilt/texinfo/taler-auditor-figures/replication.png \ prebuilt/texinfo/taler-exchange-figures/kyc-process.png \ prebuilt/texinfo/taler-exchange-figures/exchange-db.png diff --git a/src/Makefile.am b/src/Makefile.am @@ -7,12 +7,12 @@ if HAVE_SQLITE SQ_DIR = sq endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgdir = $(prefix)/share/taler-exchange/config.d/ pkgcfg_DATA = \ - taler.conf + taler-exchange.conf EXTRA_DIST = \ - taler.conf + $(pkgcfg_DATA) SUBDIRS = \ include \ diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am @@ -6,7 +6,7 @@ if USE_COVERAGE XLIB = -lgcov endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgdir = $(prefix)/share/taler-auditor/config.d/ pkgcfg_DATA = \ auditor.conf diff --git a/src/auditor/auditor.conf b/src/auditor/auditor.conf @@ -9,7 +9,7 @@ DB = postgres #TINY_AMOUNT = KUDOS:0.01 # Where do we store the auditor's private key? -AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}auditor/offline-keys/auditor.priv +AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}offline-keys/auditor.priv # What is the public key of this auditor? Used for processes that # verify auditor's signatures but have no access to the private key. diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c @@ -615,6 +615,7 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) if (GNUNET_OK != TALER_config_get_currency (TALER_ARL_cfg, + "exchange", &TALER_ARL_currency)) { return GNUNET_SYSERR; @@ -622,14 +623,14 @@ TALER_ARL_init (const struct GNUNET_CONFIGURATION_Handle *c) { if ( (GNUNET_OK != TALER_config_get_amount (TALER_ARL_cfg, - "taler", + "exchange", "CURRENCY_ROUND_UNIT", &TALER_ARL_currency_round_unit)) || ( (0 != TALER_ARL_currency_round_unit.fraction) && (0 != TALER_ARL_currency_round_unit.value) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need non-zero value in section `TALER' under `CURRENCY_ROUND_UNIT'\n"); + "Need non-zero value in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); return GNUNET_SYSERR; } } diff --git a/src/auditor/taler-auditor-dbinit.c b/src/auditor/taler-auditor-dbinit.c @@ -141,7 +141,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-auditor-dbinit", gettext_noop ("Initialize Taler auditor database"), diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c @@ -939,6 +939,7 @@ auditor_serve_process_config (void) } if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &TAH_currency)) { return GNUNET_SYSERR; @@ -1020,6 +1021,9 @@ auditor_serve_process_config (void) "AUDITOR_PRIV_FILE"); return GNUNET_SYSERR; } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Loading auditor private key from %s\n", + auditor_key_file); if (GNUNET_OK != GNUNET_CRYPTO_eddsa_key_from_file (auditor_key_file, GNUNET_NO, @@ -1211,7 +1215,7 @@ main (int argc, "after how long do connections timeout by default (in seconds)", &connection_timeout), GNUNET_GETOPT_option_help ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), "HTTP server providing a RESTful API to access a Taler auditor"), GNUNET_GETOPT_option_version (VERSION "-" VCS_VERSION), GNUNET_GETOPT_OPTION_END @@ -1219,7 +1223,7 @@ main (int argc, int ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-auditor-httpd", "Taler auditor HTTP service", diff --git a/src/auditor/taler-auditor-httpd_spa.c b/src/auditor/taler-auditor-httpd_spa.c @@ -56,7 +56,8 @@ TAH_spa_handler ( enum GNUNET_GenericReturnValue TAH_spa_init () { - spa = TALER_MHD_spa_load ("auditor/spa/"); + spa = TALER_MHD_spa_load (TALER_AUDITOR_project_data (), + "spa/"); if (NULL == spa) { GNUNET_break (0); diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c @@ -463,7 +463,7 @@ load_config (const char *cfgfile) { struct GNUNET_CONFIGURATION_Handle *cfg; - cfg = GNUNET_CONFIGURATION_create (TALER_EXCHANGE_project_data ()); + cfg = GNUNET_CONFIGURATION_create (TALER_AUDITOR_project_data ()); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Loading config file: %s\n", cfgfile); @@ -572,7 +572,7 @@ main (int argc, GNUNET_GETOPT_option_mandatory ( option_cfgfile_dst (&dst_cfgfile)), GNUNET_GETOPT_option_help ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), gettext_noop ("Make a safe copy of an exchange database")), GNUNET_GETOPT_option_uint ( 'b', diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c @@ -1661,7 +1661,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-aggregation", diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c @@ -3126,7 +3126,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-coins", diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c @@ -403,7 +403,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-deposits", diff --git a/src/auditor/taler-helper-auditor-purses.c b/src/auditor/taler-helper-auditor-purses.c @@ -1589,7 +1589,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-purses", diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c @@ -2126,7 +2126,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-reserves", diff --git a/src/auditor/taler-helper-auditor-transfer.c b/src/auditor/taler-helper-auditor-transfer.c @@ -533,7 +533,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-transfer", diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c @@ -469,7 +469,7 @@ reserve_in_cb (void *cls, rii->credit_details.amount = *credit; rii->credit_details.execution_date = execution_date; rii->credit_details.details.reserve.reserve_pub = *reserve_pub; - rii->credit_details.debit_account_uri.full_payto = (const char *) &rii[1]; + rii->credit_details.debit_account_uri.full_payto = (char *) &rii[1]; GNUNET_memcpy (&rii[1], sender_account_details.full_payto, slen); @@ -484,8 +484,8 @@ reserve_in_cb (void *cls, { struct TALER_AUDITORDB_RowInconsistency ri = { .row_id = rowid, - .row_table = "reserves_in", - .diagnostic = "duplicate wire offset" + .row_table = (char *) "reserves_in", + .diagnostic = (char *) "duplicate wire offset" }; enum GNUNET_DB_QueryStatus qs; @@ -526,8 +526,9 @@ complain_in_not_found (void *cls, enum GNUNET_DB_QueryStatus qs; struct TALER_AUDITORDB_ReserveInInconsistency riiDb = { .bank_row_id = rii->rowid, - .diagnostic = "incoming wire transfer claimed by exchange not found", - .account = { .full_payto = (const char *) wa->ai->section_name }, + .diagnostic = (char *) + "incoming wire transfer claimed by exchange not found", + .account.full_payto = (char *) wa->ai->section_name, .amount_exchange_expected = rii->credit_details.amount, .amount_wired = zero, .reserve_pub = rii->credit_details.details.reserve.reserve_pub, @@ -642,13 +643,13 @@ analyze_credit ( &rii->credit_details.details.reserve.reserve_pub)) { struct TALER_AUDITORDB_ReserveInInconsistency riiDb = { - .diagnostic = "wire subject does not match", - .account = (char *) wa->ai->section_name, .bank_row_id = credit_details->serial_id, .amount_exchange_expected = rii->credit_details.amount, .amount_wired = zero, .reserve_pub = rii->credit_details.details.reserve.reserve_pub, - .timestamp = rii->credit_details.execution_date.abs_time + .timestamp = rii->credit_details.execution_date.abs_time, + .account.full_payto = (char *) wa->ai->section_name, /* FIXME: get actual account? */ + .diagnostic = (char *) "wire subject does not match" }; enum GNUNET_DB_QueryStatus qs; @@ -679,8 +680,8 @@ analyze_credit ( &credit_details->amount)) { struct TALER_AUDITORDB_ReserveInInconsistency riiDb = { - .diagnostic = "wire amount does not match", - .account = (char *) wa->ai->section_name, + .diagnostic = (char *) "wire amount does not match", + .account.full_payto = (char *) wa->ai->section_name, /* FIXME: get actual account! */ .bank_row_id = credit_details->serial_id, .amount_exchange_expected = rii->credit_details.amount, .amount_wired = credit_details->amount, @@ -769,8 +770,8 @@ analyze_credit ( { struct TALER_AUDITORDB_RowMinorInconsistencies rmi = { .problem_row = rii->rowid, - .diagnostic = "execution date mismatch", - .row_table = "reserves_in" + .diagnostic = (char *) "execution date mismatch", + .row_table = (char *) "reserves_in" }; enum GNUNET_DB_QueryStatus qs; @@ -1215,7 +1216,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-wire-credit", diff --git a/src/auditor/taler-helper-auditor-wire-debit.c b/src/auditor/taler-helper-auditor-wire-debit.c @@ -888,8 +888,8 @@ check_profit_drain (struct ReserveOutInfo *roi) { struct TALER_AUDITORDB_RowInconsistency ri = { .row_id = roi->details.serial_id, - .row_table = "profit_drains", - .diagnostic = "invalid signature" + .row_table = (char *) "profit_drains", + .diagnostic = (char *) "invalid signature" }; GNUNET_break (0); @@ -916,7 +916,7 @@ check_profit_drain (struct ReserveOutInfo *roi) struct TALER_AUDITORDB_WireOutInconsistency woi = { .wire_out_row_id = serial, .destination_account = roi->details.credit_account_uri, - .diagnostic = "profit drain wired to invalid account", + .diagnostic = (char *) "profit drain wired to invalid account", .expected = roi->details.amount, .claimed = zero, }; @@ -946,7 +946,7 @@ check_profit_drain (struct ReserveOutInfo *roi) struct TALER_AUDITORDB_WireOutInconsistency woi = { .wire_out_row_id = roi->details.serial_id, .destination_account = roi->details.credit_account_uri, - .diagnostic = "incorrect amount drained to correct account", + .diagnostic = (char *) "incorrect amount drained to correct account", .expected = roi->details.amount, .claimed = amount, }; @@ -1027,7 +1027,7 @@ complain_out_not_found (void *cls, { struct TALER_AUDITORDB_WireOutInconsistency woi = { .destination_account = roi->details.credit_account_uri, - .diagnostic = "missing justification for outgoing wire transfer", + .diagnostic = (char *) "missing justification for outgoing wire transfer", .wire_out_row_id = roi->details.serial_id, .expected = zero, .claimed = roi->details.amount @@ -1138,7 +1138,7 @@ wire_out_cb ( struct TALER_AUDITORDB_WireOutInconsistency woi = { .wire_out_row_id = rowid, .destination_account = payto_uri, - .diagnostic = "receiver account mismatch", + .diagnostic = (char *) "receiver account mismatch", .expected = *amount, .claimed = roi->details.amount, }; @@ -1171,7 +1171,7 @@ wire_out_cb ( { struct TALER_AUDITORDB_WireOutInconsistency woi = { .destination_account = payto_uri, - .diagnostic = "wire amount does not match", + .diagnostic = (char *) "wire amount does not match", .wire_out_row_id = rowid, .expected = *amount, .claimed = roi->details.amount, @@ -1386,7 +1386,7 @@ history_debit_cb ( &roi->subject_hash); roi->details = *dd; roi->details.credit_account_uri.full_payto - = (const char *) &roi[1]; + = (char *) &roi[1]; GNUNET_memcpy (&roi[1], dd->credit_account_uri.full_payto, slen); @@ -1399,7 +1399,7 @@ history_debit_cb ( struct TALER_AUDITORDB_WireFormatInconsistency wfi = { .amount = dd->amount, .wire_offset = dd->serial_id, - .diagnostic = "duplicate outgoing wire transfer subject" + .diagnostic = (char *) "duplicate outgoing wire transfer subject" }; enum GNUNET_DB_QueryStatus qs; @@ -1530,8 +1530,10 @@ reserve_closed_cb ( { struct TALER_AUDITORDB_RowInconsistency ri = { .row_id = rowid, - .row_table = "reserves_closures", - .diagnostic = "closing fee above reserve balance (and closed anyway)" + .row_table + = (char *) "reserves_closures", + .diagnostic + = (char *) "closing fee above reserve balance (and closed anyway)" }; enum GNUNET_DB_QueryStatus qs; @@ -1890,7 +1892,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-helper-auditor-wire-debit", diff --git a/src/auditordb/Makefile.am b/src/auditordb/Makefile.am @@ -6,12 +6,12 @@ if USE_COVERAGE XLIB = -lgcov endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgdir = $(prefix)/share/taler-auditor/config.d/ pkgcfg_DATA = \ auditordb-postgres.conf -sqldir = $(prefix)/share/taler/sql/auditor/ +sqldir = $(prefix)/share/taler-auditor/sql/ sqlinputs = \ 0002-*.sql \ @@ -49,7 +49,7 @@ EXTRA_DIST = \ pg_template.h pg_template.c \ pg_template.sh -plugindir = $(libdir)/taler +plugindir = $(libdir)/taler-auditor if HAVE_POSTGRESQL plugin_LTLIBRARIES = \ diff --git a/src/auditordb/auditordb-postgres.conf b/src/auditordb/auditordb-postgres.conf @@ -1,6 +1,6 @@ [auditordb-postgres] # Argument for Postgres for how to connect to the database. -CONFIG = "postgres:///taler" +CONFIG = "postgres:///taler-auditor" # Where are the SQL files to setup our tables? -SQL_DIR = $DATADIR/sql/auditor/ +SQL_DIR = ${DATADIR}sql/ diff --git a/src/auditordb/auditordb_plugin.c b/src/auditordb/auditordb_plugin.c @@ -47,13 +47,15 @@ TALER_AUDITORDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg, "libtaler_plugin_auditordb_%s", plugin_name); GNUNET_free (plugin_name); - plugin = GNUNET_PLUGIN_load (TALER_EXCHANGE_project_data (), + plugin = GNUNET_PLUGIN_load (TALER_AUDITOR_project_data (), lib_name, (void *) cfg); - if (NULL != plugin) - plugin->library_name = lib_name; - else + if (NULL == plugin) + { GNUNET_free (lib_name); + return NULL; + } + plugin->library_name = lib_name; if ( (! skip_preflight) && (GNUNET_OK != plugin->preflight (plugin->cls)) ) diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c @@ -63,7 +63,6 @@ #include "pg_get_row_inconsistency.h" #include "pg_update_balance.h" - #include "pg_insert_coin_inconsistency.h" #include "pg_insert_row_inconsistency.h" #include "pg_insert_amount_arithmetic_inconsistency.h" @@ -514,6 +513,7 @@ libtaler_plugin_auditordb_postgres_init (void *cls) pg->cfg = cfg; if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &pg->currency)) { GNUNET_free (pg); diff --git a/src/auditordb/test-auditor-db-postgres.conf b/src/auditordb/test-auditor-db-postgres.conf @@ -7,7 +7,7 @@ DB = postgres CONFIG = "postgres:///talercheck" # Where are the SQL files to setup our tables? -SQL_DIR = $DATADIR/sql/auditor/ +SQL_DIR = ${DATADIR}sql/ [taler] CURRENCY = "EUR" diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c @@ -499,7 +499,7 @@ main (int argc, plugin_name); (void) GNUNET_asprintf (&config_filename, "%s.conf", testname); - cfg = GNUNET_CONFIGURATION_create (TALER_EXCHANGE_project_data ()); + cfg = GNUNET_CONFIGURATION_create (TALER_AUDITOR_project_data ()); if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, config_filename)) diff --git a/src/auditordb/test_auditordb_checkpoints.c b/src/auditordb/test_auditordb_checkpoints.c @@ -386,7 +386,7 @@ main (int argc, (void) GNUNET_asprintf (&config_filename, "%s.conf", testname); - cfg = GNUNET_CONFIGURATION_create (TALER_EXCHANGE_project_data ()); + cfg = GNUNET_CONFIGURATION_create (TALER_AUDITOR_project_data ()); if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, config_filename)) diff --git a/src/bank-lib/taler-fakebank-run.c b/src/bank-lib/taler-fakebank-run.c @@ -115,6 +115,7 @@ run (void *cls, (void) cfgfile; if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &currency_string)) { ret = EXIT_NOTCONFIGURED; @@ -235,7 +236,7 @@ main (int argc, }; enum GNUNET_GenericReturnValue iret; - iret = GNUNET_PROGRAM_run (TALER_EXCHANGE_project_data (), + iret = GNUNET_PROGRAM_run (TALER_FAKEBANK_project_data (), argc, argv, "taler-fakebank-run", "Runs the fakebank", diff --git a/src/benchmark/taler-aggregator-benchmark.c b/src/benchmark/taler-aggregator-benchmark.c @@ -445,6 +445,7 @@ run (void *cls, cfg = c; if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &currency)) { global_ret = EXIT_NOTCONFIGURED; diff --git a/src/benchmark/taler-bank-benchmark.c b/src/benchmark/taler-bank-benchmark.c @@ -505,6 +505,7 @@ main (int argc, } if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &currency)) { GNUNET_CONFIGURATION_destroy (cfg); diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c @@ -578,6 +578,7 @@ main (int argc, } if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &currency)) { GNUNET_CONFIGURATION_destroy (cfg); diff --git a/src/exchange-tools/Makefile.am b/src/exchange-tools/Makefile.am @@ -1,7 +1,7 @@ # This Makefile.am is in the public domain AM_CPPFLAGS = -I$(top_srcdir)/src/include -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgdir = $(prefix)/share/taler-exchange/config.d/ pkgcfg_DATA = \ coins.conf \ diff --git a/src/exchange-tools/taler-auditor-offline.c b/src/exchange-tools/taler-auditor-offline.c @@ -1394,6 +1394,7 @@ run (void *cls, kcfg = cfg; if (GNUNET_OK != TALER_config_get_currency (kcfg, + "exchange", &currency)) { global_ret = EXIT_NOTCONFIGURED; @@ -1471,7 +1472,7 @@ main (int argc, enum GNUNET_GenericReturnValue ret; ret = GNUNET_PROGRAM_run ( - TALER_EXCHANGE_project_data (), + TALER_AUDITOR_project_data (), argc, argv, "taler-auditor-offline", gettext_noop ("Operations for offline signing for a Taler exchange"), diff --git a/src/exchange-tools/taler-exchange-kyc-trigger.c b/src/exchange-tools/taler-exchange-kyc-trigger.c @@ -230,6 +230,7 @@ run (void *cls, } if (GNUNET_OK != TALER_config_get_currency (kcfg, + "exchange", &currency)) { global_ret = EXIT_NOTCONFIGURED; diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c @@ -5441,6 +5441,7 @@ run (void *cls, if (GNUNET_OK != TALER_config_get_currency (kcfg, + "exchange", &currency)) { global_ret = EXIT_NOTCONFIGURED; diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am @@ -9,9 +9,15 @@ if USE_COVERAGE XLIB = -lgcov endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgadir = $(prefix)/share/taler-auditor/config.d/ +pkgcfgedir = $(prefix)/share/taler-exchange/config.d/ -pkgcfg_DATA = \ +# Auditor also needs to access the exchange config, so we install +# the exchange configuration for it here as well! +pkgcfga_DATA = \ + exchange.conf + +pkgcfge_DATA = \ exchange.conf # Programs diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c @@ -318,13 +318,13 @@ parse_aggregator_config (void) } if ( (GNUNET_OK != TALER_config_get_amount (cfg, - "taler", + "exchange", "CURRENCY_ROUND_UNIT", &currency_round_unit)) || (TALER_amount_is_zero (&currency_round_unit)) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need non-zero amount in section `taler' under `CURRENCY_ROUND_UNIT'\n"); + "Need non-zero amount in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); return GNUNET_SYSERR; } diff --git a/src/exchange/taler-exchange-closer.c b/src/exchange/taler-exchange-closer.c @@ -139,14 +139,13 @@ parse_closer_config (void) } if ( (GNUNET_OK != TALER_config_get_amount (cfg, - "taler", + "exchange", "CURRENCY_ROUND_UNIT", &currency_round_unit)) || - ( (0 != currency_round_unit.fraction) && - (0 != currency_round_unit.value) ) ) + (TALER_amount_is_zero (&currency_round_unit)) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need non-zero amount in section `TALER' under `CURRENCY_ROUND_UNIT'\n"); + "Need non-zero amount in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); return GNUNET_SYSERR; } diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -2206,6 +2206,7 @@ exchange_serve_process_config (const char *cfg_fn) } if (GNUNET_OK != TALER_config_get_currency (TEH_cfg, + "exchange", &TEH_currency)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, @@ -2737,7 +2738,7 @@ run (void *cls, return; } if (GNUNET_OK != - TALER_TEMPLATING_init ("exchange")) + TALER_TEMPLATING_init (TALER_EXCHANGE_project_data ())) { global_ret = EXIT_NOTINSTALLED; GNUNET_SCHEDULER_shutdown (); diff --git a/src/exchange/taler-exchange-httpd_kyc-upload.c b/src/exchange/taler-exchange-httpd_kyc-upload.c @@ -350,6 +350,8 @@ aml_trigger_callback ( if (TALER_EC_NONE != ec) { uc->response_code = TALER_ErrorCode_get_http_status (ec); + if (0 == uc->response_code) + uc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR; GNUNET_assert (uc->response_code != UINT_MAX); uc->response = TALER_MHD_make_error ( ec, diff --git a/src/exchange/taler-exchange-httpd_spa.c b/src/exchange/taler-exchange-httpd_spa.c @@ -85,13 +85,15 @@ TEH_handler_kyc_spa (struct TEH_RequestContext *rc, enum GNUNET_GenericReturnValue TEH_spa_init () { - aml_spa = TALER_MHD_spa_load ("exchange/aml-spa/"); + aml_spa = TALER_MHD_spa_load (TALER_EXCHANGE_project_data (), + "aml-spa/"); if (NULL == aml_spa) { GNUNET_break (0); return GNUNET_SYSERR; } - kyc_spa = TALER_MHD_spa_load ("exchange/kyc-spa/"); + kyc_spa = TALER_MHD_spa_load (TALER_EXCHANGE_project_data (), + "kyc-spa/"); if (NULL == kyc_spa) { GNUNET_break (0); diff --git a/src/exchange/taler-exchange-router.c b/src/exchange/taler-exchange-router.c @@ -186,14 +186,13 @@ parse_wirewatch_config (void) } if ( (GNUNET_OK != TALER_config_get_amount (cfg, - "taler", + "exchange", "CURRENCY_ROUND_UNIT", &currency_round_unit)) || - ( (0 != currency_round_unit.fraction) && - (0 != currency_round_unit.value) ) ) + (TALER_amount_is_zero (&currency_round_unit)) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Need non-zero value in section `TALER' under `CURRENCY_ROUND_UNIT'\n"); + "Need non-zero value in section `exchange' under `CURRENCY_ROUND_UNIT'\n"); return GNUNET_SYSERR; } diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am @@ -6,13 +6,20 @@ if USE_COVERAGE XLIB = -lgcov endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgadir = $(prefix)/share/taler-auditor/config.d/ +pkgcfgedir = $(prefix)/share/taler-exchange/config.d/ -pkgcfg_DATA = \ +# Auditor also needs to access the exchange DB, so we install +# the exchange configuration for it here as well! +pkgcfga_DATA = \ exchangedb.conf \ exchangedb-postgres.conf -sqldir = $(prefix)/share/taler/sql/exchange/ +pkgcfge_DATA = \ + exchangedb.conf \ + exchangedb-postgres.conf + +sqldir = $(prefix)/share/taler-exchange/sql/ sqlinputs = \ exchange_do_*.sql \ @@ -107,7 +114,7 @@ EXTRA_DIST = \ pg_template.h pg_template.c \ pg_template.sh -plugindir = $(libdir)/taler +plugindir = $(libdir)/taler-exchange if HAVE_POSTGRESQL plugin_LTLIBRARIES = \ diff --git a/src/exchangedb/exchangedb-postgres.conf b/src/exchangedb/exchangedb-postgres.conf @@ -3,7 +3,7 @@ CONFIG = "postgres:///taler-exchange" # Where are the SQL files to setup our tables? # Important: this MUST end with a "/"! -SQL_DIR = ${DATADIR}sql/exchange/ +SQL_DIR = ${DATADIR}sql/ # Number of purses per account by default. DEFAULT_PURSE_LIMIT = 1 \ No newline at end of file diff --git a/src/exchangedb/exchangedb.conf b/src/exchangedb/exchangedb.conf @@ -3,16 +3,6 @@ # Database-backend independent specification for the exchangedb module. # [exchangedb] -# Where do we expect to find information about auditors? -AUDITOR_BASE_DIR = ${TALER_DATA_HOME}/auditors/ - -# Where do we expect to find information about wire transfer fees -# for aggregate payments? These are the amounts we charge (subtract) -# the merchant per wire transfer. The directory is expected to -# contain files "$METHOD.fee" with the cost structure, where -# $METHOD corresponds to a wire transfer method. -WIREFEE_BASE_DIR = ${TALER_DATA_HOME}/exchange/wirefees/ - # After how long do we close idle reserves? The exchange # and the auditor must agree on this value. We currently diff --git a/src/exchangedb/exchangedb_plugin.c b/src/exchangedb/exchangedb_plugin.c @@ -32,7 +32,7 @@ TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg, char *lib_name; struct TALER_EXCHANGEDB_Plugin *plugin; - if (GNUNET_SYSERR == + if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "exchange", "db", @@ -50,10 +50,12 @@ TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg, plugin = GNUNET_PLUGIN_load (TALER_EXCHANGE_project_data (), lib_name, (void *) cfg); - if (NULL != plugin) - plugin->library_name = lib_name; - else + if (NULL == plugin) + { GNUNET_free (lib_name); + return NULL; + } + plugin->library_name = lib_name; if ( (! skip_preflight) && (GNUNET_OK != plugin->preflight (plugin->cls)) ) diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c @@ -360,6 +360,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls) if (GNUNET_OK != TALER_config_get_currency (cfg, + "exchange", &pg->currency)) { GNUNET_free (pg->exchange_url); diff --git a/src/exchangedb/test-exchange-db-postgres.conf b/src/exchangedb/test-exchange-db-postgres.conf @@ -10,9 +10,9 @@ BASE_URL = http://localhost/ CONFIG = postgres:///talercheck # Where are the SQL files to setup our tables? -SQL_DIR = $DATADIR/sql/exchange/ +SQL_DIR = ${DATADIR}sql/ -[taler] +[exchange] CURRENCY = EUR [exchangedb] diff --git a/src/extensions/age_restriction/Makefile.am b/src/extensions/age_restriction/Makefile.am @@ -12,7 +12,7 @@ endif # Age restriction as extension library -plugindir = $(libdir)/taler +plugindir = $(libdir)/taler-exchange plugin_LTLIBRARIES = \ libtaler_extension_age_restriction.la diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h @@ -1058,11 +1058,13 @@ TALER_MHD_reply_cors_preflight (struct MHD_Connection *connection); /** * Load SPA files from @a dir * + * @param pd project data to use to determine the parent directory * @param dir directory suffix to append to our data directory with the location of the files of the SPA * @return handle to serve static files from @a dir */ struct TALER_MHD_Spa * -TALER_MHD_spa_load (const char *dir); +TALER_MHD_spa_load (const struct GNUNET_OS_ProjectData *pd, + const char *dir); /** diff --git a/src/include/taler_templating_lib.h b/src/include/taler_templating_lib.h @@ -114,11 +114,11 @@ TALER_TEMPLATING_reply_error (struct MHD_Connection *connection, /** * Preload templates. * - * @param subsystem name of the subsystem, "merchant" or "exchange" + * @param pd project data for the subsystem * @return #GNUNET_OK on success */ enum GNUNET_GenericReturnValue -TALER_TEMPLATING_init (const char *subsystem); +TALER_TEMPLATING_init (const struct GNUNET_OS_ProjectData *pd); /** diff --git a/src/include/taler_util.h b/src/include/taler_util.h @@ -210,15 +210,17 @@ TALER_denom_fee_check_currency ( /** - * Load our currency from the @a cfg (in section [taler] - * the option "CURRENCY"). + * Load our currency from the @a cfg in @a section + * the option "CURRENCY". * * @param cfg configuration to use + * @param section configuration section to inspect * @param[out] currency where to write the result * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue TALER_config_get_currency (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, char **currency); @@ -344,6 +346,20 @@ TALER_EXCHANGE_project_data (void); /** + * Return default project data used by Taler auditor. + */ +const struct GNUNET_OS_ProjectData * +TALER_AUDITOR_project_data (void); + + +/** + * Return default project data used by Taler fakebank. + */ +const struct GNUNET_OS_ProjectData * +TALER_FAKEBANK_project_data (void); + + +/** * Re-encode string at @a inp to match RFC 8785 (section 3.2.2.2). * * @param[in,out] inp pointer to string to re-encode diff --git a/src/kyclogic/Makefile.am b/src/kyclogic/Makefile.am @@ -6,7 +6,7 @@ if USE_COVERAGE XLIB = -lgcov endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgdir = $(prefix)/share/taler-exchange/config.d/ pkgcfg_DATA = \ kyclogic.conf \ @@ -70,7 +70,7 @@ taler_exchange_kyc_tester_LDADD = \ -plugindir = $(libdir)/taler +plugindir = $(libdir)/taler-exchange plugin_LTLIBRARIES = \ libtaler_plugin_kyclogic_kycaid.la \ diff --git a/src/kyclogic/taler-exchange-helper-measure-freeze b/src/kyclogic/taler-exchange-helper-measure-freeze @@ -86,7 +86,7 @@ EXPIRATION=$((3600 * 30 + $(date +%s))) # for the required output format. jq -n \ - --arg expiration "$EXPIRATION" \ + --argjson expiration "$EXPIRATION" \ '{ "to_investigate": true, "new_rules" : { "new_measures" : "info-frozen", diff --git a/src/kyclogic/taler-exchange-kyc-tester.c b/src/kyclogic/taler-exchange-kyc-tester.c @@ -1493,7 +1493,7 @@ run (void *cls, (void) args; (void ) cfgfile; if (GNUNET_OK != - TALER_TEMPLATING_init ("exchange")) + TALER_TEMPLATING_init (TALER_EXCHANGE_project_data ())) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not load templates. Installation broken.\n"); diff --git a/src/mhd/mhd_spa.c b/src/mhd/mhd_spa.c @@ -302,7 +302,8 @@ build_webui (void *cls, struct TALER_MHD_Spa * -TALER_MHD_spa_load (const char *dir) +TALER_MHD_spa_load (const struct GNUNET_OS_ProjectData *pd, + const char *dir) { struct TALER_MHD_Spa *spa; char *dn; @@ -310,7 +311,7 @@ TALER_MHD_spa_load (const char *dir) { char *path; - path = GNUNET_OS_installation_get_path (TALER_EXCHANGE_project_data (), + path = GNUNET_OS_installation_get_path (pd, GNUNET_OS_IPK_DATADIR); if (NULL == path) { diff --git a/src/taler-exchange.conf b/src/taler-exchange.conf @@ -0,0 +1,2 @@ +[exchange] +CURRENCY = KUDOS diff --git a/src/taler.conf b/src/taler.conf @@ -1,2 +0,0 @@ -[taler] -CURRENCY = KUDOS diff --git a/src/templating/templating_api.c b/src/templating/templating_api.c @@ -473,7 +473,7 @@ TALER_TEMPLATING_reply_error ( enum GNUNET_GenericReturnValue -TALER_TEMPLATING_init (const char *subsystem) +TALER_TEMPLATING_init (const struct GNUNET_OS_ProjectData *pd) { char *dn; int ret; @@ -481,7 +481,7 @@ TALER_TEMPLATING_init (const char *subsystem) { char *path; - path = GNUNET_OS_installation_get_path (TALER_EXCHANGE_project_data (), + path = GNUNET_OS_installation_get_path (pd, GNUNET_OS_IPK_DATADIR); if (NULL == path) { @@ -489,9 +489,8 @@ TALER_TEMPLATING_init (const char *subsystem) return GNUNET_SYSERR; } GNUNET_asprintf (&dn, - "%s/%s/templates/", - path, - subsystem); + "%s/templates/", + path); GNUNET_free (path); } ret = GNUNET_DISK_directory_scan (dn, diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am @@ -597,9 +597,6 @@ EXTRA_DIST = \ test_bank_api_fakebank.conf \ test_bank_api_fakebank_twisted.conf \ test_bank_api_nexus.conf \ - test_exchange_api_home/taler/auditor/offline-keys/auditor.priv \ - test_exchange_api_home/.local/share/taler/exchange-offline/master.priv \ - test_exchange_api_home/.local/share/taler/auditor/offline-keys/auditor.priv \ test_exchange_api.conf \ test_exchange_api-cs.conf \ test_exchange_api-rsa.conf \ diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh @@ -268,8 +268,8 @@ fi STAGE="config" -EXCHANGE_URL=$(taler-config -c "$CONF" -s "EXCHANGE" -o "BASE_URL") -CURRENCY=$(taler-config -c "$CONF" -s "TALER" -o "CURRENCY") +EXCHANGE_URL=$(taler-exchange-config -c "$CONF" -s "EXCHANGE" -o "BASE_URL") +CURRENCY=$(taler-exchange-config -c "$CONF" -s "EXCHANGE" -o "CURRENCY") echo "Setting up for $CURRENCY at $EXCHANGE_URL" @@ -336,13 +336,13 @@ register_fakebank_account() { if [[ "1" = "$START_BANK" ]] then - BANK_PORT=$(taler-config -c "$CONF" -s "libeufin-bank" -o "PORT") + BANK_PORT=$(taler-exchange-config -c "$CONF" -s "libeufin-bank" -o "PORT") BANK_URL="http://localhost:${BANK_PORT}/" fi if [[ "1" = "$START_FAKEBANK" ]] then - BANK_PORT=$(taler-config -c "$CONF" -s "BANK" -o "HTTP_PORT") + BANK_PORT=$(taler-exchange-config -c "$CONF" -s "BANK" -o "HTTP_PORT") BANK_URL="http://localhost:${BANK_PORT}/" fi @@ -486,15 +486,15 @@ STAGE="exchange" if [ "1" = "$START_EXCHANGE" ] then echo -n "Starting exchange ..." - EXCHANGE_PORT=$(taler-config -c "$CONF" -s EXCHANGE -o PORT) - SERVE=$(taler-config -c "$CONF" -s EXCHANGE -o SERVE) + EXCHANGE_PORT=$(taler-exchange-config -c "$CONF" -s EXCHANGE -o PORT) + SERVE=$(taler-exchange-config -c "$CONF" -s EXCHANGE -o SERVE) if [ "${SERVE}" = "unix" ] then - EXCHANGE_URL=$(taler-config -c "$CONF" -s EXCHANGE -o BASE_URL) + EXCHANGE_URL=$(taler-exchange-config -c "$CONF" -s EXCHANGE -o BASE_URL) else 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-exchange-config -f -c "${CONF}" -s "EXCHANGE-OFFLINE" -o "MASTER_PRIV_FILE") MASTER_PRIV_DIR=$(dirname "$MASTER_PRIV_FILE") mkdir -p "${MASTER_PRIV_DIR}" if [ ! -e "$MASTER_PRIV_FILE" ] @@ -503,11 +503,11 @@ then echo -n "." fi MASTER_PUB=$(gnunet-ecc -p "${MASTER_PRIV_FILE}") - MPUB=$(taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY) + MPUB=$(taler-exchange-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY) if [ "$MPUB" != "$MASTER_PUB" ] then echo -n " patching master_pub ($MASTER_PUB)..." - taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY -V "$MASTER_PUB" + taler-exchange-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY -V "$MASTER_PUB" fi taler-exchange-dbinit -c "$CONF" --reset $USE_VALGRIND taler-exchange-secmod-eddsa \ @@ -594,20 +594,20 @@ then echo -n "Starting merchant ..." if [ -n "${USE_MERCHANT_EXCHANGE+x}" ] then - MEPUB=$(taler-config -c "$CONF" -s "${USE_MERCHANT_EXCHANGE}" -o MASTER_KEY) - MXPUB=${MASTER_PUB:-$(taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY)} + MEPUB=$(taler-merchant-config -c "$CONF" -s "${USE_MERCHANT_EXCHANGE}" -o MASTER_KEY) + MXPUB=${MASTER_PUB:-$(taler-merchant-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY)} if [ "$MEPUB" != "$MXPUB" ] then echo -n " patching master_pub ($MXPUB)..." - taler-config -c "$CONF" -s "${USE_MERCHANT_EXCHANGE}" -o MASTER_KEY -V "$MXPUB" + taler-merchant-config -c "$CONF" -s "${USE_MERCHANT_EXCHANGE}" -o MASTER_KEY -V "$MXPUB" fi fi - MERCHANT_TYPE=$(taler-config -c "$CONF" -s MERCHANT -o SERVE) + MERCHANT_TYPE=$(taler-merchant-config -c "$CONF" -s MERCHANT -o SERVE) if [ "unix" = "$MERCHANT_TYPE" ] then - MERCHANT_URL="$(taler-config -c "$CONF" -s MERCHANT -o BASE_URL)" + MERCHANT_URL="$(taler-merchant-config -c "$CONF" -s MERCHANT -o BASE_URL)" else - MERCHANT_PORT="$(taler-config -c "$CONF" -s MERCHANT -o PORT)" + MERCHANT_PORT="$(taler-merchant-config -c "$CONF" -s MERCHANT -o PORT)" MERCHANT_URL="http://localhost:${MERCHANT_PORT}/" fi taler-merchant-dbinit \ @@ -659,11 +659,11 @@ STAGE="sync" if [ "1" = "$START_BACKUP" ] then echo -n "Starting sync ..." - SYNC_PORT=$(taler-config -c "$CONF" -s SYNC -o PORT) - SERVE=$(taler-config -c "$CONF" -s SYNC -o SERVE) + SYNC_PORT=$(sync-config -c "$CONF" -s SYNC -o PORT) + SERVE=$(sync-config -c "$CONF" -s SYNC -o SERVE) if [ "${SERVE}" = "unix" ] then - SYNC_URL=$(taler-config -c "$CONF" -s SYNC -o BASE_URL) + SYNC_URL=$(sync-config -c "$CONF" -s SYNC -o BASE_URL) else SYNC_URL="http://localhost:${SYNC_PORT}/" fi @@ -681,10 +681,10 @@ if [ "1" = "$START_CHALLENGER" ] then echo -n "Starting challenger ..." CHALLENGER_PORT=$(challenger-config -c "$CONF" -s CHALLENGER -o PORT) - SERVE=$(taler-config -c "$CONF" -s CHALLENGER -o SERVE) + SERVE=$(challenger-config -c "$CONF" -s CHALLENGER -o SERVE) if [ "${SERVE}" = "unix" ] then - CHALLENGER_URL=$(taler-config -c "$CONF" -s CHALLENGER -o BASE_URL) + CHALLENGER_URL=$(challenger-config -c "$CONF" -s CHALLENGER -o BASE_URL) else CHALLENGER_URL="http://localhost:${CHALLENGER_PORT}/" fi @@ -696,16 +696,16 @@ then -L "$LOGLEVEL" \ 2> challenger-httpd.log & echo " DONE" - for SECTION in $(taler-config -c "$CONF" -S | grep kyc-provider) + for SECTION in $(taler-exchange-config -c "$CONF" -S | grep kyc-provider) do - LOGIC=$(taler-config -c "$CONF" -s "$SECTION" -o "LOGIC") + LOGIC=$(taler-exchange-config -c "$CONF" -s "$SECTION" -o "LOGIC") if [ "${LOGIC}" = "oauth2" ] then - INFO=$(taler-config -c "$CONF" -s "$SECTION" -o "KYC_OAUTH2_INFO_URL") + INFO=$(taler-exchange-config -c "$CONF" -s "$SECTION" -o "KYC_OAUTH2_INFO_URL") if [ "${CHALLENGER_URL}info" = "$INFO" ] then echo -n "Enabling Challenger client for $SECTION" - CLIENT_SECRET=$(taler-config -c "$CONF" -s "$SECTION" -o "KYC_OAUTH2_CLIENT_SECRET") + CLIENT_SECRET=$(taler-exchange-config -c "$CONF" -s "$SECTION" -o "KYC_OAUTH2_CLIENT_SECRET") RFC_8959_PREFIX="secret-token:" if ! echo "${CLIENT_SECRET}" | grep ^${RFC_8959_PREFIX} > /dev/null then @@ -713,7 +713,7 @@ then fi REDIRECT_URI="${EXCHANGE_URL}kyc-proof/kyc-provider-example-challeger" CLIENT_ID=$(challenger-admin --add="${CLIENT_SECRET}" --quiet "${REDIRECT_URI}") - taler-config -c "$CONF" -s "$SECTION" -o KYC_OAUTH2_CLIENT_ID -V "$CLIENT_ID" + taler-exchange-config -c "$CONF" -s "$SECTION" -o KYC_OAUTH2_CLIENT_ID -V "$CLIENT_ID" echo " DONE" fi fi @@ -726,10 +726,10 @@ if [ "1" = "$START_AUDITOR" ] then echo -n "Starting auditor ..." - export TALER_AUDITOR_SALT=$(taler-config -c "$CONF" -s AUDITOR -o TALER_AUDITOR_SALT) + export TALER_AUDITOR_SALT=$(taler-auditor-config -c "$CONF" -s AUDITOR -o TALER_AUDITOR_SALT) - AUDITOR_URL=$(taler-config -c "$CONF" -s AUDITOR -o BASE_URL) - AUDITOR_PRIV_FILE=$(taler-config -f -c "$CONF" -s AUDITOR -o AUDITOR_PRIV_FILE) + AUDITOR_URL=$(taler-auditor-config -c "$CONF" -s AUDITOR -o BASE_URL) + AUDITOR_PRIV_FILE=$(taler-auditor-config -f -c "$CONF" -s AUDITOR -o AUDITOR_PRIV_FILE) AUDITOR_PRIV_DIR=$(dirname "$AUDITOR_PRIV_FILE") mkdir -p "$AUDITOR_PRIV_DIR" if [ ! -e "$AUDITOR_PRIV_FILE" ] @@ -738,19 +738,24 @@ then echo -n "." fi AUDITOR_PUB=$(gnunet-ecc -p "${AUDITOR_PRIV_FILE}") - MAPUB=${MASTER_PUB:-$(taler-config -c "$CONF" -s exchange -o MASTER_PUBLIC_KEY)} + APUB=$(taler-exchange-config -c "$CONF" -s auditor -o PUBLIC_KEY) + if [ "$APUB" != "$AUDITOR_PUB" ] + then + echo -n " patching auditor public key ..." + # Using taler-exchange-config is correct here, we don't want to + # suddenly use the auditor-defaults while editing... + taler-exchange-config -c "$CONF" -s auditor -o PUBLIC_KEY -V "$AUDITOR_PUB" + fi + taler-auditor-dbinit \ -c "$CONF" \ --reset + echo "Launching auditor using $CONF" > taler-auditor-httpd.log + echo "Launching auditor using $AUDITOR_PUB from $AUDITOR_PRIV_FILE" \ + >> taler-auditor-httpd.log $USE_VALGRIND taler-auditor-httpd \ -L "$LOGLEVEL" \ - -c "$CONF" 2> taler-auditor-httpd.log & -# $USE_VALGRIND taler-helper-auditor-deposits \ -# -L "$LOGLEVEL" \ -# -c "$CONF" 2> taler-helper-auditor.log & - - - + -c "$CONF" 2>> taler-auditor-httpd.log & echo " DONE" fi @@ -868,11 +873,11 @@ then global-fee now "$CURRENCY:0.01" "$CURRENCY:0.01" "$CURRENCY:0.0" 1h 1year 5 \ upload &> taler-exchange-offline.log echo "OK" - ENABLED=$(taler-config -c "$CONF" -s "$USE_ACCOUNT" -o "ENABLE_CREDIT") + ENABLED=$(taler-exchange-config -c "$CONF" -s "$USE_ACCOUNT" -o "ENABLE_CREDIT") if [ "YES" = "$ENABLED" ] then echo -n "Configuring bank account $USE_ACCOUNT ..." - EXCHANGE_PAYTO_URI=$(taler-config -c "$CONF" -s "$USE_ACCOUNT" -o "PAYTO_URI") + EXCHANGE_PAYTO_URI=$(taler-exchange-config -c "$CONF" -s "$USE_ACCOUNT" -o "PAYTO_URI") taler-exchange-offline -c "$CONF" \ enable-account "$EXCHANGE_PAYTO_URI" \ upload &> "taler-exchange-offline-account.log" diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf b/src/testing/test-taler-exchange-aggregator-postgres.conf @@ -12,11 +12,9 @@ LOOKAHEAD_SIGN = 24 days LOOKAHEAD_SIGN = 24 days DURATION = 14 days -[taler] +[exchange] CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 - -[exchange] AML_THRESHOLD = EUR:1000000 DB = postgres PORT = 8081 diff --git a/src/testing/test-taler-exchange-wirewatch-postgres.conf b/src/testing/test-taler-exchange-wirewatch-postgres.conf @@ -11,11 +11,9 @@ LOOKAHEAD_SIGN = 24 days LOOKAHEAD_SIGN = 24 days DURATION = 14 days -[taler] +[exchange] CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 - -[exchange] AML_THRESHOLD = EUR:1000000 DB = postgres PORT = 8081 diff --git a/src/testing/test_bank_api.conf b/src/testing/test_bank_api.conf @@ -3,9 +3,13 @@ [PATHS] TALER_TEST_HOME = test_exchange_api_home/ -[taler] +[exchange] currency = EUR +[auditor] +BASE_URL = "http://localhost:8083/" +PORT = 8083 + [bank] SERVE = http HTTP_PORT = 8082 diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf @@ -21,11 +21,6 @@ PWD_AUTH_COMPAT = yes [libeufin-bankdb-postgres] CONFIG = postgresql:///talercheck - -[taler] -CURRENCY = EUR -CURRENCY_ROUND_UNIT = EUR:0.01 - [auditor] BASE_URL = "http://localhost:8083/" PORT = 8083 @@ -33,6 +28,9 @@ PUBLIC_KEY = 9QZ7CCC5QFMWE9FVF50MGYWV7JR92SFHY5KHT8A1A2VNHM37VCRG TINY_AMOUNT = EUR:0.01 TALER_AUDITOR_SALT = "salt" +# Where do we store the auditor's private key? +AUDITOR_PRIV_FILE = ${TALER_DATA_HOME}offline-keys/auditor.priv + [auditordb-postgres] CONFIG = "postgres:///talercheck" @@ -40,6 +38,8 @@ CONFIG = "postgres:///talercheck" HTTP_PORT = 8082 [exchange] +CURRENCY = EUR +CURRENCY_ROUND_UNIT = EUR:0.01 TERMS_ETAG = exchange-tos-tops-v0 PRIVACY_ETAG = 0 PORT = 8081 @@ -51,6 +51,8 @@ EXPIRE_IDLE_SLEEP_INTERVAL ="1 s" STEFAN_ABS = EUR:0 STEFAN_LOG = EUR:0.005 ENABLE_KYC = YES +DB = postgres +BASE_URL = http://localhost:8081/ [exchangedb-postgres] CONFIG = "postgres:///talercheck" @@ -204,6 +206,11 @@ DESCRIPTION = "Dummy AML program used for INFO checks, always fails" COMMAND = taler-exchange-helper-measure-none FALLBACK = manual-freeze +[aml-program-freeze] +DESCRIPTION = "Freeze the account" +COMMAND = taler-exchange-helper-measure-freeze +FALLBACK = manual-freeze + [aml-program-oauth-output-check] DESCRIPTION = "Validates the output from OAauth2 and then increases all limits to EUR:1000" # Command that runs on the output of the OAuth provider @@ -238,7 +245,7 @@ CONTEXT = {} CHECK_NAME = skip # AML program that freezes the account and flags # it for investigation. -PROGRAM = taler-exchange-helper-measure-freeze +PROGRAM = freeze # Context to provide for check and program; empty. CONTEXT = {} diff --git a/src/testing/test_exchange_api_age_restriction.conf b/src/testing/test_exchange_api_age_restriction.conf @@ -4,7 +4,7 @@ [PATHS] TALER_TEST_HOME = test_exchange_api_home/ -[taler] +[exchange] CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 diff --git a/src/testing/test_exchange_api_conflicts.conf b/src/testing/test_exchange_api_conflicts.conf @@ -4,7 +4,7 @@ [PATHS] TALER_TEST_HOME = test_exchange_api_home/ -[taler] +[exchange] CURRENCY = EUR CURRENCY_ROUND_UNIT = EUR:0.01 diff --git a/src/testing/test_exchange_api_home/.local/share/taler/auditor/offline-keys/auditor.priv b/src/testing/test_exchange_api_home/.local/share/taler/auditor/offline-keys/auditor.priv Binary files differ. diff --git a/src/testing/test_exchange_api_home/.local/share/taler/exchange-offline/master.priv b/src/testing/test_exchange_api_home/.local/share/taler/exchange-offline/master.priv Binary files differ. diff --git a/src/testing/test_exchange_api_keys_cherry_picking.conf b/src/testing/test_exchange_api_keys_cherry_picking.conf @@ -4,9 +4,10 @@ # Persistent data storage for the testcase TALER_TEST_HOME = test_exchange_api_keys_cherry_picking_home/ -[taler] -CURRENCY = EUR -CURRENCY_ROUND_UNIT = EUR:0.01 +[auditor] +BASE_URL = "http://localhost:8083/" +PORT = 8083 + [taler-exchange-secmod-eddsa] OVERLAP_DURATION = 1 s @@ -14,6 +15,8 @@ DURATION = 30 s LOOKAHEAD_SIGN = 20 s [exchange] +CURRENCY = EUR +CURRENCY_ROUND_UNIT = EUR:0.01 AML_THRESHOLD = EUR:1000000 PORT = 8081 MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG diff --git a/src/testing/testing_api_cmd_get_auditor.c b/src/testing/testing_api_cmd_get_auditor.c @@ -49,6 +49,16 @@ struct GetAuditorState struct TALER_TESTING_Interpreter *is; /** + * Our configuration. + */ + const struct GNUNET_CONFIGURATION_Handle *cfg; + + /** + * Should we load and check the auditor's private key? + */ + bool load_auditor_keys; + + /** * Auditor handle used to get the configuration. */ struct TALER_AUDITOR_GetConfigHandle *auditor; @@ -100,6 +110,48 @@ version_cb ( /** + * Get the file name of the master private key file of the auditor from @a + * cfg. + * + * @param cfg configuration to evaluate + * @return base URL of the auditor according to @a cfg + */ +static char * +get_auditor_priv_file ( + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + char *fn; + struct GNUNET_CONFIGURATION_Handle *acfg; + char *dfn; + + GNUNET_break (GNUNET_OK == + GNUNET_CONFIGURATION_get_value_filename (cfg, + "PATHS", + "DEFAULTCONFIG", + &dfn)); + acfg = GNUNET_CONFIGURATION_create (TALER_AUDITOR_project_data ()); + GNUNET_break (GNUNET_OK == + GNUNET_CONFIGURATION_load (acfg, + dfn)); + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_filename (acfg, + "auditor", + "AUDITOR_PRIV_FILE", + &fn)) + { + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + "auditor", + "AUDITOR_PRIV_FILE"); + } + GNUNET_CONFIGURATION_destroy (acfg); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Loading auditor private key from %s\n", + fn); + return fn; +} + + +/** * Run the "get_auditor" command. * * @param cls closure. @@ -114,6 +166,9 @@ get_auditor_run (void *cls, struct GetAuditorState *gas = cls; (void) cmd; + if (gas->load_auditor_keys) + gas->priv_file = get_auditor_priv_file (gas->cfg); + if (NULL == gas->auditor_url) { GNUNET_break (0); @@ -231,34 +286,6 @@ get_auditor_base_url ( } -/** - * Get the file name of the master private key file of the auditor from @a - * cfg. - * - * @param cfg configuration to evaluate - * @return base URL of the auditor according to @a cfg - */ -static char * -get_auditor_priv_file ( - const struct GNUNET_CONFIGURATION_Handle *cfg) -{ - char *fn; - - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_filename (cfg, - "auditor", - "AUDITOR_PRIV_FILE", - &fn)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "auditor", - "AUDITOR_PRIV_FILE"); - return NULL; - } - return fn; -} - - struct TALER_TESTING_Command TALER_TESTING_cmd_get_auditor ( const char *label, @@ -269,8 +296,8 @@ TALER_TESTING_cmd_get_auditor ( gas = GNUNET_new (struct GetAuditorState); gas->auditor_url = get_auditor_base_url (cfg); - if (load_auditor_keys) - gas->priv_file = get_auditor_priv_file (cfg); + gas->load_auditor_keys = load_auditor_keys; + gas->cfg = cfg; { struct TALER_TESTING_Command cmd = { .cls = gas, diff --git a/src/testing/testing_api_cmd_run_fakebank.c b/src/testing/testing_api_cmd_run_fakebank.c @@ -183,6 +183,7 @@ TALER_TESTING_cmd_run_fakebank ( (unsigned int) rfs->port); GNUNET_assert (GNUNET_OK == TALER_config_get_currency (cfg, + "exchange", &rfs->currency)); { char *exchange_xtalerbank_account; diff --git a/src/util/.gitignore b/src/util/.gitignore @@ -10,3 +10,5 @@ test_helper_cs_home/ test_helper_eddsa test_helper_eddsa_home/ test_conversion +taler-auditor-config +taler-exchange-config diff --git a/src/util/Makefile.am b/src/util/Makefile.am @@ -7,31 +7,43 @@ if USE_COVERAGE endif -pkgcfgdir = $(prefix)/share/taler/config.d/ +pkgcfgadir = $(prefix)/share/taler-auditor/config.d/ +pkgcfgedir = $(prefix)/share/taler-exchange/config.d/ -pkgcfg_DATA = \ +pkgcfga_DATA = \ + auditor-paths.conf + +pkgcfge_DATA = \ currencies.conf \ - paths.conf \ + exchange-paths.conf \ taler-exchange-secmod-eddsa.conf \ taler-exchange-secmod-rsa.conf \ taler-exchange-secmod-cs.conf EXTRA_DIST = \ - $(pkgcfg_DATA) \ - taler-config.in \ + $(pkgcfga_DATA) \ + $(pkgcfge_DATA) \ test_helper_eddsa.conf \ test_helper_rsa.conf \ test_helper_cs.conf bin_PROGRAMS = \ + taler-auditor-config \ taler-exchange-secmod-eddsa \ taler-exchange-secmod-rsa \ taler-exchange-secmod-cs \ - taler-config + taler-exchange-config + +taler_auditor_config_SOURCES = \ + taler-auditor-config.c +taler_auditor_config_LDADD = \ + libtalerutil.la \ + -lgnunetutil \ + $(XLIB) -taler_config_SOURCES = \ - taler-config.c -taler_config_LDADD = \ +taler_exchange_config_SOURCES = \ + taler-exchange-config.c +taler_exchange_config_LDADD = \ libtalerutil.la \ -lgnunetutil \ $(XLIB) diff --git a/src/util/auditor-paths.conf b/src/util/auditor-paths.conf @@ -0,0 +1,29 @@ +# This file is in the public domain. +# +[PATHS] +# The PATHS section is special, as filenames including $-expression are +# expanded using the values from PATHS or the system environment (PATHS +# is checked first). Taler also supports expanding $-expressions using +# defaults with the syntax "${VAR:-default}". Here, "default" can again +# be a $-expression. +# +# We usually want $HOME for $TALER_HOME, but we allow testcases to +# easily override this by setting $TALER_TEST_HOME. +# +TALER_HOME = ${TALER_TEST_HOME:-${HOME:-${USERPROFILE}}} + +# see XDG Base Directory Specification at +# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +# for how these should be used. + +# Persistent data storage +TALER_DATA_HOME = ${XDG_DATA_HOME:-${TALER_HOME}/.local/share}/taler-auditor/ + +# Configuration files +TALER_CONFIG_HOME = ${XDG_CONFIG_HOME:-${TALER_HOME}/.config}/taler-auditor/ + +# Cached data, no big deal if lost +TALER_CACHE_HOME = ${XDG_CACHE_HOME:-${TALER_HOME}/.cache}/taler-auditor/ + +# Runtime data (always lost on system boot) +TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-auditor-runtime/ diff --git a/src/util/config.c b/src/util/config.c @@ -126,18 +126,19 @@ TALER_config_get_denom_fees (const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_GenericReturnValue TALER_config_get_currency (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, char **currency) { size_t slen; if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, - "taler", + section, "CURRENCY", currency)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "taler", + section, "CURRENCY"); return GNUNET_SYSERR; } diff --git a/src/util/exchange-paths.conf b/src/util/exchange-paths.conf @@ -0,0 +1,29 @@ +# This file is in the public domain. +# +[PATHS] +# The PATHS section is special, as filenames including $-expression are +# expanded using the values from PATHS or the system environment (PATHS +# is checked first). Taler also supports expanding $-expressions using +# defaults with the syntax "${VAR:-default}". Here, "default" can again +# be a $-expression. +# +# We usually want $HOME for $TALER_HOME, but we allow testcases to +# easily override this by setting $TALER_TEST_HOME. +# +TALER_HOME = ${TALER_TEST_HOME:-${HOME:-${USERPROFILE}}} + +# see XDG Base Directory Specification at +# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +# for how these should be used. + +# Persistent data storage +TALER_DATA_HOME = ${XDG_DATA_HOME:-${TALER_HOME}/.local/share}/taler-exchange/ + +# Configuration files +TALER_CONFIG_HOME = ${XDG_CONFIG_HOME:-${TALER_HOME}/.config}/taler-exchange/ + +# Cached data, no big deal if lost +TALER_CACHE_HOME = ${XDG_CACHE_HOME:-${TALER_HOME}/.cache}/taler-exchange/ + +# Runtime data (always lost on system boot) +TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-exchange-runtime/ diff --git a/src/util/os_installation.c b/src/util/os_installation.c @@ -1,6 +1,6 @@ /* This file is part of GNU Taler. - Copyright (C) 2016 Taler Systems SA + Copyright (C) 2016, 2024 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 @@ -28,18 +28,18 @@ /** * Default project data used for installation path detection - * for GNU Taler. + * for GNU Taler exchange. */ -static const struct GNUNET_OS_ProjectData taler_pd = { +static const struct GNUNET_OS_ProjectData exchange_pd = { .libname = "libtalerutil", - .project_dirname = "taler", + .project_dirname = "taler-exchange", .binary_name = "taler-exchange-httpd", .env_varname = "TALER_PREFIX", .base_config_varname = "TALER_BASE_CONFIG", .bug_email = "taler@gnu.org", .homepage = "http://www.gnu.org/s/taler/", - .config_file = "taler.conf", - .user_config_file = "~/.config/taler.conf", + .config_file = "taler-exchange.conf", + .user_config_file = "~/.config/taler-exchange.conf", .version = PACKAGE_VERSION "-" VCS_VERSION, .is_gnu = 1, .gettext_domain = "taler", @@ -48,13 +48,68 @@ static const struct GNUNET_OS_ProjectData taler_pd = { }; +const struct GNUNET_OS_ProjectData * +TALER_EXCHANGE_project_data (void) +{ + return &exchange_pd; +} + + /** - * Return default project data used by Taler exchange. + * Default project data used for installation path detection + * for GNU Taler auditor. */ +static const struct GNUNET_OS_ProjectData auditor_pd = { + .libname = "libtalerutil", + .project_dirname = "taler-auditor", + .binary_name = "taler-auditor-httpd", + .env_varname = "TALER_PREFIX", + .base_config_varname = "TALER_BASE_CONFIG", + .bug_email = "taler@gnu.org", + .homepage = "http://www.gnu.org/s/taler/", + .config_file = "taler-auditor.conf", + .user_config_file = "~/.config/taler-auditor.conf", + .version = PACKAGE_VERSION "-" VCS_VERSION, + .is_gnu = 1, + .gettext_domain = "taler", + .gettext_path = NULL, + .agpl_url = "https://git.taler.net/" +}; + + const struct GNUNET_OS_ProjectData * -TALER_EXCHANGE_project_data (void) +TALER_AUDITOR_project_data (void) +{ + return &auditor_pd; +} + + +/** + * Default project data used for installation path detection + * for GNU Taler fakebank. + */ +static const struct GNUNET_OS_ProjectData fakebank_pd = { + .libname = "libtalerutil", + .project_dirname = "taler-fakebank", + .binary_name = "taler-fakebank-run", + .env_varname = "TALER_PREFIX", + .base_config_varname = "TALER_BASE_CONFIG", + .bug_email = "taler@gnu.org", + .homepage = "http://www.gnu.org/s/taler/", + .config_file = "taler-fakebank.conf", + .user_config_file = "~/.config/taler-fakebank.conf", + .version = PACKAGE_VERSION "-" VCS_VERSION, + .is_gnu = 1, + .gettext_domain = "taler", + .gettext_path = NULL, + .agpl_url = "https://git.taler.net/" +}; + + +const struct GNUNET_OS_ProjectData * +TALER_FAKEBANK_project_data (void) { - return &taler_pd; + return &fakebank_pd; } diff --git a/src/util/paths.conf b/src/util/paths.conf @@ -1,29 +0,0 @@ -# This file is in the public domain. -# -[PATHS] -# The PATHS section is special, as filenames including $-expression are -# expanded using the values from PATHS or the system environment (PATHS -# is checked first). Taler also supports expanding $-expressions using -# defaults with the syntax "${VAR:-default}". Here, "default" can again -# be a $-expression. -# -# We usually want $HOME for $TALER_HOME, but we allow testcases to -# easily override this by setting $TALER_TEST_HOME. -# -TALER_HOME = ${TALER_TEST_HOME:-${HOME:-${USERPROFILE}}} - -# see XDG Base Directory Specification at -# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html -# for how these should be used. - -# Persistent data storage -TALER_DATA_HOME = ${XDG_DATA_HOME:-${TALER_HOME}/.local/share}/taler/ - -# Configuration files -TALER_CONFIG_HOME = ${XDG_CONFIG_HOME:-${TALER_HOME}/.config}/taler/ - -# Cached data, no big deal if lost -TALER_CACHE_HOME = ${XDG_CACHE_HOME:-${TALER_HOME}/.cache}/taler/ - -# Runtime data (always lost on system boot) -TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/taler-system-runtime/ diff --git a/src/util/taler-auditor-config.c b/src/util/taler-auditor-config.c @@ -0,0 +1,72 @@ +/* + This file is part of Taler. + Copyright (C) 2012-2024 Taler Systems SA + + Taler is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + Taler is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ +/** + * @file util/taler-auditor-config.c + * @brief tool to access and manipulate Taler configuration files + * @author Christian Grothoff + */ +#include "platform.h" +#include "taler_util.h" + + +/** + * Program to manipulate configuration files. + * + * @param argc number of arguments from the command line + * @param argv command line arguments + * @return 0 ok, 1 on error + */ +int +main (int argc, + char *const *argv) +{ + struct GNUNET_CONFIGURATION_ConfigSettings cs = { + .api_version = GNUNET_UTIL_VERSION, + .global_ret = EXIT_SUCCESS + }; + struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_option_help (TALER_AUDITOR_project_data (), + "taler-auditor-config [OPTIONS]"), + GNUNET_GETOPT_option_version (TALER_AUDITOR_project_data ()->version), + GNUNET_CONFIGURATION_CONFIG_OPTIONS (&cs), + GNUNET_GETOPT_OPTION_END + }; + enum GNUNET_GenericReturnValue ret; + + ret = GNUNET_PROGRAM_run ( + TALER_AUDITOR_project_data (), + argc, + argv, + "taler-auditor-config [OPTIONS]", + gettext_noop ( + "Manipulate Taler configuration files"), + options, + &GNUNET_CONFIGURATION_config_tool_run, + &cs); + GNUNET_CONFIGURATION_config_settings_free (&cs); + if (GNUNET_NO == ret) + return 0; + if (GNUNET_SYSERR == ret) + return EXIT_INVALIDARGUMENT; + return cs.global_ret; +} + + +/* end of taler-auditor-config.c */ diff --git a/src/util/taler-config.c b/src/util/taler-config.c @@ -1,73 +0,0 @@ -/* - This file is part of Taler. - Copyright (C) 2012-2024 Taler Systems SA - - Taler is free software: you can redistribute it and/or modify it - under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - Taler is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - SPDX-License-Identifier: AGPL3.0-or-later - */ -/* FIXME: probably should have separate tool for taler-merchant - and taler-exchange! */ -/** - * @file util/taler-config.c - * @brief tool to access and manipulate Taler configuration files - * @author Christian Grothoff - */ -#include "platform.h" -#include "taler_util.h" - - -/** - * Program to manipulate configuration files. - * - * @param argc number of arguments from the command line - * @param argv command line arguments - * @return 0 ok, 1 on error - */ -int -main (int argc, - char *const *argv) -{ - struct GNUNET_CONFIGURATION_ConfigSettings cs = { - .api_version = GNUNET_UTIL_VERSION, - .global_ret = EXIT_SUCCESS - }; - struct GNUNET_GETOPT_CommandLineOption options[] = { - GNUNET_GETOPT_option_help (TALER_EXCHANGE_project_data (), - "taler-config [OPTIONS]"), - GNUNET_GETOPT_option_version (TALER_EXCHANGE_project_data ()->version), - GNUNET_CONFIGURATION_CONFIG_OPTIONS (&cs), - GNUNET_GETOPT_OPTION_END - }; - enum GNUNET_GenericReturnValue ret; - - ret = GNUNET_PROGRAM_run (TALER_EXCHANGE_project_data (), - argc, - argv, - "taler-config [OPTIONS]", - gettext_noop ( - "Manipulate Taler configuration files"), - options, - &GNUNET_CONFIGURATION_config_tool_run, - &cs); - GNUNET_CONFIGURATION_config_settings_free (&cs); - if (GNUNET_NO == ret) - return 0; - if (GNUNET_SYSERR == ret) - return EXIT_INVALIDARGUMENT; - return cs.global_ret; -} - - -/* end of taler-config.c */ diff --git a/src/util/taler-exchange-config.c b/src/util/taler-exchange-config.c @@ -0,0 +1,72 @@ +/* + This file is part of Taler. + Copyright (C) 2012-2024 Taler Systems SA + + Taler is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + Taler is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ +/** + * @file util/taler-exchange-config.c + * @brief tool to access and manipulate Taler configuration files + * @author Christian Grothoff + */ +#include "platform.h" +#include "taler_util.h" + + +/** + * Program to manipulate configuration files. + * + * @param argc number of arguments from the command line + * @param argv command line arguments + * @return 0 ok, 1 on error + */ +int +main (int argc, + char *const *argv) +{ + struct GNUNET_CONFIGURATION_ConfigSettings cs = { + .api_version = GNUNET_UTIL_VERSION, + .global_ret = EXIT_SUCCESS + }; + struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_option_help (TALER_EXCHANGE_project_data (), + "taler-exchange-config [OPTIONS]"), + GNUNET_GETOPT_option_version (TALER_EXCHANGE_project_data ()->version), + GNUNET_CONFIGURATION_CONFIG_OPTIONS (&cs), + GNUNET_GETOPT_OPTION_END + }; + enum GNUNET_GenericReturnValue ret; + + ret = GNUNET_PROGRAM_run ( + TALER_EXCHANGE_project_data (), + argc, + argv, + "taler-exchange-config [OPTIONS]", + gettext_noop ( + "Manipulate Taler configuration files"), + options, + &GNUNET_CONFIGURATION_config_tool_run, + &cs); + GNUNET_CONFIGURATION_config_settings_free (&cs); + if (GNUNET_NO == ret) + return 0; + if (GNUNET_SYSERR == ret) + return EXIT_INVALIDARGUMENT; + return cs.global_ret; +} + + +/* end of taler-exchange-config.c */