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

Validate configuration #9364

Open
3 tasks done
dokterbob opened this issue Oct 21, 2022 · 0 comments
Open
3 tasks done

Validate configuration #9364

dokterbob opened this issue Oct 21, 2022 · 0 comments
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/config Topic config

Comments

@dokterbob
Copy link
Contributor

Checklist

  • My issue is specific & actionable.
  • I am not suggesting a protocol enhancement.
  • I have searched on the issue tracker for my issue.

Description

It currently seems possible to feed ipfs config erroneous keys, which will be added to the configuration file. This can lead to unexpected behaviour in case of typos/configuration errors, e.g. in automated deployments.

What I would expect is that IPFS commands will fail with a (documented) non-zero exit status for invalid configuration keys and/or values.

Example

Correct key

% ipfs config --json -- Provider  '{"Strategy":"sdfsd"}' &&  ipfs config --json -- Provider; echo $?
{
  "Strategy": "sdfsd"
}
0

Incorrect key

% ipfs config --json -- Provider  '{"Strategies":"sdfsd"}' &&  ipfs config --json -- Provider; echo $?
{
  "Strategies": "sdfsd"
}
0

In addition, ipfs commands will not err and merely ignore invalid/additional configuration keys.

Possibly related: #8925, #8776, #8993

@dokterbob dokterbob added the kind/enhancement A net-new feature or improvement to an existing feature label Oct 21, 2022
@guseggert guseggert added topic/config Topic config exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up labels Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/config Topic config
Projects
None yet
Development

No branches or pull requests

2 participants