26.58. swiyu-verifier-dbconfig(1)#
26.58.1. Name#
swiyu-verifier-dbconfig - create the PostgreSQL database for the SWIYU verifier
26.58.2. Synopsis#
swiyu-verifier-dbconfig [-c FILENAME] [-n DBNAME] [-u DBUSER] [-d FILENAME] [-r] [-h]
26.58.3. Description#
swiyu-verifier-dbconfig performs the one-time database setup for
swiyu-verifier(1): it creates the PostgreSQL role the service connects as with
a freshly generated password, creates the database with that role as its owner,
and writes the password to /etc/swiyu-verifier/secrets/db.env, mode 0640
and owned by root:swiyu-verifier, which is where swiyu-verifier.service
reads it from.
It must be run as root, because it works through the postgres
administrative user.
Unlike kych-dbconfig(1) this does not create a schema: the verifier runs its own Flyway migrations on every start, so the database it is handed only has to exist and be owned by its role. For the same reason there is nothing to do after an upgrade of the package.
A password is needed – rather than peer authentication over the local
socket, as KyCH uses – because the connection is made by the PostgreSQL JDBC
driver, which cannot authenticate that way.
Running the script again generates a new password and sets it on the existing role, which is how a password is rotated; restart the service afterwards.
Where the database goes is read from the service’s own configuration rather
than assumed: POSTGRES_JDBC in /etc/swiyu-verifier/swiyu-verifier.env
supplies the host, the port and the database name, and POSTGRES_USER the
role. On a host whose PostgreSQL is not on port 5432 that is the difference
between setting up the database the service will use and setting one up
somewhere else.
26.58.4. Options#
- -c FILENAME
Read the connection from FILENAME instead of
/etc/swiyu-verifier/swiyu-verifier.env.- -n DBNAME
The database to create, overriding the name in
POSTGRES_JDBC.- -u DBUSER
The role to create, overriding
POSTGRES_USER.- -d FILENAME
Write the generated password to FILENAME instead of
/etc/swiyu-verifier/secrets/db.env.- -r
Reset: drop an existing database before creating it again. This destroys every verification in it and is never needed for an upgrade.
- -h
Print short help.
26.58.5. Examples#
Set up the database as the package expects it:
$ sudo swiyu-verifier-dbconfig
$ sudo systemctl restart swiyu-verifier
Rotate the database password:
$ sudo swiyu-verifier-dbconfig
$ sudo systemctl restart swiyu-verifier
26.58.6. See Also#
swiyu-verifier(1), kych-dbconfig(1), kych-oauth2-gateway(1).
26.58.7. Bugs#
Report bugs by using https://bugs.taler.net/ or by sending electronic mail to <taler@gnu.org>.