Commit Graph

284 Commits

Author SHA1 Message Date
eikek
aafd908906 Adopt code to use moved schedule api 2022-03-13 15:20:33 +01:00
eikek
c1ce0769eb Check file integrity 2022-03-12 12:58:34 +01:00
eikek
422c0905dc Add task to copy files 2022-03-12 12:58:28 +01:00
eikek
e82b00c582 Use different file stores based on config 2022-03-12 12:19:00 +01:00
eikek
e483a97de7 Adopt to new loggin api 2022-02-19 21:41:38 +01:00
eikek
553b1fa249 Add a file-repository for better organizing files
Docspell now must use a new api for accessing files.

Issue: #1379
2022-02-15 22:20:06 +01:00
eikek
14a413e787 Update channel names when retrieving user tasks
Usertasks hold their arguments in an opaque json structure that is not
connected to the other data at the db level. When loading tasks that
holds references (like channels) they could have changed in the
meantime. This is now a hacky way around that updates the channels
when loading. Should they be deleted, the tasks fails when running.
2022-01-30 17:09:52 +01:00
eikek
e1a8b9b121 Use collective settings for shares 2022-01-29 17:36:18 +01:00
eikek
1ca64f09d1 Add route to get settings for a share
Returns the client settings of the creator.
2022-01-29 10:11:54 +01:00
eikek
23cb34a6ff Manage notification channels separately and migrate
It's more convenient to manage notification channels separately, as it
is done with email settings. Notification hook and other forms are
adopted to only select channels. Hooks can now use more than one
channel.
2022-01-19 21:57:30 +01:00
eikek
d41490dd88 Add a name to notification channels
This name is supposed to be used by users to distinguish multiple channels.
2022-01-17 18:10:59 +01:00
eikek
8a4471343c Fix personal/non-personal when updating bookmarks 2022-01-16 00:31:59 +01:00
eikek
7aebc1ccdf Add priority to gotify channel
Closes: #1277
2022-01-12 20:59:24 +01:00
eikek
699cf091e6 Allow bookmarks in periodic query notification 2022-01-10 14:25:20 +01:00
eikek
ccb4df5bd7 Prevent duplicate bookmark names 2022-01-10 00:41:07 +01:00
eikek
54a4e6efee Fix formatting 2022-01-09 23:58:57 +01:00
eikek
9415f72ec0 Instead of client only, make bookmarks a server aware feature
Makes it much more useful
2022-01-09 23:58:57 +01:00
eikek
a50a0a9a1a Bookmark queries scoped to user or collective 2022-01-08 22:42:48 +01:00
eikek
706cfaeb05 Introduce table to store client settings per collective 2022-01-08 12:38:14 +01:00
eikek
3a642ee01e Fix sending notification mails from background tasks
When looking up the mail settings, a valid user id must be given.
2021-12-22 17:57:26 +01:00
eikek
4ffc8d1f14 Add support for more generic notification
This is a start to have different kinds of notifications. It is
possible to be notified via e-mail, matrix or gotify. It also extends
the current "periodic query" for due items by allowing notification
over different channels. A "generic periodic query" variant is added
as well.
2021-12-11 18:57:32 +01:00
eikek
4176b6bc64 Publish event when a waiting job is removed
Fixes: #1182
2021-11-18 21:52:11 +01:00
eikek
0651db9901 Make publish async, replace joexclient in periodic job scheduler 2021-11-16 22:55:37 +01:00
eikek
7a8527f821 Indicate number of running jobs in tob nav
Issue: #1069
2021-11-12 22:01:30 +01:00
eikek
61c01ad79b Use job group instead of parsing the task arguments 2021-11-08 00:07:44 +01:00
eikek
3e58d97f72 Add websockets and notify frontend when an item is processed 2021-11-06 21:32:30 +01:00
eikek
f38d520a1d Hooking the new pubsub impl into the application 2021-11-06 01:44:06 +01:00
eikek
8fd86f9ec1 Don't allow shares with fulltext queries
Currently the query implementation cannot combine multiple/nested
fulltext searches within a query. It doesn't seem useful to have
shares based on fulltext searches, so it is disabled for now.

