Commit Graph

191 Commits (a28d8fac2fb282b752e960e3329acffd1302da20)

Author SHA1 Message Date
jld3103 efb7448cd2
workflowengine: Stop using a service alias for controller
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-06-19 09:43:44 +07:00
Joas Schilling 9ba091b348
fix(workflow): Check tag attribute
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-16 08:44:41 +07:00
Joas Schilling 5bc86dd6ac
techdebt(workflowengine): Remove transition event classes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-03 15:33:17 +07:00
Joas Schilling 15fc42966c
Also check the scope when reading operations from the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-23 06:13:00 +07:00
Joas Schilling c6700150d5
Validate the scope when validating operations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-23 06:13:00 +07:00
Julius Härtl aebf654214
perf(workflowengine): Cache query that is performed on every request
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-10 14:33:07 +07:00
Robin Appelman 83cc8202b8
remove file exists check from `cacheAndReturnMimeType`
the method is only called if the file exists already

a check against storing the fallback mimetype is added as a safety instead

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-12-20 13:28:40 +07:00
Robin Appelman c5a8246742
use mimetype from cache for workflow if available
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-12-20 13:28:33 +07:00
Côme Chilliet a0f6a6545b
Use TimedJob from OCP instead of OC
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-05 10:13:34 +07:00
Côme Chilliet 9ba9f9a7dc
Make sure to not pass null to DateTime::createFromFormat
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-14 16:23:50 +07:00
Carl Schwan d5c23dbb9f Move CappedMemoryCache to OCP
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 15:54:31 +07:00
Carl Schwan 30d7763edc Use SettingsSection in workflowengine settings
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-05-31 08:38:50 +07:00
Carl Schwan ec6b83cc18 Add stricter psalm type for CappedMemoryCache
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-12 15:06:18 +07:00
Louis Chemineau 64951ec14e Change script loading order in worflowengine
Fix: https://github.com/nextcloud/server/issues/31709

Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-03-31 10:33:50 +07:00
Côme Chilliet ccab35f23f
Fix similar potential problems with fetchOne loops
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 12:10:52 +07:00
Carl Schwan cbf9064b8e
Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 12:30:27 +07:00
Carl Schwan 695165260f
Add helper method in Wrapper
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 10:39:36 +07:00
Carl Schwan 0479fff37c
The storage is not static anymore
Don't call twice $cache->getId

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 10:39:36 +07:00
Carl Schwan 1f392d666a
Optimize FileSystemTags workflow for groupfolder
In https://github.com/nextcloud/server/pull/28774 we disabled the
caching for the groupfolder application since it worked due to the fact
that in groupfolders, getFileIds could be called with the same $cacheId
and path for actually different groupfolders.

This revert this change and instead add the folderId from the
groupFolder to the cacheId. This solve the issue of the uniqueness of
the cacheId inside GroupFolder. Downside is that we introduce
groupfolder specific implementation inside the server repo.

The seconf optimization is to not consider paths starting with
__groupfolders in executeCheck. This is due to the fact that files in
the groupfolder application call two times executeCheck one time with
the url __groupfolder/<folderId>/<path> and the other time with <path>.
The first time will always return an empty systemTags array while the
second call will return the correct system tags.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 10:39:32 +07:00
Carl Schwan 08bf47a5de
Fix RequestURL check for cli commands
Fix https://github.com/nextcloud/files_automatedtagging/issues/526

