kuralabs / docker-akaunting

This repository holds the source of the all-in-one Akaunting Docker image available at:
https://hub.docker.com/r/kuralabs/docker-akaunting/
9 stars 14 forks source link

Mail configuration #1

Open denisdulici opened 6 years ago

denisdulici commented 6 years ago

Hello,

First of all, thanks for such a great contribution to Akaunting.

As you may know, there is an Email tab in the Settings > General page that allows to override the mail settings. Is there any reason you indicate to change the config/mail.php file?

Regards

carlos-jenkins commented 6 years ago

Hi,

Not any particular reason, but I'm unaware of where does the "Settings > General page" stores the configuration. In the database? In the .env file?

We were persisting the /config previously (still in master, but we are working in the persistence branch to try to identify a better persistence model after this happened to us, and a we identified that persisting /config is a bad idea in general.

We are trying then to persist the .env file only, but two things stop us:

  1. The life cycle of the .env file doesn't allow for easy persistence, as you cannot create the file empty in the host, as Akaunting will consider itself installed (and other places). So you cannot --volume to it directly, and persisting the directory it is in is not an option as it is the root for Akaunting. We haven't been able to fix this. We tried to change the above line with:

    if (File::exists(base_path('.env')) || File::size(base_path('.env')) > 0) {

    But it seems the problem is more complex than that.

  2. Since we are not persisting /config then we need a way to persist the configuration for the trustedproxy.php. 99% of our users will surely use this container behind a reserve proxy so it makes senses to provide them an easy, and persistent, way to configure this. For that we made this commit that allows to grab the proxy configuration from the .env file when we are able to persist it.

denisdulici commented 6 years ago

Settings are stored in the database and they override the config.