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

Check config before starting MM #3450

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

KristjanESPERANTO
Copy link
Contributor

I think it might be a good idea to check the config at every start.

@khassel
Copy link
Collaborator

khassel commented May 14, 2024

We implemented the possibility to use a config.js.template instead of a config.js (where the config.js is created while startup).

At the moment the check fails if there is no config.js:

[2024-05-14 21:51:17.549] [ERROR] File not found: /opt/magic_mirror/config/config.js

So if we want this check the code must be changed that no error is thrown if no config.js exists but a config.js.template.
If we want to check config.js.template in such a case I don't now if the check can handle Variables ${XY} which can be present in config.js.template. There is also a env variable MM_CONFIG_FILE which is used to set another config file location. I don't know if the check respects this variable (it should).

Other point: Any idea why the test fails?

@bugsounet
Copy link
Contributor

bugsounet commented May 19, 2024

Why not hard coding this check in main core of MM² before loading config ?

in this case, it's +/- related to #3445

@sdetweil
Copy link
Collaborator

in general I am in favor of not starting if there is a fatal config error .

not like now where we start with a built in dummy config, unlike whatever the user expected.

@khassel
Copy link
Collaborator

khassel commented May 19, 2024

I agree with the idea, I just wanted to point out that the current approach doesn't fit all use cases...

Why not hard coding this check in main core of MM² before loading config ?

I think loadConfig in app.js must be executed before the check because in this function the config.js is created when using config.js.template.

@KristjanESPERANTO
Copy link
Contributor Author

I'd like to take a closer look, but it looks like I will not find the time soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants