Merge branch 'dev'

This commit is contained in:
shamoon 2024-10-29 11:08:50 -07:00
commit 9c9b4effe2
14 changed files with 52 additions and 40 deletions

View File

@ -19,6 +19,8 @@ Options available to any installation of paperless:
export. Therefore, incremental backups with `rsync` are entirely export. Therefore, incremental backups with `rsync` are entirely
possible. possible.
The exporter does not include API tokens and they will need to be re-generated after importing.
!!! caution !!! caution
You cannot import the export generated with one version of paperless in You cannot import the export generated with one version of paperless in

View File

@ -5,26 +5,26 @@
} }
} }
::ng-deep .ng-select-container { :host ::ng-deep .ng-select-container {
border-top-right-radius: 0 !important; border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important; border-bottom-right-radius: 0 !important;
height: 100% !important; height: 100% !important;
} }
::ng-deep .rounded-end .ng-select-container { :host ::ng-deep .rounded-end .ng-select-container {
border-top-right-radius: var(--bs-border-radius) !important; border-top-right-radius: var(--bs-border-radius) !important;
border-bottom-right-radius: var(--bs-border-radius) !important; border-bottom-right-radius: var(--bs-border-radius) !important;
border-top-left-radius: 0 !important; border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important; border-bottom-left-radius: 0 !important;
} }
::ng-deep .ng-select { :host ::ng-deep .ng-select {
max-width: 100px; max-width: 100px;
min-width: 35%; min-width: 35%;
font-size: 14px; font-size: 14px;
} }
::ng-deep .doc-link-select { :host ::ng-deep .doc-link-select {
padding-top: 0 !important; padding-top: 0 !important;
border-top-right-radius: var(--bs-border-radius) !important; border-top-right-radius: var(--bs-border-radius) !important;
border-bottom-right-radius: var(--bs-border-radius) !important; border-bottom-right-radius: var(--bs-border-radius) !important;

View File

@ -5348,7 +5348,7 @@
<context context-type="sourcefile">src/app/components/common/input/document-link/document-link.component.html</context> <context context-type="sourcefile">src/app/components/common/input/document-link/document-link.component.html</context>
<context context-type="linenumber">50</context> <context context-type="linenumber">50</context>
</context-group> </context-group>
<target state="needs-translation">Not found</target> <target state="translated">No trobat</target>
</trans-unit> </trans-unit>
<trans-unit id="5676637575587497817" datatype="html"> <trans-unit id="5676637575587497817" datatype="html">
<source>Search for documents</source> <source>Search for documents</source>

View File

@ -5348,7 +5348,7 @@
<context context-type="sourcefile">src/app/components/common/input/document-link/document-link.component.html</context> <context context-type="sourcefile">src/app/components/common/input/document-link/document-link.component.html</context>
<context context-type="linenumber">50</context> <context context-type="linenumber">50</context>
</context-group> </context-group>
<target state="needs-translation">Not found</target> <target state="translated">Non trouvé</target>
</trans-unit> </trans-unit>
<trans-unit id="5676637575587497817" datatype="html"> <trans-unit id="5676637575587497817" datatype="html">
<source>Search for documents</source> <source>Search for documents</source>

View File

@ -3619,7 +3619,7 @@
<context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context> <context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context>
<context context-type="linenumber">79</context> <context context-type="linenumber">79</context>
</context-group> </context-group>
<target state="needs-translation">True</target> <target state="translated">Vero</target>
</trans-unit> </trans-unit>
<trans-unit id="3800326155195149498" datatype="html"> <trans-unit id="3800326155195149498" datatype="html">
<source>False</source> <source>False</source>
@ -3635,7 +3635,7 @@
<context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context> <context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context>
<context context-type="linenumber">80</context> <context context-type="linenumber">80</context>
</context-group> </context-group>
<target state="needs-translation">False</target> <target state="translated">Falso</target>
</trans-unit> </trans-unit>
<trans-unit id="7551700625201096185" datatype="html"> <trans-unit id="7551700625201096185" datatype="html">
<source>Search docs...</source> <source>Search docs...</source>
@ -3643,7 +3643,7 @@
<context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context> <context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context>
<context context-type="linenumber">96</context> <context context-type="linenumber">96</context>
</context-group> </context-group>
<target state="needs-translation">Search docs...</target> <target state="translated">Ricerca di documenti...</target>
</trans-unit> </trans-unit>
<trans-unit id="3184700926171002527" datatype="html"> <trans-unit id="3184700926171002527" datatype="html">
<source>Any</source> <source>Any</source>
@ -3691,7 +3691,7 @@
<context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context> <context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context>
<context context-type="linenumber">131</context> <context context-type="linenumber">131</context>
</context-group> </context-group>
<target state="needs-translation">Not</target> <target state="translated">Non</target>
</trans-unit> </trans-unit>
<trans-unit id="6548676277933116532" datatype="html"> <trans-unit id="6548676277933116532" datatype="html">
<source>Add query</source> <source>Add query</source>
@ -3699,7 +3699,7 @@
<context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context> <context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context>
<context context-type="linenumber">150</context> <context context-type="linenumber">150</context>
</context-group> </context-group>
<target state="needs-translation">Add query</target> <target state="translated">Aggiungi query</target>
</trans-unit> </trans-unit>
<trans-unit id="5599577087865387184" datatype="html"> <trans-unit id="5599577087865387184" datatype="html">
<source>Add expression</source> <source>Add expression</source>
@ -3707,7 +3707,7 @@
<context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context> <context context-type="sourcefile">src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html</context>
<context context-type="linenumber">153</context> <context context-type="linenumber">153</context>
</context-group> </context-group>
<target state="needs-translation">Add expression</target> <target state="translated">Aggiungi espressione</target>
</trans-unit> </trans-unit>
<trans-unit id="6052766076365105714" datatype="html"> <trans-unit id="6052766076365105714" datatype="html">
<source>now</source> <source>now</source>
@ -4135,7 +4135,7 @@
<context context-type="sourcefile">src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.html</context>
<context context-type="linenumber">19</context> <context context-type="linenumber">19</context>
</context-group> </context-group>
<target state="needs-translation">Order</target> <target state="translated">Priorità</target>
</trans-unit> </trans-unit>
<trans-unit id="4816216590591222133" datatype="html"> <trans-unit id="4816216590591222133" datatype="html">
<source>Enabled</source> <source>Enabled</source>
@ -4519,7 +4519,7 @@
<context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context>
<context context-type="linenumber">13</context> <context context-type="linenumber">13</context>
</context-group> </context-group>
<target state="needs-translation">See &lt;a target='_blank' href='https://docs.paperless-ngx.com/advanced_usage/#file-name-handling'&gt;the documentation&lt;/a&gt;.</target> <target state="translated">Vedi &lt;a target='_blank' href='https://docs.paperless-ngx.com/advanced_usage/#file-name-handling'&gt;la documentazione&lt;/a&gt;.</target>
</trans-unit> </trans-unit>
<trans-unit id="1295614462098694869" datatype="html"> <trans-unit id="1295614462098694869" datatype="html">
<source>Preview</source> <source>Preview</source>
@ -4539,7 +4539,7 @@
<context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context>
<context context-type="linenumber">30</context> <context context-type="linenumber">30</context>
</context-group> </context-group>
<target state="needs-translation">Path test failed</target> <target state="translated">Test percorso non riuscito</target>
</trans-unit> </trans-unit>
<trans-unit id="9116034231465034307" datatype="html"> <trans-unit id="9116034231465034307" datatype="html">
<source>No document selected</source> <source>No document selected</source>
@ -4547,7 +4547,7 @@
<context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context>
<context context-type="linenumber">32</context> <context context-type="linenumber">32</context>
</context-group> </context-group>
<target state="needs-translation">No document selected</target> <target state="translated">Nessun documento selezionato</target>
</trans-unit> </trans-unit>
<trans-unit id="2083498114116917092" datatype="html"> <trans-unit id="2083498114116917092" datatype="html">
<source>Search for a document</source> <source>Search for a document</source>
@ -4555,7 +4555,7 @@
<context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/storage-path-edit-dialog/storage-path-edit-dialog.component.html</context>
<context context-type="linenumber">38</context> <context context-type="linenumber">38</context>
</context-group> </context-group>
<target state="needs-translation">Search for a document</target> <target state="translated">Ricerca di un documento</target>
</trans-unit> </trans-unit>
<trans-unit id="6423278459497515329" datatype="html"> <trans-unit id="6423278459497515329" datatype="html">
<source>No documents found</source> <source>No documents found</source>
@ -5348,7 +5348,7 @@
<context context-type="sourcefile">src/app/components/common/input/document-link/document-link.component.html</context> <context context-type="sourcefile">src/app/components/common/input/document-link/document-link.component.html</context>
<context context-type="linenumber">50</context> <context context-type="linenumber">50</context>
</context-group> </context-group>
<target state="needs-translation">Not found</target> <target state="translated">Non trovato</target>
</trans-unit> </trans-unit>
<trans-unit id="5676637575587497817" datatype="html"> <trans-unit id="5676637575587497817" datatype="html">
<source>Search for documents</source> <source>Search for documents</source>

View File

@ -5473,7 +5473,7 @@
<context context-type="sourcefile">src/app/components/common/input/tags/tags.component.html</context> <context context-type="sourcefile">src/app/components/common/input/tags/tags.component.html</context>
<context context-type="linenumber">41</context> <context context-type="linenumber">41</context>
</context-group> </context-group>
<target state="needs-translation">Filter documents with these Tags</target> <target state="translated">按标签过滤</target>
</trans-unit> </trans-unit>
<trans-unit id="5752465522295465624" datatype="html"> <trans-unit id="5752465522295465624" datatype="html">
<source>What&apos;s this?</source> <source>What&apos;s this?</source>
@ -5537,7 +5537,7 @@
<context context-type="sourcefile">src/app/components/common/permissions-dialog/permissions-dialog.component.ts</context> <context context-type="sourcefile">src/app/components/common/permissions-dialog/permissions-dialog.component.ts</context>
<context context-type="linenumber">75</context> <context context-type="linenumber">75</context>
</context-group> </context-group>
<target state="needs-translation">Any and all existing owner, user and group permissions will be replaced.</target> <target state="translated"/>
</trans-unit> </trans-unit>
<trans-unit id="5947558132119506443" datatype="html"> <trans-unit id="5947558132119506443" datatype="html">
<source>My documents</source> <source>My documents</source>

View File

@ -24,7 +24,6 @@ from django.utils import timezone
from filelock import FileLock from filelock import FileLock
from guardian.models import GroupObjectPermission from guardian.models import GroupObjectPermission
from guardian.models import UserObjectPermission from guardian.models import UserObjectPermission
from rest_framework.authtoken.models import Token
if TYPE_CHECKING: if TYPE_CHECKING:
from django.db.models import QuerySet from django.db.models import QuerySet
@ -271,7 +270,6 @@ class Command(CryptMixin, BaseCommand):
"social_accounts": SocialAccount.objects.all(), "social_accounts": SocialAccount.objects.all(),
"social_apps": SocialApp.objects.all(), "social_apps": SocialApp.objects.all(),
"social_tokens": SocialToken.objects.all(), "social_tokens": SocialToken.objects.all(),
"auth_tokens": Token.objects.all(),
} }
if settings.AUDIT_LOG_ENABLED: if settings.AUDIT_LOG_ENABLED:
@ -570,11 +568,7 @@ class Command(CryptMixin, BaseCommand):
value=manifest_record["fields"][field], value=manifest_record["fields"][field],
) )
elif ( elif MailAccount.objects.count() > 0 or SocialToken.objects.count() > 0:
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(
"No passphrase was given, sensitive fields will be in plaintext", "No passphrase was given, sensitive fields will be in plaintext",

View File

@ -108,13 +108,6 @@ class CryptMixin:
"token_secret", "token_secret",
], ],
}, },
{
"exporter_key": "auth_tokens",
"model_name": "authtoken.token",
"fields": [
"key",
],
},
] ]
def get_crypt_params(self) -> dict[str, dict[str, str | int]]: def get_crypt_params(self) -> dict[str, dict[str, str | int]]:

