Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 1 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 19 | </div> |
| 20 | {% for domain, domain_data in dkim_domains %} |
| 21 | {% if domain_data.dkim %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 22 | <div class="row collapse show dkim_key_valid"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 23 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 26 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 29 | </p> |
| 30 | </div> |
| 31 | <div class="col-md-8"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 32 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 37 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 38 | <hr class="d-block d-md-none"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 39 | </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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 44 | <p>{{ lang.admin.domain }}: <strong>{{ domain }}</strong><br><span class="badge fs-6 bg-danger">{{ lang.admin.dkim_key_missing }}</span></p> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 45 | </div> |
| 46 | <div class="col-md-8"><pre>-</pre></div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 47 | <hr class="d-block d-md-none"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 48 | </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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 54 | <div class="col-md-2 offset-md-1"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 55 | <p><small>↳ Alias-Domain: <strong>{{ alias_domain }}</strong></small> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 56 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 59 | </p> |
| 60 | </div> |
| 61 | <div class="col-md-8"> |
| 62 | <pre>{{ alias_domain_data.dkim.dkim_txt }}</pre> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 63 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 64 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 65 | <hr class="d-block d-md-none"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 66 | </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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 70 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 72 | </div> |
| 73 | <div class="col-md-8"><pre>-</pre></div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 74 | <hr class="d-block d-md-none"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 75 | </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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 84 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 87 | </p> |
| 88 | </div> |
| 89 | <div class="col-md-8"> |
| 90 | <pre>{{ data.dkim.dkim_txt }}</pre> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 91 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 92 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 93 | <hr class="d-block d-md-none"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 94 | </div> |
| 95 | {% endfor %} |
| 96 | |
| 97 | <div class="mass-actions-admin"> |
| 98 | <div class="btn-group btn-group-sm"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 99 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 101 | </div> |
| 102 | </div> |
| 103 | |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 104 | <legend style="margin-top:40px">{{ lang.admin.dkim_add_key }}</legend><hr /> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 105 | <form class="form" data-id="dkim" role="form" method="post"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 106 | <div class="mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 107 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 111 | <div class="mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 112 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 115 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 122 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 123 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 124 | </form> |
| 125 | |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 126 | <legend data-bs-target="#import_dkim" style="margin-top:40px;cursor:pointer" unselectable="on" data-bs-toggle="collapse"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 127 | <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.import_private_key }} |
| 128 | </legend> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 129 | <hr /> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 130 | <div id="import_dkim" class="collapse"> |
| 131 | <form class="form" data-id="dkim_import" role="form" method="post"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 132 | <div class="mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 133 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 136 | <div class="mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 137 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 140 | <div class="mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 141 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 144 | <div class="mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 145 | <label> |
| 146 | <input type="checkbox" name="overwrite_existing" value="1"> {{ lang.admin.dkim_overwrite_key }} |
| 147 | </label> |
| 148 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 149 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 150 | </form> |
| 151 | </div> |
| 152 | |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 153 | <legend data-bs-target="#duplicate_dkim" style="margin-top:40px;cursor:pointer" unselectable="on" data-bs-toggle="collapse"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 154 | <i style="font-size:10pt;" class="bi bi-plus-square"></i> {{ lang.admin.duplicate_dkim }} |
| 155 | </legend> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 156 | <hr /> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 157 | <div id="duplicate_dkim" class="collapse"> |
| 158 | <form class="form-horizontal" data-id="dkim_duplicate" role="form" method="post"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 159 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 163 | 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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 173 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 176 | <select |
| 177 | data-live-search="true" |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 178 | data-style="btn btn-secondary btn-sm" |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 179 | 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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 188 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 189 | </form> |
| 190 | </div> |
| 191 | </div> |
| 192 | </div> |
| 193 | </div> |