kych-dbconfig.1.rst (2306B)
1 kych-dbconfig(1) 2 ################ 3 4 .. only:: html 5 6 Name 7 ==== 8 9 **kych-dbconfig** - create the PostgreSQL database for KyCH 10 11 12 Synopsis 13 ======== 14 15 **kych-dbconfig** 16 [**-c** *CONFIG*] 17 [**-r**] 18 [**-s**] 19 [**-u** *USER*] 20 [**-h**] 21 22 23 Description 24 =========== 25 26 **kych-dbconfig** performs the one-time database setup for 27 kych-oauth2-gateway(1): it creates the PostgreSQL role the daemon 28 authenticates as, creates the database named by the ``DATABASE`` option of 29 kych.conf(5) with that role as its owner, and then runs kych-dbinit(1) to load 30 the schema. 31 32 It must be run as root, because it works through the ``postgres`` 33 administrative user, and the role it creates has the same name as the 34 operating-system user the daemon runs as -- which is what ``peer`` 35 authentication over the local socket expects, and why no password has to be 36 stored in the configuration. 37 38 The Debian package does not run this for you: a database is site state, not 39 something a package installation should create. Schema *upgrades* afterwards 40 are a different matter and do happen automatically; see kych-dbinit(1). 41 42 43 Options 44 ======= 45 46 **-c** *CONFIG* 47 Use the configuration file *CONFIG* instead of ``/etc/kych/kych.conf``. The 48 database name is read from it by kych-dbinit(1), so ``@inline@`` includes 49 and ``$``-expansion work as everywhere else. 50 51 **-r** 52 Reset: drop an existing database before creating it again. **This destroys 53 all sessions, clients and issued tokens** and is never needed for an 54 upgrade. 55 56 **-s** 57 Skip the schema initialisation, creating only the role and the database. 58 kych-dbinit(1) can then be run separately. 59 60 **-u** *USER* 61 The operating-system user the daemon runs as, and therefore the name of the 62 role to create. Defaults to ``kych``, which is the user the shipped 63 ``kych.service`` uses. 64 65 **-h** 66 Print short help. 67 68 69 Examples 70 ======== 71 72 Set up the database as the package expects it: 73 74 .. code-block:: shell 75 76 $ sudo kych-dbconfig 77 78 Start over from an empty schema, having stopped the service first: 79 80 .. code-block:: shell 81 82 $ sudo systemctl stop kych 83 $ sudo kych-dbconfig -r 84 85 86 See Also 87 ======== 88 89 kych-dbinit(1), kych-oauth2-gateway(1), kych-client-management(1), 90 kych.conf(5). 91 92 93 Bugs 94 ==== 95 96 Report bugs by using https://bugs.taler.net/ or by sending electronic 97 mail to <taler@gnu.org>.