exchange

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

commit ee2be6682ab2a0c62ffa6e36b2aca40180e4d61b
parent 44bebc039c564a4263d034355c503623ec2552e6
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 17 Mar 2026 11:54:14 +0100

fix #11241 / #11208

Diffstat:
Mcontrib/typst/_cover_/Makefile.am | 2+-
Mcontrib/typst/accept-tos/Makefile.am | 2+-
Mcontrib/typst/challenger-postal/Makefile.am | 2+-
Mcontrib/typst/challenger-sms/Makefile.am | 2+-
Mcontrib/typst/common/Makefile.am | 2+-
Mcontrib/typst/generic_note/Makefile.am | 2+-
Mcontrib/typst/generic_upload/Makefile.am | 2+-
Mcontrib/typst/vqf_902_1/Makefile.am | 2+-
Mcontrib/typst/vqf_902_11/Makefile.am | 2+-
Mcontrib/typst/vqf_902_11_customer/Makefile.am | 2+-
Mcontrib/typst/vqf_902_11_officer/Makefile.am | 2+-
Mcontrib/typst/vqf_902_12/Makefile.am | 2+-
Mcontrib/typst/vqf_902_13/Makefile.am | 2+-
Mcontrib/typst/vqf_902_14/Makefile.am | 2+-
Mcontrib/typst/vqf_902_15/Makefile.am | 2+-
Mcontrib/typst/vqf_902_1_customer/Makefile.am | 2+-
Mcontrib/typst/vqf_902_1_officer/Makefile.am | 2+-
Mcontrib/typst/vqf_902_4/Makefile.am | 2+-
Mcontrib/typst/vqf_902_5/Makefile.am | 2+-
Mcontrib/typst/vqf_902_9/Makefile.am | 2+-
Mcontrib/typst/vqf_902_9_customer/Makefile.am | 2+-
Mcontrib/typst/vqf_902_9_officer/Makefile.am | 2+-
Mdebian/taler-exchange-typst.install | 6++----
Msrc/exchange/taler-exchange-httpd_aml-attributes-get.c | 3++-
Msrc/include/taler/taler_mhd_lib.h | 2++
Msrc/mhd/mhd_typst.c | 23++++++++++++++++++++++-
Msrc/mhd/test_typst.c | 3++-
Msrc/testing/test_exchange_api_twisted.c | 2+-
28 files changed, 53 insertions(+), 30 deletions(-)

