Yacht Management Software (YMS) Installation

1. Install requirements

1.1 Generic
- MariaDB
- Python 3
  - python3-bcrypt
  - python3-mysqldb
- optional 
  - gettext
  - mupdf-tools for extended pdf file management

1.2 Native GUI
- Python GTK3
  - python3-gi
  - gir1.2-gtk-3.0

1.3 Web GUI
- Webserver
- PHP
  - php-mysql
  - php-xml

2. Create database

Create a database for YMS on your server, as well as a MariaDB user who has
the privileges for accessing and modifying it.

  CREATE DATABASE yms;

Create system user for native gui.

  CREATE USER 'ymssys'@'localhost' IDENTIFIED BY '********';
  GRANT SELECT, INSERT, UPDATE, DELETE ON yms.* TO 'ymssys'@'localhost';

Create database-user for web application with minimum necessary rights.

  CREATE USER 'ymsweb'@'localhost' IDENTIFIED BY '********';
  GRANT SELECT, INSERT, UPDATE, DELETE ON yms.* TO 'ymsweb'@'localhost';

3. Run database import

Import the mariadb.sql file into your database, which will create the tables.

  mariadb yms < mariadb.sql

According to your desired language import minimal required dataset into your
new database. For german use

   mariadb yms < minimal.sql

or alternatively for english language

   mariadb yms < minimal_en.sql

Optional import some sample data

  mariadb yms < mariadb_sample.sql

4. Initialize document storage
Customize path and access rights to your needs

  mkdir /var/local/yms
  mkdir /var/local/yms/thumb
  chown -R www-data /var/local/yms
  chmod -R 750 /var/local/yms

5. Install webgui

5.1 Upload webgui files

Upload all files and directories (except the install directory) to your
webserver.
Disallow access to include files (.inc). There is an example _htaccess
file.

5.2. Create and edit webgui config file

Rename sample configfile config.inc-sample:

  mv config.inc-sample config.inc

Open config.inc in a text editor and fill in your database details.

5.3. Check file access rights for security

Configfile should be readable by webserver but not writeable.

  chmod 640 config.inc
  chgrp www-data config.inc

6. Setup local GUI

Create a local database user with same name as your computer user and allow
database acces with current unix credentials:
   mysql> CREATE USER 'ymsgui'@'localhost' IDENTIFIED VIA unix_socket;

Start ymsgui.py, default configuration file is automatically created

7. Start using YMS

Use webgui:
Start your browser and login to YMS with the default username/password:
captain/captain

Use local client:
Start ymsgui.py