Issue: #446
2021-10-25 21:29:55 +02:00
eikek
48d2bec9c4 Update http4s to 0.23.6 2021-10-24 18:24:03 +02:00
eikek
2ac0b84e52 Link shares to the user, not the collective
The user is required when searching because of folders (sadly), so the
share is connected to the user.
2021-10-24 01:41:18 +02:00
eikek
337293128d Add route to send mail for a share 2021-10-23 14:33:24 +02:00
eikek
02cbd95e0d Increment share access on verify 2021-10-23 14:33:24 +02:00
eikek
1a10216e3d Get item details from a share 2021-10-23 14:33:24 +02:00
eikek
9eb2f9c6fe Implement binary routes for shares 2021-10-23 14:33:24 +02:00
eikek
e961a5ac10 Use search stats to populate search menu 2021-10-23 14:33:24 +02:00
eikek
e52271f9cd Implement share preview image 2021-10-23 14:33:24 +02:00
eikek
a286556116 Initial impl of search route 2021-10-23 14:33:24 +02:00
eikek
f4596db63d Authorize share access 2021-10-23 14:33:24 +02:00
eikek
c7d587bea4 Basic management of shares 2021-10-23 14:33:24 +02:00
eikek
f74624485f Allow to manage passwords for a collective 2021-09-30 10:35:38 +02:00
eikek
e31107eb49 Require a otp to disable 2fa 2021-09-23 09:27:44 +02:00
eikek
9013f2de5b Update scalafmt settings 2021-09-22 17:23:24 +02:00
eikek
20a829cf7a Refactoring for migrating to binny library 2021-09-22 14:18:43 +02:00
eikek
9785db0683 Change license header of all files 2021-09-21 22:35:38 +02:00
eikek
506e9a0c36 Move sent mails when merging items
Fixes: 1055
2021-09-08 22:29:34 +02:00
eikek
736968b049 Fix adding a new user and don't allow to add non-local users
The user structure must provide the correct account source now.
2021-09-08 20:57:10 +02:00
eikek
8df235e9db Delete the user along its data 2021-09-08 20:57:10 +02:00
eikek
f8362329a9 Authenticate with external accounts using OIDC
After successful authentication at the provider, an account is
automatically created at docspell and the user is logged in.
2021-09-05 21:39:30 +02:00
eikek
7edb96a297 Register external accounts
This creates the account if it doesn't exist yet; otherwise it's a
noop. Only valid for non-local accounts.
2021-09-05 21:38:14 +02:00
eikek
aa099a340e Remove unused code 2021-09-05 21:38:14 +02:00
eikek
aef56233a5 Add a new column to distinguish local from external users 2021-09-05 21:38:14 +02:00
eikek
1afc005a6c Adopt login process for two-factor auth 2021-08-31 21:29:07 +02:00
eikek
309a52393a Initial impl for totp 2021-08-31 16:45:39 +02:00
eikek
733096f979 Improve querying item results
The join to retrieve the attachment count per item turned out to be
very expensive. And it is not used anymore for the result, only to
support fulltext search. It is now removed from the query. The
DISTINCT keyword is also removed, because it is not necessary and it
is expensive. With the DISTINCT removed, a new index (provided in the
previous commit) can now be used to avoid sorting items.
2021-08-29 11:09:06 +02:00
eikek
cf88f5c2de Allow to specify ordering when retrieving meta data
The query now searches in more fields. For example, when getting a
list of tags, the query is applied to the tag name *and* category.
When listing persons, the query now also looks in the associated
organization name.

This has been used to make some headers in the meta data tables
clickable to sort the list accordingly.

Refs: #965, #538
2021-08-27 23:04:54 +02:00
eikek
993a391c13 Add the attachment-only option to a source
The upload request can now contain a boolean for importing only
attachments when e-mails are uploaded. This option is now also added
to a source url.

