secrets.tx 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <div id="backoffice">
  2. <h2>Stored Secrets</h2>
  3. <p>
  4. Passwords that are not tCMS's, which tCMS needs in order to do something
  5. on your behalf &mdash; the passphrase to the provisioner's secrets
  6. database, to begin with. Store one here and the next thing that needs
  7. it asks you for a TOTP code instead, which is a thing you have on you
  8. rather than a thing you have written down.
  9. </p>
  10. : if ( !$has_vault ) {
  11. <p class="guest-reprovision-warning">
  12. This installation has no vault key, so there is nowhere to keep a secret
  13. and nothing below will save. See <code>Trog::Vault</code>: the key is
  14. handed to the service by systemd, and without one the things that would
  15. have used a stored secret go on asking for the password directly.
  16. </p>
  17. : }
  18. : if ( $secrets ) {
  19. <table class="cooltext" style="width:100%;border-collapse:collapse;">
  20. <thead>
  21. <tr style="text-align:left;">
  22. <th style="padding:4px 8px;">Name</th>
  23. <th style="padding:4px 8px;">Stored</th>
  24. <th style="padding:4px 8px;">Last used</th>
  25. <th style="padding:4px 8px;"></th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. : for $secrets -> $secret {
  30. <tr>
  31. <td style="padding:4px 8px;font-family:monospace;"><: $secret.name :></td>
  32. <td style="padding:4px 8px;white-space:nowrap;"><: $secret.stored :></td>
  33. <td style="padding:4px 8px;white-space:nowrap;"><: $secret.used :></td>
  34. <td style="padding:4px 8px;">
  35. : # A row sealed under a key this installation no longer has
  36. : # is not going to open, and saying so beats letting somebody
  37. : # find out at the moment they were relying on it.
  38. : if ( !$secret.readable ) {
  39. <span class="tag guest-state" title="sealed with a vault key this installation does not have">unreadable</span>
  40. : }
  41. <form method="POST" action="/secrets/forget" style="display:inline;">
  42. <input type="hidden" name="name" value="<: $secret.name :>" />
  43. <button class="coolbutton guest-destroy" type="submit">Forget</button>
  44. </form>
  45. </td>
  46. </tr>
  47. : }
  48. </tbody>
  49. </table>
  50. : } else {
  51. <p>Nothing stored.</p>
  52. : }
  53. <br />
  54. <h3>Store one</h3>
  55. <p>
  56. Storing under a name that is already here replaces it. Nothing on this
  57. page ever shows a value back to you &mdash; if you have forgotten one,
  58. replace it.
  59. </p>
  60. <form method="POST" action="/secrets/save">
  61. <label>
  62. Name
  63. <input required class="cooltext" type="text" name="name" pattern="[A-Za-z0-9][A-Za-z0-9._-]*" maxlength="64"
  64. placeholder="provisioner"
  65. title="letters, digits, dot, dash and underscore. 'provisioner' is the one reprovisioning looks for." />
  66. </label>
  67. <label>
  68. Secret
  69. <input required class="cooltext" type="password" name="secret" autocomplete="off" />
  70. </label>
  71. <input class="coolbutton" type="submit" value="Store it" />
  72. </form>
  73. </div>