From 28c71fb56bdcefaafdd5c34b255a3bdcb3f16409 Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Thu, 23 Feb 2017 21:22:56 +0100 Subject: [PATCH 1/2] Add config option to disable and hide self-update --- app/Controllers/updateController.php | 2 +- app/layout/aside_configure.phtml | 2 ++ app/layout/header.phtml | 2 ++ data/config.default.php | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 8f939dbdb68e..b4e8a0bff1a2 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -162,7 +162,7 @@ public function checkAction() { } public function applyAction() { - if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH)) { + if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH) || Minz_Configuration::get('system')->disable_update) { Minz_Request::forward(array('c' => 'update'), true); } diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index d956ec21f6fb..94f5b1f6ca8c 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -41,9 +41,11 @@ Minz_Request::actionName() === 'checkInstall' ? ' active' : ''; ?>"> + disable_update) { ?>
  • + diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 238c664b084b..e589ed7ef63b 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -71,8 +71,10 @@ if (FreshRSS_Auth::accessNeedsAction()) {
  • + disable_update) { ?>
  • +
  • diff --git a/data/config.default.php b/data/config.default.php index 433207a9c430..748df1884fd5 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -146,4 +146,7 @@ # List of enabled FreshRSS extensions. 'extensions_enabled' => array(), + + # Disable self-update, + 'disable_update' => false, ); From 889320a6f94b66e9ddeaba35c8396354369b2244 Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Fri, 24 Feb 2017 07:20:50 +0100 Subject: [PATCH 2/2] Added disable_update option to cli/do-install.php --- cli/do-install.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/do-install.php b/cli/do-install.php index 100d4947fe0c..483ec5224c2d 100755 --- a/cli/do-install.php +++ b/cli/do-install.php @@ -13,6 +13,7 @@ 'auth_type:', 'api_enabled', 'allow_robots', + 'disable_update', ); $dBparams = array( @@ -31,7 +32,7 @@ " --environment production --base_url https://rss.example.net/" . " --title FreshRSS --allow_anonymous --api_enabled" . " --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123" . - " --db-base freshrss --db-prefix freshrss_ )"); + " --db-base freshrss --db-prefix freshrss_ --disable_update )"); } fwrite(STDERR, 'FreshRSS install…' . "\n");