Refs: #983
2021-08-23 14:19:11 +02:00
mergify[bot]
45f6357f49
Merge pull request #1024 from eikek/enhance-search-mode
Enhance search mode to search in all items
2021-08-21 13:56:43 +00:00
eikek
d5022f883e Enhance search mode to search in all items 2021-08-21 15:45:14 +02:00
eikek
751fa3da5a Add attachments-only filter to uploads
When uploading a file which is an e-mail, this option allows to skip
the mail body when the file is being processed.
2021-08-21 13:49:12 +02:00
Scala Steward
e4fecefaea
Reformat with scalafmt 3.0.0 2021-08-19 08:50:30 +02:00
eikek
c7c488f0cc Fix position of merged attachments 2021-08-16 15:05:26 +02:00
eikek
a923351b09 Fix item merge when merging tags and text fields
Also hard delete the remaining items. They are empty (have no
attachments), because data is moved if possible. Doesn't make much
sense to keep them, because restoring them isn't much useful.
2021-08-16 14:40:52 +02:00
eikek
85085ec173 Implement item merge 2021-08-16 12:32:54 +02:00
eikek
14e4a8f792 Fixup for deleting items
First, when checking for existence of a file, deleted items are not
conisdered.

The working with fulltext search has been changed: deleted items are
removed from fulltext index and are re-added when they are restored.
The fulltext index currently doesn't hold the item state and it would
mean much more work to introduce it into the index (or, worse, to
reprocess the results from the index). Thus, deleted items can only be
searched using database queries. It is probably a very rare use case
when fulltext search should be applied to deleted items. They have
been deleted for a reason and the most likely case is that they are
simply removed.

Refs: #347
2021-08-15 16:00:30 +02:00
eikek
f4a2b86ea8 Use a minimum age of items to remove
In order to keep deleted items for a while, the periodic task can now
use a duration to only remove items with a certain age. This can be
used to ensure that a deleted item stays at least X days before it
will be removed from the database.

Refs: #347
2021-08-15 12:32:50 +02:00
eikek
31d885ed79 Refactor user tasks to support collective and user scopes
Before, there were periodic tasks run per collective and not user by
making sure that submitter + group are the same value. This is now
encoded in `UserTaskScope` so it is now obvious and errors can be
reduced when using this.
2021-08-14 22:07:56 +02:00
eikek
27fd7a5867 Make sure the empty-trash task is started for all collectives 2021-08-14 20:40:04 +02:00
eikek
50706c3d6d Add a task implementation to delete items 2021-08-14 19:33:18 +02:00
eikek
4901276c66 Change "empty trash" settings for a collective and submit the job 2021-08-14 19:33:15 +02:00
eikek
f999662905 Add routes to restore deleted items 2021-08-14 16:48:03 +02:00
eikek
edb344314f Use an enum instead of a boolean to differentiate search
It's not very likely to have more modes of search besides normal and
trashed, but got surprised in that way quite often and it's nicer this
way anyways.
2021-08-14 15:11:48 +02:00
eikek
a7b74bd5ae Allow to search in soft-deleted items
A new query/request parameter can be used to apply a search to only
soft-deleted items.

