| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="{{ mailcow_locale|default('en') }}"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> |
| 7 | <meta name="theme-color" content="#F5D76E"/> |
| 8 | <meta http-equiv="Referrer-Policy" content="same-origin"> |
| 9 | <title>{{ ui_texts.title_name|raw }}</title> |
| 10 | |
| 11 | <link rel="stylesheet" href="{{ css_path }}"> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 12 | <script> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 13 | var mailcow_dark_css = '{{ dark_css_path }}'; |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 14 | // check if darkmode is preferred by OS or set by localStorage |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 15 | if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches && localStorage.getItem("mailcow_theme") !== "light" || |
| 16 | localStorage.getItem("mailcow_theme") === "dark") { |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 17 | var head = document.getElementsByTagName('head')[0]; |
| 18 | var link = document.createElement('link'); |
| 19 | link.id = 'dark-mode-theme'; |
| 20 | link.rel = 'stylesheet'; |
| 21 | link.type = 'text/css'; |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 22 | link.href = mailcow_dark_css; |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 23 | head.appendChild(link); |
| 24 | } |
| 25 | </script> |
| 26 | |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 27 | <link rel="shortcut icon" href="/favicon.png" type="image/png"> |
| 28 | <link rel="icon" href="/favicon.png" type="image/png"> |
| 29 | </head> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 30 | <body> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 31 | <div class="overlay"></div> |
| 32 | {% block navbar %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 33 | <nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top p-0"> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 34 | <div class="container-fluid"> |
| Matthias Andreas Benkard | d63fe56 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 35 | <a class="navbar-brand" href="/"> |
| 36 | <img class="main-logo" alt="mailcow-logo" src="{{ logo|default('/img/cow_mailcow.svg') }}"> |
| 37 | <img class="main-logo-dark" alt="mailcow-logo-dark" src="{{ logo_dark|default('/img/cow_mailcow.svg') }}"> |
| 38 | </a> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 39 | <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> |
| 40 | <i class="bi bi-list fs-3"></i> |
| 41 | </button> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 42 | <div id="navbar" class="navbar-collapse collapse"> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 43 | <ul class="navbar-nav ms-auto"> |
| 44 | <li class="nav-item"> |
| 45 | <div class="nav-link form-check form-switch my-auto d-flex align-items-center"> |
| 46 | <label class="form-check-label"><i class="bi bi-moon-fill"></i></label> |
| 47 | <input class="form-check-input ms-2" type="checkbox" id="dark-mode-toggle"> |
| 48 | </div> |
| 49 | </li> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 50 | {% if mailcow_locale %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 51 | <li class="nav-item dropdown{% if available_languages|length == 1 %}lang-link-disabled{% endif %}"> |
| 52 | <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false"><span class="flag-icon flag-icon-{{ mailcow_locale[-2:] }}"></span></a> |
| 53 | <ul class="dropdown-menu" role="menu "aria-labelledby="languageDropdown"> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 54 | {% for key, val in available_languages %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 55 | <li> |
| 56 | <a class="dropdown-item {% if mailcow_locale == key %}active{% endif %}" href="?{{ query_string({'lang': key}) }}"> |
| 57 | <span class="flag-icon flag-icon-{{ key[-2:] }}"></span>{{ val }} |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 58 | </a> |
| 59 | </li> |
| 60 | {% endfor %} |
| 61 | </ul> |
| 62 | </li> |
| 63 | {% endif %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 64 | |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 65 | {% if mailcow_cc_role %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 66 | {% if mailcow_cc_role == 'admin' %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 67 | <li class="nav-item dropdown"> |
| 68 | <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false">{{ lang.header.mailcow_system }}</a> |
| 69 | <ul class="dropdown-menu"> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 70 | <li><a href="/admin/dashboard" class="dropdown-item {% if is_uri('dashboard') %}active{% endif %}">{{ lang.header.debug }}</a></li> |
| 71 | <li><a href="/admin/system" class="dropdown-item {% if is_uri('system') %}active{% endif %}">{{ lang.header.mailcow_config }}</a></li> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 72 | </ul> |
| 73 | </li> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 74 | <li class="nav-item dropdown"> |
| 75 | <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false">{{ lang.header.email }}</a> |
| 76 | <ul class="dropdown-menu"> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 77 | <li><a href="/admin/mailbox" class="dropdown-item {% if is_uri('mailbox') %}active{% endif %}">{{ lang.header.mailcow_config }}</a></li> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 78 | <li><a href="/quarantine" class="dropdown-item {% if is_uri('quarantine') %}active{% endif %}">{{ lang.header.quarantine }}</a></li> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 79 | <li><a href="/admin/queue" class="dropdown-item {% if is_uri('queue') %}active{% endif %}">{{ lang.queue.queue_manager }}</a></li> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 80 | <li><a href="#" class="dropdown-item" data-bs-toggle="modal" data-container="sogo-mailcow" data-bs-target="#RestartContainer">{{ lang.header.restart_sogo }}</a></li> |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 81 | </ul> |
| 82 | </li> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 83 | {% endif %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 84 | {% if mailcow_cc_role == 'domainadmin' %} |
| 85 | <li class="nav-item dropdown"> |
| 86 | <a href="/domainadmin/user" class="nav-link" role="button" aria-expanded="false">{{ lang.header.user_settings }}</a> |
| 87 | </li> |
| 88 | {% elseif mailcow_cc_role == 'user' %} |
| 89 | <li class="nav-item dropdown"> |
| 90 | <a href="/user" class="nav-link" role="button" aria-expanded="false">{{ lang.header.user_settings }}</a> |
| 91 | </li> |
| 92 | {% endif %} |
| 93 | |
| 94 | {% if mailcow_cc_role == 'domainadmin' %} |
| 95 | <li class="nav-item dropdown"> |
| 96 | <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false">{{ lang.header.email }}</a> |
| 97 | <ul class="dropdown-menu"> |
| 98 | <li><a href="/domainadmin/mailbox" class="dropdown-item {% if is_uri('mailbox') %}active{% endif %}">{{ lang.header.mailcow_config }}</a></li> |
| 99 | <li><a href="/quarantine" class="dropdown-item {% if is_uri('quarantine') %}active{% endif %}">{{ lang.header.quarantine }}</a></li> |
| 100 | </ul> |
| 101 | </li> |
| 102 | {% endif %} |
| 103 | |
| 104 | {% if mailcow_cc_role == 'user' %} |
| 105 | <li class="nav-item dropdown"> |
| 106 | <a href="/quarantine" class="nav-link">{{ lang.header.quarantine }}</a> |
| 107 | </li> |
| 108 | {% endif %} |
| 109 | {% endif %} |
| 110 | |
| 111 | {% if mailcow_apps_processed or app_links %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 112 | <li class="nav-item dropdown"> |
| 113 | <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false"><i class="bi bi-link-45deg me-2"></i> {{ ui_texts.apps_name|raw }}</a> |
| 114 | <ul class="dropdown-menu"> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 115 | {% for app in mailcow_apps_processed %} |
| 116 | {% if not skip_sogo or not is_uri('SOGo', app.user_link) %} |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 117 | <li {% if app.description %}title="{{ app.description }}"{% endif %}> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 118 | <a href="{{ app.user_link }}" class="dropdown-item">{{ app.name }}</a> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 119 | </li> |
| 120 | {% endif %} |
| 121 | {% endfor %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 122 | {% for row in app_links_processed %} |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 123 | {% for key, val in row %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 124 | <li><a href="{{ val.user_link }}" class="dropdown-item">{{ key }}</a></li> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 125 | {% endfor %} |
| 126 | {% endfor %} |
| 127 | </ul> |
| 128 | </li> |
| 129 | {% endif %} |
| 130 | {% if not dual_login and mailcow_cc_username %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 131 | <li class="logged-in-as nav-item"><a href="#" onclick="logout.submit()" class="nav-link"><b class="username-lia">{{ mailcow_cc_username }}</b> <i class="bi bi-power ms-2"></i></a></li> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 132 | {% elseif dual_login %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 133 | <li class="logged-in-as nav-item"><a href="#" onclick="logout.submit()" class="nav-link"><b class="username-lia">{{ mailcow_cc_username }} <span class="text-info">({{ dual_login.username }})</span> </b><i class="bi bi-power ms-2"></i></a></li> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 134 | {% endif %} |
| 135 | {% if not is_master %} |
| Matthias Andreas Benkard | 9dabdab | 2024-03-06 13:12:09 +0100 | [diff] [blame] | 136 | <div class="nav-link form-check form-switch my-auto d-flex align-items-center"> |
| 137 | <li class="slave-info">[ slave ]</li> |
| 138 | </div> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 139 | {% endif %} |
| 140 | </ul> |
| 141 | </div><!--/.nav-collapse --> |
| 142 | </div><!--/.container-fluid --> |
| 143 | </nav> |
| 144 | {% endblock navbar %} |
| 145 | |
| 146 | <form action="/" method="post" id="logout"><input type="hidden" name="logout"></form> |
| 147 | |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 148 | {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active and not is_root_uri and mailcow_cc_username %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 149 | <div class="container mt-4"> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 150 | <div class="alert alert-{{ ui_texts.ui_announcement_type }}">{{ ui_texts.ui_announcement_text }}</div> |
| 151 | </div> |
| 152 | {% endif %} |
| 153 | |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 154 | <div class="container flex-grow-1 my-4"> |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 155 | {% block content %}{% endblock %} |
| 156 | </div> |
| 157 | |
| 158 | {% include 'modals/footer.twig' %} |
| 159 | |
| 160 | <script src="{{ js_path }}"></script> |
| 161 | <script> |
| 162 | var lang_footer = {{ lang_footer|raw }}; |
| 163 | var lang_acl = {{ lang_acl|raw }}; |
| 164 | var lang_tfa = {{ lang_tfa|raw }}; |
| 165 | var lang_fido2 = {{ lang_fido2|raw }}; |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 166 | var lang_success = {{ lang_success|raw }}; |
| 167 | var lang_danger = {{ lang_danger|raw }}; |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 168 | var docker_timeout = {{ docker_timeout|raw }} * 1000; |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 169 | var mailcow_cc_role = '{{ mailcow_cc_role }}'; |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 170 | {% if mailcow_cc_username %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 171 | var mailcow_info = { |
| 172 | version_tag: '{{ mailcow_info.version_tag }}', |
| 173 | last_version_tag: '{{ mailcow_info.last_version_tag }}', |
| 174 | updatedAt: '{{ mailcow_info.updated_at }}', |
| 175 | project_url: '{{ mailcow_info.git_project_url }}', |
| 176 | project_owner: '{{ mailcow_info.git_owner }}', |
| 177 | project_repo: '{{ mailcow_info.git_repo }}', |
| 178 | branch: '{{ mailcow_info.mailcow_branch }}' |
| 179 | }; |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 180 | {% else %} |
| 181 | var mailcow_info = { |
| 182 | version_tag: '', |
| 183 | last_version_tag: '', |
| 184 | updatedAt: '', |
| 185 | project_url: '', |
| 186 | project_owner: '', |
| 187 | project_repo: '', |
| 188 | branch: '' |
| 189 | }; |
| 190 | {% endif %} |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 191 | |
| 192 | $(window).scroll(function() { |
| 193 | sessionStorage.scrollTop = $(this).scrollTop(); |
| 194 | }); |
| 195 | // Select language and reopen active URL without POST |
| 196 | function setLang(sel) { |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 197 | $.post( '{{ uri|escape("js") }}', {lang: sel} ); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 198 | window.location.href = window.location.pathname + window.location.search; |
| 199 | } |
| 200 | // FIDO2 functions |
| 201 | function arrayBufferToBase64(buffer) { |
| 202 | let binary = ''; |
| 203 | let bytes = new Uint8Array(buffer); |
| 204 | let len = bytes.byteLength; |
| 205 | for (let i = 0; i < len; i++) { |
| 206 | binary += String.fromCharCode( bytes[ i ] ); |
| 207 | } |
| 208 | return window.btoa(binary); |
| 209 | } |
| 210 | function recursiveBase64StrToArrayBuffer(obj) { |
| 211 | let prefix = '=?BINARY?B?'; |
| 212 | let suffix = '?='; |
| 213 | if (typeof obj === 'object') { |
| 214 | for (let key in obj) { |
| 215 | if (typeof obj[key] === 'string') { |
| 216 | let str = obj[key]; |
| 217 | if (str.substring(0, prefix.length) === prefix && str.substring(str.length - suffix.length) === suffix) { |
| 218 | str = str.substring(prefix.length, str.length - suffix.length); |
| 219 | let binary_string = window.atob(str); |
| 220 | let len = binary_string.length; |
| 221 | let bytes = new Uint8Array(len); |
| 222 | for (let i = 0; i < len; i++) { |
| 223 | bytes[i] = binary_string.charCodeAt(i); |
| 224 | } |
| 225 | obj[key] = bytes.buffer; |
| 226 | } |
| 227 | } else { |
| 228 | recursiveBase64StrToArrayBuffer(obj[key]); |
| 229 | } |
| 230 | } |
| 231 | } |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 232 | } |
| 233 | $(window).on('load', function() { |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 234 | $(".overlay").hide(); |
| 235 | }); |
| 236 | $(document).ready(function() { |
| 237 | $(document).on('shown.bs.modal', function(e) { |
| 238 | modal_id = $(e.relatedTarget).data('target'); |
| 239 | $(modal_id).attr("aria-hidden","false"); |
| 240 | }); |
| 241 | // TFA, CSRF, Alerts in footer.inc.php |
| 242 | // Other general functions in mailcow.js |
| 243 | {% for alert_type, alert_msg in alerts %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 244 | mailcow_alert_box('{{ alert_msg|raw|e("js") }}', '{{ alert_type }}'); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 245 | {% endfor %} |
| 246 | |
| 247 | // Confirm TFA modal |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 248 | {% if pending_tfa_methods %} |
| 249 | new bootstrap.Modal(document.getElementById("ConfirmTFAModal"), { |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 250 | backdrop: 'static', |
| 251 | keyboard: false |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 252 | }).show(); |
| 253 | |
| 254 | |
| 255 | // validate Time based OTP tfa |
| 256 | $("#pending_tfa_tab_totp").click(function(){ |
| 257 | $(".webauthn-authenticator-selection").removeClass("active"); |
| 258 | $("#collapseWebAuthnTFA").collapse('hide'); |
| 259 | |
| 260 | // select default if only one authenticator exists |
| 261 | if ($('.totp-authenticator-selection').length == 1){ |
| 262 | $('.totp-authenticator-selection').addClass("active"); |
| 263 | var id = $('.totp-authenticator-selection').children('input').first().val(); |
| 264 | $("#totp_selected_id").val(id); |
| 265 | $("#collapseTotpTFA").collapse('show'); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 266 | } |
| 267 | }); |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 268 | $(".totp-authenticator-selection").click(function(){ |
| 269 | $(".totp-authenticator-selection").removeClass("active"); |
| 270 | $(this).addClass("active"); |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 271 | |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 272 | var id = $(this).children('input').first().val(); |
| 273 | $("#totp_selected_id").val(id); |
| 274 | |
| 275 | $("#collapseTotpTFA").collapse('show'); |
| 276 | }); |
| 277 | if ($('.totp-authenticator-selection').length == 1 && |
| 278 | $('#pending_tfa_tab_yubi_otp').length == 0 && |
| 279 | $('.webauthn-authenticator-selection').length == 0){ |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 280 | |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 281 | // select default if only one authenticator exists |
| 282 | $('.totp-authenticator-selection').addClass("active"); |
| 283 | |
| 284 | var id = $('.totp-authenticator-selection').children('input').first().val(); |
| 285 | $("#totp_selected_id").val(id); |
| 286 | |
| 287 | $("#collapseTotpTFA").collapse('show'); |
| 288 | setTimeout(function() { $("#collapseTotpTFA").find('input[name="token"]').focus(); }, 1000); |
| 289 | } |
| 290 | $('#pending_tfa_tab_totp').on('shown.bs.tab', function() { |
| 291 | // autofocus |
| 292 | setTimeout(function() { $("#collapseTotpTFA").find('input[name="token"]').focus(); }, 200); |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 293 | }); |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 294 | // validate Yubi OTP tfa |
| 295 | if ($('.webauthn-authenticator-selection').length == 0){ |
| 296 | // autofocus |
| 297 | setTimeout(function() { $("#collapseYubiTFA").find('input[name="token"]').focus(); }, 1000); |
| 298 | } |
| 299 | $('#pending_tfa_tab_yubi_otp').on('shown.bs.tab', function() { |
| 300 | // autofocus |
| 301 | $("#collapseYubiTFA").find('input[name="token"]').focus(); |
| 302 | }); |
| 303 | // validate WebAuthn tfa |
| 304 | $("#pending_tfa_tab_webauthn").click(function(){ |
| 305 | $(".totp-authenticator-selection").removeClass("active"); |
| 306 | |
| 307 | $("#collapseTotpTFA").collapse('hide'); |
| 308 | }); |
| 309 | $(".webauthn-authenticator-selection").click(function(){ |
| 310 | $(".webauthn-authenticator-selection").removeClass("active"); |
| 311 | $(this).addClass("active"); |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 312 | |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 313 | var id = $(this).children('input').first().val(); |
| 314 | $("#webauthn_selected_id").val(id); |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 315 | |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 316 | var webauthn_status_auth = document.getElementById('webauthn_status_auth'); |
| 317 | webauthn_status_auth.style.setProperty('display', 'flex', 'important'); |
| 318 | var webauthn_return_code = document.getElementById('webauthn_return_code'); |
| 319 | webauthn_return_code.style.setProperty('display', 'none', 'important'); |
| 320 | |
| 321 | $("#collapseWebAuthnTFA").collapse('show'); |
| 322 | |
| 323 | $(this).find('input[name=token]').focus(); |
| 324 | if(document.getElementById("webauthn_auth_data") !== null) { |
| 325 | // Check Browser support |
| 326 | if (!window.fetch || !navigator.credentials || !navigator.credentials.create) { |
| 327 | window.alert('Browser not supported for WebAuthn.'); |
| 328 | return; |
| 329 | } |
| 330 | |
| 331 | // fetch webauthn auth args |
| 332 | window.fetch("/api/v1/get/webauthn-tfa-get-args", {method:'GET',cache:'no-cache'}).then(response => { |
| 333 | return response.json(); |
| 334 | }).then(json => { |
| 335 | console.log(json); |
| 336 | if (json.success === false) throw new Error(); |
| 337 | if (json.type === "error") throw new Error(json.msg); |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 338 | |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 339 | recursiveBase64StrToArrayBuffer(json); |
| 340 | return json; |
| 341 | }).then(getCredentialArgs => { |
| 342 | // get credentials |
| 343 | return navigator.credentials.get(getCredentialArgs); |
| 344 | }).then(cred => { |
| 345 | return { |
| 346 | id: cred.rawId ? arrayBufferToBase64(cred.rawId) : null, |
| 347 | clientDataJSON: cred.response.clientDataJSON ? arrayBufferToBase64(cred.response.clientDataJSON) : null, |
| 348 | authenticatorData: cred.response.authenticatorData ? arrayBufferToBase64(cred.response.authenticatorData) : null, |
| 349 | signature : cred.response.signature ? arrayBufferToBase64(cred.response.signature) : null |
| 350 | }; |
| 351 | }).then(JSON.stringify).then(function(AuthenticatorAttestationResponse) { |
| 352 | // send request by submit |
| 353 | var form = document.getElementById('webauthn_auth_form'); |
| 354 | var auth = document.getElementById('webauthn_auth_data'); |
| 355 | auth.value = AuthenticatorAttestationResponse; |
| 356 | form.submit(); |
| 357 | }).catch(function(err) { |
| 358 | var webauthn_status_auth = document.getElementById('webauthn_status_auth'); |
| 359 | webauthn_status_auth.style.setProperty('display', 'none', 'important'); |
| 360 | |
| 361 | var webauthn_return_code = document.getElementById('webauthn_return_code'); |
| 362 | webauthn_return_code.style.setProperty('display', 'block', 'important'); |
| 363 | webauthn_return_code.innerHTML = lang_tfa.error_code + ': ' + err + ' ' + lang_tfa.reload_retry; |
| 364 | }); |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 365 | } |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 366 | }); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 367 | $('#ConfirmTFAModal').on('hidden.bs.modal', function(){ |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 368 | // cancel pending login |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 369 | $.ajax({ |
| 370 | type: "GET", |
| 371 | cache: false, |
| 372 | dataType: 'script', |
| 373 | url: '/inc/ajax/destroy_tfa_auth.php', |
| 374 | complete: function(data){ |
| 375 | window.location = window.location.href.split("#")[0]; |
| 376 | } |
| 377 | }); |
| 378 | }); |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 379 | {% endif %} |
| 380 | |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 381 | {% if pending_tfa_setup %} |
| 382 | var setupTFAModal = new bootstrap.Modal(document.getElementById("SetupTFAModal"), { |
| 383 | backdrop: 'static', |
| 384 | keyboard: false |
| 385 | }); |
| 386 | setupTFAModal.show(); |
| 387 | |
| 388 | // Load QR code for TOTP setup in SetupTFAModal |
| 389 | var setupTotpSecret = $('#setup-tfa-qr-img').data('totp-secret'); |
| 390 | if (setupTotpSecret) { |
| 391 | $.ajax({ |
| 392 | type: "GET", |
| 393 | url: "/inc/ajax/qr_gen.php?token=" + encodeURIComponent(setupTotpSecret), |
| 394 | success: function(data) { |
| 395 | $('#setup-tfa-qr-img').attr('src', data); |
| 396 | } |
| 397 | }); |
| 398 | } |
| 399 | |
| 400 | // WebAuthn registration for SetupTFAModal |
| 401 | $('#start_setup_webauthn_register').click(function() { |
| 402 | if (!window.fetch || !navigator.credentials || !navigator.credentials.create) { |
| 403 | window.alert('Browser not supported.'); |
| 404 | return; |
| 405 | } |
| 406 | var keyId = $('#setup_webauthn_reg_form input[name=key_id]').val(); |
| 407 | if (!keyId) { |
| 408 | $('#setup_webauthn_return_code').show().text('Please fill in the key ID first.'); |
| 409 | return; |
| 410 | } |
| 411 | window.fetch('/api/v1/get/webauthn-tfa-registration', {method: 'GET', cache: 'no-cache'}).then(function(response) { |
| 412 | return response.json(); |
| 413 | }).then(function(json) { |
| 414 | if (json.success === false) throw new Error(json.error || 'Registration failed'); |
| 415 | recursiveBase64StrToArrayBuffer(json); |
| 416 | return navigator.credentials.create(json); |
| 417 | }).then(function(cred) { |
| 418 | return { |
| 419 | id: cred.id, |
| 420 | rawId: arrayBufferToBase64(cred.rawId), |
| 421 | response: { |
| 422 | attestationObject: arrayBufferToBase64(cred.response.attestationObject), |
| 423 | clientDataJSON: arrayBufferToBase64(cred.response.clientDataJSON) |
| 424 | }, |
| 425 | type: cred.type |
| 426 | }; |
| 427 | }).then(function(credData) { |
| 428 | $('#setup_webauthn_register_data').val(JSON.stringify(credData)); |
| 429 | $('#setup_webauthn_reg_form input[name=set_tfa]').val('1'); |
| 430 | $('#setup_webauthn_reg_form').submit(); |
| 431 | }).catch(function(err) { |
| 432 | $('#setup_webauthn_return_code').show().text(err.message || 'Registration failed'); |
| 433 | }); |
| 434 | }); |
| 435 | {% endif %} |
| 436 | |
| 437 | {% if pending_pw_update_modal and not pending_tfa_setup and not pending_tfa_methods %} |
| 438 | var changePWModal = new bootstrap.Modal(document.getElementById("ChangePWModal"), { |
| 439 | backdrop: 'static', |
| 440 | keyboard: false |
| 441 | }); |
| 442 | changePWModal.show(); |
| 443 | |
| 444 | $('#changePWModalForm').on('submit', function(e) { |
| 445 | e.preventDefault(); |
| 446 | var newPw = $('#changePWNew').val(); |
| 447 | var newPw2 = $('#changePWNew2').val(); |
| 448 | var role = '{{ mailcow_cc_role }}'; |
| 449 | var username = '{{ mailcow_cc_username }}'; |
| 450 | |
| 451 | var url, attrPayload, itemsPayload; |
| 452 | if (role === 'admin') { |
| 453 | url = '/api/v1/edit/admin'; |
| 454 | attrPayload = {password: newPw, password2: newPw2}; |
| 455 | itemsPayload = [username]; |
| 456 | } else { |
| 457 | url = '/api/v1/edit/self'; |
| 458 | attrPayload = {user_new_pass: newPw, user_new_pass2: newPw2}; |
| 459 | itemsPayload = null; |
| 460 | } |
| 461 | |
| 462 | $('#changePWAlert').hide(); |
| 463 | $.ajax({ |
| 464 | type: 'POST', |
| 465 | url: url, |
| 466 | data: { |
| 467 | attr: JSON.stringify(attrPayload), |
| 468 | items: JSON.stringify(itemsPayload), |
| 469 | csrf_token: '{{ csrf_token }}' |
| 470 | }, |
| 471 | dataType: 'json', |
| 472 | success: function(data) { |
| 473 | if (data && data[0] && data[0].type === 'success') { |
| 474 | window.location.reload(); |
| 475 | } else { |
| 476 | var msg = (data && data[0] && data[0].msg) ? data[0].msg : 'Password change failed.'; |
| 477 | // the API returns raw language keys, resolve them like the alert box does |
| 478 | if (Object.prototype.hasOwnProperty.call(lang_danger, msg)) { |
| 479 | msg = lang_danger[msg]; |
| 480 | } |
| 481 | $('#changePWAlert').show().text(msg); |
| 482 | } |
| 483 | }, |
| 484 | error: function() { |
| 485 | $('#changePWAlert').show().text('Request failed. Please try again.'); |
| 486 | } |
| 487 | }); |
| 488 | }); |
| 489 | {% endif %} |
| 490 | |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 491 | |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 492 | // Validate FIDO2 |
| 493 | $("#fido2-login").click(function(){ |
| 494 | $('#fido2-alerts').html(); |
| 495 | if (!window.fetch || !navigator.credentials || !navigator.credentials.create) { |
| 496 | window.alert('Browser not supported.'); |
| 497 | return; |
| 498 | } |
| 499 | window.fetch("/api/v1/get/fido2-get-args", {method:'GET',cache:'no-cache'}).then(function(response) { |
| 500 | return response.json(); |
| 501 | }).then(function(json) { |
| 502 | if (json.success === false) { |
| 503 | throw new Error(); |
| 504 | } |
| 505 | recursiveBase64StrToArrayBuffer(json); |
| 506 | return json; |
| 507 | }).then(function(getCredentialArgs) { |
| 508 | return navigator.credentials.get(getCredentialArgs); |
| 509 | }).then(function(cred) { |
| 510 | return { |
| 511 | id: cred.rawId ? arrayBufferToBase64(cred.rawId) : null, |
| 512 | clientDataJSON: cred.response.clientDataJSON ? arrayBufferToBase64(cred.response.clientDataJSON) : null, |
| 513 | authenticatorData: cred.response.authenticatorData ? arrayBufferToBase64(cred.response.authenticatorData) : null, |
| 514 | signature : cred.response.signature ? arrayBufferToBase64(cred.response.signature) : null |
| 515 | }; |
| 516 | }).then(JSON.stringify).then(function(AuthenticatorAttestationResponse) { |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 517 | var formData = new FormData(); |
| 518 | formData.append("token", AuthenticatorAttestationResponse); |
| 519 | formData.append("verify_fido2_login", "true"); |
| 520 | |
| 521 | return window.fetch(window.location.href, {method:'POST', body: formData, cache:'no-cache'}); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 522 | }).then(function(response) { |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 523 | window.location = window.location.href.split("#")[0]; |
| 524 | }).catch(function(err) { |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 525 | if (typeof err.message === 'undefined') { |
| 526 | mailcow_alert_box(lang_fido2.fido2_validation_failed, "danger"); |
| 527 | } else { |
| 528 | mailcow_alert_box(lang_fido2.fido2_validation_failed + ":<br><i>" + err.message + "</i>", "danger"); |
| 529 | } |
| 530 | }); |
| 531 | }); |
| 532 | // Set TFA/FIDO2 |
| 533 | $("#register-fido2, #register-fido2-touchid").click(function(){ |
| 534 | let t = $(this); |
| 535 | |
| 536 | $("option:selected").prop("selected", false); |
| 537 | if (!window.fetch || !navigator.credentials || !navigator.credentials.create) { |
| 538 | window.alert('Browser not supported.'); |
| 539 | return; |
| 540 | } |
| 541 | |
| 542 | window.fetch("/api/v1/get/fido2-registration/{{ mailcow_cc_username|url_encode(true)|default('null') }}", {method:'GET',cache:'no-cache'}).then(function(response) { |
| 543 | return response.json(); |
| 544 | }).then(function(json) { |
| 545 | if (json.success === false) { |
| 546 | throw new Error(json.msg); |
| 547 | } |
| 548 | recursiveBase64StrToArrayBuffer(json); |
| 549 | |
| 550 | // set attestation to node if we are registering apple touch id |
| 551 | if(t.attr('id') === 'register-fido2-touchid') { |
| 552 | json.publicKey.attestation = 'none'; |
| 553 | json.publicKey.authenticatorSelection.authenticatorAttachment = "platform"; |
| 554 | } |
| 555 | |
| 556 | return json; |
| 557 | }).then(function(createCredentialArgs) { |
| 558 | console.log(createCredentialArgs); |
| 559 | return navigator.credentials.create(createCredentialArgs); |
| 560 | }).then(function(cred) { |
| 561 | return { |
| 562 | clientDataJSON: cred.response.clientDataJSON ? arrayBufferToBase64(cred.response.clientDataJSON) : null, |
| 563 | attestationObject: cred.response.attestationObject ? arrayBufferToBase64(cred.response.attestationObject) : null |
| 564 | }; |
| 565 | }).then(JSON.stringify).then(function(AuthenticatorAttestationResponse) { |
| 566 | return window.fetch("/api/v1/add/fido2-registration", {method:'POST', body: AuthenticatorAttestationResponse, cache:'no-cache'}); |
| 567 | }).then(function(response) { |
| 568 | return response.json(); |
| 569 | }).then(function(json) { |
| 570 | if (json.success) { |
| 571 | window.location = window.location.href.split("#")[0]; |
| 572 | } else { |
| 573 | throw new Error(json.msg); |
| 574 | } |
| 575 | }).catch(function(err) { |
| 576 | $('#fido2-alerts').html('<span class="text-danger"><b>' + err.message + '</b></span>'); |
| 577 | }); |
| 578 | }); |
| 579 | $('#selectTFA').change(function () { |
| 580 | if ($(this).val() == "yubi_otp") { |
| 581 | $('#YubiOTPModal').modal('show'); |
| 582 | $("option:selected").prop("selected", false); |
| 583 | } |
| 584 | if ($(this).val() == "totp") { |
| 585 | $('#TOTPModal').modal('show'); |
| 586 | request_token = $('#tfa-qr-img').data('totp-secret'); |
| 587 | $.ajax({ |
| 588 | url: '/inc/ajax/qr_gen.php', |
| 589 | data: { |
| 590 | token: request_token, |
| 591 | }, |
| 592 | }).done(function (result) { |
| 593 | $("#tfa-qr-img").attr("src", result); |
| 594 | }); |
| 595 | $("option:selected").prop("selected", false); |
| 596 | } |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 597 | if ($(this).val() == "webauthn") { |
| 598 | // check if Browser is supported |
| 599 | if (!window.fetch || !navigator.credentials || !navigator.credentials.create) { |
| 600 | window.alert('Browser not supported.'); |
| 601 | return; |
| 602 | } |
| 603 | |
| 604 | // show modal |
| 605 | $('#WebAuthnModal').modal('show'); |
| 606 | $("option:selected").prop("selected", false); |
| 607 | |
| 608 | $("#start_webauthn_register").click(() => { |
| 609 | var key_id = document.getElementsByName('key_id')[1].value; |
| 610 | var confirm_password = document.getElementsByName('confirm_password')[1].value; |
| 611 | |
| 612 | // fetch WebAuthn create args |
| 613 | window.fetch("/api/v1/get/webauthn-tfa-registration/{{ mailcow_cc_username|url_encode(true)|default('null') }}", {method:'GET',cache:'no-cache'}).then(response => { |
| 614 | return response.json(); |
| 615 | }).then(json => { |
| 616 | console.log(json); |
| 617 | if (json.success === false) throw new Error(json.msg); |
| 618 | recursiveBase64StrToArrayBuffer(json); |
| 619 | |
| 620 | return json; |
| 621 | }).then(createCredentialArgs => { |
| 622 | // create credentials |
| 623 | return navigator.credentials.create(createCredentialArgs); |
| 624 | }).then(cred => { |
| 625 | return { |
| 626 | clientDataJSON: cred.response.clientDataJSON ? arrayBufferToBase64(cred.response.clientDataJSON) : null, |
| 627 | attestationObject: cred.response.attestationObject ? arrayBufferToBase64(cred.response.attestationObject) : null, |
| 628 | key_id: key_id, |
| 629 | tfa_method: "webauthn", |
| 630 | confirm_password: confirm_password |
| 631 | }; |
| 632 | }).then(JSON.stringify).then(AuthenticatorAttestationResponse => { |
| 633 | // send request |
| 634 | return window.fetch("/api/v1/add/webauthn-tfa-registration", {method:'POST', body: AuthenticatorAttestationResponse, cache:'no-cache'}); |
| 635 | }).then(response => { |
| 636 | return response.json(); |
| 637 | }).then(json => { |
| 638 | if (json.success) { |
| 639 | // reload on success |
| 640 | window.location = window.location.href.split("#")[0]; |
| 641 | } else { |
| 642 | throw new Error(json.msg); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 643 | } |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 644 | }).catch(function(err) { |
| 645 | console.log(err); |
| 646 | var webauthn_return_code = document.getElementById('webauthn_return_code'); |
| 647 | webauthn_return_code.style.display = webauthn_return_code.style.display === 'none' ? '' : null; |
| 648 | webauthn_return_code.innerHTML = lang_tfa.error_code + ': ' + err + ' ' + lang_tfa.reload_retry; |
| 649 | }); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 650 | }); |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 651 | } |
| 652 | if ($(this).val() == "none") { |
| 653 | $('#DisableTFAModal').modal('show'); |
| 654 | $("option:selected").prop("selected", false); |
| 655 | } |
| 656 | }); |
| 657 | |
| 658 | {% if mailcow_cc_username %} |
| 659 | // Reload after session timeout |
| 660 | var session_lifetime = {{ (session_lifetime * 1000) + 15000 }}; |
| 661 | setTimeout(function() { |
| 662 | location.reload(); |
| 663 | }, session_lifetime); |
| 664 | {% endif %} |
| 665 | |
| 666 | // CSRF |
| 667 | $('<input type="hidden" value="{{ csrf_token }}">').attr('name', 'csrf_token').appendTo('form'); |
| 668 | if (sessionStorage.scrollTop != "undefined") { |
| 669 | $(window).scrollTop(sessionStorage.scrollTop); |
| 670 | } |
| 671 | }); |
| 672 | </script> |
| 673 | |
| 674 | <div class="container footer"> |
| 675 | {% if ui_texts.ui_footer %} |
| 676 | <hr><span class="rot-enc">{{ ui_texts.ui_footer|rot13|raw }}</span> |
| 677 | {% endif %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 678 | {% if mailcow_cc_username and mailcow_info.mailcow_branch|lower == "master" and mailcow_info.version_tag|default %} |
| 679 | <span class="version"> |
| 680 | 🐮 + 🐋 = 💕 |
| 681 | Version: <a href="{{ mailcow_info.git_project_url }}/releases/tag/{{ mailcow_info.version_tag }}" target="_blank">{{ mailcow_info.version_tag }} |
| 682 | </a> |
| 683 | </span> |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 684 | {% endif %} |
| Matthias Andreas Benkard | 3c18a08 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 685 | {% if mailcow_cc_username and mailcow_info.mailcow_branch|lower == "nightly" and mailcow_info.version_tag|default %} |
| 686 | <span class="version"> |
| 687 | 🛠️🐮 + 🐋 = 💕 |
| 688 | Nightly: <a href="{{ mailcow_info.git_project_url }}/commit/{{ mailcow_info.git_commit }}" target="_blank">{{ mailcow_info.version_tag }} |
| 689 | </a><br> |
| 690 | <span style="text-align:right;display:block;">Build: {{ mailcow_info.git_commit_date }}</span> |
| 691 | </span> |
| 692 | {% endif %} |
| Matthias Andreas Benkard | 97f1202 | 2026-10-23 08:46:40 +0200 | [diff] [blame] | 693 | {% if mailcow_cc_username and mailcow_info.mailcow_branch|lower == "legacy" and mailcow_info.version_tag|default %} |
| 694 | <span class="version"> |
| 695 | ⚰️🐮 + 🐋 = 💕 |
| 696 | Legacy: <a href="{{ mailcow_info.git_project_url }}/commit/{{ mailcow_info.git_commit }}" target="_blank">{{ mailcow_info.version_tag }} |
| 697 | </a><br> |
| 698 | <span style="text-align:right;display:block;">Build: {{ mailcow_info.git_commit_date }}</span> |
| 699 | </span> |
| 700 | {% endif %} |
| Matthias Andreas Benkard | b4b5cc1 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 701 | </div> |
| 702 | </body> |
| 703 | </html> |