aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-03-04 09:44:19 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-03-04 20:17:01 +0000
commita258abfe5940fa70edde9932c817b0dbcf72883c (patch)
treede0af8dbe2288b6734d424db162a7e79ef871f80 /lib
parenta14ec0ace63db04966ba6ad596b88ce369c7987b (diff)
downloadnextcloud-server-a258abfe5940fa70edde9932c817b0dbcf72883c.tar.gz
nextcloud-server-a258abfe5940fa70edde9932c817b0dbcf72883c.zip
fix: Fetch custom app store url without internet connection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index a693804f50f..4f1250d4eb7 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -44,6 +44,7 @@ use Psr\Log\LoggerInterface;
abstract class Fetcher {
public const INVALIDATE_AFTER_SECONDS = 3600;
public const RETRY_AFTER_FAILURE_SECONDS = 300;
+ public const APP_STORE_URL = 'https://apps.nextcloud.com/api/v1';
/** @var IAppData */
protected $appData;
@@ -109,7 +110,7 @@ abstract class Fetcher {
];
}
- if ($this->config->getSystemValueString('appstoreurl', 'https://apps.nextcloud.com/api/v1') === 'https://apps.nextcloud.com/api/v1') {
+ if ($this->config->getSystemValueString('appstoreurl', self::APP_STORE_URL) === self::APP_STORE_URL) {
// If we have a valid subscription key, send it to the appstore
$subscriptionKey = $this->config->getAppValue('support', 'subscription_key');
if ($this->registry->delegateHasValidSubscription() && $subscriptionKey) {
@@ -153,8 +154,9 @@ abstract class Fetcher {
public function get($allowUnstable = false) {
$appstoreenabled = $this->config->getSystemValueBool('appstoreenabled', true);
$internetavailable = $this->config->getSystemValueBool('has_internet_connection', true);
+ $isDefaultAppStore = $this->config->getSystemValueString('appstoreurl', self::APP_STORE_URL) === self::APP_STORE_URL;
- if (!$appstoreenabled || !$internetavailable) {
+ if (!$appstoreenabled || (!$internetavailable && $isDefaultAppStore)) {
return [];
}