Open fdddf opened 1 year ago
@mtrezza do we even have port as config parameter inside that config file?
It seems that --port
is a CLI parameter. If it isn't supported in the config file, this would be feature request to add it. This is also a good indication that we should add a config options table to the README.
ok i'm on the way to adding port
as config file parameter.
Great! Before you make extensive changes about it in the README, you may want to take a look at https://github.com/parse-community/parse-dashboard/issues/2465.
I'm thinking of refactoring of the file. So I want to do something like if same parameter is passed from file as well as command line arg, the command line arg should take precedence instead of throwing error like "it should be either file or CLI oprion." And also add same options to .env as well.
Basically adding same options to CLI, env, and config file. And precedence order from low to high will be CLI < config file < env < default hardcoded value.
Example const host = options.host || configFile.host || process.env.HOST || '0.0.0.0';
What are ur thoughts @mtrezza
Here is my algorithm to do the same
steps to get values (every step is optional in a way that we don't required the input to that step like file or env or CLI options etc, as we are not concerned with the steps but the values)
It sounds good, just a note... if we change the precedence order it would be a breaking change; if there is a good reason (i.e. improvement) we can have a breaking change, otherwise we try to avoid it. If the dashboard currently just crashes / throws an error and stops init when a param is set via CLI and config and env var, then I'd not consider it a breaking change.
Maybe leave this open for discussion a few days, in case there is any additional input.
I mean we are just making it clear about preceding order. It is almost exactly as it is right now. Still, I'll run through edge case myself and report here.
Sure, it's probably unlikely that someone has the same param set in config as in CLI or env var; but if someone has it may break their deployment. So it would be interesting to know how it currently behaves in these cases.
Enviroment: parse-dashboard 5.0.0 / parse-server 6.0.0 The port in
--config dashboard.json
doesn't work, the only way to work is give a particular port with --port:dashboard.json
I am not sure port should be place into the root or apps in dashboard.json, but it doesn't works as I have tried both.
Originally posted by @fdddf in https://github.com/parse-community/parse-dashboard/issues/2113#issuecomment-1521438890