Fix https://github.com/nextcloud/groupfolders/issues/1855

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-11 19:45:07 +07:00
John Molakvoæ (skjnldsv) b664aad7ab
Move bundles to /dist
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2022-01-08 10:11:58 +07:00
Robin Appelman e95745c074
fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:43:16 +07:00
Joas Schilling 7a6d559f19
Detect mimetype by content only with content
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-27 10:46:44 +07:00
Arthur Schiwon 7d7ef1d2e6
fixes an undefined index when getAccessList returns an empty array
- [] is a valid return value that should be honored as having no access

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-10-22 22:42:25 +07:00
Richard Steinmetz 8bd8e97181
Do not cache file ids in FileSystemTags inside group folders
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2021-09-14 15:10:44 +07:00
Daniel Kesselberg 7492b3c24f
Set alias for result of cast column function
On OCI an expression like to_char(events) end up as $row['to_char(events)'] in the query result.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-08-16 14:38:19 +07:00
Vincent Petry 15a62c5237
Make "name" column nullable in workflow operations
The "name" column is now unused and the code is always inserting an
empty string. While this works with most databases, Oracle complains
because an empty string is equivalent to null.

To fix this, the column definition is changed to allow null values now.

Also added some logging in case of database exceptions, because without
this nothing would be logged to detect the above problem.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-08-10 11:19:15 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
szaimen 35d978c2fc Rename External storages to External storage
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-05-20 12:13:04 +07:00
François Freitag d887851183 Prefer string $file over 1-element array in script()
The string syntax is more obvious. There should be one (and preferably
only one) way of doing things.

Signed-off-by: François Freitag <mail@franek.fr>
2021-05-18 09:24:05 +07:00
Christoph Wurst 11e2286a82
Merge pull request #25588 from nextcloud/techdept/custom-psr-logger
Migrate custom loggers to PSR
2021-03-05 09:46:07 +07:00
Roeland Jago Douma bc961baa40 Move some settings over to the IInitialState
The old one has been deprecated. Part one of many.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-02 21:11:56 +07:00
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Christoph Wurst 77a8ba0d11
Migrate WFE to the new PSR logger
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-11 16:17:37 +07:00
Christoph Wurst c1d4f8161b
Migrate internal classes to the OCP db col types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-12 14:09:13 +07:00
Morris Jobke 24d436cb60
Remove unneeded casts that were found by Psalm
In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521)

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-11 13:14:41 +07:00
Christoph Wurst 8b64e92b92
Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-08 11:45:19 +07:00
Arthur Schiwon 04cd1348ec
consider local external storages, too
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-12-15 11:50:04 +07:00
Arthur Schiwon 14bbec5fa7
enables the file name check also to match name of mountpoints
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-12-15 00:05:42 +07:00
Morris Jobke c44ec8c5d5
Only execute plain mimetype check for directories and do the fallback only for non-directories
Ref #23096

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-30 16:43:57 +07:00
Julius Härtl b06b0315c6
Files client and info bundles are always loaded so we don't need to load them again
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-25 15:11:03 +07:00
Arthur Schiwon 21a53de451
avoid empty null default with value that will be inserted anyways
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-11-23 21:20:27 +07:00
Arthur Schiwon 1eb86e46fd
inform the user when flow config data exceeds thresholds
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-10-28 14:07:14 +07:00
Christoph Wurst f464ef050b
Fix type errors detected by Psalm
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-14 15:40:12 +07:00
Morris Jobke fe08f406b2
Merge pull request #23096 from nextcloud/bugfix/noid/mimetypes2
Also check the path based mimetype for flow rule checks
2020-10-05 22:01:00 +07:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
Julius Härtl 63479684a5
Make sure to check the mimetype on the path if a secure one could not be detemined though the content
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-29 16:01:50 +07:00
J0WI 1639289b95 Update urls to stackoverflow.com to "HTTPS"
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2020-09-17 17:38:27 +07:00
Joas Schilling aa5e4aacc1
Don't use SELECT DISTINCT when to_char() is used in a WHERE statement
Nice bug in Oracle

Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-07 15:17:48 +07:00
Arthur Schiwon 28c0eea8cb
fix possible leaking scope in Flow
- a configured flow can be brought into consideration, despite its event
  was not fired
- it could either run through
- or run into a RuntimeException and killing processing of valid flows

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-08-24 13:44:01 +07:00