Commit Graph

65 Commits

Author SHA1 Message Date
Côme Chilliet f68d4f7300
Remove deprecated methods Util::writeLog and DIContainer::log
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-25 10:37:12 +02:00
Joas Schilling 3962cd0aa8
fix!: Move getEventDispatcher usage to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:22 +02:00
Christoph Wurst 14719110b9 chore: Replace \OC::$server->query with \OCP\Server::get in /lib
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-07-06 15:21:22 +02:00
Robin Appelman 9f1d497a0b
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in  lib/private to improve code readability.
2023-06-01 23:10:00 +02:00
Christoph Wurst 999aec366a
chore: Drop \OC_App::getSettingsNavigation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-06-01 11:31:27 +02:00
Christoph Wurst 167763d312
chore: Drop \OC_App::getNavigation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-06-01 11:31:27 +02:00
Christoph Wurst e76d525a43
chore: Drop \OC_App::getAppInfo
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-06-01 11:31:27 +02:00
Christoph Wurst cf6e2fa1b7
chore: Drop \OC_App::getAppVersion
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-06-01 11:31:26 +02:00
Christoph Wurst dd2d50471e
chore!: Drop \OC_App::isEnabled
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-05-31 15:06:25 +02:00
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +03:30
Carl Schwan b1ec7ff51f
Add missing taint analysis docblock comments, and improve escaping in some methods
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-24 17:17:53 +02:00
Côme Chilliet e94a689bca
Fix version number in phpdoc for app loading refactor
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-27 14:27:23 +02:00
Côme Chilliet 13c71ed24a
Small cleanups for AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-20 10:21:45 +01:00
Côme Chilliet 78c1716818
Move loadApps to the AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-20 10:21:45 +01:00
Côme Chilliet 8dc5f82189
Move isType to AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-20 10:21:45 +01:00
Côme Chilliet a7c8090dc3
Move loadApp function to the AppManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-20 10:01:17 +01:00
Christoph Wurst 416c824c74 perf(autoloader): Drop legacy class autoloader
The documentation says apps should use PSR-4 to get their classes
loaded. The legacy PSR-0 is still in place and has a negative impact on
performance.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-03-16 12:02:09 +00:00
Thomas Citharel f1751c4428
Introduced app enable/disable/update typed events
OCP\App\ManagerEvent is depreciated since 22 without a replacement

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-03-13 11:52:57 +01:00
Robin Appelman fe78ef7a38 instrumentation for app booting
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-09 17:41:43 +01:00
Côme Chilliet 2a4ab201b7
Make sure application are only loaded once
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 16:06:32 +01:00
Maxence Lange 4cac49c797 refresh cached app folder on install/upgrade
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2023-02-01 11:07:31 -01:00
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
zorn-v a27388ccd3
Fix alternative logins custom css class
In NC 25 login page was changed, and alternative login css class get from `class` prop but not `style`. 
It is correct change in my opinion, so just add backend fix.

Signed-off-by: zorn-v <zorn7@yandex.ru>
2022-10-20 14:32:13 +10:00
Côme Chilliet a2a7150d6d
Migrate Repair events to OCP\EventDispatcher\Event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-25 16:15:48 +02:00
Côme Chilliet 4f260dce6e
Moving to string key for arguments of GenericEvent in Repair
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-25 16:13:46 +02:00
Carl Schwan 458c2fa297
Remove OCP\App and OCP\BackgroundJob
Both deprecated since NC 23

