Skip to content

Commit

Permalink
Merge pull request FreshRSS#1436 from dswd/disable-update
Browse files Browse the repository at this point in the history
Add config option to disable and hide self-update
  • Loading branch information
Alkarex committed Feb 24, 2017
2 parents 28244ca + 889320a commit 590f133
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/updateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions app/layout/aside_configure.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
Minz_Request::actionName() === 'checkInstall' ? ' active' : ''; ?>">
<a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a>
</li>
<?php if (!Minz_Configuration::get('system')->disable_update) { ?>
<li class="item<?php echo Minz_Request::controllerName() === 'update' &&
Minz_Request::actionName() === 'index' ? ' active' : ''; ?>">
<a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a>
</li>
<?php } ?>
<?php } ?>
</ul>
2 changes: 2 additions & 0 deletions app/layout/header.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ if (FreshRSS_Auth::accessNeedsAction()) {
<li class="item"><a href="<?php echo _url('user', 'manage'); ?>"><?php echo _t('gen.menu.user_management'); ?></a></li>
<li class="item"><a href="<?php echo _url('auth', 'index'); ?>"><?php echo _t('gen.menu.authentication'); ?></a></li>
<li class="item"><a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a></li>
<?php if (!Minz_Configuration::get('system')->disable_update) { ?>
<li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a></li>
<?php } ?>
<?php } ?>
<li class="separator"></li>
<li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('gen.menu.stats'); ?></a></li>
<li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('gen.menu.logs'); ?></a></li>
Expand Down
3 changes: 2 additions & 1 deletion cli/do-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'auth_type:',
'api_enabled',
'allow_robots',
'disable_update',
);

$dBparams = array(
Expand All @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions data/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,7 @@

# List of enabled FreshRSS extensions.
'extensions_enabled' => array(),

# Disable self-update,
'disable_update' => false,
);

0 comments on commit 590f133

Please sign in to comment.