26.31. kych-dbconfig(1)#
26.31.1. Name#
kych-dbconfig - create the PostgreSQL database for KyCH
26.31.2. Synopsis#
kych-dbconfig [-c CONFIG] [-r] [-s] [-u USER] [-h]
26.31.3. Description#
kych-dbconfig performs the one-time database setup for
kych-oauth2-gateway(1): it creates the PostgreSQL role the daemon
authenticates as, creates the database named by the DATABASE option of
kych.conf(5) with that role as its owner, and then runs kych-dbinit(1) to load
the schema.
It must be run as root, because it works through the postgres
administrative user, and the role it creates has the same name as the
operating-system user the daemon runs as – which is what peer
authentication over the local socket expects, and why no password has to be
stored in the configuration.
The Debian package does not run this for you: a database is site state, not something a package installation should create. Schema upgrades afterwards are a different matter and do happen automatically; see kych-dbinit(1).
26.31.4. Options#
- -c CONFIG
Use the configuration file CONFIG instead of
/etc/kych/kych.conf. The database name is read from it by kych-dbinit(1), so@inline@includes and$-expansion work as everywhere else.- -r
Reset: drop an existing database before creating it again. This destroys all sessions, clients and issued tokens and is never needed for an upgrade.
- -s
Skip the schema initialisation, creating only the role and the database. kych-dbinit(1) can then be run separately.
- -u USER
The operating-system user the daemon runs as, and therefore the name of the role to create. Defaults to
kych, which is the user the shippedkych.serviceuses.- -h
Print short help.
26.31.5. Examples#
Set up the database as the package expects it:
$ sudo kych-dbconfig
Start over from an empty schema, having stopped the service first:
$ sudo systemctl stop kych
$ sudo kych-dbconfig -r
26.31.6. See Also#
kych-dbinit(1), kych-oauth2-gateway(1), kych-client-management(1), kych.conf(5).
26.31.7. Bugs#
Report bugs by using https://bugs.taler.net/ or by sending electronic mail to <taler@gnu.org>.