IAppManager is the replacement for OCP\App unfortunately it can't be
dependency injected in classes used by the installed otherwise the
database connection is initialised too early

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-01 09:46:40 +02:00
Arthur Schiwon 0f2e75a6ce
fix loading legacy app.php with multi app dir
- requireAppFile() only appends /appinfo/app.php
- without the absolute path, require_once looks into include_path
- the first match in inlcude_path however migth be different from appPath
- fixed by providing the tested(!), full path to the app


Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-07-18 20:19:02 +02:00
Joas Schilling d96633916c
Log exception
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 14:45:58 +02:00
Joas Schilling a06ba88502
Fix \OC_App::getCurrentApp() when being called from CLI or phpunit
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 14:08:37 +02:00
Julius Härtl eede608c0e
Add event logging to app loading
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-02-28 11:24:41 +01:00
Joas Schilling 06611e4780
Revert "Fix "never catch" catches in OC_App" 2021-10-25 08:41:56 +02:00
zorn-v 9cb0b8c713 Fix "never catch" catches in OC_App
Need to check another legacy. Need to explicitly add to use or do not forget add slash `\`
2021-10-22 09:29:03 +00:00
Joas Schilling 4cae2cc06c
Merge pull request #29004 from nextcloud/bugfix/noid/fix-translated-app-details
Fix translated app details
2021-10-13 11:37:22 +02:00
Bjoern Schiessle 664bd5802f add 'supported'-label to all supported apps, also if they are not downloaded yet
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2021-10-06 22:17:50 +02:00
Joas Schilling 37f40cdd46
Fix translated app details
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-09-30 09:08:17 +02:00
Carl Schwan 6958d8005a
Add admin privilege delegation for admin settings
This makes it possible for selected groups to access some settings
pages.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-09-29 21:43:31 +02:00
Gary Kim 92555b6014
Allow removing apps with app store disabled
Signed-off-by: Gary Kim <gary@garykim.dev>
2021-05-24 10:35:51 -04:00
Joas Schilling 784b059a01
Don't break OCC if an app is breaking in it's Application class
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-05-05 10:41:18 +02:00
Joas Schilling bb0c50717c
Bye bye database.xml
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-24 20:04:12 +01:00
Robin Appelman 9e3775618b
log full expection during repair step
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-18 08:45:17 +01:00
Roeland Jago Douma 25f9203a70 Fix remaining #25359
As a wise man once said:

"I like PRs that pass tests before merging"
C. Wurst, Feb 9th 2021

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-02-10 15:41:25 +01:00
Christoph Wurst aabd73912e
Type the service registration
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-10 09:44:24 +01: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 +01:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Christoph Wurst cbb34af53f
Do not update incompatible apps
Previously there was no (platform) dependency check for an app that was
installed before. So Nextcloud happily upgraded an app that now requires
a php version newer than the current one. Which means in the lucky case
you see a failing upgrade due to the language incompatibility, or in the
unlucky case you see unexpected errors later in production.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-04 17:05:22 +01:00
Christoph Wurst fd649afb1f
Remove the deprecated update.php
* It was documented as deprecated.
* The app code checker warned about it
* It's been three years

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-11-27 13:02:59 +01:00
Roeland Jago Douma 032de4f333
Merge pull request #24269 from nextcloud/taint-specialize
Mark getAppPath as specialized taint
2020-11-22 13:39:46 +01:00
Lukas Reschke d25ca1976b Mark getAppPath as specialized taint
Should remove some false positives.

https://psalm.dev/docs/security_analysis/avoiding_false_positives/

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2020-11-21 01:15:15 +00:00
Lukas Reschke 98ddfdd1e8 Mark cleanAppId as sanitizer for include
Should remove a bunch of false positive code scanning results.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2020-11-21 00:57:25 +00:00
Lukas Reschke 47ac8e0028
Add Psalm Taint Flow Analysis
This adds the Psalm Security Analysis, as described at
https://psalm.dev/docs/security_analysis/

It also adds a plugin for adding input into AppFramework.

The results can be viewed in the GitHub Security tab at
https://github.com/nextcloud/server/security/code-scanning

**Q&A:**

Q: Why do you not use the shipped Psalm version?
A: I do a lot of changes to the Psalm Taint behaviour. Using released
versions is not gonna get us the results we want.

Q: How do I improve false positives?
A: https://psalm.dev/docs/security_analysis/avoiding_false_positives/

Q: How do I add custom sources?
A: https://psalm.dev/docs/security_analysis/custom_taint_sources/

Q: We should run this on apps!
A: Yes.

Q: What will change in Psalm?
A: Quite some of the PHP core functions are not yet marked to propagate
the taint. This leads to results where the taint flow is lost. That's
something that I am currently working on.

Q: Why is the plugin MIT licensed?
A: Because its the first of its kind (based on GitHub Code Search) and
I want other people to copy it if they want to. Security is for all :)

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2020-11-20 23:12:00 +01:00