Use encryption

This commit is contained in:
shamoon 2024-10-25 15:24:00 -07:00
parent 71b7c4f23d
commit 0a5066ebce
No known key found for this signature in database
3 changed files with 23 additions and 9 deletions

View File

@ -569,11 +569,13 @@ class Command(CryptMixin, BaseCommand):
value=manifest_record["fields"][field], value=manifest_record["fields"][field],
) )
elif MailAccount.objects.count() > 0: elif (
MailAccount.objects.count() > 0
or SocialToken.objects.count() > 0
or Token.objects.count() > 0
):
self.stdout.write( self.stdout.write(
self.style.NOTICE( self.style.NOTICE(
"You have configured mail accounts, " "No passphrase was given, sensitive fields will be in plaintext",
"but no passphrase was given. "
"Passwords will be in plaintext",
), ),
) )

View File

@ -97,6 +97,22 @@ class CryptMixin:
"model_name": "paperless_mail.mailaccount", "model_name": "paperless_mail.mailaccount",
"fields": [ "fields": [
"password", "password",
"refresh_token",
],
},
{
"exporter_key": "social_tokens",
"model_name": "socialaccount.socialtoken",
"fields": [
"token",
"token_secret",
],
},
{
"exporter_key": "auth_tokens",
"model_name": "authtoken.token",
"fields": [
"key",
], ],
}, },
] ]

View File

@ -971,10 +971,6 @@ class TestCryptExportImport(
) )
stdout.seek(0) stdout.seek(0)
self.assertIn( self.assertIn(
( ("No passphrase was given, sensitive fields will be in plaintext"),
"You have configured mail accounts, "
"but no passphrase was given. "
"Passwords will be in plaintext"
),
stdout.read(), stdout.read(),
) )