Explorar el Código

Move auto-update server URL in configuration

Fix https://github.com/FreshRSS/FreshRSS/issues/1019
Marien Fressinaud hace 10 años
padre
commit
bb0556543d
Se han modificado 3 ficheros con 6 adiciones y 3 borrados
  1. 3 2
      app/Controllers/updateController.php
  2. 0 1
      constants.php
  3. 3 0
      data/config.default.php

+ 3 - 2
app/Controllers/updateController.php

@@ -53,7 +53,8 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 			return;
 		}
 
-		$c = curl_init(FRESHRSS_UPDATE_WEBSITE);
+		$auto_update_url = FreshRSS_Context::$system_conf->auto_update_url . '?v=' . FRESHRSS_VERSION;
+		$c = curl_init($auto_update_url);
 		curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
 		curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true);
 		curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2);
@@ -70,7 +71,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 			$this->view->message = array(
 				'status' => 'bad',
 				'title' => _t('gen.short.damn'),
-				'body' => _t('feedback.update.server_not_found', FRESHRSS_UPDATE_WEBSITE)
+				'body' => _t('feedback.update.server_not_found', $auto_update_url)
 			);
 			return;
 		}

+ 0 - 1
constants.php

@@ -1,7 +1,6 @@
 <?php
 define('FRESHRSS_VERSION', '1.1.4-dev');
 define('FRESHRSS_WEBSITE', 'http://freshrss.org');
-define('FRESHRSS_UPDATE_WEBSITE', 'https://update.freshrss.org?v=' . FRESHRSS_VERSION);
 define('FRESHRSS_WIKI', 'http://doc.freshrss.org');
 
 // PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level)

+ 3 - 0
data/config.default.php

@@ -18,6 +18,9 @@ return array(
 	# https://freshrss.example.net/
 	'base_url' => '',
 
+	# Specify address of the FreshRSS auto-update server.
+	'auto_update_url' => 'https://update.freshrss.org',
+
 	# Natural language of the user interface, e.g. `en`, `fr`.
 	'language' => 'en',