mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
Work on cryptography
This commit is contained in:
parent
e75e3d73a0
commit
a1b5a4099e
11 changed files with 69 additions and 17 deletions
13
features/data/configs/encrypted_old.json
Normal file
13
features/data/configs/encrypted_old.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"default_hour": 9,
|
||||
"default_minute": 0,
|
||||
"editor": "",
|
||||
"encrypt": true,
|
||||
"highlight": true,
|
||||
"journals": {
|
||||
"default": "features/journals/encrypted_jrnl-1-9-5.journal"
|
||||
},
|
||||
"linewrap": 80,
|
||||
"tagsymbols": "@",
|
||||
"timeformat": "%Y-%m-%d %H:%M"
|
||||
}
|
|
@ -4,8 +4,7 @@ editor: ''
|
|||
encrypt: true
|
||||
highlight: true
|
||||
journals:
|
||||
default: features/journals/encrypted.journal
|
||||
default: features/journals/encrypted_jrnl1-9-5.journal
|
||||
linewrap: 80
|
||||
password: bad doggie no biscuit
|
||||
tagsymbols: '@'
|
||||
timeformat: '%Y-%m-%d %H:%M'
|
Binary file not shown.
|
@ -1,11 +1,16 @@
|
|||
Feature: Encrypted journals
|
||||
|
||||
Scenario: Loading an encrypted journal
|
||||
Given we use the config "encrypted.yaml"
|
||||
When we run "jrnl -n 1" and enter "bad doggie no biscuit"
|
||||
Then we should see the message "Password"
|
||||
and the output should contain "2013-06-10 15:40 Life is good"
|
||||
|
||||
Scenario: Upgrading a journal encrypted with jrnl 1.x
|
||||
Given we use the config "encrypted_old.json"
|
||||
When we run "jrnl -n 1" and enter "Y"
|
||||
Then we should see the message "Password"
|
||||
and the output should contain "2013-06-10 15:40 Life is good"
|
||||
|
||||
Scenario: Decrypting a journal
|
||||
Given we use the config "encrypted.yaml"
|
||||
When we run "jrnl --decrypt" and enter "bad doggie no biscuit"
|
||||
|
|
|
@ -50,9 +50,10 @@ def open_journal(journal_name="default"):
|
|||
def set_config(context, config_file):
|
||||
full_path = os.path.join("features/configs", config_file)
|
||||
install.CONFIG_FILE_PATH = os.path.abspath(full_path)
|
||||
# Add jrnl version to file
|
||||
with open(install.CONFIG_FILE_PATH, 'a') as cf:
|
||||
cf.write("version: {}".format(__version__))
|
||||
if config_file.endswith("yaml"):
|
||||
# Add jrnl version to file for 2.x journals
|
||||
with open(install.CONFIG_FILE_PATH, 'a') as cf:
|
||||
cf.write("version: {}".format(__version__))
|
||||
|
||||
|
||||
@when('we run "{command}" and enter')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue