Commit Graph

10549 Commits

Author SHA1 Message Date
Joas Schilling d9c4c9eb99
Simplify array filter
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:36 +02:00
Joas Schilling dfeee3b850
Fix wrong doc + type hint
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:36 +02:00
Joas Schilling 8376c4891f
Only throw when also the last 30 mins were attacking
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:36 +02:00
Joas Schilling 6f751d01db
Make the throttling O(2^n) instead of O(n^n)
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:36 +02:00
Joas Schilling 64539a6ee1
Make Throttler strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:36 +02:00
Joas Schilling c8fea66d65
Split delay calculation from getting the attempts
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:35 +02:00
Joas Schilling cdb36c8ead
Let the database count the entries
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:35 +02:00
Joas Schilling e66bc4a8a7
Send "429 Too Many Requests" in case of brute force protection
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 11:20:35 +02:00
Joas Schilling c8f175e936
Allow to disable share emails
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-19 09:03:58 +02:00
Morris Jobke 560ccf5d83
Cast float to int to avoid invalid scalar argument warning
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-18 16:56:36 +02:00
Morris Jobke 27e7332a9c
Cast float/char to int to avoid invalid scalar argument warning
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-18 16:51:59 +02:00
Roeland Jago Douma 6ed4c8a946
Improve recent file fetching
Fixes #16876

Before we'd just fetch everything from all storages we'd have access to.
Then we'd sort. And filter in php. Now this of course is tricky if a
user shared just a file with you and then has a ton of activity.

Now we try to contruct the prefix path. So that the filtering can happen
right away in the databae.

Now this will make the DB more busy. But it should help overall as in
most cases less queries are needed then etc.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-08-18 05:56:06 +02:00
John Molakvoæ 565ccb08cd
Merge pull request #22109 from nextcloud/feature/20931/followup-1 2020-08-17 22:13:45 +02:00
Roeland Jago Douma 6675528804
Merge pull request #22271 from nextcloud/phpdoc/22063/add-interface-method-and-phpdoc
Properly add new methods to interface and document in PHPDoc for getR…
2020-08-17 19:34:56 +02:00
Morris Jobke d7f66c36ac
Fix "misplaced variables" warning of Psalm in PHPDoc statements
Ref #21787

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-17 17:46:57 +02:00
Morris Jobke 00cb8e6c54
Merge pull request #22253 from nextcloud/debt/noid/docblocks
Fix some MissingDocblockType or InvalidDocblock warnings.
2020-08-17 17:45:11 +02:00
Morris Jobke e47cfc9a54
Properly add new methods to interface and document in PHPDoc for getRootMounts()
Introduced in #22063 and was just forgotten.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-17 17:13:46 +02:00
Daniel Kesselberg 3e7b815da4
Fix more MissingDocblockType or InvalidDocblock warnings.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-08-14 20:19:23 +02:00
Daniel Kesselberg 10ac844448
Update documentation for QueryBuilder::set
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-08-14 19:55:01 +02:00
Georg Ehrke 5b26487f14
Expose status via Collaborators API
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-08-14 17:04:52 +02:00
Roeland Jago Douma 8daaf33e3d
Silence duplicate session warnings
Fixes #20490

Basically restroring the old behavior.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-08-14 05:23:11 +02:00
Gary Kim 5559570faf
Merge pull request #22242 from nextcloud/techdebt/noid/remove-deprecated-methods
Remove deprecated and unused method calls
2020-08-14 10:10:53 +08:00
Scott Dutton b12a390220
Always try and show pre rendered preview
Currently if the following situation happens

Server generates preview
Server has command removed which allows a preview to be shown
Client asks for preview, gets a 404 error when preview exists
(Mime checked before preview)

This happens more often with documents, or video as the commands are not
native PHP, they require a binary on the server.

After the fix the following would happen

Server generates preview
Server has command removed which allows a preview to be shown
Client asks for preview, gets preview which has been generated
(Mime checked after preview)

This would also allow offline generation (for example a docker image
containing the extra binaries), allowing a reduction in attack surface
of the instance serving the preview data.

Signed-off-by: Scott Dutton <scott@exussum.co.uk>
2020-08-13 22:50:38 +02:00
Morris Jobke 16d83ab30a
Remove getLastJob from IJobList
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-13 21:50:06 +02:00
Georg Ehrke ee23906c3c
Allow writing empty content to new file
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-08-13 15:41:26 +02:00
Julius Härtl 52eff4ae7c
Use user mount with matching shared storage only
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-13 15:10:05 +02:00
Morris Jobke 0b856329eb
Merge pull request #22202 from nextcloud/enh/noid/cleanup-servercontainer
Use autowiring where possible in server container
2020-08-13 10:55:48 +02:00
Morris Jobke 3c56922444
Merge pull request #22205 from nextcloud/activity-settings-cleanup
merge file activity settings into a single 'favorite changed' item
2020-08-13 08:15:06 +02:00
Morris Jobke df4bcd616f
Add @deprecated labels for server DI containter aliases
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-13 07:43:37 +02:00
Morris Jobke 725fecee34
Merge pull request #21344 from nextcloud/fix/twofactor-cleanup-event
Emit an event for every disabled 2FA provider during cleanup
2020-08-13 07:25:01 +02:00
Morris Jobke 894640206e
Use registerDeprecatedAlias for non-namespaced aliases
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-13 05:43:38 +02:00
Morris Jobke 2f2252cfba
Use autowiring where possible in server container
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-13 05:43:36 +02:00
Robin Appelman 5f58cefbd7
merge file activity settings into a single 'favorite changed' item
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-08-13 00:01:34 +02:00
Daniel Kesselberg 4dd507675c
Generate password by password_policy app
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-08-11 21:58:51 +02:00
Morris Jobke 8fc877ff7d
Merge pull request #22117 from nextcloud/activity-settings-grouping
allow grouping of activity settings
2020-08-11 11:24:23 +02:00
Morris Jobke c0be7e329f
Prefer typed event over string based ones
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-10 15:22:55 +02:00
Morris Jobke 54726d5934
Merge pull request #21738 from nextcloud/techdebt/14552/migrate-OC_Group-post_removeFromGroup
Migrate OC_Group post_removeFromGroup hook to actual event object
2020-08-07 17:46:00 +02:00
Morris Jobke 408ed7ebd4
Merge pull request #22139 from nextcloud/fix/noid/check-for-preview-multibucket-fallback-as-second-step
Check previews in multibucket fallback folder as the last step and not as first step
2020-08-07 16:02:02 +02:00
John Molakvoæ (skjnldsv) 9e962fb69f
Allow to update to nightly
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-08-07 13:51:39 +02:00
Morris Jobke 0807e29e17
Merge pull request #22133 from nextcloud/boot-app-once
only boot apps once
2020-08-07 12:05:09 +02:00
Morris Jobke 06eb230d24
Merge pull request #22135 from nextcloud/enh/noid/occ-preview-repair
Add occ preview:migrate to migrate previews from the old flat structure to a subfolder structure
2020-08-07 11:09:16 +02:00
Robin Appelman 246ed35d94
only boot apps once
in some cases `loadApp` is called more then once which is currently causing apps to be "booted" multiple times which can lead to unexepected behaviour with things like registering hooks

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-08-07 11:04:47 +02:00
Morris Jobke 4d0c3fa4a8
Check previews in multibucket fallback folder as the last step and not as first step
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-07 09:37:11 +02:00
Morris Jobke 45428e4948
Add config option to enable multibucket preview distribution
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-06 22:31:39 +02:00
Morris Jobke 4fdd38c737
Use fixed preview buckets that are postfixed with -preview-NUMBER
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-06 22:19:21 +02:00
Morris Jobke 159f28cd52
Mount the old previews in a separate folder for the multi bucket setup and check in them before using the actual locations
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-06 22:19:21 +02:00
Morris Jobke 438ac23e2a
Distribute preview folders in appdata in multibucket setup to multiple buckets
* introduces a new IRootMountProvider to register mount points inside the root storage
* adds a AppdataPreviewObjectStoreStorage to handle the split between preview folders and bucket number

Ref #22033

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-06 22:19:20 +02:00
Morris Jobke d8734b3b93
Add occ preview:migrate to migrate previews from the old flat structure to a subfolder structure
* `php occ preview:repair` - a preview migration tool that moves existing previews into the new location introduced with #19214
* moves `appdata_INSTANCEID/previews/FILEID` to `appdata_INSTANCEID/previews/0/5/8/4/c/e/5/FILEID`
* migration tool can be stopped during migration via `CTRL+C` - it then finishes the current folder (with the previews of one file) and stops gracefully
* if a PHP memory limit is set in the `php.ini` then it will stop automatically once it has less than 25 MiB memory left (this is to avoid hard crashes in the middle of a migration)
* the tool can be used during operation - possible drawbacks:
    * there is the chance of a race condition that a new preview is generated in the moment the folder is already migrated away - so the old folder with the newly cached preview is deleted and one cached preview needs to be re-generated
    * there is the chance of a race condition during access of a preview while it is migrated to the other folder - then no preview can be shown and results in a 404 (as of now this is an accepted risk)

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-06 22:05:46 +02:00
John Molakvoæ 5b6246f52a
Merge pull request #21598 from nextcloud/enh/20930/dashboard-drag 2020-08-06 08:17:52 +02:00
Morris Jobke ae9ecd521f
Merge pull request #21677 from J0WI/clearstatcache-on-rmdir
Do clearstatcache() on rmdir
2020-08-05 23:03:06 +02:00
Morris Jobke 519cd678ee
Merge pull request #22008 from elijahnyp/OCImage_Leak_Fix
Ensured large image is unloaded from memory when generating previews
2020-08-05 22:39:09 +02:00
Julius Härtl 61cc356e0b
Fix php cs check
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-05 17:03:39 +02:00
Julius Härtl 018be662f4
Refactor API to match the widget wording
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-05 17:03:38 +02:00
Julius Härtl db86bea18c
Allow default app to be overwritten by user config
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-05 17:03:38 +02:00
Jan C. Borchardt e25bab98b7
Set Dashboard as default app
Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net>
2020-08-05 17:01:28 +02:00
Joas Schilling 55473dd2eb
Merge pull request #22104 from nextcloud/enh/search/make-app-handle-the-order-logic
Make apps handle the order logic
2020-08-05 16:38:45 +02:00
Robin Appelman 227e362842
allow grouping of activity settings
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-08-05 16:13:03 +02:00
Morris Jobke 79fc7e78b7
Merge pull request #21138 from nextcloud/fix/noid/search-in-group-displayname-email
Search also the email and displayname in user mangement for groups
2020-08-05 16:09:00 +02:00
Morris Jobke f510da139f
Use class that actually has the destroy() method in preview generator
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-05 15:52:40 +02:00
Morris Jobke 6fbf8fceac
Merge pull request #22106 from nextcloud/feature/noid/user_status_api
Provide a PHP Api for UserStatus
2020-08-05 15:30:48 +02:00
Joas Schilling ea8f68bea6 Hand in the route and the parameters of the request
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2020-08-05 12:52:16 +00:00
Morris Jobke fee13e7ffd
Search also the email and displayname in user mangement for groups
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-05 14:14:05 +02:00
Georg Ehrke 0e0e0d19e8
Provide a PHP Api for UserStatus
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-08-05 13:48:46 +02:00
John Molakvoæ (skjnldsv) d98f7c1bd8
Make apps handle the order logic
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-08-05 11:37:45 +02:00
John Molakvoæ (skjnldsv) 71b62c4203
Show mime icon, bump bundles, make the SearchResultEntry class non-abstract, Fix header search icon, various fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-08-04 21:36:22 +02:00
John Molakvoæ (skjnldsv) 6eced42b7a
Remove outdated legacy search scripts
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-08-04 20:56:22 +02:00
Morris Jobke 489fecac32
Merge pull request #22057 from nextcloud/fix/20009/contactsmenu-limit-users
contactsmanager shall limit number of results early
2020-08-03 15:15:46 +02:00
John Molakvoæ (skjnldsv) 1a1b3e20e4 Fix unified search
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2020-08-03 11:26:03 +00:00
Georg Ehrke 0fad921840
Add user-status app
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-07-31 16:45:27 +02:00
Arthur Schiwon 7c56283c3c
contactsmanager shall limit number of results early
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-07-31 12:42:17 +02:00
Morris Jobke e19bbce7f6
Merge pull request #22060 from nextcloud/trashbin-s3-fixes
Object store trashbin fixes
2020-07-31 10:10:33 +02:00
Robin Appelman 6cb550d567
fix instanceof ISettings check for activity settings
boolean logic is hard

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-30 17:53:14 +02:00
Robin Appelman 8c3b22859c
dont update mimetype when moving to trash
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-30 16:11:45 +02:00
Joas Schilling a32e6a7958
Merge pull request #21993 from nextcloud/fix/lower_route_not_found_level
Log the route not found exception on a lower level
2020-07-30 10:59:31 +02:00
Morris Jobke 4a7d7e446f
User.php: rename of old dispatcher to legacyDispatcher
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 10:21:08 +02:00
Morris Jobke 36ee37ec0a
Migrate OC_Group post_removeFromGroup hook to actual event object
Ref #14552

This adds a BeforeUserRemovedEvent to the LDAP backend because it was missing. It's not really before, but we don't have the before state.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 10:21:08 +02:00
Joas Schilling 5993bd45f3
Correctly remove usergroup shares on removing group members
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-30 09:47:31 +02:00
Joas Schilling 2af77b2ed7
Merge pull request #22034 from nextcloud/bugfix/noid/parse-url-returns-null
parse_url returns null in case a parameter is not found
2020-07-29 18:07:50 +02:00
Morris Jobke 7e28286e9d
Merge pull request #21542 from nextcloud/activity-notifications
basic settings system for activity notifications
2020-07-29 15:36:38 +02:00
Joas Schilling 9127731c52
parse_url returns null in case a parameter is not found
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-29 08:32:20 +02:00
Joas Schilling bab4fb98eb
Fix overwriteService() for apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-28 09:38:43 +02:00
Elijah Martin-Merrill 56ed563b0c fix memory leak caused by not destroying image in Preview/Generate.php
Signed-off-by: Elijah Martin-Merrill <elijah@nyp-itsours.com>
2020-07-27 10:52:44 -04:00
Roeland Jago Douma b57019bcaa
Log the route not found exception on a lower level
This should be logged but it is not that critical to wanner level 3

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-24 15:39:53 +02:00
Morris Jobke 15561b4e0a
Merge pull request #21977 from onehappycat/issue_21960
Ignore whitespace in sharing by mail
2020-07-24 13:37:36 +02:00
Robin Appelman c8427781b4
implement old settings interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-24 13:03:35 +02:00
Julius Härtl e1b696929f
Move NotFoundResponse to a proper TemplateResponse
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-24 08:58:14 +02:00
onehappycat e04525c186 Ignore whitespace in sharing by mail
Signed-off-by: onehappycat <one.happy.cat@gmx.com>
2020-07-23 22:20:18 +02:00
Morris Jobke ce314d9484
Merge pull request #21814 from nextcloud/techdebt/noid/federated_share_added-into-typed-event
Move federated_share_added into a typed event
2020-07-23 21:42:48 +02:00
Morris Jobke 173f8abc7e
Merge pull request #21628 from nextcloud/external-to-s3-trashbin-fix
fix moving files from external storage to object store trashbin
2020-07-23 21:35:18 +02:00
Robin Appelman c8cf2e8a5b
fix renameFromStorage messing with folder mimetype
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-23 20:31:35 +02:00
Simon Spannagel 1fc54d3479 Fix header logo size in notification mails
Signed-off-by: Simon Spannagel <simonspa@kth.se>
2020-07-23 17:52:21 +02:00
Robin Appelman ad7798f9c9
use exceptions for error signaling in writeStream
this remove the ambiguity when writing zero length files

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-23 15:24:52 +02:00
Robin Appelman 5949849322
fix moving files from external storage to object store trashbin
having the "cache rename" after the "storage move" caused the target
to get the fileid from the source file, without taking care that the object
is stored under the original file id.

