blob: 8dbccf799ad1a6683cf107eed0d0721d26570c41 [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001<div role="tabpanel" class="tab-pane fade" id="tab-config-dkim" role="tabpanel" aria-labelledby="tab-config-dkim">
2 <div class="card mb-4">
3 <div class="card-header d-flex fs-5">
4 <button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-config-dkim" data-bs-toggle="collapse" aria-controls="ollapse-tab-config-dkim">
5 {{ lang.admin.dkim_keys }}
6 </button>
7 <span class="d-none d-md-block">{{ lang.admin.dkim_keys }}</span>
8 </div>
9 <div id="collapse-tab-config-dkim" class="card-body collapse" data-bs-parent="#admin-content">
10 <div class="btn-group my-4" role="group">
11 <input type="checkbox" id="check-dkim_key_valid" class="btn-check" autocomplete="off" data-bs-toggle="collapse" data-bs-target=".dkim_key_valid" checked>
12 <label class="btn btn-outline-secondary btn-check-label" for="check-dkim_key_valid">{{ lang.admin.dkim_key_valid }}</label>
13
14 <input type="checkbox" id="check-dkim_key_unused" class="btn-check" autocomplete="off" data-bs-toggle="collapse" data-bs-target=".dkim_key_unused" checked>
15 <label class="btn btn-outline-secondary btn-check-label" for="check-dkim_key_unused">{{ lang.admin.dkim_key_unused }}</label>
16
17 <input type="checkbox" id="check-dkim_key_missing" class="btn-check" autocomplete="off" data-bs-toggle="collapse" data-bs-target=".dkim_key_missing" checked>
18 <label class="btn btn-outline-secondary btn-check-label" for="check-dkim_key_missing">{{ lang.admin.dkim_key_missing }}</label>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010019 </div>
20 {% for domain, domain_data in dkim_domains %}
21 {% if domain_data.dkim %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010022 <div class="row collapse show dkim_key_valid">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010023 <div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="{{ domain }}"></div>
24 <div class="col-md-3">
25 <p>{{ lang.admin.domain }}: <strong>{{ domain }}</strong>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010026 <p class="dkim-label"><span class="badge fs-6 bg-success">{{ lang.admin.dkim_key_valid }}</span></p>
27 <p class="dkim-label"><span class="badge fs-6 bg-primary">{{ lang.admin.dkim_domains_selector }} '{{ domain_data.dkim.dkim_selector }}'</span></p>
28 <p class="dkim-label"><span class="badge fs-6 bg-info">{{ domain_data.dkim.length }} bit</span></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010029 </p>
30 </div>
31 <div class="col-md-8">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010032 <textarea class="form-control" rows="6" readonly>{{ domain_data.dkim.dkim_txt }}</textarea>
33 <small>
34 <i class="bi bi-arrow-return-right"></i>
35 <a href="#" data-bs-toggle="modal" data-bs-target="#showDKIMprivKey" id="dkim_priv" data-priv-key="{{ domain_data.dkim.privkey }}"> {{ lang.admin.dkim_private_key }}</a>
36 </small>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010037 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010038 <hr class="d-block d-md-none">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010039 </div>
40 {% else %}
41 <div class="row collapse in dkim_key_missing">
42 <div class="col-md-1"><input class="dkim_missing" type="checkbox" data-id="dkim" name="multi_select" value="{{ domain }}" disabled></div>
43 <div class="col-md-3">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010044 <p>{{ lang.admin.domain }}: <strong>{{ domain }}</strong><br><span class="badge fs-6 bg-danger">{{ lang.admin.dkim_key_missing }}</span></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010045 </div>
46 <div class="col-md-8"><pre>-</pre></div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010047 <hr class="d-block d-md-none">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010048 </div>
49 {% endif %}
50 {% for alias_domain, alias_domain_data in domain_data.alias_domains %}
51 {% if alias_domain_data.dkim %}
52 <div class="row collapse in dkim_key_valid">
53 <div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="{{ alias_domain }}"></div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010054 <div class="col-md-2 offset-md-1">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010055 <p><small>↳ Alias-Domain: <strong>{{ alias_domain }}</strong></small>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010056 <p class="dkim-label"><span class="badge fs-6 bg-success">{{ lang.admin.dkim_key_valid }}</span></p>
57 <p class="dkim-label"><span class="badge fs-6 bg-primary">Selector '{{ alias_domain_data.dkim.dkim_selector }}'</span></p>
58 <p class="dkim-label"><span class="badge fs-6 bg-info">{{ alias_domain_data.dkim.length }} bit</span></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010059 </p>
60 </div>
61 <div class="col-md-8">
62 <pre>{{ alias_domain_data.dkim.dkim_txt }}</pre>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010063 <p data-bs-toggle="modal" data-bs-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="{{ alias_domain_data.dkim.privkey }}"><small><i class="bi bi-arrow-return-right"></i> Private key</small></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010064 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010065 <hr class="d-block d-md-none">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010066 </div>
67 {% else %}
68 <div class="row collapse in dkim_key_missing">
69 <div class="col-md-1"><input class="dkim_missing" type="checkbox" data-id="dkim" name="multi_select" value="{{ alias_domain }}" disabled></div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010070 <div class="col-md-2 offset-md-1">
71 <p><small>↳ Alias-Domain: <strong>{{ alias_domain }}</strong><br></small><span class="badge fs-6 bg-danger">{{ lang.admin.dkim_key_missing }}</span></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010072 </div>
73 <div class="col-md-8"><pre>-</pre></div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010074 <hr class="d-block d-md-none">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010075 </div>
76 {% endif %}
77 {% endfor %}
78 {% endfor %}
79 {% for blind, data in dkim_blind_domains|filter(data => data.dkim is not null) %}
80 <div class="row collapse in dkim_key_unused">
81 <div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="{{ blind }}"></div>
82 <div class="col-md-3">
83 <p>{{ lang.admin.domain }}: <strong>{{ blind }}</strong>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010084 <p class="dkim-label"><span class="badge fs-6 bg-warning">{{ lang.admin.dkim_key_unused }}</span></p>
85 <p class="dkim-label"><span class="badge fs-6 bg-primary">Selector '{{ data.dkim.dkim_selector }}'</span></p>
86 <p class="dkim-label"><span class="badge fs-6 bg-info">{{ data.dkim.length }} bit</span></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010087 </p>
88 </div>
89 <div class="col-md-8">
90 <pre>{{ data.dkim.dkim_txt }}</pre>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010091 <p data-bs-toggle="modal" data-bs-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="{{ data.dkim.privkey }}"><small><i class="bi bi-arrow-return-right"></i> Private key</small></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010092 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010093 <hr class="d-block d-md-none">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010094 </div>
95 {% endfor %}
96
97 <div class="mass-actions-admin">
98 <div class="btn-group btn-group-sm">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010099 <button type="button" id="toggle_multi_select_all" data-id="dkim" class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary"><i class="bi bi-check-all"></i> {{ lang.mailbox.toggle_all }}</button>
100 <button type="button" data-action="delete_selected" name="delete_selected" data-id="dkim" data-api-url="delete/dkim" class="btn btn-sm btn-xs-half d-block d-sm-inline btn-danger"><i class="bi bi-trash"></i> {{ lang.admin.remove }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100101 </div>
102 </div>
103
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100104 <legend style="margin-top:40px">{{ lang.admin.dkim_add_key }}</legend><hr />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100105 <form class="form" data-id="dkim" role="form" method="post">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100106 <div class="mb-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100107 <label for="dkim_add_domains">{{ lang.admin.domain_s }}</label>
108 <input class="form-control input-sm" id="dkim_add_domains" name="domains" placeholder="example.org, example.com" required>
109 <small><i class="bi bi-arrow-return-right"></i> <a href="#" id="dkim_missing_keys">{{ lang.admin.dkim_domains_wo_keys }}</a></small>
110 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100111 <div class="mb-2">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100112 <label for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label>
113 <input class="form-control input-sm" id="dkim_selector" name="dkim_selector" value="dkim" required>
114 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100115 <div class="row mb-4">
116 <div class="col-12 col-md-6 col-lg-4 col-xl-3">
117 <select data-style="btn btn-secondary btn-sm" class="form-control" id="key_size" name="key_size" title="{{ lang.admin.dkim_key_length }}" required>
118 <option data-subtext="bits">1024</option>
119 <option data-subtext="bits">2048</option>
120 </select>
121 </div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100122 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100123 <button class="btn btn-sm d-block d-sm-inline btn-success" data-action="add_item" data-id="dkim" data-api-url='add/dkim' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100124 </form>
125
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100126 <legend data-bs-target="#import_dkim" style="margin-top:40px;cursor:pointer" unselectable="on" data-bs-toggle="collapse">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100127 <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.import_private_key }}
128 </legend>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100129 <hr />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100130 <div id="import_dkim" class="collapse">
131 <form class="form" data-id="dkim_import" role="form" method="post">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100132 <div class="mb-2">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100133 <label for="dkim_import_domain">{{ lang.admin.domain }}:</label>
134 <input class="form-control input-sm" id="dkim_import_domain" name="domain" placeholder="example.org" required>
135 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100136 <div class="mb-2">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100137 <label for="dkim_import_selector">{{ lang.admin.dkim_domains_selector }}:</label>
138 <input class="form-control input-sm" id="dkim_import_selector" name="dkim_selector" value="dkim" required>
139 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100140 <div class="mb-4">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100141 <label for="private_key_file">{{ lang.admin.private_key }}: (RSA PKCS#8)</label>
142 <textarea class="form-control input-sm" rows="10" name="private_key_file" id="private_key_file" required placeholder="-----BEGIN RSA KEY-----"></textarea>
143 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100144 <div class="mb-2">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100145 <label>
146 <input type="checkbox" name="overwrite_existing" value="1"> {{ lang.admin.dkim_overwrite_key }}
147 </label>
148 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100149 <button class="btn btn-sm d-block d-sm-inline btn-secondary" data-action="add_item" data-id="dkim_import" data-api-url='add/dkim_import' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.import }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100150 </form>
151 </div>
152
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100153 <legend data-bs-target="#duplicate_dkim" style="margin-top:40px;cursor:pointer" unselectable="on" data-bs-toggle="collapse">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100154 <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.duplicate_dkim }}
155 </legend>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100156 <hr />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100157 <div id="duplicate_dkim" class="collapse">
158 <form class="form-horizontal" data-id="dkim_duplicate" role="form" method="post">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100159 <div class="row mb-2">
160 <label class="control-label col-sm-2 text-sm-end" for="from_domain">{{ lang.admin.dkim_from }}:</label>
161 <div class="col-sm-10 col-md-6 col-lg-4 col-xl-3">
162 <select data-style="btn btn-secondary btn-sm"
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100163 data-live-search="true"
164 data-id="dkim_duplicate"
165 title="{{ lang.admin.dkim_from_title }}"
166 name="from_domain" id="from_domain" class="full-width-select form-control" required>
167 {% for dkim_domain in dkim_domains_with_keys %}
168 <option value="{{ dkim_domain }}">{{ dkim_domain }}</option>
169 {% endfor %}
170 </select>
171 </div>
172 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100173 <div class="row mb-4">
174 <label class="control-label col-sm-2 text-sm-end" for="to_domain">{{ lang.admin.dkim_to }}:</label>
175 <div class="col-sm-10 col-md-6 col-lg-4 col-xl-3">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100176 <select
177 data-live-search="true"
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100178 data-style="btn btn-secondary btn-sm"
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100179 data-id="dkim_duplicate"
180 title="{{ lang.admin.dkim_to_title }}"
181 name="to_domain" id="to_domain" class="full-width-select form-control" multiple required>
182 {% for domain in all_domains %}
183 <option value="{{ domain }}">{{ domain }}</option>
184 {% endfor %}
185 </select>
186 </div>
187 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100188 <button class="btn btn-sm d-block d-sm-inline btn-secondary" data-action="add_item" data-id="dkim_duplicate" data-api-url='add/dkim_duplicate' data-api-attr='{}' href="#"><i class="bi bi-clipboard-plus"></i> {{ lang.admin.duplicate }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100189 </form>
190 </div>
191 </div>
192 </div>
193</div>