OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

fix for "wrong environment variable value can be saved"

Open lampersky opened this issue 1 year ago • 4 comments

@rjpowers10 could you check if this will fix the issue #15275

I've aded a few variables:

image

Here it is my Default\appsettings.json, as you can see I have correct value.

image

lampersky avatar Feb 13 '24 19:02 lampersky

why do we need to write these variable to the settings file?

What if you want to change the default later?

MikeAlhayek avatar Feb 13 '24 19:02 MikeAlhayek

why do we need to write these variable to the settings file?

What if you want to change the default later?

Yes, that was part of my question in the original issue. Not only was the wrong value being saved, I'm not sure if it's correct for it to be saved at all. The value doesn't get saved unless the env var is present at the time of tenant creation, so it may just be an obscure bug. If I initialize the tenant first and then add the env var, the correct value is used (and it is not saved to the file).

rjpowers10 avatar Feb 13 '24 19:02 rjpowers10

Need to see why it gets written into our tenants appsettings.json files. Maybe there was a use case or it is simply the default behavior.

Skrypt avatar Feb 13 '24 19:02 Skrypt

I did not analyze why the environment variables are being saved, I assumed it was intentional, instead I focused on analyzing why the wrong value is being saved.

Converting to draft, as I need to work a bit more on this.

lampersky avatar Feb 14 '24 07:02 lampersky

Is this something you'd like to revisit any time soon @lampersky or should we close?

Piedone avatar Mar 24 '24 20:03 Piedone