Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment variable to change the default config file path ./config.toml #141

Merged
merged 1 commit into from
May 9, 2023
Merged

Add environment variable to change the default config file path ./config.toml #141

merged 1 commit into from
May 9, 2023

Conversation

josecelano
Copy link
Member

You can now overwrite the default config file path with:

TORRUST_IDX_BACK_CONFIG_PATH=./storage/config/config.toml cargo run

The default path is ./config.toml

@josecelano
Copy link
Member Author

josecelano commented May 8, 2023

Hi @da2ce7 @WarmBeer, I've just realised that we cannot update the settings when we use the environment variable instead of the config.toml file.

If we use the env var there is no file. The main problem is that the config env var was added as a read-only way to inject configuration.

From my point of view, we should move to the database or a different file the settings we want to allow the admin to change via the admin panel. If we want the admin to change everything then we have to make some changes because, for example, you cannot change the app port or IP without restarting the socket (gracefully).

For the time being, I would only allow changing these settings:

[website]
name = "Torrust"

[auth]
email_on_signup = "Optional"

[mail]
email_verification_enabled = false

And I would move them to a new table in the database (with default values).

If we do not want to make those changes now, I would totally disable the ability to update the settings from the control panel.

You can overwrite the default config file path with:

```
TORRUST_IDX_BACK_CONFIG_PATH=./storage/config/config.toml cargo run
```

The default path is `./config.toml`
@josecelano
Copy link
Member Author

ACK 655f631

@josecelano josecelano merged commit 44cde6a into torrust:develop May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Running E2E tests resets the config.toml file in the root dir to default values
1 participant