Debian Codegraph @

plinth/modules/backups/templates/backups_add_remote_repository.html

raw symbols SCIP
1 {% extends "base.html" %}
2 {% comment %}
3 # SPDX-License-Identifier: AGPL-3.0-or-later
4 {% endcomment %}
5
6 {% load bootstrap %}
7 {% load i18n %}
8 {% load static %}
9 {% load extras %}
10
11 {% block page_js %}
12 <script src="{% static 'backups/backups_add_remote_repository.js' %}"
13 defer></script>
14 {% endblock %}
15
16 {% block content %}
17
18 <h3>{{ title }}</h3>
19
20 <form class="form form-add-remote-repository" method="post">
21 {% if form.non_field_errors %}
22 <div class="alert alert-danger">
23 <a class="close" data-dismiss="alert">&times;</a>
24 {% for non_field_error in form.non_field_errors %}
25 {{ non_field_error }}
26 {% endfor %}
27 </div>
28 {% endif %}
29
30 {% csrf_token %}
31
32 <div class="form-group{% if form.repository.errors %}
33 has-error{% endif %}">
34 <label class="control-label fs-4 fw-medium" for="id_repository">
35 {{ form.repository.label }}
36 </label>
37 <div>
38 <input type="text" name="repository" class="form-control"
39 required id="id_repository">
40 {% for error in form.repository.errors %}
41 <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
42 {% endfor %}
43 <p class="help-block">
44 {{ form.repository.help_text|safe }}
45 </p>
46 </div>
47 </div>
48
49 <div class="form-group{% if form.ssh_auth_type.errors %}
50 has-error{% endif %}">
51 <label class="control-label fs-4 fw-medium">
52 {{ form.ssh_auth_type.label }}
53 </label>
54 <p class="help-block">
55 {{ form.ssh_auth_type.help_text|safe }}
56 </p>
57 {% for error in form.ssh_auth_type.errors %}
58 <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
59 {% endfor %}
60
61 <div class="radio">
62 <label>
63 {{ form.ssh_auth_type.0.tag }}
64 {{ form.ssh_auth_type.0.choice_label }}
65 </label>
66 </div>
67
68 <div>
69 <p>
70 {% blocktrans trimmed %}
71 The following SSH client public key must be added to the
72 authorized keys list on the remote machine for {{ box_name }} to
73 be able to connect to the remote machine:
74 {% endblocktrans %}
75 </p>
76 <pre>{{ ssh_client_public_key }}</pre>
77 </div>
78
79 <div class="radio">
80 <label>
81 {{ form.ssh_auth_type.1.tag }}
82 {{ form.ssh_auth_type.1.choice_label }}
83 </label>
84 </div>
85
86 <p>
87 {% blocktrans trimmed %}
88 {{ box_name }} service will attempt to connect using the provided
89 password. If successful, then the public key will be automatically
90 added to the authorized keys list, so that future connections do
91 not need the password.
92 {% endblocktrans %}
93 </p>
94
95 {% with _=form.ssh_password|add_input_classes %}
96 {% include "bootstrapform/field.html" with field=form.ssh_password %}
97 {% endwith %}
98 </div>
99
100 <div class="form-group">
101 <div class="form-group{% if form.encryption.errors %}
102 has-error{% endif %}">
103 <label class="control-label fs-4 fw-medium" for="id_encryption">
104 {{ form.encryption.label }}
105 </label>
106 <div>
107 <select name="encryption" class="form-control" id="id_encryption">
108 <option value="repokey">{{ form.encryption.0.choice_label }}</option>
109 <option value="none">{{ form.encryption.1.choice_label }}</option>
110 </select>
111 {% for error in form.encryption.errors %}
112 <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
113 {% endfor %}
114 <p class="help-block">
115 {{ form.encryption.help_text|safe }}
116 </p>
117 </div>
118 </div>
119
120 {% with _=form.encryption_passphrase|add_input_classes %}
121 {% include "bootstrapform/field.html" with field=form.encryption_passphrase %}
122 {% endwith %}
123
124 {% with _=form.confirm_encryption_passphrase|add_input_classes %}
125 {% include "bootstrapform/field.html" with field=form.confirm_encryption_passphrase %}
126 {% endwith %}
127 </div>
128
129 <div class="alert alert-warning d-flex align-items-center" role="alert">
130 <div class="me-2">
131 {% icon 'exclamation-triangle' %}
132 <span class="visually-hidden">{% trans "Caution:" %}</span>
133 </div>
134 <div>
135 {% blocktrans trimmed %}
136 The credentials for this repository are stored on your {{ box_name }}.
137 <br />
138 To restore a backup on a new {{ box_name }} you need the SSH
139 credentials and, if chosen, the encryption passphrase.
140 {% endblocktrans %}
141 </div>
142 </div>
143
144 <input type="submit" class="btn btn-primary"
145 value="{% trans "Create Location" %}"/>
146 </form>
147
148 {% endblock %}