12. Cyclos Adapter Setup Manual#
taler-cyclos is a Cyclos Taler adapter.
This manual targets system administrators who want to install and operate a Cyclos GNU Taler adapter
12.1. Installation#
12.1.1. Installing on Debian#
To install the GNU Taler Debian packages, first ensure that you have the right Debian distribution. At this time, the packages are built for Debian trixie.
You need to add a file to import the GNU Taler packages. Typically,
this is done by adding a file /etc/apt/sources.list.d/taler.list that
looks like this:
deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/debian trixie main
Next, you must import the Taler Systems SA public package signing key into your keyring and update the package lists:
# wget -O /etc/apt/keyrings/taler-systems.gpg \
https://taler.net/taler-systems.gpg
# apt update
Note
You may want to verify the correctness of the Taler Systems SA key out-of-band.
Now your system is ready to install the official GNU Taler binary packages using apt.
To install the adapter, you can now simply run:
# apt install taler-cyclos
12.1.2. Installing on Ubuntu#
To install the GNU Taler Ubuntu packages, first ensure that you have
the right Ubuntu distribution. At this time, the packages are built for
Ubuntu Lunar and Ubuntu Jammy. Make sure to have universe in your
/etc/apt/sources.list.d/ubuntu.sources (after main)
as we depend on some packages from Ubuntu universe.
A typical /etc/apt/sources.list.d/taler.list file for this setup
would look like this for Ubuntu Noble:
deb [signed-by=/etc/apt/keyrings/taler-systems.gpg] https://deb.taler.net/apt/ubuntu/ noble main
Next, you must import the Taler Systems SA public package signing key into your keyring and update the package lists:
# wget -O /etc/apt/keyrings/taler-systems.gpg \
https://taler.net/taler-systems.gpg
# apt update
Note
You may want to verify the correctness of the Taler Systems key out-of-band.
Now your system is ready to install the official GNU Taler binary packages using apt.
To install the adapter, you can now simply run:
# apt install taler-cyclos
12.1.3. Building from source#
Cyclos Adapter belongs to the Taler Rust project, and can be downloaded via Git:
$ git clone git://git.taler.net/taler-rust
$ cd taler-rust
You will need the latest version of the rust stable toolchain and a C toolchain:
$ sudo apt install rustup build-essential
$ rustup toolchain install stable
Then from top-level run:
$ ./bootstrap
To install the adapter as a Debian/Ubuntu package with an automated secure setup and systemd services:
$ sudo apt install debhelper
$ make deb
$ sudo dpkg -i ../taler-cyclos*.deb
If the previous steps succeeded, the taler-cyclos command should be found in the $PATH.
12.1.4. Services, users, groups and file system hierarchy#
The taler-cyclos package will create several system users to compartmentalize different parts of the system:
taler-cyclos-httpd: runs the HTTP daemon with the API logic.taler-cyclos-worker: runs the worker daemon interacting with the Cyclos API.postgres: runs the PostgreSQL database (from postgresql package).
The adapter setup uses the following system groups:
taler-cyclos-db: group for all adapter users with direct database access, specifically taler-cyclos-httpd and taler-cyclos-worker.
The package will deploy systemd service files in
/usr/lib/systemd/system/ for the various components:
taler-cyclos-httpd.service: adapter REST API.taler-cyclos-httpd.socket: systemd socket activation for the HTTP daemon.taler-cyclos-worker.service: worker deamon interacting with the Cyclos API.taler-cyclos.target: main target for the adapter to be operational.
The deployment creates the following key locations in the system:
/etc/taler-cyclos/: configuration files./run/taler-cyclos/: contains the UNIX domain sockets for inter-process communication (IPC).
12.2. Configuration Fundamentals#
This chapter provides fundamental details about the adapter configuration.
The configuration for all adapter components uses a single configuration file
as entry point: /etc/taler-cyclos/taler-cyclos.conf.
System defaults are automatically loaded from files in
/usr/share/taler-cyclos/config.d.
These default files should never be modified.
The default configuration taler-cyclos.conf configuration file
also includes all configuration files in /etc/taler-cyclos/conf.d.
The settings from files in
conf.d are only relevant to particular components of an adapter, while
taler-cyclos.conf contains settings that affect all adapter components.
The directory /etc/taler-cyclos/secrets contains configuration file snippets with
values that should only be readable to certain users. They are included with the @inline-secret@
directive and should end with .secret.conf.
To view the entire configuration annotated with the source of each configuration option, you
can use the taler-cyclos config helper:
# taler-cyclos config dump --diagnostics
12.2.1. Configuration format#
All GNU Taler components are designed to possibly share the same configuration files. When installing a GNU Taler component, the installation deploys default values in configuration files located at ${prefix}/share/taler/config.d/ where ${prefix} is the installation prefix. Different components must be installed to the same prefix.
In order to override these defaults, the user can write a custom configuration
file and either pass it to the component at execution time using the -c
option, or name it taler.conf and place it under $HOME/.config/ which is where
components will look by default. Note that the systemd service files pass -c
/etc/taler/taler.conf, thus making /etc/taler/taler.conf
the primary location for the configuration.
A config file is a text file containing sections, and each section contains maps options to their values. Configuration files follow basically the INI syntax:
[section1]
value1 = string
value2 = 23
[section2]
value21 = string
value22 = /path22
Comments start with a hash (#). Throughout the configuration, it is
possible to use $-substitution for options relating to names of files or
directories. It is also possible to provide defaults values for those
variables that are unset, by using the following syntax:
${VAR:-default}. There are two ways a user can set the value
of $-prefixable variables:
by defining them under a
[paths]section:[paths] TALER_DEPLOYMENT_SHARED = ${HOME}/shared-data .. [section-x] path-x = ${TALER_DEPLOYMENT_SHARED}/x
or by setting them in the environment:
$ export VAR=/x
The configuration loader will give precedence to variables set under
[path] over environment variables.
The utility taler-config, which gets installed along with the exchange,
can be used get and set configuration values without directly editing the
configuration file. The option -f is particularly useful to resolve
pathnames, when they use several levels of $-expanded variables. See
taler-config --help.
The repository git://git.taler.net/deployment contains example code
for generating configuration files under deployment/netzbon/.
12.3. Basic Setup#
12.3.1. Database setup#
The configuration file must include a connection string that tells the adapter how it should connect to the database. The default is:
[cyclosdb-postgres]
config = postgres:///taler-cyclos
If the database is run on a different host, please follow the instructions from the PostgreSQL manual for configuring remote access.
Assuming the configuration is correct, the following command initializes (or upgrades) the database schema using: You can then use a script to automate a secure database setup:
$ sudo taler-cyclos-dbconfig
12.3.2. Worker setup#
You will need a Cyclos account to sync. Update the configuration files:
[cyclos]
CURRENCY = KUDOS
ACCOUNT_ID = 7762070814178012479
NAME = John Smith S.A.
[cyclos-worker]
API_URL = https://demo.cyclos.org/api/
USERNAME = admin
PASSWORD = password
And finaly run the setup process:
$ sudo -u taler-cyclos-worker taler-cyclos -c /etc/taler-cyclos/taler-cyclos.conf setup
12.3.3. Wire Gateway setup#
Update the configuration files:
[cyclos-httpd-wire-gateway-api]
ENABLED = YES
[cyclos-httpd-wire-gateway-api
AUTH_METHOD = bearer
TOKEN = $SECRET_TOKEN
Check the server is correctly configured:
$ sudo -u taler-cyclos-httpd taler-cyclos -c /etc/taler-cyclos/taler-cyclos.conf serve --check
12.4. Deployment#
This chapter describes how to deploy the adapter once the basic installation and configuration are completed.
12.4.1. Reverse Proxy Setup#
By default, the taler-cyclos-httpd service listens for HTTP connections
on a UNIX domain socket. To make the service publicly available, a reverse
proxy such as nginx should be used. We strongly recommend to configure nginx
to use TLS.
The taler-cyclos package ships with a sample configuration that can be
enabled in nginx:
# vim /etc/nginx/sites-available/taler-cyclos
< ... customize configuration ... >
# ln -s /etc/nginx/sites-available/taler-cyclos /etc/nginx/sites-enabled/taler-cyclos
# systemctl reload nginx
With this last step, we are finally ready to launch the main adapter process.
12.4.2. Launching the adapter#
$ sudo systemctl start taler-cyclos.target