encryption.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 class="section" id='encryptionAPI'>
  27. <h2><?php p($l->t('Server-side encryption')); ?></h2>
  28. <a target="_blank" rel="noreferrer" class="icon-info"
  29. title="<?php p($l->t('Open documentation'));?>"
  30. href="<?php p(link_to_docs('admin-encryption')); ?>"></a>
  31. <p class="settings-hint"><?php p($l->t('Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed.')); ?></p>
  32. <p id="enable">
  33. <input type="checkbox"
  34. id="enableEncryption" class="checkbox"
  35. value="1" <?php if ($_['encryptionEnabled']) print_unescaped('checked="checked" disabled="disabled"'); ?> />
  36. <label
  37. for="enableEncryption"><?php p($l->t('Enable server-side encryption')); ?> <span id="startmigration_msg" class="msg"></span> </label><br/>
  38. </p>
  39. <div id="EncryptionWarning" class="warning hidden">
  40. <p><?php p($l->t('Please read carefully before activating server-side encryption: ')); ?></p>
  41. <ul>
  42. <li><?php p($l->t('Once encryption is enabled, all files uploaded to the server from that point forward will be encrypted at rest on the server. It will only be possible to disable encryption at a later date if the active encryption module supports that function, and all pre-conditions (e.g. setting a recover key) are met.')); ?></li>
  43. <li><?php p($l->t('Encryption alone does not guarantee security of the system. Please see documentation for more information about how the encryption app works, and the supported use cases.')); ?></li>
  44. <li><?php p($l->t('Be aware that encryption always increases the file size.')); ?></li>
  45. <li><?php p($l->t('It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.')); ?></li>
  46. </ul>
  47. <p><?php p($l->t('This is the final warning: Do you really want to enable encryption?')) ?> <input type="button"
  48. id="reallyEnableEncryption"
  49. value="<?php p($l->t("Enable encryption")); ?>" /></p>
  50. </div>
  51. <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) p('hidden'); ?>">
  52. <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) p('hidden'); ?>">
  53. <?php
  54. if (empty($_['encryptionModules'])) {
  55. p($l->t('No encryption module loaded, please enable an encryption module in the app menu.'));
  56. } else { ?>
  57. <h3><?php p($l->t('Select default encryption module:')) ?></h3>
  58. <fieldset id='encryptionModules'>
  59. <?php foreach ($_['encryptionModules'] as $id => $module): ?>
  60. <input type="radio" id="<?php p($id) ?>" class="radio"
  61. name="default_encryption_module"
  62. value="<?php p($id) ?>"
  63. <?php if ($module['default']) {
  64. p('checked');
  65. } ?>>
  66. <label
  67. for="<?php p($id) ?>"><?php p($module['displayName']) ?></label>
  68. <br/>
  69. <?php endforeach; ?>
  70. </fieldset>
  71. <?php } ?>
  72. </div>
  73. <div id="migrationWarning" class="<?php if ($_['encryptionReady']) p('hidden'); ?>">
  74. <?php
  75. if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) {
  76. p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\''));
  77. } elseif ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === false) {
  78. p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one.')); ?>
  79. <input type="submit" name="startmigration" id="startmigration"
  80. value="<?php p($l->t('Start migration')); ?>"/>
  81. <?php } ?>
  82. </div>
  83. </div>
  84. </div>