Skip to content

Commit

Permalink
Merge pull request #3 from codewhitesec/develop
Browse files Browse the repository at this point in the history
v1.1.0 Release
  • Loading branch information
cwdel authored Jun 1, 2023
2 parents 5c385d1 + 2bec46c commit 8df38dd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## v1.1.0 - May 31, 2023

### Added

* Add support for using [multiple databases](https://github.com/codewhitesec/qubes-keepass/pull/2) at once
* Add [icon support](https://github.com/codewhitesec/qubes-keepass#configuration)


## v1.0.0 - Jan 07, 2023

**Initial Release** :tada:
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ which integrates nicely with the isolation and security features of [Qubes OS](h
to easily copy credentials to the currently focused Qube, to define allow lists for credentials based on Qube names and to
automatically clear the Qubes clipboard after a configurable amount of time.

![qubes-keepass](https://user-images.githubusercontent.com/49147108/206440037-cf2108f8-8033-4574-bdbe-88f7943c1457.png)
![qubes-keepass-example](https://github.com/codewhitesec/qubes-keepass/assets/49147108/9512901f-93f7-4bc4-bd20-951a45000171)


*qubes-keepass* is inspired by [rofi-pass](https://github.com/carnager/rofi-pass) which provides a rofi based frontend
for the password manager [pass](https://www.passwordstore.org/).
Expand Down Expand Up @@ -159,6 +160,8 @@ trust = 4
* `qubes` - specifies an allow list of qubes for the credential. The credential can only be copied into the specified qubes
* `trust` - specifies the minimum trust level that a qube needs to be able to receive this credential
* `meta` - specifies a list of qubes that are only allowed to obtain meta information of the credential (username, url)
* `icon` - specifies the icon for the credential. Can be a default icon name (e.g. `firefox`) or a file system path. To display
icons within *rofi*, you also need to add the `-show-icons` *rofi-option* in your `qubes-keepass.ini` file


#### Global Options
Expand Down
31 changes: 23 additions & 8 deletions qubes-keepass.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,9 @@ def __init__(self, item: Secret.Item, service: Secret.Service) -> None:

self.meta = parse_qube_list(settings.get('meta'))
self.qubes = parse_qube_list(settings.get('qubes'))
self.trust = settings.get('trust', None)
self.trust = settings.get('trust')
self.timeout = int(settings.get('timeout', Config.get('timeout')))
self.icon = settings.get('icon')

if self.trust is not None:
self.trust = int(self.trust)
Expand Down Expand Up @@ -753,13 +754,22 @@ def __str__(self) -> str:

for credential in self.credentials:

line = ''
folder = credential.path.parent.name or 'Root'

formatted += lcut(credential.title, Config.getint('title_length'))
formatted += lcut(folder, Config.getint('folder_length'))
formatted += lcut(credential.username, Config.getint('username_length'))
formatted += lcut(credential.url, Config.getint('url_length'))
formatted += '\n'
line += lcut(credential.title, Config.getint('title_length'))
line += lcut(folder, Config.getint('folder_length'))
line += lcut(credential.username, Config.getint('username_length'))
line += lcut(credential.url, Config.getint('url_length'))

if '-show-icons' in Config.get_rofi_options():

if credential.icon is not None:
line += f'\x00icon\x1f{credential.icon}'

line = ' ' + line

formatted += line + '\n'

return formatted

Expand All @@ -775,8 +785,13 @@ def display_rofi(self, qube: str = 'Qube') -> (int, Credential):
Returns:
Credential item selected by the user and exit code
'''
title_length = Config.getint('title_length')

if '-show-icons' in Config.get_rofi_options():
title_length += 3

rofi_mesg = f'Selected credential is copied to <b>{qube}</b>\n\n'
rofi_mesg += lcut('Title', Config.getint('title_length'))
rofi_mesg += lcut('Title', title_length)
rofi_mesg += lcut('Folder', Config.getint('folder_length'))
rofi_mesg += lcut('Username', Config.getint('username_length'))
rofi_mesg += lcut('URL', Config.getint('url_length'))
Expand Down Expand Up @@ -823,7 +838,7 @@ def load(service: Secret.Service) -> CredentialCollection:
return CredentialCollection(credentials)


parser = argparse.ArgumentParser(description='''qubes-keepass v1.0.0 - A rofi based KeePassXC frontend for Qubes''')
parser = argparse.ArgumentParser(description='''qubes-keepass v1.1.0 - A rofi based KeePassXC frontend for Qubes''')
parser.add_argument('qube', help='qube to copy the credential to')
parser.add_argument('--trust-level', type=int, help='numerical trust level of the qube')
parser.add_argument('--config', help='path to the configuration file')
Expand Down

0 comments on commit 8df38dd

Please sign in to comment.