taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | README | LICENSE

README.md (4664B)


      1 # Taler merchant demos
      2 
      3 This repository contains the GNU Taler landing page, essay shop, and donation
      4 demo. It is implemented as one self-contained Go executable with no
      5 third-party Go dependencies. Templates, translations, styles, and essay
      6 content are embedded in the executable.
      7 
      8 ## Build and test
      9 
     10 Go 1.22 or newer is required.
     11 
     12 GNU gettext is also required for the translation maintenance and validation
     13 targets.
     14 
     15 Select an installation prefix with the GNU-style configuration entry point:
     16 
     17 ```console
     18 $ ./configure --prefix=/usr/local
     19 ```
     20 
     21 The default prefix is `/usr/local`.
     22 
     23 ```console
     24 $ make
     25 $ make check
     26 ```
     27 
     28 ## Translation maintenance
     29 
     30 The user interface is available in English, German, French, Italian,
     31 Portuguese, Spanish, Russian, Turkish, and Ukrainian. Run the extractor after
     32 changing user-facing strings in the Go handlers or templates:
     33 
     34 ```console
     35 $ make update-i18n
     36 ```
     37 
     38 This regenerates `messages.pot`, merges it into each retained PO file, and
     39 removes obsolete entries. `make check` verifies that the POT is current, that
     40 all PO files pass gettext validation, and that placeholders and HTML tags are
     41 preserved by every translation.
     42 
     43 The executable is written to `build/taler-merchant-demos`. Install it below
     44 the configured prefix with:
     45 
     46 ```console
     47 $ make install
     48 ```
     49 
     50 `DESTDIR` is honored for staged installations. The prefix can also be
     51 overridden directly with `make prefix=...` without running `configure`.
     52 
     53 ## Configuration
     54 
     55 The server reads the same GNUnet-style configuration used by other Taler
     56 components. Section and option names are case-insensitive. `@INLINE@`
     57 directives and `$VAR`, `${VAR}`, and `${VAR:-fallback}` filename expansions are
     58 supported.
     59 
     60 Pass a configuration explicitly with `-c`. Without it, the server uses the
     61 first existing file from `$XDG_CONFIG_HOME/taler-merchant-demos.conf` (or
     62 `~/.config/taler-merchant-demos.conf` when `XDG_CONFIG_HOME` is unset),
     63 `/etc/taler-merchant-demos.conf`, and
     64 `/etc/taler-merchant-demos/taler-merchant-demos.conf`. It proceeds with only
     65 defaults when none of these files exists.
     66 
     67 Defaults are loaded first, in filename order, from
     68 `$TALER_MERCHANT_DEMOS_BASE_CONFIG`. Without that override, the defaults are
     69 read from `share/taler-merchant-demos/config.d` below the installation prefix,
     70 which can be overridden with `$TALER_MERCHANT_DEMOS_PREFIX`. Inline files are
     71 loaded at the point where their `@INLINE@` directive occurs, and the main
     72 configuration is loaded last.
     73 
     74 A configuration containing all three demos looks like this:
     75 
     76 ```ini
     77 [taler]
     78 currency = KUDOS
     79 
     80 [frontend-demo]
     81 landing_url = https://demo.taler.net/
     82 bank_url = https://bank.demo.taler.net/
     83 blog_url = https://shop.demo.taler.net/
     84 donations_url = https://donations.demo.taler.net/
     85 
     86 [frontend-demo-landing]
     87 http_serve = tcp
     88 http_port = 8080
     89 
     90 [frontend-demo-blog]
     91 http_serve = tcp
     92 http_port = 8081
     93 backend_url = https://backend.demo.taler.net/instances/blog/
     94 backend_apikey = secret-token:secret
     95 enable_tokens = no
     96 
     97 [frontend-demo-donations]
     98 http_serve = tcp
     99 http_port = 8082
    100 backend_url_gnunet = https://backend.demo.taler.net/instances/gnunet/
    101 backend_apikey_gnunet = secret-token:secret
    102 backend_url_taler = https://backend.demo.taler.net/instances/taler/
    103 backend_apikey_taler = secret-token:secret
    104 backend_url_tor = https://backend.demo.taler.net/instances/tor/
    105 backend_apikey_tor = secret-token:secret
    106 # A non-empty legacy value enables tax-receipt output. The Merchant backend's
    107 # configured donation authorities determine which authority URLs are offered.
    108 donau_url =
    109 ```
    110 
    111 Each section can instead listen on a Unix socket:
    112 
    113 ```ini
    114 [frontend-demo-blog]
    115 http_serve = unix
    116 http_unixpath = /run/taler-merchant-demos/blog.sock
    117 http_unixpath_mode = 660
    118 ```
    119 
    120 The command-line `--http-port` option overrides the configured listener and
    121 forces TCP mode.
    122 
    123 Inspect the effective configuration, including defaults and inline files. The
    124 commented header lists files in load order, and every setting is annotated
    125 with its source location:
    126 
    127 ```console
    128 $ taler-merchant-demos config dump -c /etc/taler-merchant-demos/taler-merchant-demos.conf
    129 ```
    130 
    131 ## Run
    132 
    133 Choose exactly one demo per process:
    134 
    135 ```console
    136 $ taler-merchant-demos -c /etc/taler-merchant-demos/taler-merchant-demos.conf landing
    137 $ taler-merchant-demos -c /etc/taler-merchant-demos/taler-merchant-demos.conf blog
    138 $ taler-merchant-demos -c /etc/taler-merchant-demos/taler-merchant-demos.conf donations
    139 ```
    140 
    141 When deployed behind a reverse proxy, `X-Forwarded-Host`,
    142 `X-Forwarded-Proto`, and `X-Forwarded-Prefix` are used for public fulfillment
    143 URLs and generated links. These headers should be removed from untrusted
    144 client requests and set by the trusted proxy.