View File

@ -8,6 +8,9 @@ from pathlib import Path
from unittest import mock from unittest import mock
from zipfile import ZipFile from zipfile import ZipFile
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.models import SocialApp
from allauth.socialaccount.models import SocialToken
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
@ -874,6 +877,23 @@ class TestCryptExportImport(
password="mypassword", password="mypassword",
) )
app = SocialApp.objects.create(
provider="test",
name="test",
client_id="test",
)
account = SocialAccount.objects.create(
user=User.objects.first(),
provider="test",
uid="test",
)
SocialToken.objects.create(
app=app,
account=account,
token="test",
token_secret="test",
)
call_command( call_command(
"document_exporter", "document_exporter",
"--no-progress-bar", "--no-progress-bar",
@ -912,6 +932,9 @@ class TestCryptExportImport(
self.assertIsNotNone(account) self.assertIsNotNone(account)
self.assertEqual(account.password, "mypassword") self.assertEqual(account.password, "mypassword")
social_token = SocialToken.objects.first()
self.assertIsNotNone(social_token)
def test_import_crypt_no_passphrase(self): def test_import_crypt_no_passphrase(self):
""" """
GIVEN: GIVEN:

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n" "Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n" "POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-22 00:30\n" "PO-Revision-Date: 2024-10-29 12:12\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Catalan\n" "Language-Team: Catalan\n"
"Language: ca_ES\n" "Language: ca_ES\n"

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n" "Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n" "POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-25 12:12\n" "PO-Revision-Date: 2024-10-29 00:31\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: French\n" "Language-Team: French\n"
"Language: fr_FR\n" "Language: fr_FR\n"

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n" "Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n" "POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-20 05:58\n" "PO-Revision-Date: 2024-10-29 18:05\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"Language: it_IT\n" "Language: it_IT\n"

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n" "Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n" "POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-26 12:11\n" "PO-Revision-Date: 2024-10-29 12:12\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Polish\n" "Language-Team: Polish\n"
"Language: pl_PL\n" "Language: pl_PL\n"
@ -23,7 +23,7 @@ msgstr "Dokumenty"
#: documents/filters.py:334 #: documents/filters.py:334
msgid "Value must be valid JSON." msgid "Value must be valid JSON."
msgstr "" msgstr "Wartość musi być prawidłowym JSON."
#: documents/filters.py:353 #: documents/filters.py:353
msgid "Invalid custom field query expression" msgid "Invalid custom field query expression"

View File

@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: paperless-ngx\n" "Project-Id-Version: paperless-ngx\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-19 22:56-0700\n" "POT-Creation-Date: 2024-10-19 22:56-0700\n"
"PO-Revision-Date: 2024-10-24 12:12\n" "PO-Revision-Date: 2024-10-29 12:12\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Chinese Simplified\n" "Language-Team: Chinese Simplified\n"
"Language: zh_CN\n" "Language: zh_CN\n"