cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
13.79k stars 1.55k forks source link

Email settings can't be changed #4260

Closed gcommit closed 11 months ago

gcommit commented 3 years ago

Hello,

when i setup a Cachet and enter my Mailserver data, after finishing the process, the data is reset to default like "localhost"

If i once again change the data in the settings section and press "Save" it is again reset to default.

What can i do?

Best regards

pavog commented 3 years ago

Hi, are you sure you're hitting save? I also have this reset problem, but only when I hit the Test button.

gcommit commented 3 years ago

I think i can read. The Button with "Save" on it, is the right one, yes?

Of course i am hitting the Save button....

pavog commented 3 years ago

I'm sorry if that sounded impolite. I didn't mean to offend you.

I just wasn't sure because I couldn't reproduce the problem. I only had the problem when I pressed the test button.

Now I have found the mistake on my side: After I entered the values and pressed save, I had to reload the page. Now I see the same result as you described.

It looks like the problem exists when you reload the page. After pressing the test button, the page is reloaded. That's why I only got the result when I pressed the save button.

I have already found out the following:

pavog commented 3 years ago

I have found out that it is a cache error. The configuration is in the cache, as is the configuration for the emails. Simply writing to the .env file is not enough. It must also be reloaded / the cache must be cleared.

I suggest something like:

// Clears the cached config like artisan config:clear does.
if (app()->configurationIsCached()) {
    $this->files->delete(app()->getCachedConfigPath());
}

After writing to the env file in the UpdateConfigCommandHandler.

Note: $this->files is \Illuminate\Filesystem\Filesystem

gcommit commented 3 years ago

Yes. When i write it to the .env file and restart Cachet, it is shown in the Admin Webinterface. But NEVER when i change something in the Admin Webinterface, it is written to the .env file

lnfel commented 2 years ago

I have found out that it is a cache error. The configuration is in the cache, as is the configuration for the emails. Simply writing to the .env file is not enough. It must also be reloaded / the cache must be cleared.

I suggest something like:

// Clears the cached config like artisan config:clear does.
if (app()->configurationIsCached()) {
    $this->files->delete(app()->getCachedConfigPath());
}

After writing to the env file in the UpdateConfigCommandHandler.

Note: $this->files is \Illuminate\Filesystem\Filesystem

Hi I also encountered the same issue using cachet-docker installation. Where should I put that fix you mentioned?

pavog commented 2 years ago

UpdateConfigCommandHandler

UpdateConfigCommandHandler.php

jbrooksuk commented 11 months ago

Thank you for your input on Cachet 2.x. We are shifting our attention and resources to Cachet 3.x and will no longer be supporting the 2.x version. If your feedback or issue is relevant to the 3.x series, we encourage you to engage with the new branch.

For more information on the Cachet rebuild and our plans for 3.x, you can read the announcement here.

We appreciate your understanding and look forward to your contributions to the new version.