mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
Create new password if journal already encrypted.
This commit is contained in:
parent
da951d41a8
commit
8ea9b58473
1 changed files with 8 additions and 2 deletions
|
@ -17,6 +17,7 @@ from jrnl.exception import JrnlException
|
||||||
from jrnl.messages import Message
|
from jrnl.messages import Message
|
||||||
from jrnl.messages import MsgText
|
from jrnl.messages import MsgText
|
||||||
from jrnl.messages import MsgType
|
from jrnl.messages import MsgType
|
||||||
|
from jrnl.prompt import create_password
|
||||||
|
|
||||||
|
|
||||||
def preconfig_diagnostic(_):
|
def preconfig_diagnostic(_):
|
||||||
|
@ -84,9 +85,14 @@ def postconfig_encrypt(args, config, original_config, **kwargs):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
journal.config["encrypt"] = True
|
|
||||||
|
|
||||||
new_journal = EncryptedJournal.from_journal(journal)
|
new_journal = EncryptedJournal.from_journal(journal)
|
||||||
|
|
||||||
|
# If journal is encrypted, create new password
|
||||||
|
if journal.config["encrypt"] is True:
|
||||||
|
print(f"Journal {journal.name} is already encrypted. Create a new password.")
|
||||||
|
new_journal.password = create_password(new_journal.name)
|
||||||
|
|
||||||
|
journal.config["encrypt"] = True
|
||||||
new_journal.write(args.filename)
|
new_journal.write(args.filename)
|
||||||
|
|
||||||
print(
|
print(
|
||||||
|
|
Loading…
Add table
Reference in a new issue