diff --git a/apps/comments/appinfo/info.xml b/apps/comments/appinfo/info.xml
index 88f780cf7deab..70a1695b92391 100644
--- a/apps/comments/appinfo/info.xml
+++ b/apps/comments/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Arthur Schiwon
Vincent Petry
-
diff --git a/apps/contactsinteraction/appinfo/info.xml b/apps/contactsinteraction/appinfo/info.xml
index 8ea086712c057..2f52ff2c030ae 100644
--- a/apps/contactsinteraction/appinfo/info.xml
+++ b/apps/contactsinteraction/appinfo/info.xml
@@ -13,7 +13,6 @@
-
integration
social
https://github.com/nextcloud/server/issues
diff --git a/apps/dashboard/appinfo/info.xml b/apps/dashboard/appinfo/info.xml
index a21f3ab47b10e..5969c5d1dee53 100644
--- a/apps/dashboard/appinfo/info.xml
+++ b/apps/dashboard/appinfo/info.xml
@@ -14,7 +14,6 @@ they like and change the background to their liking.]]>
agpl
Julius Härtl
Dashboard
-
customization
diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml
index deb99b1c33bf1..02fbe970c47a0 100644
--- a/apps/dav/appinfo/info.xml
+++ b/apps/dav/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
owncloud.org
DAV
-
diff --git a/apps/federation/appinfo/info.xml b/apps/federation/appinfo/info.xml
index 6728033576914..263ffad2092ae 100644
--- a/apps/federation/appinfo/info.xml
+++ b/apps/federation/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Bjoern Schiessle
Federation
-
diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml
index f62a913e8f435..6c8c043cd2c6b 100644
--- a/apps/files/appinfo/info.xml
+++ b/apps/files/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Robin Appelman
Vincent Petry
-
diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml
index 44f3e3a45cda7..66c49d6eeb686 100644
--- a/apps/files_sharing/appinfo/info.xml
+++ b/apps/files_sharing/appinfo/info.xml
@@ -14,7 +14,6 @@ Turning the feature off removes shared files and folders on the server for all s
Michael Gapczynski
Bjoern Schiessle
Files_Sharing
-
diff --git a/apps/files_trashbin/appinfo/info.xml b/apps/files_trashbin/appinfo/info.xml
index b8f4b5ea6b17f..f63953ade9b66 100644
--- a/apps/files_trashbin/appinfo/info.xml
+++ b/apps/files_trashbin/appinfo/info.xml
@@ -13,7 +13,6 @@ To prevent a user from running out of disk space, the Deleted files app will not
agpl
Bjoern Schiessle
Files_Trashbin
-
diff --git a/apps/files_versions/appinfo/info.xml b/apps/files_versions/appinfo/info.xml
index 49e48e6e43696..bdd699d620cef 100644
--- a/apps/files_versions/appinfo/info.xml
+++ b/apps/files_versions/appinfo/info.xml
@@ -13,7 +13,6 @@
Frank Karlitschek
Bjoern Schiessle
Files_Versions
-
diff --git a/apps/lookup_server_connector/appinfo/info.xml b/apps/lookup_server_connector/appinfo/info.xml
index cf486e062286b..5cc54c7e9f23f 100644
--- a/apps/lookup_server_connector/appinfo/info.xml
+++ b/apps/lookup_server_connector/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Bjoern Schiessle
LookupServerConnector
-
diff --git a/apps/oauth2/appinfo/info.xml b/apps/oauth2/appinfo/info.xml
index ae2fcb0998610..6eed9b9d18e57 100644
--- a/apps/oauth2/appinfo/info.xml
+++ b/apps/oauth2/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Lukas Reschke
OAuth2
-
diff --git a/apps/provisioning_api/appinfo/info.xml b/apps/provisioning_api/appinfo/info.xml
index dd01689950a0c..56dc6e610d4c2 100644
--- a/apps/provisioning_api/appinfo/info.xml
+++ b/apps/provisioning_api/appinfo/info.xml
@@ -17,7 +17,6 @@
agpl
Tom Needham
Provisioning_API
-
diff --git a/apps/settings/appinfo/info.xml b/apps/settings/appinfo/info.xml
index 13e5eddcdf2ec..f030c1e5c50f7 100644
--- a/apps/settings/appinfo/info.xml
+++ b/apps/settings/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Nextcloud
Settings
-
customization
https://github.com/nextcloud/server/issues
diff --git a/apps/sharebymail/appinfo/info.xml b/apps/sharebymail/appinfo/info.xml
index f4d2900c80df3..70458f44d1990 100644
--- a/apps/sharebymail/appinfo/info.xml
+++ b/apps/sharebymail/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Bjoern Schiessle
ShareByMail
-
diff --git a/apps/systemtags/appinfo/info.xml b/apps/systemtags/appinfo/info.xml
index 9e0b347acbdb4..1f572a831d67b 100644
--- a/apps/systemtags/appinfo/info.xml
+++ b/apps/systemtags/appinfo/info.xml
@@ -11,7 +11,6 @@
Vincent Petry
Joas Schilling
SystemTags
-
diff --git a/apps/theming/appinfo/info.xml b/apps/theming/appinfo/info.xml
index b67b461c410f8..6823a9fbd886c 100644
--- a/apps/theming/appinfo/info.xml
+++ b/apps/theming/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Nextcloud
Theming
-
diff --git a/apps/updatenotification/appinfo/info.xml b/apps/updatenotification/appinfo/info.xml
index 44fa6b9c50f70..626316f04aa4b 100644
--- a/apps/updatenotification/appinfo/info.xml
+++ b/apps/updatenotification/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Lukas Reschke
UpdateNotification
-
monitoring
https://github.com/nextcloud/server/issues
diff --git a/apps/user_status/appinfo/info.xml b/apps/user_status/appinfo/info.xml
index c385886e9464c..23f07eb325ae2 100644
--- a/apps/user_status/appinfo/info.xml
+++ b/apps/user_status/appinfo/info.xml
@@ -9,7 +9,6 @@
agpl
Georg Ehrke
UserStatus
-
social
https://github.com/nextcloud/server
diff --git a/apps/weather_status/appinfo/info.xml b/apps/weather_status/appinfo/info.xml
index 50d107855fdfe..403d5eb3e5dea 100644
--- a/apps/weather_status/appinfo/info.xml
+++ b/apps/weather_status/appinfo/info.xml
@@ -11,7 +11,6 @@
agpl
Julien Veyssier
WeatherStatus
-
integration
dashboard
https://github.com/nextcloud/server
diff --git a/core/shipped.json b/core/shipped.json
index 33980afb7c428..e140779828999 100644
--- a/core/shipped.json
+++ b/core/shipped.json
@@ -47,6 +47,46 @@
"weather_status",
"workflowengine"
],
+ "defaultEnabled": [
+ "activity",
+ "circles",
+ "comments",
+ "contactsinteraction",
+ "dashboard",
+ "dav",
+ "federation",
+ "files",
+ "files_pdfviewer",
+ "files_rightclick",
+ "files_sharing",
+ "files_trashbin",
+ "files_versions",
+ "files_videoplayer",
+ "firstrunwizard",
+ "logreader",
+ "lookup_server_connector",
+ "nextcloud_announcements",
+ "notifications",
+ "oauth2",
+ "password_policy",
+ "photos",
+ "privacy",
+ "provisioning_api",
+ "recommendations",
+ "related_resources",
+ "serverinfo",
+ "settings",
+ "sharebymail",
+ "support",
+ "survey_client",
+ "systemtags",
+ "text",
+ "theming",
+ "updatenotification",
+ "user_status",
+ "viewer",
+ "weather_status"
+ ],
"alwaysEnabled": [
"files",
"cloud_federation_api",
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index f154bd854ada0..6d2fe51d0eddf 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -13,6 +13,7 @@
* @author Julius Haertl
* @author Julius Härtl
* @author Lukas Reschke
+ * @author Maxence Lange
* @author Morris Jobke
* @author Robin Appelman
* @author Roeland Jago Douma
@@ -91,8 +92,8 @@ class AppManager implements IAppManager {
/** @var string[] */
private $shippedApps;
- /** @var string[] */
- private $alwaysEnabled;
+ private array $alwaysEnabled = [];
+ private array $defaultEnabled = [];
/** @var array */
private $appInfos = [];
@@ -574,6 +575,7 @@ private function loadShippedJson() {
$content = json_decode(file_get_contents($shippedJson), true);
$this->shippedApps = $content['shippedApps'];
$this->alwaysEnabled = $content['alwaysEnabled'];
+ $this->defaultEnabled = $content['defaultEnabled'];
}
}
@@ -584,4 +586,20 @@ public function getAlwaysEnabledApps() {
$this->loadShippedJson();
return $this->alwaysEnabled;
}
+
+ /**
+ * @inheritdoc
+ */
+ public function isDefaultEnabled(string $appId): bool {
+ return (in_array($appId, $this->getDefaultEnabledApps()));
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getDefaultEnabledApps():array {
+ $this->loadShippedJson();
+
+ return $this->defaultEnabled;
+ }
}
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 86d933b6fbd9d..43c3db7c3fdf9 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -545,8 +545,7 @@ public static function installShippedApps($softErrors = false) {
if ($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) {
if (file_exists($app_dir['path']."/$filename/appinfo/info.xml")) {
if ($config->getAppValue($filename, "installed_version", null) === null) {
- $info = OC_App::getAppInfo($filename);
- $enabled = isset($info['default_enable']);
+ $enabled = $appManager->isDefaultEnabled($filename);
if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps()))
&& $config->getAppValue($filename, 'enabled') !== 'no') {
if ($softErrors) {
diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php
index e0b5c049290d6..f7c9d84809939 100644
--- a/lib/public/App/IAppManager.php
+++ b/lib/public/App/IAppManager.php
@@ -83,6 +83,17 @@ public function isEnabledForUser($appId, $user = null);
*/
public function isInstalled($appId);
+ /**
+ * Check if an app should be enabled by default
+ *
+ * Notice: This actually checks if the app should be enabled by default
+ * and not if currently installed/enabled
+ *
+ * @param string $appId ID of the app
+ * @since 25.0.0
+ */
+ public function isDefaultEnabled(string $appId):bool;
+
/**
* Enable an app for every user
*
@@ -178,6 +189,12 @@ public function isShipped($appId);
*/
public function getAlwaysEnabledApps();
+ /**
+ * @return string[] app IDs
+ * @since 25.0.0
+ */
+ public function getDefaultEnabledApps(): array;
+
/**
* @param \OCP\IGroup $group
* @return String[]
diff --git a/tests/acceptance/features/bootstrap/AppsManagementContext.php b/tests/acceptance/features/bootstrap/AppsManagementContext.php
index 747ef3d96b52c..908754163d7aa 100644
--- a/tests/acceptance/features/bootstrap/AppsManagementContext.php
+++ b/tests/acceptance/features/bootstrap/AppsManagementContext.php
@@ -243,7 +243,7 @@ public function iSeeThatThereAreOnlyEnabledApps() {
*/
public function iSeeTheAppBundles() {
Assert::assertTrue(
- $this->actor->find(self::rowForApp('Auditing / Logging'), 2)->isVisible()
+ $this->actor->find(self::rowForApp('Auditing / Logging'), 10)->isVisible()
);
Assert::assertTrue(
$this->actor->find(self::rowForApp('LDAP user and group backend'), 2)->isVisible()