Skip to content

New prompts and configuration options, plus additional security measures

Compare
Choose a tag to compare
@sepulworld sepulworld released this 19 Jul 02:39
· 66 commits to master since this release

Thank you @msabramo for this contribution!

This allows not keeping usernames/passwords in the config file.

E.g.: In /etc/aptly-cli.conf:


:proto: http
:server: 10.3.0.46
:port: 8082
:debug: false
:username: ${PROMPT}
:password: ${PROMPT_PASSWORD}

The tool will prompt for the specified values, where ${PROMPT} results in a regular prompt and ${PROMPT_PASSWORD} results in a password prompt where the input is replaced by asterisks -- e.g.:

$ aptly-cli version
Enter a value for username:
zane
Enter a value for password:


{"Version"=>"0.9.7"}

This also eliminates a bunch of duplicated code in all of the command classes by having them inherit from a common base class. This was actually essential because otherwise, every required file would trigger a config load and thus prompting for any needed values over and over again.

The --config (-c) option allows specifying an alternative config file -- e.g.:

$ aptly-cli -c ~/.config/aptly-cli/aptly-cli.conf repo_list
and the --server, --username, and --password options allow specifying those things on the command-line and not even requiring a config file:

$ aptly-cli --server 10.3.0.46 --username marca --password '${PROMPT_PASSWORD}' repo_list
Note that you can use ${PROMPT} and ${PROMPT_PASSWORD} in the values of these options, just as you can in a config file.