Ciphermail Community Virtual Appliance External Database Configuration

Hi all,

I have a problem with the Ciphermail Community Edition Virtual Appliance.

I was trying to follow the instructions to connect to a PostgreSQL database ( Setup — CipherMail Documentation ) but the configuration file we’re supposed to create:

sudo vi /etc/ciphermail/ansible/group_vars/all/database.yml

Is ignored, and the configuration after running the playbook command is always the default localhost MariaDB.

I’m stumped. At one point I tried using different variable names, because I found the template.

I tried:

---
ciphermail_database_config__database_type: 'custom'
ciphermail_database_config__connection_url: 'jdbc:postgresql://<database-host>:<database-port>/<database-name>?<database-options>'
ciphermail_database_config__driver_class: 'org.postgresql.Driver'
ciphermail_database_config__database_name: '<database-name>'
ciphermail_database_config__database_user: '<database-user>'
ciphermail_database_config__database_password: '<database-password>'

I also tried:

---
ciphermail_community__database_type: 'custom'
ciphermail_community__connection_url: 'jdbc:postgresql://<database-host>:<database-port>/<database-name>?<database-options>'
ciphermail_community__driver_class: 'org.postgresql.Driver'
ciphermail_community__database_name: '<database-name>'
ciphermail_community__database_user: '<database-user>'
ciphermail_community__database_password: '<database-password>'

But it didn’t work.

I’m not sure what I’m doing wrong, probably something obvious, and would appreciate any help.

Thank you in advance!

Just to add some more information, I tried appliance versions 6.2.5 and 6.3.2, with kvm.

Configuring the gateway using ansible is only supported by the pro/enterprise edition.

To configure an external database with the community edition, you need to create a config file /etc/ciphermail/spring.config.d/database/application.yml

For example for MariaDB:

---
ciphermail:
  hibernate:
    connection:
      driver_class: 'org.mariadb.jdbc.Driver'
      url: 'jdbc:mariadb://127.0.0.1:3306/ciphermail'
      username: 'dbuser'
      password: 'dbpassword'

See Vagrantfile · main · CipherMail B.V. / ciphermail-community-gateway · GitLab (look for alma9_install_ciphermail) for a full installation script (for a Vagrant box) with a database config file application.yml

1 Like

Thank you! Good to know that I’m not doing something wrong. By the way, is this mentioned in the documentation and I missed it?

See README.md · main · CipherMail B.V. / ciphermail-community-gateway · GitLab

1 Like