diff --git a/contrib/typst/_cover_/Makefile.am b/contrib/typst/_cover_/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/_cover_/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/_cover_/0.0.0/ typstpackage_DATA = \ _cover_.typ \ typst.toml diff --git a/contrib/typst/accept-tos/Makefile.am b/contrib/typst/accept-tos/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/accept-tos/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/accept-tos/0.0.0/ typstpackage_DATA = \ accept-tos.typ \ typst.toml diff --git a/contrib/typst/challenger-postal/Makefile.am b/contrib/typst/challenger-postal/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/challenger-postal/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/challenger-postal/0.0.0/ typstpackage_DATA = \ challenger-postal.typ \ typst.toml diff --git a/contrib/typst/challenger-sms/Makefile.am b/contrib/typst/challenger-sms/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/challenger-sms/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/challenger-sms/0.0.0/ typstpackage_DATA = \ challenger-sms.typ \ typst.toml diff --git a/contrib/typst/common/Makefile.am b/contrib/typst/common/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/common/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/common/0.0.0/ typstpackage_DATA = \ lib.typ \ pointing_finger.svg \ diff --git a/contrib/typst/generic_note/Makefile.am b/contrib/typst/generic_note/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/generic_note/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/generic_note/0.0.0/ typstpackage_DATA = \ generic_note.typ \ typst.toml diff --git a/contrib/typst/generic_upload/Makefile.am b/contrib/typst/generic_upload/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/generic_upload/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/generic_upload/0.0.0/ typstpackage_DATA = \ generic_upload.typ \ typst.toml diff --git a/contrib/typst/vqf_902_1/Makefile.am b/contrib/typst/vqf_902_1/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_1/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_1/0.0.0/ typstpackage_DATA = \ vqf_902_1.typ \ typst.toml diff --git a/contrib/typst/vqf_902_11/Makefile.am b/contrib/typst/vqf_902_11/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_11/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_11/0.0.0/ typstpackage_DATA = \ vqf_902_11.typ \ typst.toml diff --git a/contrib/typst/vqf_902_11_customer/Makefile.am b/contrib/typst/vqf_902_11_customer/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_11_customer/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_11_customer/0.0.0/ typstpackage_DATA = \ vqf_902_11_customer.typ \ typst.toml diff --git a/contrib/typst/vqf_902_11_officer/Makefile.am b/contrib/typst/vqf_902_11_officer/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_11_officer/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_11_officer/0.0.0/ typstpackage_DATA = \ vqf_902_11_officer.typ \ typst.toml diff --git a/contrib/typst/vqf_902_12/Makefile.am b/contrib/typst/vqf_902_12/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_12/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_12/0.0.0/ typstpackage_DATA = \ vqf_902_12.typ \ typst.toml diff --git a/contrib/typst/vqf_902_13/Makefile.am b/contrib/typst/vqf_902_13/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_13/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_13/0.0.0/ typstpackage_DATA = \ vqf_902_13.typ \ typst.toml diff --git a/contrib/typst/vqf_902_14/Makefile.am b/contrib/typst/vqf_902_14/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_14/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_14/0.0.0/ typstpackage_DATA = \ vqf_902_14.typ \ typst.toml diff --git a/contrib/typst/vqf_902_15/Makefile.am b/contrib/typst/vqf_902_15/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_15/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_15/0.0.0/ typstpackage_DATA = \ vqf_902_15.typ \ typst.toml diff --git a/contrib/typst/vqf_902_1_customer/Makefile.am b/contrib/typst/vqf_902_1_customer/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_1_customer/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_1_customer/0.0.0/ typstpackage_DATA = \ vqf_902_1_customer.typ \ typst.toml diff --git a/contrib/typst/vqf_902_1_officer/Makefile.am b/contrib/typst/vqf_902_1_officer/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_1_officer/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_1_officer/0.0.0/ typstpackage_DATA = \ vqf_902_1_officer.typ \ typst.toml diff --git a/contrib/typst/vqf_902_4/Makefile.am b/contrib/typst/vqf_902_4/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_4/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_4/0.0.0/ typstpackage_DATA = \ vqf_902_4.typ \ typst.toml diff --git a/contrib/typst/vqf_902_5/Makefile.am b/contrib/typst/vqf_902_5/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_5/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_5/0.0.0/ typstpackage_DATA = \ vqf_902_5.typ \ typst.toml diff --git a/contrib/typst/vqf_902_9/Makefile.am b/contrib/typst/vqf_902_9/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_9/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_9/0.0.0/ typstpackage_DATA = \ vqf_902_9.typ \ typst.toml diff --git a/contrib/typst/vqf_902_9_customer/Makefile.am b/contrib/typst/vqf_902_9_customer/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_9_customer/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_9_customer/0.0.0/ typstpackage_DATA = \ vqf_902_9_customer.typ \ typst.toml diff --git a/contrib/typst/vqf_902_9_officer/Makefile.am b/contrib/typst/vqf_902_9_officer/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = . -typstpackagedir = $(prefix)/.local/share/typst/packages/taler-exchange/vqf_902_9_officer/0.0.0/ +typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_9_officer/0.0.0/ typstpackage_DATA = \ vqf_902_9_officer.typ \ typst.toml diff --git a/debian/taler-exchange-typst.install b/debian/taler-exchange-typst.install @@ -1,4 +1,2 @@ -# The local Typst packages must actually be in the $HOME -# of the user, not in the PREFIX. Move them to the right -# location. -usr/.local/share/typst/packages/taler-exchange/* /var/lib/taler-exchange/.local/share/typst/packages/taler-exchange/ +# The local Typst packages +usr/share/taler-exchange/typst/ diff --git a/src/exchange/taler-exchange-httpd_aml-attributes-get.c b/src/exchange/taler-exchange-httpd_aml-attributes-get.c @@ -782,7 +782,8 @@ TEH_handler_aml_attributes_get ( ); } } - rctx->tc = TALER_MHD_typst (TEH_cfg, + rctx->tc = TALER_MHD_typst (TALER_EXCHANGE_project_data (), + TEH_cfg, false, "exchange", rctx->details.pdf.off, diff --git a/src/include/taler/taler_mhd_lib.h b/src/include/taler/taler_mhd_lib.h @@ -1235,6 +1235,7 @@ typedef void * file will be returned to @a cb and after @a cb returns all data * will be deleted from the local disk. * + * @param pd project data to use * @param cfg configuration to use (where to find Typst templates) * @param remove_on_exit should the directory be removed when done? * @param cfg_section_name name of the configuration section to use @@ -1246,6 +1247,7 @@ typedef void */ struct TALER_MHD_TypstContext * TALER_MHD_typst ( + const struct GNUNET_OS_ProjectData *pd, const struct GNUNET_CONFIGURATION_Handle *cfg, bool remove_on_exit, const char *cfg_section_name, diff --git a/src/mhd/mhd_typst.c b/src/mhd/mhd_typst.c @@ -58,6 +58,11 @@ struct TALER_MHD_TypstContext { /** + * Project data to use for Typst. + */ + const struct GNUNET_OS_ProjectData *pd; + + /** * Directory where we create temporary files (or FIFOs) for the IPC. */ char *tmpdir; @@ -552,6 +557,7 @@ setup_stage (struct TypstStage *stage, const char *template_path, const struct TALER_MHD_TypstDocument *doc) { + struct TALER_MHD_TypstContext *tc = stage->tc; char *input; bool is_dot_typ; @@ -686,6 +692,19 @@ setup_stage (struct TypstStage *stage, argv[3] = NULL; } stage->proc = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ERR); + { + char *datadir; + + datadir = GNUNET_OS_installation_get_path ( + tc->pd, + GNUNET_OS_IPK_DATADIR); + GNUNET_assert (GNUNET_OK == + GNUNET_process_set_options ( + stage->proc, + GNUNET_process_option_set_environment ("XDG_DATA_HOME", + datadir))); + GNUNET_free (datadir); + } if (GNUNET_OK != GNUNET_process_run_command_argv (stage->proc, "typst", @@ -699,7 +718,7 @@ setup_stage (struct TypstStage *stage, return false; } GNUNET_free (input); - stage->tc->active_stages++; + tc->active_stages++; stage->cwh = GNUNET_wait_child (stage->proc, &typst_done_cb, stage); @@ -711,6 +730,7 @@ setup_stage (struct TypstStage *stage, struct TALER_MHD_TypstContext * TALER_MHD_typst ( + const struct GNUNET_OS_ProjectData *pd, const struct GNUNET_CONFIGURATION_Handle *cfg, bool remove_on_exit, const char *cfg_section_name, @@ -755,6 +775,7 @@ TALER_MHD_typst ( return NULL; } tc = GNUNET_new (struct TALER_MHD_TypstContext); + tc->pd = pd; tc->tmpdir = GNUNET_strdup ("/tmp/taler-typst-XXXXXX"); tc->remove_on_exit = remove_on_exit; tc->cb = cb; diff --git a/src/mhd/test_typst.c b/src/mhd/test_typst.c @@ -109,7 +109,8 @@ run (void *cls, GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); - tc = TALER_MHD_typst (cfg, + tc = TALER_MHD_typst (TALER_EXCHANGE_project_data (), + cfg, keep_output ? true : false, "test-typst", 2, diff --git a/src/testing/test_exchange_api_twisted.c b/src/testing/test_exchange_api_twisted.c @@ -307,7 +307,7 @@ run (void *cls, * @param[in] process process to purge. */ static void -purge_process (struct GNUNET_OS_Process *process) +purge_process (struct GNUNET_Process *process) { GNUNET_break (GNUNET_OK == GNUNET_process_kill (process,