UI for making encrypted ssh remotes with gcrypt

Improved probing the remote server, so it gathers a list of the
capabilities it has. From that list, we can determine which types
of remotes are supported, and display an appropriate UI.

The new buttons for making gcrypt repos don't work yet, but the old buttons
for unencrypted git repo and encrypted rsync repo have been adapted to the
new data types and are working.

This commit was sponsored by David Schmitt.
This commit is contained in:
Joey Hess 2013-09-29 14:39:10 -04:00
parent 2f75512188
commit d83a244986
10 changed files with 141 additions and 105 deletions

View file

@ -26,11 +26,11 @@
<p>
$forall (keyid, name) <- secretkeys
<p>
<a .btn onclick="$('#setupmodal').modal('show');" href="@{MakeRsyncNetGCryptR sshdata (RepoKey keyid)}">
<a .btn href="@{MakeRsyncNetGCryptR sshdata (RepoKey keyid)}" onclick="$('#setupmodal').modal('show');">
<i .icon-lock></i> Encrypt repository #
to ^{gpgKeyDisplay keyid (Just name)}
<p>
<a .btn onclick="$('#genkeymodal').modal('show');" href="@{MakeRsyncNetGCryptR sshdata NoRepoKey}">
<a .btn href="@{MakeRsyncNetGCryptR sshdata NoRepoKey}" onclick="$('#genkeymodal').modal('show');">
<i .icon-plus-sign></i> Encrypt repository #
with a new encryption key
^{genKeyModal}

View file

@ -3,45 +3,69 @@
Ready to add remote server
<div .row-fluid>
<div .span9>
<p>
The server #{sshHostName sshdata} has been verified to be usable.
<p>
You have two options for how to use the server:
<p>
$if not (rsyncOnly sshdata)
<a .btn .btn-primary href="@{MakeSshGitR sshdata}" onclick="$('#setupmodal').modal('show');">
Use a git repository on the server
$else
<a .btn .disabled .btn-warning href="@{RetrySshR sshdata}" onclick="$('#testmodal').modal('show');">
Use a git repository on the server (not available) #
<a .btn .btn-primary href="@{RetrySshR sshdata}" onclick="$('#testmodal').modal('show');">
Retry
<br>
$if not (hasCapability sshdata GitAnnexShellCapable)
<p>
<i .icon-warning-sign></i> #
<i>
The server needs git and git-annex installed to use this option.
<br>
All your data will be uploaded to the server, including the full #
git repository. This is a great choice if you want to set up #
other devices to use the same server, or share the repository with #
others.
<p style="text-align: center">
-or-
The server #{sshHostName sshdata} can be used as is, but #
installing #
$if not (hasCapability sshdata GitCapable)
git and git-annex #
$else
git-annex #
on it would make it work better, and provide more options below. #
<p>
If you're able to install software on the server, do so and click
<a .btn href="@{RetrySshR sshdata}" onclick="$('#testmodal').modal('show');">
Retry
$else
<p>
The server #{sshHostName sshdata} has been verified to be usable. #
Depending on whether you trust this server, you can choose between #
storing your data on it encrypted, or unencrypted.
<h3>
Unencrypted repository
<p>
All your data will be uploaded to the server, including a clone of #
the git repository. This is a good choice if you want to set up #
other devices to use the same server, or share the repository with #
others.
<p>
<a .btn href="@{MakeSshGitR sshdata}" onclick="$('#setupmodal').modal('show');">
Make an unencrypted git repository on the server
<p style="text-align: center">
-or-
<h3>
Simple shared encryption
<p>
<a .btn .btn-primary href="@{MakeSshRsyncR sshdata}" onclick="$('#setupmodal').modal('show');">
Use an encrypted rsync repository on the server
<br>
The contents of your files will be stored, fully encrypted, on the #
server. The server will not store other information about your #
git repository. This is the best choice if you don't run the server #
yourself, or have sensitive data.
<div .span4>
$if needsPubKey sshdata
<div .alert .alert-info>
<i .icon-info-sign></i> #
A ssh key will be installed on the server, allowing git-annex to #
access it securely without a password.
This allows everyone who has a clone of this repository to #
decrypt the files stored on #{sshHostName sshdata}. That makes #
it good for sharing. And it's easy to set up and use.
<p>
<a .btn href="@{MakeSshRsyncR sshdata}" onclick="$('#setupmodal').modal('show');">
<i .icon-lock></i> Use shared encryption
$if hasCapability sshdata GitCapable
<p style="text-align: center">
-or-
<h3>
Encrypt with GnuPG key
<p>
This stores an encrypted clone of your repository on #
#{sshHostName sshdata}, unlike shared encryption which only #
stores file contents there. So it's good for backups. But the #
encryption will prevent you from sharing the repository with #
friends, or easily accessing its contents on another computer.
<p>
$forall (keyid, name) <- secretkeys
<p>
<a .btn href="@{MakeSshGCryptR sshdata (RepoKey keyid)}" onclick="$('#setupmodal').modal('show');" >
<i .icon-lock></i> Encrypt repository #
to ^{gpgKeyDisplay keyid (Just name)}
<p>
<a .btn href="@{MakeSshGCryptR sshdata NoRepoKey}" onclick="$('#genkeymodal').modal('show');">
<i .icon-plus-sign></i> Encrypt repository #
with a new encryption key
^{sshTestModal}
^{genKeyModal}
<div .modal .fade #setupmodal>
<div .modal-header>
<h3>