server.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. /** @var \OCP\IL10N $l */
  24. /** @var array $_ */
  25. ?>
  26. <div id="security-warning" class="section">
  27. <h2><?php p($l->t('Security & setup warnings'));?></h2>
  28. <p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.'));?></p>
  29. <ul>
  30. <?php
  31. // is php setup properly to query system environment variables like getenv('PATH')
  32. if ($_['getenvServerNotWorking']) {
  33. ?>
  34. <li>
  35. <?php p($l->t('php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?><br>
  36. <?php print_unescaped($l->t('Please check the <a target="_blank" rel="noreferrer" href="%s">installation documentation ↗</a> for php configuration notes and the php configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?>
  37. </li>
  38. <?php
  39. }
  40. // is read only config enabled
  41. if ($_['readOnlyConfigEnabled']) {
  42. ?>
  43. <li>
  44. <?php p($l->t('The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.')); ?>
  45. </li>
  46. <?php
  47. }
  48. // Are doc blocks accessible?
  49. if (!$_['isAnnotationsWorking']) {
  50. ?>
  51. <li>
  52. <?php p($l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?><br>
  53. <?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
  54. </li>
  55. <?php
  56. }
  57. // Is the Transaction isolation level READ_COMMITTED?
  58. if ($_['invalidTransactionIsolationLevel']) {
  59. ?>
  60. <li>
  61. <?php p($l->t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?>
  62. </li>
  63. <?php
  64. }
  65. // Warning if memcache is outdated
  66. foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
  67. ?>
  68. <li>
  69. <?php p($l->t('%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version.', $data)); ?>
  70. </li>
  71. <?php
  72. }
  73. // if module fileinfo available?
  74. if (!$_['has_fileinfo']) {
  75. ?>
  76. <li>
  77. <?php p($l->t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with MIME type detection.')); ?>
  78. </li>
  79. <?php
  80. }
  81. // locking configured optimally?
  82. if ($_['fileLockingType'] === 'none') {
  83. ?>
  84. <li>
  85. <?php print_unescaped($l->t('Transactional file locking is disabled, this might lead to issues with race conditions. Enable \'filelocking.enabled\' in config.php to avoid these problems. See the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a> for more information.', link_to_docs('admin-transactional-locking'))); ?>
  86. </li>
  87. <?php
  88. }
  89. // is locale working ?
  90. if (!$_['isLocaleWorking']) {
  91. ?>
  92. <li>
  93. <?php
  94. $locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
  95. p($l->t('System locale can not be set to a one which supports UTF-8.'));
  96. ?>
  97. <br>
  98. <?php
  99. p($l->t('This means that there might be problems with certain characters in file names.'));
  100. ?>
  101. <br>
  102. <?php
  103. p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
  104. ?>
  105. </li>
  106. <?php
  107. }
  108. if ($_['suggestedOverwriteCliUrl']) {
  109. ?>
  110. <li>
  111. <?php p($l->t('If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the "overwrite.cli.url" option in your config.php file to the webroot path of your installation (Suggested: "%s")', $_['suggestedOverwriteCliUrl'])); ?>
  112. </li>
  113. <?php
  114. }
  115. if ($_['cronErrors']) {
  116. ?>
  117. <li>
  118. <?php p($l->t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?>
  119. <br>
  120. <ol>
  121. <?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
  122. <li><?php p($error->error) ?> <?php p($error->hint) ?></li>
  123. <?php }};?>
  124. </ol>
  125. </li>
  126. <?php
  127. }
  128. ?>
  129. </ul>
  130. <div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
  131. <div class="loading"></div>
  132. <ul class="errors hidden"></ul>
  133. <ul class="warnings hidden"></ul>
  134. <ul class="info hidden"></ul>
  135. <p class="hint hidden">
  136. <?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="%s">log</a>.', [link_to_docs('admin-install'), \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => 'logging'])] )); ?>
  137. </p>
  138. </div>
  139. <div id="security-warning-state">
  140. <span class="hidden icon-checkmark"><?php p($l->t('All checks passed.'));?></span>
  141. </div>
  142. </div>
  143. <div class="section" id="backgroundjobs">
  144. <h2 class="inlineblock"><?php p($l->t('Background jobs'));?></h2>
  145. <?php if ($_['cron_log']): ?>
  146. <p class="cronlog inlineblock">
  147. <?php if ($_['lastcron'] !== false):
  148. $relative_time = relative_modified_date($_['lastcron']);
  149. $absolute_time = OC_Util::formatDate($_['lastcron']);
  150. if (time() - $_['lastcron'] <= 3600): ?>
  151. <span class="status success"></span>
  152. <span class="crondate" title="<?php p($absolute_time);?>">
  153. <?php p($l->t("Last job ran %s.", [$relative_time]));?>
  154. </span>
  155. <?php else: ?>
  156. <span class="status error"></span>
  157. <span class="crondate" title="<?php p($absolute_time);?>">
  158. <?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
  159. </span>
  160. <?php endif;
  161. else: ?>
  162. <span class="status error"></span>
  163. <?php p($l->t("Background job didn’t run yet!"));
  164. endif; ?>
  165. </p>
  166. <?php endif; ?>
  167. <a target="_blank" rel="noreferrer" class="icon-info"
  168. title="<?php p($l->t('Open documentation'));?>"
  169. href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a>
  170. <p class="settings-hint"><?php p($l->t('For optimal performance it\'s important to configure background jobs correctly. For bigger instances \'Cron\' is the recommended setting. Please see the documentation for more information.'));?></p>
  171. <p>
  172. <input type="radio" name="mode" value="ajax" class="radio"
  173. id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
  174. print_unescaped('checked="checked"');
  175. } ?>>
  176. <label for="backgroundjobs_ajax">AJAX</label><br/>
  177. <em><?php p($l->t("Execute one task with each page loaded")); ?></em>
  178. </p>
  179. <p>
  180. <input type="radio" name="mode" value="webcron" class="radio"
  181. id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
  182. print_unescaped('checked="checked"');
  183. } ?>>
  184. <label for="backgroundjobs_webcron">Webcron</label><br/>
  185. <em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?></em>
  186. </p>
  187. <p>
  188. <input type="radio" name="mode" value="cron" class="radio"
  189. id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
  190. print_unescaped('checked="checked"');
  191. }
  192. if (!$_['cli_based_cron_possible']) {
  193. print_unescaped('disabled');
  194. }?>>
  195. <label for="backgroundjobs_cron">Cron</label><br/>
  196. <em><?php p($l->t("Use system cron service to call the cron.php file every 15 minutes.")); ?>
  197. <?php if($_['cli_based_cron_possible']) {
  198. p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
  199. } else {
  200. print_unescaped(str_replace(
  201. ['{linkstart}', '{linkend}'],
  202. ['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'],
  203. $l->t('To run this you need the PHP posix extension. See {linkstart}PHP documentation{linkend} for more details.')
  204. ));
  205. } ?></em>
  206. </p>
  207. </div>
  208. <div class="section">
  209. <!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). -->
  210. <h2><?php p($l->t('Version'));?></h2>
  211. <p><strong><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></strong></p>
  212. </div>