server.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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. <ul>
  29. <?php
  30. // is php setup properly to query system environment variables like getenv('PATH')
  31. if ($_['getenvServerNotWorking']) {
  32. ?>
  33. <li>
  34. <?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>
  35. <?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'))); ?>
  36. </li>
  37. <?php
  38. }
  39. // is read only config enabled
  40. if ($_['readOnlyConfigEnabled']) {
  41. ?>
  42. <li>
  43. <?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.')); ?>
  44. </li>
  45. <?php
  46. }
  47. // Are doc blocks accessible?
  48. if (!$_['isAnnotationsWorking']) {
  49. ?>
  50. <li>
  51. <?php p($l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?><br>
  52. <?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
  53. </li>
  54. <?php
  55. }
  56. // Is the Transaction isolation level READ_COMMITTED?
  57. if ($_['invalidTransactionIsolationLevel']) {
  58. ?>
  59. <li>
  60. <?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.')); ?>
  61. </li>
  62. <?php
  63. }
  64. // Warning if memcache is outdated
  65. foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
  66. ?>
  67. <li>
  68. <?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)); ?>
  69. </li>
  70. <?php
  71. }
  72. // if module fileinfo available?
  73. if (!$_['has_fileinfo']) {
  74. ?>
  75. <li>
  76. <?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.')); ?>
  77. </li>
  78. <?php
  79. }
  80. // locking configured optimally?
  81. if ($_['fileLockingType'] === 'none') {
  82. ?>
  83. <li>
  84. <?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'))); ?>
  85. </li>
  86. <?php
  87. }
  88. // is locale working ?
  89. if (!$_['isLocaleWorking']) {
  90. ?>
  91. <li>
  92. <?php
  93. $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';
  94. p($l->t('System locale can not be set to a one which supports UTF-8.'));
  95. ?>
  96. <br>
  97. <?php
  98. p($l->t('This means that there might be problems with certain characters in file names.'));
  99. ?>
  100. <br>
  101. <?php
  102. p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
  103. ?>
  104. </li>
  105. <?php
  106. }
  107. if ($_['suggestedOverwriteCliUrl']) {
  108. ?>
  109. <li>
  110. <?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'])); ?>
  111. </li>
  112. <?php
  113. }
  114. if ($_['cronErrors']) {
  115. ?>
  116. <li>
  117. <?php p($l->t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?>
  118. <br>
  119. <ol>
  120. <?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
  121. <li><?php p($error->error) ?> <?php p($error->hint) ?></li>
  122. <?php }};?>
  123. </ol>
  124. </li>
  125. <?php
  126. }
  127. ?>
  128. </ul>
  129. <div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
  130. <div class="loading"></div>
  131. <ul class="errors hidden"></ul>
  132. <ul class="warnings hidden"></ul>
  133. <ul class="info hidden"></ul>
  134. <p class="hint hidden">
  135. <?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'])] )); ?>
  136. </p>
  137. </div>
  138. <div id="security-warning-state">
  139. <span class="hidden icon-checkmark"><?php p($l->t('All checks passed.'));?></span>
  140. </div>
  141. </div>
  142. <div class="section" id="backgroundjobs">
  143. <h2 class="inlineblock"><?php p($l->t('Cron'));?></h2>
  144. <?php if ($_['cron_log']): ?>
  145. <p class="cronlog inlineblock">
  146. <?php if ($_['lastcron'] !== false):
  147. $relative_time = relative_modified_date($_['lastcron']);
  148. $absolute_time = OC_Util::formatDate($_['lastcron']);
  149. if (time() - $_['lastcron'] <= 3600): ?>
  150. <span class="status success"></span>
  151. <span class="crondate" title="<?php p($absolute_time);?>">
  152. <?php p($l->t("Last cron job execution: %s.", [$relative_time]));?>
  153. </span>
  154. <?php else: ?>
  155. <span class="status error"></span>
  156. <span class="crondate" title="<?php p($absolute_time);?>">
  157. <?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?>
  158. </span>
  159. <?php endif;
  160. else: ?>
  161. <span class="status error"></span>
  162. <?php p($l->t("Cron was not executed yet!"));
  163. endif; ?>
  164. </p>
  165. <?php endif; ?>
  166. <a target="_blank" rel="noreferrer" class="icon-info"
  167. title="<?php p($l->t('Open documentation'));?>"
  168. href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a>
  169. <p>
  170. <input type="radio" name="mode" value="ajax" class="radio"
  171. id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
  172. print_unescaped('checked="checked"');
  173. } ?>>
  174. <label for="backgroundjobs_ajax">AJAX</label><br/>
  175. <em><?php p($l->t("Execute one task with each page loaded")); ?></em>
  176. </p>
  177. <p>
  178. <input type="radio" name="mode" value="webcron" class="radio"
  179. id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
  180. print_unescaped('checked="checked"');
  181. } ?>>
  182. <label for="backgroundjobs_webcron">Webcron</label><br/>
  183. <em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?></em>
  184. </p>
  185. <p>
  186. <input type="radio" name="mode" value="cron" class="radio"
  187. id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
  188. print_unescaped('checked="checked"');
  189. }
  190. if (!$_['cli_based_cron_possible']) {
  191. print_unescaped('disabled');
  192. }?>>
  193. <label for="backgroundjobs_cron">Cron</label><br/>
  194. <em><?php p($l->t("Use system's cron service to call the cron.php file every 15 minutes.")); ?>
  195. <?php if($_['cli_based_cron_possible']) {
  196. p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
  197. } else {
  198. print_unescaped(str_replace(
  199. ['{linkstart}', '{linkend}'],
  200. ['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'],
  201. $l->t('To run this you need the PHP posix extension. See {linkstart}PHP documentation{linkend} for more details.')
  202. ));
  203. } ?></em>
  204. </p>
  205. </div>
  206. <div class="section">
  207. <!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). -->
  208. <h2><?php p($l->t('Version'));?></h2>
  209. <p><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></p>
  210. </div>