By doing the "cache rename" first, we trigger the "update existing file"
logic while moving the file to the object store and the object gets stored for the
correct file id

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-23 15:24:44 +02:00
Roeland Jago Douma e0cc95f3aa
Allow user backends to specify a custom logout url
* Allows SSO backends to do a global logout

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-23 10:42:40 +02:00
Morris Jobke 0763a17332
Move federated_share_added into a typed event
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-23 08:33:17 +02:00
Morris Jobke 346f647962
Merge pull request #21870 from nextcloud/fix/bootstrap-context-container-interfaces
Make the bootstrap context return ContainerInterface instances
2020-07-22 20:38:50 +02:00
Morris Jobke 7b250db60b
Merge pull request #21658 from nextcloud/trashbin-configurable-size
allow admin to configure the max trashbin size
2020-07-21 20:46:43 +02:00
Morris Jobke 7870ca0663
Use the proper IAppContainer and IServerContainer type hints to know which code runs with which container
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-21 20:44:05 +02:00
Christoph Wurst e029055e76
Make the bootstrap context return ContainerInterface instances
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-21 20:42:24 +02:00
Robin Appelman 5eb1e75e24
build autoloader
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-21 19:26:59 +02:00
Robin Appelman fb5ae20722
basic settings system for activity notifications
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-21 17:12:38 +02:00
Morris Jobke 09e6b26bdd
Merge pull request #21875 from nextcloud/techdebt/deprecate-ilogger
Deprecate ILogger in favor of the PSR-3 logger
2020-07-20 16:45:14 +02:00
Morris Jobke 9ae75a3ca9
Merge pull request #21850 from nextcloud/techdebt/noid/register-alternative-logins
Allow to register AlternativeLogin on RegistrationContext
2020-07-20 14:20:03 +02:00
Morris Jobke 9271d65641
Merge pull request #21880 from nextcloud/webauthn/discourage_user_auth
Discourage webauthn user interaction
2020-07-20 09:24:08 +02:00
Christoph Wurst 9bc6a8437d
Deprecate the query mothod on the server container
The interface method has already been deprecated, but if some code uses
the concrete type instead, the deprecation is not shown (by phpstorm),
so I think it's better to have this method tagged as well.

The "fix" for this deprecation is to simply use `get` instead of
`query`. Right now this will work 100% the same, but the goal is to slim
down the interface and only use what PSR-11 offers.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-17 08:05:07 +02:00
Joas Schilling cae849bcf9
Merge pull request #21869 from nextcloud/techdebt/noid/add-constants-for-magic-strings
Add constants for the magic strings of template rendering
2020-07-16 22:00:57 +02:00
Roeland Jago Douma 884f3d009a
Discourage webauthn user interaction
Else people might have the feeling this is also doing 2FA. And since it
is only prefered it can be ignored and hacked around.

Once we have proper 2FA with webauthn in one go this probably needs to
be revisted.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-16 21:10:07 +02:00
Roeland Jago Douma dfcb49b9b7
Merge pull request #21873 from nextcloud/techdebt/deprecate-server-container-getters
Deprecate the server container getters
2020-07-16 20:27:36 +02:00
Christoph Wurst 8a433a7226
Deprecate ILogger
The logger service was always intended to follow the PSR-3 interface.
It's time to embrace this and switch over to the "official" API,
hence this custom interface can be slowly phased out.

