Login window: adding a button to run createdb, setup schema, etc

After putting the setup procedure in my blog post, it occurred to me that some of the commands could be embedded in a button on the login window.

This wouldn’t work for every case. For example, if the database is on a different machine and the DBA needs to manually grant access then this can’t be automated in the Tryton login process.

On the other hand, for cases where somebody runs Tryton and the database on the same host and if the user has sudo access, it may not be very hard to add a button to run the various commands:

sudo systemctl stop tryton-server && \
  sudo -u postgres createuser --createdb tryton && \
  sudo -u postgres createdb --encoding=UNICODE --owner=tryton tryton && \
  sudo -u tryton trytond-admin -v -c /etc/tryton/trytond.conf --all -d tryton && \
  sudo systemctl restart tryton-server

Has anybody already thought about a feature like this?

There was the functionality to manage databases from the client but we removed it we prefer to force to delegate the database administration task to the system administrator.

As you already realized, this tasks depends on a lot of the variables (also on the backend type) so it’s simplier to delegate it to the database administrator.

1 Like