2016-09-23 11:30:47 +02:00
tryton-server for openSUSE
==========================
2022-03-07 15:13:59 +01:00
Note for GNU Health 4.0 /Tryton 6.0 and above:
When installing GNU Health 4.0 or higher, note that dependency on postgresql-server is now 'Recommends'.
This helps keeping the installation lean when running Postgresql on a separate server.
If you are using --no-recommends for installation, you need to install postgresql-server additionally.
If you install with recommendations, postgresql-server is installed automatically.
2016-10-20 23:09:41 +02:00
How to get it running (Without reading the instructions)
========================================================
You have already installed the package trytond and found this documentation. Good.
2017-01-10 10:43:50 +01:00
2022-03-07 15:13:59 +01:00
An easy way to set-up a trton server is to use
sudo openSUSE-trytond-setup
Just answer the questions and the script does the steps, that are detailed below, for you.
Setup in detail:
2016-10-20 23:09:41 +02:00
1) Log in as root and start the database
2017-09-17 22:38:53 +02:00
> su
> systemctl start postgresql
2016-10-20 23:09:41 +02:00
2) Change postgres parameters. You need to log in as user postgres, in order to avoid authorisation issues. Assuming we have nano as editor:
<you are logged in as user 'root'>
2017-09-17 22:38:53 +02:00
> su postgres
> nano /var/lib/pgsql/data/pg_hba.conf
2017-07-05 23:56:19 +02:00
2016-10-20 23:09:41 +02:00
Change the line
local all all md5
to
local all all trust
Save your input.
2017-07-05 23:56:19 +02:00
Save your input.
2016-10-20 23:09:41 +02:00
3) Create a role for 'tryton' in the database (sill as user postgres)
2017-09-17 22:38:53 +02:00
> psql -c "CREATE USER tryton WITH CREATEDB;"
2016-10-20 23:09:41 +02:00
4) exit as user postgres and restart postgres
2017-09-17 22:38:53 +02:00
> exit
> systemctl restart postgresql
2016-10-20 23:09:41 +02:00
2017-09-17 22:38:53 +02:00
5) start trytond:
> systemctl start trytond
2017-01-10 10:43:50 +01:00
2017-09-17 22:38:53 +02:00
6) Install the tryton client:
> zypper in tryton
2016-10-20 23:09:41 +02:00
2017-09-17 22:38:53 +02:00
7) Open the tryton client:
>tryton
2016-10-20 23:09:41 +02:00
go to 'manage profiles' -> add -> name it 'localhost' -> Host: localhost
2017-07-05 23:56:19 +02:00
-> you should now see a selection of available databases
2016-10-20 23:09:41 +02:00
2017-09-17 22:38:53 +02:00
Note: From Tryton Release 4.2 onwards it is not possible anymore to create databases from the Frontend. You need to do this manually (see below)
2016-10-20 23:09:41 +02:00
2017-07-05 23:56:19 +02:00
DONE.
2016-10-20 23:09:41 +02:00
Setup (a bit more in detail)
============================
2016-09-23 11:30:47 +02:00
Preparing the database
----------------------
Tryton uses a Relational Database Management System (RDBMS) to store data. The
preferred RDBMS for Tryton is PostgreSQL.
2018-12-28 15:30:20 +01:00
You have to setup this database manually. Here is a short explanation how to
achieve this.
2016-09-23 11:30:47 +02:00
2018-12-28 15:30:20 +01:00
We can distinguish two scenarios, to which the following description will reference:
1) the database is created manually (recommended for productive environments)
2) the database shall be created from the Tryton client (recommended for test)
* In both cases, make sure PostgreSQL is running:
2016-09-23 11:30:47 +02:00
2017-09-17 22:38:53 +02:00
> systemctl status postgresql
2016-09-23 11:30:47 +02:00
Note: If PostgreSQL runs on another machine than the Tryton server, make sure
you have setup database password authentication. Please refer to the
2017-07-05 23:56:19 +02:00
PostgreSQL manual how to do this.
2016-09-23 11:30:47 +02:00
2017-07-05 23:56:19 +02:00
To allow Tryton Server to connect to postgres, md5 authentication should be used.
In the configuration file /var/lib/pgsql/data/pg_hba.conf change the lines
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
to:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
2016-09-23 11:30:47 +02:00
2017-07-05 23:56:19 +02:00
Restart the server for the changes to take effect.
2016-09-23 11:30:47 +02:00
* Creating the database user:
The Tryton Server runs as user 'tryton', so we need a role in postgres for this.
2017-09-17 22:38:53 +02:00
For manual database creation (standard as from Tryton 4.2 onwards) it is sufficient to create the user as follows:
2016-09-23 11:30:47 +02:00
2017-09-17 22:38:53 +02:00
> su postgres
> psql -c "CREATE USER tryton WITH CREATEDB;"
2016-09-23 11:30:47 +02:00
Note: If you want to run the database as another user than 'tryton', you
need to replace 'tryton' above with the user you want to use instead.
Preparing the Tryton server
---------------------------
* Setting up the Tryton server (trytond):
2022-03-07 15:13:59 +01:00
The openSUSE package comes with a working configuration, see
/etc/tryton/trytond.conf
2016-09-23 11:30:47 +02:00
It contains all settings for a locally running database and manual database
configuration.
2017-09-17 22:38:53 +02:00
Adjust /etc/tryton/trytond.conf to reflect any different the setup of your system.
2016-09-23 11:30:47 +02:00
* If the Tryton server shall listen on some external interface (i.e. shall be
available for clients connecting from other machines), change the jsonrpc
protocol to listen accordingly.
* If the Tryton server is listening on external interfaces, it is highly
recommended to enable SSL for the connection.
2017-07-05 23:56:19 +02:00
Note: See https://code.google.com/p/tryton/wiki/InstallationonopenSUSE#Setting_up_SSL_communication_with_the_Tryton_server
2016-09-23 11:30:47 +02:00
for a description to set up certificates
* Restarting trytond:
2017-09-17 22:38:53 +02:00
> systemctl restart trytond
2016-09-23 11:30:47 +02:00
Note: The fingerprint of connected servers is stored in the clients
known_hosts file. When a server is changed for its SSL usage, the client
will refuse to reconnect to this server. Removing the according line
from ~/.config/tryton/<version>/known_hosts will allow to connect to
the server again.
Now you are ready to connect with a client, e.g. tryton-client.
Creating the database for Tryton
--------------------------------
2018-12-28 15:30:20 +01:00
For manual creation of the database, the folowing steps are to be performed:
2016-09-23 11:30:47 +02:00
* Creating the database:
2017-09-17 22:38:53 +02:00
> su - postgres -c "createdb mydb --encoding='UTF-8' --owner=tryton"
2016-09-23 11:30:47 +02:00
Note: The owner of the database should be the same user, as under which the
tryton server runs (default:tryton) Enter a name for the database
(here as default: mydb).
* Initializing the database:
2017-07-05 23:56:19 +02:00
Log in as user tryton:
2016-09-23 11:30:47 +02:00
2017-09-17 22:38:53 +02:00
> sudo su tryton -s /bin/bash
> /usr/bin/trytond-admin -c /etc/tryton/trytond.conf --all -d mydb
2016-09-23 11:30:47 +02:00
Note: Use the database name you chose in the previous step (here as default:
2018-12-28 15:30:20 +01:00
mydb). You will be asked for the admin password for this database. For the first time, log in to the newly initialized database with user admin and password as set during initialization.
2016-09-23 11:30:47 +02:00
As result you will have a bare Tryton database with the base modules installed.
2022-09-08 18:08:31 +02:00
See: https://docs.tryton.org/projects/server/en/latest/topics/configuration.html#topics-configuration
2016-09-23 11:30:47 +02:00
Installation of the Webfrontend for tryton (sao) from source
------------------------------------------------------------
In case you want to install sao from source:
sao bases on nodejs, and it comes as separate package. Download and extract
tryton-sao into a directory, say /srv/tryton-sao
Make sure you have nodejs and git installed:
2018-12-28 15:30:20 +01:00
> zypper install nodejs git
2016-09-23 11:30:47 +02:00
Now change into to installation directory and install sao:
2017-09-17 22:38:53 +02:00
> cd /srv/tryton-sao/package
> npm install
2016-09-23 11:30:47 +02:00
Now you need to run grunt. make sure it is run from the locally installed version:
2017-09-17 22:38:53 +02:00
> cd /srv/tryton-sao/package
> node_modules/grunt-cli/bin/grunt
2016-09-23 11:30:47 +02:00
Last but not least, edit /etc/tryton/trytond.conf
2017-07-05 23:56:19 +02:00
In the section [web], set the path:
2017-08-18 15:06:00 +02:00
root = /srv/tryton-sao/package
2016-09-23 11:30:47 +02:00
2019-12-15 12:39:42 +01:00
Now restart trytond (or gnuhealth).
2016-09-23 11:30:47 +02:00
Upgrade
-------
* Once you have upgraded to a new major version (second number of the
version string) you have to update your database(s).
After the categorically recommended backup do:
2017-09-17 22:38:53 +02:00
> /usr/bin/trytond-admin -c /etc/tryton/trytond.conf --all -d mydb
2016-09-23 11:30:47 +02:00
Remember to replace tryton with the name of your database.
Notes
-----
Now, you're finished with the system setup. Please be aware of the following things:
* trytond runs by default under the user 'tryton', who is setup as no-login.
If you need to login as user tryton, use su - tryton -s /bin/bash
* trytond has one default account for server administration:
- User: admin; password: the one you have configured in trytond.conf
as super_pwd. This user is the one used for database management tasks
from the client.
Note: Each Tryton database will have its own admin with login password
stored in the database itself (not to be confound with the admin of the
Tryton Server).
* trytond must have read access to its configuration file, otherwise it will
start with internal defaults. The postinst script will (re)set ownership to
the system user running trytond and correct the permissions on the standard
configuration file (/etc/tryton/trytond.conf).
* trytond listens by default on port 8000 (jsonrpc). If you need to change
this, edit /etc/tryton/trytond.conf in the section [jsonrpc].
* trytond in its upstream configuration listens by default to the localhost
interface. If you want to change this default to listen on all interfaces,
edit /etc/tryton/trytond.conf in the section [jsonrpc].
* modules can be installed via YaST or zypper, e.g. zypper in trytond_account
* Installation of modules into the database can be done from the
Administration Panel of the client. Under Modules you can select from the
modules packages (trytond_*) you have installed on your system.
* Only the same major version of Tryton client and Tryton server can connect.
2022-03-07 15:13:59 +01:00
-- Axel Braun <DocB@opensuse.org> Wed Aug 4 14:27:11 UTC 2021
2018-06-11 11:26:25 +02:00
2018-06-11 11:29:12 +02:00
This file is based on tryton-server.README.Debian
2018-06-11 11:26:25 +02:00
Copyright: 2009-2012 Daniel Baumann <daniel@debian.org>
2018-12-28 15:30:20 +01:00
2011-2014 Mathias Behrle <mathiasb@m9s.biz>