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 global cli.args file (configuration file) #252

Closed
matsduf opened this issue Mar 30, 2022 · 6 comments
Closed

Add global cli.args file (configuration file) #252

matsduf opened this issue Mar 30, 2022 · 6 comments
Labels
T-Feature Type: New feature in software or test case description
Milestone

Comments

@matsduf
Copy link
Contributor

matsduf commented Mar 30, 2022

Zonemaster-cli has the feature that allows the user to create a configuration file (~/.zonemaster/cli.args) with default command line options:

CONFIGURATION
       If there is a readable file .zonemaster/cli.args in the user's home directory, each line in that file will be
       prepended as an argument on the command line. For example, if one would like to by default run with the log level
       set to DEBUG and with translation to human-readable messages turned off, one could put this in the config file:

          --raw
          --level=DEBUG

       Any arguments actually given on the command line will override what's in the config file.

(from man zonemaster-cli)

Add the support for a global configuration file (/etc/zonemaster/cli.args ; /usr/local/etc/zonemaster/cli.args for FreeBSD) that works in the same way.

  • Any options in the private configuration file should overwrite options in the global configuration file.
  • Any options on the command line should also overwrite.

The new feature was requested in an email to the zonemaster-users list by @aabdnn.

@matsduf matsduf added the T-Feature Type: New feature in software or test case description label Mar 30, 2022
@matsduf matsduf added this to the v2022.1 milestone Mar 30, 2022
@mattias-p
Copy link
Member

The usefulness of this feature isn't obvious. (At least not to me.) Maybe you could document it here in terms of a user story or something?

@matsduf
Copy link
Contributor Author

matsduf commented Mar 30, 2022

@aabdnn, could you provide a description of your need for this feature as a comment to this issue?

@mattias-p
Copy link
Member

Oh. I wasn't aware of the discussion on the mailing list.

@anandb-ripencc
Copy link

My use case is that we have a Zonemaster server, used by multiple users to do checks. Some use the web gui, and some use the cli, but cli users are at a disadvantage, because they would all have to remember that we have a custom profile and use it.

I am aware of ~/.zonemaster/cli.args, which can be used to specify custom arguments for the cli. However, this is per-user. If this scheme were extended to instead (or additionally) read /etc/zonemaster/cli.ini (similar to how the backend reads backend_config.ini), then a custom profile can be defined there globally for all cli users.

@mattias-p
Copy link
Member

Thank you so much for explaining! I had no idea Zonemaster was being used like this.

@matsduf
Copy link
Contributor Author

matsduf commented May 11, 2022

Resolved by #260.

@matsduf matsduf closed this as completed May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Feature Type: New feature in software or test case description
Projects
None yet
Development

No branches or pull requests

3 participants