mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 04:26:35 +01:00
Fixed a few consumer bugs and added an exporter
Rename exporter to export and fixt some debugging Account for files not matching the sender/title pattern Added a safety note Wrong regex on the name parser Renamed the command to something slightly less ambiguous
This commit is contained in:
parent
2e48036f92
commit
17615d43cb
9 changed files with 141 additions and 24 deletions
24
src/paperless/db.py
Normal file
24
src/paperless/db.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import gnupg
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class GnuPG(object):
|
||||
"""
|
||||
A handy singleton to use when handling encrypted files.
|
||||
"""
|
||||
|
||||
gpg = gnupg.GPG(gnupghome=settings.GNUPG_HOME)
|
||||
|
||||
@classmethod
|
||||
def decrypted(cls, path):
|
||||
return cls.gpg.decrypt_file(path, passphrase=settings.PASSPHRASE).data
|
||||
|
||||
@classmethod
|
||||
def encrypted(cls, path):
|
||||
return cls.gpg.encrypt_file(
|
||||
path,
|
||||
recipients=None,
|
||||
passphrase=settings.PASSPHRASE,
|
||||
symmetric=True
|
||||
).data
|
||||
Loading…
Add table
Add a link
Reference in a new issue