From 837e1ecec9798381f78b838947f8028403cb0bef Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 23 Jun 2018 09:57:03 +0100 Subject: Handle SSH keys via the database This makes it more explicit, and works around Terraform being unpredictable when dealing with SSH agents. --- app/views/backends/terraform_aws/new.html.erb | 38 ++++++++++++++++++++++++ app/views/backends/terraform_aws/show.html.erb | 40 ++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) (limited to 'app/views') diff --git a/app/views/backends/terraform_aws/new.html.erb b/app/views/backends/terraform_aws/new.html.erb index bcbf3b4..790e5eb 100644 --- a/app/views/backends/terraform_aws/new.html.erb +++ b/app/views/backends/terraform_aws/new.html.erb @@ -144,6 +144,44 @@ License along with the GOV.UK Mini Environment Admin. If not, see +
+ <%= f.label( + :ssh_public_key, + 'SSH Key, public part', + class: 'col-sm-4 control-label' + ) %> +
+ <%= f.text_area( + :ssh_public_key, + class: 'form-control', + placeholder: 'The public part of the SSH key to use' + ) %> + +

+

+
+
+
+ +
+ <%= f.label( + :ssh_private_key, + 'SSH Key, private part', + class: 'col-sm-4 control-label' + ) %> +
+ <%= f.text_area( + :ssh_private_key, + class: 'form-control', + placeholder: 'The private part of the SSH key to use' + ) %> + +

+

+
+
+
+
<%= f.submit "Create", class: 'btn btn-lg btn-success' %> diff --git a/app/views/backends/terraform_aws/show.html.erb b/app/views/backends/terraform_aws/show.html.erb index 81ce150..3a1b329 100644 --- a/app/views/backends/terraform_aws/show.html.erb +++ b/app/views/backends/terraform_aws/show.html.erb @@ -155,6 +155,46 @@ License along with the GOV.UK Mini Environment Admin. If not, see
+
+ <%= f.label( + :ssh_public_key, + 'SSH Key, public part', + class: 'col-sm-4 control-label' + ) %> +
+ <%= f.text_area( + :ssh_public_key, + class: 'form-control', + placeholder: 'The public part of the SSH key to use', + readonly: true + ) %> + +

+

+
+
+
+ +
+ <%= f.label( + :ssh_private_key, + 'SSH Key, private part', + class: 'col-sm-4 control-label' + ) %> +
+ <%= text_area_tag( + :ssh_private_key, + 'Secret key hidden', + class: 'form-control', + disabled: true + ) %> + +

+

+
+
+
+
<%= f.submit "Save", class: 'btn btn-lg btn-success' %> -- cgit v1.2.3