With Nextcloud 20 the logger also got support for
* App id filled out automatically
* Exceptions handling (as replacement for logException)

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-16 19:19:23 +02:00
Christoph Wurst c889021334
Add a scoped PSR logger for apps
Just like for ILogger we should have a version that has the app ID
pre-set for the context (unless overwritten) so that each log entry can
be traced back to the app that produced it.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-16 19:11:56 +02:00
Christoph Wurst efd2835b23
Deprecate the server container getters
Service locators are an anti pattern. These getters just make it more
appealing to do the wrong thing. If you want to locate a service the bad
way, just use the `get` method on a container – it will do the same in
also one line of code.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-16 18:59:56 +02:00
Joas Schilling 49970639fa
Add constants for the magic strings of template rendering
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-16 15:47:28 +02:00
Joas Schilling 0dfcc132ca
Allow to register AlternativeLogin on RegistrationContext
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-16 14:20:24 +02:00
Christoph Wurst 4152216bd8
Use PSR container interface and deprecate our own abstraction
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-16 13:35:45 +02:00
Morris Jobke fc41810d2f
Merge pull request #21822 from nextcloud/enh/events/additionalscripts
Add real events to load additionalscripts
2020-07-15 19:50:01 +02:00
Morris Jobke cc258ad51a
Merge pull request #21844 from bladewing/bladewing-harden-against-mimetype-mismatch
Avoid substr() error when strpos returns false
2020-07-15 19:33:09 +02:00
Roeland Jago Douma 7d7ba61625
Add real events to load additionalscripts
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-15 14:07:18 +02:00
Christoph Wurst b9a911f0b3
Deprecate the internal Symfony dispatcher adapter
This type is not known on the public API, yet we should make sure that
any usage of this class is noticed and migrated as soon as possible.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-15 13:57:35 +02:00
lui87kw 3fe3d1fca3 Extra white space to follow other ifs
Signed-off-by: lui87kw <lukas.ifflaender@uni-wuerzburg.de>
2020-07-15 10:18:47 +02:00
bladewing 7dafd5831f Avoid substr() error when strpos returns false
"Exception: substr() expects parameter 3 to be int, bool given" can occur on Line 378 $mimePart = substr($icon, 0, strpos($icon, '-'));
This happens, when '-' is not found and strpos returns false instead of an int.
When this occurs, e.g., Activity hangs.

Signed-off-by: lui87kw <lukas.ifflaender@uni-wuerzburg.de>
2020-07-15 10:18:47 +02:00
Julius Härtl 35bdb998ef
Dashboard strict typing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-15 09:28:12 +02:00
Julius Härtl 31a1494529
Add load method for apps to bootstrap their panels
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-15 09:28:11 +02:00
Julius Härtl b71de68f43
Cleanup public api methods
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-15 09:28:11 +02:00
Julius Härtl 81e5593133
Move to lazy panel registration during registration context
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-15 09:27:57 +02:00
Julius Härtl 673d70dfc5
Add new dashboard public API
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-15 09:24:50 +02:00
Morris Jobke 157c652762
Merge pull request #21825 from nextcloud/fix/appframework/services
Fix AppFramework services
2020-07-14 17:07:38 +02:00
Morris Jobke fba64a972f
Merge pull request #21812 from nextcloud/feature/noid/app-bootstrap-without-app.php
Do not load app.php if Application implements IBootstrap
2020-07-14 17:06:06 +02:00
Roeland Jago Douma dca2469462
Merge pull request #21833 from nextcloud/docfix/noid/irequest_getHeader
Fix PHPDoc of IRequest::getHeader
2020-07-14 16:43:09 +02:00
Morris Jobke 6f167f0dd1
Merge pull request #21828 from nextcloud/enhancement/lazy-bootstrap-registration-delegation
Delegate bootstrap registration lazily
2020-07-14 16:37:04 +02:00
Roeland Jago Douma fa9dfd83c9
Fix AppFramework services
* We can't just register an alias as the services need the appId to be
  injected. if we just register an alias this blows up since the main
  container doesn't have the appId.
