aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/config/ConfigManager.php4
-rw-r--r--application/front/controller/admin/ServerController.php15
2 files changed, 13 insertions, 6 deletions
diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php
index a0acc94d..717a038f 100644
--- a/application/config/ConfigManager.php
+++ b/application/config/ConfigManager.php
@@ -371,8 +371,8 @@ class ConfigManager
371 $this->setEmpty('general.enable_async_metadata', true); 371 $this->setEmpty('general.enable_async_metadata', true);
372 $this->setEmpty('general.tags_separator', ' '); 372 $this->setEmpty('general.tags_separator', ' ');
373 373
374 $this->setEmpty('updates.check_updates', false); 374 $this->setEmpty('updates.check_updates', true);
375 $this->setEmpty('updates.check_updates_branch', 'stable'); 375 $this->setEmpty('updates.check_updates_branch', 'latest');
376 $this->setEmpty('updates.check_updates_interval', 86400); 376 $this->setEmpty('updates.check_updates_interval', 86400);
377 377
378 $this->setEmpty('feed.rss_permalinks', true); 378 $this->setEmpty('feed.rss_permalinks', true);
diff --git a/application/front/controller/admin/ServerController.php b/application/front/controller/admin/ServerController.php
index 575a2f9d..fabeaf2f 100644
--- a/application/front/controller/admin/ServerController.php
+++ b/application/front/controller/admin/ServerController.php
@@ -25,9 +25,16 @@ class ServerController extends ShaarliAdminController
25 */ 25 */
26 public function index(Request $request, Response $response): Response 26 public function index(Request $request, Response $response): Response
27 { 27 {
28 $latestVersion = 'v' . ApplicationUtils::getVersion( 28 $releaseUrl = ApplicationUtils::$GITHUB_URL . '/releases/';
29 ApplicationUtils::$GIT_RAW_URL . '/latest/' . ApplicationUtils::$VERSION_FILE 29 if ($this->container->conf->get('updates.check_updates', true)) {
30 ); 30 $latestVersion = 'v' . ApplicationUtils::getVersion(
31 ApplicationUtils::$GIT_RAW_URL . '/latest/' . ApplicationUtils::$VERSION_FILE
32 );
33 $releaseUrl .= 'tag/' . $latestVersion;
34 } else {
35 $latestVersion = t('Check disabled');
36 }
37
31 $currentVersion = ApplicationUtils::getVersion('./shaarli_version.php'); 38 $currentVersion = ApplicationUtils::getVersion('./shaarli_version.php');
32 $currentVersion = $currentVersion === 'dev' ? $currentVersion : 'v' . $currentVersion; 39 $currentVersion = $currentVersion === 'dev' ? $currentVersion : 'v' . $currentVersion;
33 $phpEol = new \DateTimeImmutable(ApplicationUtils::getPhpEol(PHP_VERSION)); 40 $phpEol = new \DateTimeImmutable(ApplicationUtils::getPhpEol(PHP_VERSION));
@@ -37,7 +44,7 @@ class ServerController extends ShaarliAdminController
37 $this->assignView('php_has_reached_eol', $phpEol < new \DateTimeImmutable()); 44 $this->assignView('php_has_reached_eol', $phpEol < new \DateTimeImmutable());
38 $this->assignView('php_extensions', ApplicationUtils::getPhpExtensionsRequirement()); 45 $this->assignView('php_extensions', ApplicationUtils::getPhpExtensionsRequirement());
39 $this->assignView('permissions', ApplicationUtils::checkResourcePermissions($this->container->conf)); 46 $this->assignView('permissions', ApplicationUtils::checkResourcePermissions($this->container->conf));
40 $this->assignView('release_url', ApplicationUtils::$GITHUB_URL . '/releases/tag/' . $latestVersion); 47 $this->assignView('release_url', $releaseUrl);
41 $this->assignView('latest_version', $latestVersion); 48 $this->assignView('latest_version', $latestVersion);
42 $this->assignView('current_version', $currentVersion); 49 $this->assignView('current_version', $currentVersion);
43 $this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode')); 50 $this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode'));