读取gpg加密的yaml文件
gypp的Python项目详细描述
gypp为访问gpg加密的yaml文件中的条目提供了方便的方法。
yaml文件的结构如下:
# Comments start with a "#" DESCRIPTION: | This is a human readable description of this file. RECIPIENTS: - list of - recipients of - the encrypted file some_key: user: name of account (required) password: the password or phrase (required) name: human readable name of entry (optional) note: | optional note. The pipe char indicates that line breaks will be preserved, but the preceding space on each line will not. other: Other properties may be added as needed. another_key: user: some user password: password with a quote " in it name: another test entry note: | Same old stuff
安装
pip install -U gypp
使用
列出可用条目:
$ gypp my_passwords.gpg Source: junk.txt Description: This is a human readable description of this file. Keys available: some_key : human readable name of entry (optional) another_key : another test entry
在命令行上显示特定条目:
$ gypp -s -k some_key my_passwords.gpg user : name of account (required) password : name : human readable name of entry (optional) note optional note. The pipe char indicates that line breaks will be preserved, but the preceding space on each line will not. other : Other properties may be added as needed.
在剪贴板上输入密码:
$ gypp -k some_key my_passwords.gpg
版本1.1中的新功能:gypp将从配置文件中读取源列表 默认情况下位于$HOME/.config/gypp/gypp.yaml。配置文件是一个yaml 文件结构如下:
sources: source_name_1: path/to/encrypted/file source_name_2: path/to/another/encryped/file
gypp然后可以使用sources下的键运行,以指定要读取的gpg文件。例如:
$ gypp source_name_2
开发
存储库:https://github.com/datadavev/gypp
开发安装:
$ git clone https://github.com/datadavev/gypp.git $ cd gypp $ pip install -U -e .
部署到pypi:
$ python setup.py sdist $ twine upload dist/*