* Moved the Authtokens over to show the PoC works

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-14 16:01:14 +02:00
Morris Jobke d9cc2f0213
Do not load app.php if Application implements IBootstrap
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-14 15:55:23 +02:00
Christoph Wurst f03f88b437
Delegate bootstrap registration lazily
* Keep the registration context
* Expose the context object for other components
* Ensure registration is only run once

Search providers are migrated for demonstration.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-14 15:33:32 +02:00
Georg Ehrke 3bdfb380fc
Fix PHPDoc of IRequest::getHeader
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-07-14 14:20:43 +02:00
Christoph Wurst ab303dddcd
Make the PSR-3 adapter exception-aware
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-07-14 09:38:51 +02:00
Morris Jobke cbbbbee8b1
Merge pull request #21785 from nextcloud/techdebt/noid/remove-classmap-in-files_external
Move OC_Mount_Config to proper classname and remove OC::$CLASSPATH us…
2020-07-13 16:47:12 +02:00
Morris Jobke 7569bc15bd
Merge pull request #21789 from nextcloud/ftp-filter-hash
filter files containing a hash in the path for ftp storages
2020-07-13 10:56:16 +02:00
Robin Appelman e357d46863
filter files containing a hash in the path for ftp storages
the php ftp streamwrapper doesn't handle hashes correctly and will break when it tries to enter a path containing a hash.

By filtering out paths containing a hash we can at least stop the external storage from breaking completely

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-10 14:18:40 +02:00
Morris Jobke 065ef14cb0
Move OC_Mount_Config to proper classname and remove OC::$CLASSPATH usage in files_external
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-10 00:02:59 +02:00
Roeland Jago Douma 10d862e243
Merge pull request #21759 from nextcloud/enh/lazy_subscription
Make the subscription registry lazy
2020-07-09 15:43:48 +02:00
Roeland Jago Douma 725872c23a
Make the subscription registry lazy
This will allow to do lazy registration here which should allow for
loading less (or at least only when needed!).

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-09 12:21:06 +02:00
Robin Appelman 70906a359f
ensure home storage is initialized on first setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-09 11:14:45 +02:00
Roeland Jago Douma 43efac345e
Use the correct mountpoint to calculate
If we use the owners mount point this results in null. And then the rest
of the checks get called with null. Which doesn't work.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-09 11:14:44 +02:00
Morris Jobke 9e88456768
Fix regression in return value of OC_Util::checkDataDirectoryPermissions due to #21761
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-09 09:29:44 +02:00
Roeland Jago Douma c7d9636e82
Kill another unneeded translation
We should only translate things when we actually need them.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-08 21:47:16 +02:00
Roeland Jago Douma ce5cb5ac33
Merge pull request #21758 from nextcloud/fix/routes/defaults
Fix supporting defaults for routes
2020-07-08 20:42:28 +02:00
Roeland Jago Douma 3f447b9c8c
Fix supporting defaults for routes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-08 19:52:45 +02:00
Roeland Jago Douma 76eb793f9b
Only translate if we need the string
This translation was done in each call. Over and over and over again.
All while it was probably not used in 99.99999% of the cases. A small
gain. But still.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-08 15:12:01 +02:00
Robin Appelman 050e2fe346
allow admin to configure the max trashbin size
this allows an admin to configure the max trashbin size instead of always relying on the users quota.

The trashbin size can be configured using the `occ trash:size` command and can be set both globally and per-user

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-07 14:45:08 +02:00
Roeland Jago Douma edc1c77dd9
Do not create a RouteActionHandler object for each route
This is not required and doesn't allow us to be properly lazy. On top of
it this doesnt allow us to cache the routes (since closures/objects
can't be cached).

This is the first small step into cleaning up the routing we have

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-07 12:33:22 +02:00
Morris Jobke cd7a6276f2
Merge pull request #21676 from J0WI/fix-chmod-on-fd
Fix chmod on file descriptor
2020-07-07 09:44:57 +02:00