The query expression `Trashed` has been introduced which selects only
items with state `Deleted`. This is another option an analog to
`ValidItemStates` (both cannot be used together as they would select
no items). This new query node is not added to the parser, because
users may not use it in their own queries - it must be part of the
"fixed" query so the application can control in which subset to search
(it would otherwise be possible to select any items).
2021-08-14 14:53:05 +02:00
eikek
cb777e30c0 Delete items by introducing a deleted state
When deleting items via the http api, they are not deleted anymore but
a new status "Deleted" is set. The collective insights contains now a
count separately for deleted items.
2021-08-14 14:18:03 +02:00
eikek
48d13a35fc Fix search summary to restrict on valid items 2021-08-14 14:09:07 +02:00
eikek
fcef52856a Allow tag ids or tag names when replacing tags 2021-07-25 21:26:22 +02:00
eikek
916217df4f Make convert-all-pdfs an admin endpoint 2021-07-25 01:25:24 +02:00
eikek
1913877de1 The id must be recreated for each job, obviously
Fixes: #938
2021-07-16 21:14:47 +02:00
eikek
f7eed33545 Return a 404 if a source was not found when checking a file 2021-07-08 21:17:48 +02:00
eikek
1120434cd9 Replace generating preview images with an admin endpoint
It doesn't make much sense to have this per collective, because this
is triggered by an admin after changing the server config file. So it
is now implemented as an admin endpoint that affects all files.
2021-07-04 21:37:34 +02:00
eikek
8e5c88fd32 Add copyright header to source files 2021-07-04 10:57:53 +02:00
eikek
bd791b4593 Upgrade code base to CE3 2021-06-22 22:53:34 +02:00
Eike Kettner
25788a0b23 Add routes for storing/retrieving client settings 2021-05-27 21:34:05 +02:00
Eike Kettner
a1a93e5ca6 Fixes searching items with fulltext
When using fulltext only search, then only the index must be searched.
This wasn't working anymore, because the routes added a query to
always select valid items (those not being processed). But this lead
to the downstream code to always consult the database, too. Since the
routes are using a "simple-search" interface, this is now adding the
valid-state condition if applicable. There are still more low-level
interfaces that can be used when searching should be done differently.

Closes: #823
2021-05-23 14:14:25 +02:00
Stefan Scheidewig
558197e415 Fixed the imports 2021-04-15 20:49:34 +02:00
Stefan Scheidewig
fa34312020 Implemented endpoint to delete multiple attachments 2021-04-15 18:05:01 +02:00
Eike Kettner
3e0914ece7 Correctly count tag categories
If multiple tags of the same category are applied to the same item,
just summing tag counts will produce the wrong results as now items
are counted multiple times.
2021-04-11 14:34:44 +02:00
Eike Kettner
c36073b852 Allow to give human readable summary to user tasks 2021-03-27 22:13:13 +01:00
Eike Kettner
cc38b850a6 Remove deprecated search routes and some refactoring 2021-03-27 22:13:13 +01:00
Eike Kettner
a7ee0aa08b Add a flag to processing task to distinguish re-/processing 2021-03-12 00:45:23 +01:00
Eike Kettner
7b1ec97c97 Fix sort when using fulltext only 2021-03-08 00:47:15 +01:00
Eike Kettner
63d146c2de Resolve fulltext search queries the same way as before
For now, fulltext search is only possible when being the only term or
inside the root AND expression.
2021-03-07 09:40:47 +01:00
Eike Kettner
dadab0d308 Implement search by query in endpoints 2021-03-01 15:31:02 +01:00
Eike Kettner
698ff58aa3 Provide a more convenient interface to search 2021-03-01 11:50:07 +01:00
Eike Kettner
9013d9264e Add more convenient date parsers and some basic macros 2021-03-01 00:51:01 +01:00
Eike Kettner
e9ed998e3a Basic poc to search via custom query 2021-03-01 00:51:01 +01:00
Eike Kettner
186014a1c6 Refactor search to separate between a base query and user query
The `findBase` is adding only strictly required conditions. Everything
else comes from the user.
2021-03-01 00:51:01 +01:00
Eike Kettner
7ef3185659 Add language to a source
Allows to define upload urls for different languages.
2021-02-18 23:34:42 +01:00
Eike Kettner
4cba96f390 Always return classifier results as suggestion
The classifier results are spliced into the suggestion list at second
place. When linking they are only used if nlp didn't find anything.
2021-01-21 21:05:28 +01:00
Eike Kettner
668abf2140 Add a reset-password admin route 2021-01-04 20:59:31 +01:00
Eike Kettner
0cfd8974d3 Add a flag to imap settings to enable/disable oauth2 scheme 2021-01-04 11:03:04 +01:00