public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
Merge branch 'nightly' into feature/bootstrap5
ecc16c69
.drone.yml | 120 ------
.github/workflows/close_old_issues_and_prs.yml | 3 +-
.github/workflows/image_builds.yml | 42 ++
.github/workflows/integration_tests.yml | 60 +++
.../workflows/tweet-trigger-publish-release.yml | 17 +
.travis.yml | 16 -
README.md | 3 +-
SECURITY.md | 42 ++
create_cold_standby.sh | 0
data/Dockerfiles/clamd/Dockerfile | 10 +-
data/Dockerfiles/clamd/healthcheck.sh | 9 +
data/Dockerfiles/dovecot/Dockerfile | 2 +-
data/Dockerfiles/dovecot/docker-entrypoint.sh | 8 +
data/conf/dovecot/dovecot.conf | 1 -
data/conf/rspamd/local.d/groups.conf | 3 +
data/web/api/openapi.yaml | 146 ++++---
data/web/css/build/013-mailcow.css | 79 +---
data/web/inc/ajax/destroy_tfa_auth.php | 2 +-
data/web/inc/footer.inc.php | 35 +-
data/web/inc/functions.inc.php | 437 ++++++++++++---------
data/web/inc/functions.mailbox.inc.php | 67 +++-
data/web/inc/init_db.inc.php | 20 +-
data/web/inc/prerequisites.inc.php | 3 +-
data/web/inc/triggers.inc.php | 31 +-
data/web/inc/vars.inc.php | 128 ++++++
data/web/json_api.php | 47 ++-
data/web/lang/lang.es.json | 3 +-
data/web/lang/lang.ru.json | 5 +-
data/web/lang/lang.uk.json | 3 +-
data/web/templates/base.twig | 126 ++++--
data/web/templates/domainadmin.twig | 2 +-
data/web/templates/modals/footer.twig | 16 +-
data/web/templates/modals/mailbox.twig | 4 +-
data/web/templates/user/tab-user-auth.twig | 21 +
data/web/user.php | 4 +-
docker-compose.yml | 10 +-
generate_config.sh | 107 +++--
helper-scripts/_cold-standby.sh | 84 ++--
helper-scripts/backup_and_restore.sh | 47 +--
helper-scripts/update_compose.sh | 70 ++++
update.sh | 393 ++++++++++++------
41 files changed, 1452 insertions(+), 774 deletions(-)
delete mode 100644 .drone.yml
create mode 100644 .github/workflows/image_builds.yml
create mode 100644 .github/workflows/integration_tests.yml
create mode 100644 .github/workflows/tweet-trigger-publish-release.yml
delete mode 100644 .travis.yml
create mode 100644 SECURITY.md
mode change 100644 => 100755 create_cold_standby.sh
create mode 100755 data/Dockerfiles/clamd/healthcheck.sh
create mode 100755 helper-scripts/update_compose.sh
Diff
diff --cc data/web/css/build/013-mailcow.css
index 49a47693,b118ca01..88d82e0c
--- a/data/web/css/build/013-mailcow.css
+++ b/data/web/css/build/013-mailcow.css
@@@ -270,28 -259,19 +270,7 @@@ code
.flag-icon {
margin-right: 5px;
}
- .dropdown-header {
- font-weight: 600;
- }
-
- .dataTables_info {
- margin: 15px 0 !important;
- padding: 0px !important;
- }
- .dataTables_paginate, .dataTables_length, .dataTables_filter {
- margin: 15px 0 !important;
- }
- .dtr-details {
- width: 100%;
- }
- .dtr-title {
- width: 20%;
- }
- table.dataTable>tbody>tr.child ul.dtr-details>li {
- border-bottom: 1px solid rgba(239, 239, 239, 0.129);
- padding: 0.5em 0;
- }
-.list-group-item.webauthn-authenticator-selection,
-.list-group-item.totp-authenticator-selection,
-.list-group-item.yubi_otp-authenticator-selection {
- border-radius: 0px !important;
-}
-.pending-tfa-collapse {
- padding: 10px;
- background: #fbfbfb;
- border: 1px solid #ededed;
- min-height: 110px;
-}
-
.tag-box {
display: flex;
flex-wrap: wrap;
@@@ -328,68 -308,3 +307,12 @@@
align-items: center;
display: inline-flex;
}
++
+#dnstable {
+ overflow-x: auto!important;
+}
+.well {
+ border: 1px solid #dfdfdf;
+ background-color: #f9f9f9;
+ padding: 10px;
- }
-
-
- table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before:hover,
- table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before:hover {
- background-color: #5e5e5e;
- }
- table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,
- table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before,
- table.dataTable td.dt-control:before {
- background-color: #979797 !important;
- border: 1.5px solid #616161 !important;
- border-radius: 2px !important;
- color: #fff;
- height: 1em;
- width: 1em;
- line-height: 1.25em;
- border-radius: 0px;
- box-shadow: none;
- font-size: 14px;
- transition: 0.5s all;
- }
- table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td.dtr-control:before,
- table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control:before,
- table.dataTable td.dt-control:before {
- background-color: #979797 !important;
- }
- table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,
- table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,
- table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty {
- background-color: #fbfbfb;
- }
- table.dataTable.table-striped>tbody>tr>td {
- vertical-align: middle;
- }
- table.dataTable.table-striped>tbody>tr>td>input[type="checkbox"] {
- margin-top: 7px;
- }
-
-
- .btn-check-label {
- color: #555;
- }
-
- .caret {
- transform: rotate(0deg);
- }
- a[aria-expanded='true'] > .caret,
- button[aria-expanded='true'] > .caret {
- transform: rotate(-180deg);
- }
-
- .list-group-details {
- background: #fff;
- }
- .list-group-header {
- background: #f7f7f7;
+}
diff --cc data/web/templates/base.twig
index c39ceda4,b19c548a..3a34f6ba
--- a/data/web/templates/base.twig
+++ b/data/web/templates/base.twig
@@@ -202,15 -176,75 +202,75 @@@ function recursiveBase64StrToArrayBuffe
{% endfor %}
// Confirm TFA modal
- {% if pending_tfa_methods %}
- $('#ConfirmTFAModal').modal({
+ {% if pending_tfa_method %}
+ new bootstrap.Modal(document.getElementById("ConfirmTFAModal"), {
backdrop: 'static',
keyboard: false
- });
+ }).show();
+
+ // validate Time based OTP tfa
+ $("#pending_tfa_tab_totp").click(function(){
+ $(".webauthn-authenticator-selection").removeClass("active");
+ $("#collapseWebAuthnTFA").collapse('hide');
+
+ // select default if only one authenticator exists
+ if ($('.totp-authenticator-selection').length == 1){
+ $('.totp-authenticator-selection').addClass("active");
+ var id = $('.totp-authenticator-selection').children('input').first().val();
+ $("#totp_selected_id").val(id);
+ $("#collapseTotpTFA").collapse('show');
+ }
+ });
+ $(".totp-authenticator-selection").click(function(){
+ $(".totp-authenticator-selection").removeClass("active");
+ $(this).addClass("active");
+
+ var id = $(this).children('input').first().val();
+ $("#totp_selected_id").val(id);
+
+ $("#collapseTotpTFA").collapse('show');
+ });
+ if ($('.totp-authenticator-selection').length == 1 &&
+ $('#pending_tfa_tab_yubi_otp').length == 0 &&
+ $('.webauthn-authenticator-selection').length == 0){
+
+ // select default if only one authenticator exists
+ $('.totp-authenticator-selection').addClass("active");
+
+ var id = $('.totp-authenticator-selection').children('input').first().val();
+ $("#totp_selected_id").val(id);
+
+ $("#collapseTotpTFA").collapse('show');
+ setTimeout(function() { $("#collapseTotpTFA").find('input[name="token"]').focus(); }, 1000);
+ }
+ $('#pending_tfa_tab_totp').on('shown.bs.tab', function() {
+ // autofocus
+ setTimeout(function() { $("#collapseTotpTFA").find('input[name="token"]').focus(); }, 200);
+ });
+ // validate Yubi OTP tfa
+ if ($('.webauthn-authenticator-selection').length == 0){
+ // autofocus
+ setTimeout(function() { $("#collapseYubiTFA").find('input[name="token"]').focus(); }, 1000);
+ }
+ $('#pending_tfa_tab_yubi_otp').on('shown.bs.tab', function() {
+ // autofocus
+ $("#collapseYubiTFA").find('input[name="token"]').focus();
+ });
// validate WebAuthn tfa
- $('#start_webauthn_confirmation').click(function(){
- $('#webauthn_status_auth').html('<p><i class="bi bi-arrow-repeat icon-spin"></i> ' + lang_tfa.init_webauthn + '</p>');
+ $("#pending_tfa_tab_webauthn").click(function(){
+ $(".totp-authenticator-selection").removeClass("active");
+
+ $("#collapseTotpTFA").collapse('hide');
+ });
+ $(".webauthn-authenticator-selection").click(function(){
+ $(".webauthn-authenticator-selection").removeClass("active");
+ $(this).addClass("active");
+
+ var id = $(this).children('input').first().val();
+ $("#webauthn_selected_id").val(id);
+
+ $("#collapseWebAuthnTFA").collapse('show');
$(this).find('input[name=token]').focus();
if(document.getElementById("webauthn_auth_data") !== null) {
diff --cc data/web/templates/domainadmin.twig
index 5ce28410,3bc7ab40..56f5e75f
--- a/data/web/templates/domainadmin.twig
+++ b/data/web/templates/domainadmin.twig
@@@ -24,11 -24,11 +24,11 @@@
</div>
</div>
<div class="row">
- <div class="col-sm-3 col-xs-5 text-right">{{ lang.tfa.set_tfa }}</div>
- <div class="col-sm-9 col-xs-7">
+ <div class="col-sm-3 col-5 text-end">{{ lang.tfa.set_tfa }}</div>
+ <div class="col-sm-9 col-7">
<select id="selectTFA" class="selectpicker" title="{{ lang.tfa.select }}">
<option value="yubi_otp">{{ lang.tfa.yubi_otp }}</option>
- <option value="u2f">{{ lang.tfa.u2f }}</option>
+ <option value="webauthn">{{ lang.tfa.webauthn }}</option>
<option value="totp">{{ lang.tfa.totp }}</option>
<option value="none">{{ lang.tfa.none }}</option>
</select>
diff --cc data/web/templates/modals/footer.twig
index 8bb0889e,52e89e00..87e36514
--- a/data/web/templates/modals/footer.twig
+++ b/data/web/templates/modals/footer.twig
@@@ -136,68 -138,158 +136,68 @@@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
- <h3 class="modal-title">{{ lang.tfa.tfa }}</h3>
+ <h3 class="modal-title">{{ lang.tfa[pending_tfa_method] }}</h3>
- <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
-
- <ul class="nav nav-tabs" id="tabContent">
- {% if pending_tfa_authmechs["webauthn"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
- <li class="active"><a href="#tfa_tab_webauthn" data-toggle="tab" id="pending_tfa_tab_webauthn"><i class="bi bi-fingerprint"></i> WebAuthn</a></li>
- {% endif %}
-
- {% if pending_tfa_authmechs["yubi_otp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
- <li class="tab-pane {% if pending_tfa_authmechs["yubi_otp"] %}active{% endif %}">
- <a href="#tfa_tab_yubi_otp" data-toggle="tab" id="pending_tfa_tab_yubi_otp"><i class="bi bi-usb-drive"></i> Yubi OTP</a>
- </li>
- {% endif %}
-
- {% if pending_tfa_authmechs["totp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
- <li class="tab-pane {% if pending_tfa_authmechs["totp"] %}active{% endif %}">
- <a href="#tfa_tab_totp" data-toggle="tab" id="pending_tfa_tab_totp"><i class="bi bi-clock-history"></i> Time based OTP</a>
- </li>
- {% endif %}
-
- <!-- <li><a href="#tfa_tab_hotp" data-toggle="tab">HOTP</a></li> -->
- {% if pending_tfa_authmechs["u2f"] is defined %}
- <li class="active"><a href="#tfa_tab_u2f" data-toggle="tab"><i class="bi bi-x-octagon"></i> U2F</a></li>
- {% endif %}
- </ul>
-
- <div class="tab-content">
- {% if pending_tfa_authmechs["webauthn"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
- <div role="tabpanel" class="tab-pane active" id="tfa_tab_webauthn">
- <div class="panel panel-default" style="margin-bottom: 0px;">
- <div class="panel-body">
- <form role="form" method="post" id="webauthn_auth_form">
- <legend>
- <i class="bi bi-shield-fill-check"></i>
- Authenticators
- </legend>
- <div class="list-group">
- {% for authenticator in pending_tfa_methods %}
- {% if authenticator["authmech"] == "webauthn" %}
- <a href="#" class="list-group-item webauthn-authenticator-selection">
- <i class="bi bi-key-fill" style="margin-right: 5px"></i>
- <span>{{ authenticator["key_id"] }}</span>
- <input type="hidden" value="{{ authenticator["id"] }}" /><br/>
- </a>
- {% endif %}
- {% endfor %}
- </div>
- <div class="collapse pending-tfa-collapse" id="collapseWebAuthnTFA">
- <p id="webauthn_status_auth"><p><i class="bi bi-arrow-repeat icon-spin"></i> {{ lang.tfa.init_webauthn }}</p></p>
- <div class="alert alert-danger" style="display:none" id="webauthn_return_code"></div>
- </div>
- <input type="hidden" name="token" id="webauthn_auth_data"/>
- <input type="hidden" name="tfa_method" value="webauthn">
- <input type="hidden" name="verify_tfa_login"/><br/>
- <input type="hidden" name="id" id="webauthn_selected_id" /><br/>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- {% if pending_tfa_authmechs["yubi_otp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
- <div role="tabpanel" class="tab-pane {% if pending_tfa_authmechs["yubi_otp"] %}active{% endif %}" id="tfa_tab_yubi_otp">
- <div class="panel panel-default" style="margin-bottom: 0px;">
- <div class="panel-body">
- <form role="form" method="post">
- <legend>
- <i class="bi bi-shield-fill-check"></i>
- Authenticate
- </legend>
- <div class="collapse in pending-tfa-collapse" id="collapseYubiTFA">
- <div class="form-group">
- <div class="input-group">
- <span class="input-group-addon" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
- <input type="text" name="token" class="form-control" autocomplete="off" placeholder="Touch Yubikey" aria-describedby="yubi-addon">
- <input type="hidden" name="tfa_method" value="yubi_otp">
- <input type="hidden" name="id" id="yubi_selected_id" />
- </div>
- </div>
- <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-sm btn-default" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- {% if pending_tfa_authmechs["totp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
- <div role="tabpanel" class="tab-pane {% if pending_tfa_authmechs["totp"] %}active{% endif %}" id="tfa_tab_totp">
- <div class="panel panel-default" style="margin-bottom: 0px;">
- <div class="panel-body">
- <form role="form" method="post">
- <legend>
- <i class="bi bi-shield-fill-check"></i>
- Authenticators
- </legend>
- <div class="list-group">
- {% for authenticator in pending_tfa_methods %}
- {% if authenticator["authmech"] == "totp" %}
- <a href="#" class="list-group-item totp-authenticator-selection">
- <i class="bi bi-key-fill" style="margin-right: 5px"></i>
- <span>{{ authenticator["key_id"] }}</span>
- <input type="hidden" value="{{ authenticator["id"] }}" />
- </a>
- {% endif %}
- {% endfor %}
- </div>
- <div class="collapse pending-tfa-collapse" id="collapseTotpTFA">
- <div class="form-group">
- <div class="input-group">
- <span class="input-group-addon" id="tfa-addon"><i class="bi bi-shield-lock-fill"></i></span>
- <input type="number" min="000000" max="999999" name="token" class="form-control" placeholder="123456" autocomplete="one-time-code" aria-describedby="tfa-addon">
- <input type="hidden" name="tfa_method" value="totp">
- <input type="hidden" name="id" id="totp_selected_id" /><br/>
- </div>
- </div>
- <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- <!--
- <div role="tabpanel" class="tab-pane" id="tfa_tab_hotp">
- <div class="panel panel-default" style="margin-bottom: 0px;">
- <div class="panel-body">
- <div class="empty"></div>
- </div>
- </div>
+ <div class="modal-body">
+ {% if pending_tfa_method == 'yubi_otp' %}
+ <form role="form" method="post">
- <div>
++ <div class="form-group">
+ <div class="input-group">
- <span class="input-group-text" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
++ <span class="input-group-addon" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
+ <input type="text" name="token" class="form-control" autocomplete="off" placeholder="Touch Yubikey" aria-describedby="yubi-addon">
+ <input type="hidden" name="tfa_method" value="yubi_otp">
</div>
- -->
- {% if pending_tfa_authmechs["u2f"] is defined %}
- <div role="tabpanel" class="tab-pane active" id="tfa_tab_u2f">
- <div class="panel panel-default" style="margin-bottom: 0px;">
- <div class="panel-body">
- {# leave this here to inform users that u2f is deprecated #}
- <form role="form" method="post" id="u2f_auth_form">
- <div>
- <p>{{ lang.tfa.u2f_deprecated }}</p>
- <p><b>{{ lang.tfa.u2f_deprecated_important }}</b></p>
- <input type="hidden" name="token" value="destroy" />
- <input type="hidden" name="tfa_method" value="u2f">
- <input type="hidden" name="verify_tfa_login"/><br/>
- <button type="submit" class="btn btn-xs-lg btn-success" value="Login">{{ lang.login.login }}</button>
- </div>
- </form>
- </div>
- </div>
+ </div>
- <button class="btn btn-sm d-block d-sm-inline btn-sm btn-secondary" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
++ <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-sm btn-default" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
+ </form>
+ {% endif %}
+ {% if pending_tfa_method == 'totp' %}
+ <form role="form" method="post">
- <div>
++ <div class="form-group">
+ <div class="input-group">
- <span class="input-group-text" id="tfa-addon"><i class="bi bi-shield-lock-fill"></i></span>
++ <span class="input-group-addon" id="tfa-addon"><i class="bi bi-shield-lock-fill"></i></span>
+ <input type="number" min="000000" max="999999" name="token" class="form-control" placeholder="123456" autocomplete="one-time-code" aria-describedby="tfa-addon">
+ <input type="hidden" name="tfa_method" value="totp">
</div>
- {% endif %}
- </div>
+ </div>
- <button class="btn btn-sm d-block d-sm-inline btn-secondary" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
++ <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
+ </form>
+ {% endif %}
+ {% if pending_tfa_method == 'hotp' %}
+ <div class="empty"></div>
+ {% endif %}
+ {% if pending_tfa_method == 'webauthn' %}
+ <form role="form" method="post" id="webauthn_auth_form">
+ <center>
+ <div style="cursor:pointer" id="start_webauthn_confirmation">
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24">
+ <path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28zM3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7-.23.16-.54.11-.7-.12-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21zm6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57 0-4.66 1.97-4.66 4.39 0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94 1.7 0 3.08 1.32 3.08 2.94 0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z"></path>
+ </svg>
+ <p>{{ lang.tfa.start_webauthn_validation }}</p>
+ <hr>
+ </div>
+ </center>
+ <p id="webauthn_status_auth"></p>
+ <div class="alert alert-danger" style="display:none" id="webauthn_return_code"></div>
+ <input type="hidden" name="token" id="webauthn_auth_data"/>
+ <input type="hidden" name="tfa_method" value="webauthn">
+ <input type="hidden" name="verify_tfa_login"/><br/>
+ </form>
+ {% endif %}
+ {# leave this here to inform users that u2f is deprecated #}
+ {% if pending_tfa_method == 'u2f' %}
+ <form role="form" method="post" id="u2f_auth_form">
+ <p>{{ lang.tfa.u2f_deprecated }}</p>
+ <p><b>{{ lang.tfa.u2f_deprecated_important }}</b></p>
+ <input type="hidden" name="token" value="destroy" />
+ <input type="hidden" name="tfa_method" value="u2f">
+ <input type="hidden" name="verify_tfa_login"/><br/>
+ <button type="submit" class="btn btn-xs-lg btn-success" value="Login">{{ lang.login.login }}</button>
+ </form>
+ {% endif %}
+ </div>
</div>
</div>
</div>
diff --cc data/web/templates/modals/mailbox.twig
index 0057096b,17e06ed2..f5306e24
--- a/data/web/templates/modals/mailbox.twig
+++ b/data/web/templates/modals/mailbox.twig
@@@ -427,19 -427,19 +427,19 @@@
</div><!-- add domain alias modal -->
<!-- add sync job modal -->
<div class="modal fade" id="addSyncJobModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
- <div class="modal-dialog modal-lg">
+ <div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
- <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
<h3 class="modal-title">{{ lang.add.syncjob }}</h3>
+ <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
- <p class="help-block">{{ lang.add.syncjob_hint }}</p>
+ <p class="text-muted">{{ lang.add.syncjob_hint }}</p>
- <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_syncjob">
+ <form class="form-horizontal" data-cached-form="false" role="form" data-id="add_syncjob">
- <div class="form-group">
- <label class="control-label col-sm-2" for="username">{{ lang.add.username }}</label>
+ <div class="row mb-2">
+ <label class="control-label col-sm-2 text-sm-end" for="username">{{ lang.add.username }}</label>
<div class="col-sm-10">
- <select data-live-search="true" name="username" required>
+ <select data-live-search="true" name="username" title="{{ lang.add.select }}" required>
{% for mailbox in mailboxes %}
<option>{{ mailbox }}</option>
{% endfor %}
diff --cc data/web/templates/user/tab-user-auth.twig
index 7f601982,7596a036..5f432872
--- a/data/web/templates/user/tab-user-auth.twig
+++ b/data/web/templates/user/tab-user-auth.twig
@@@ -53,9 -48,30 +53,30 @@@
</div>
</div>
<hr>
+ {# TFA #}
+ <div class="row">
+ <div class="col-sm-3 col-xs-5 text-right">{{ lang.tfa.tfa }}:</div>
+ <div class="col-sm-9 col-xs-7">
+ <p id="tfa_pretty">{{ tfa_data.pretty }}</p>
+ {% include 'tfa_keys.twig' %}
+ <br>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-3 col-xs-5 text-right">{{ lang.tfa.set_tfa }}:</div>
+ <div class="col-sm-9 col-xs-7">
+ <select data-style="btn btn-sm dropdown-toggle bs-placeholder btn-default" data-width="fit" id="selectTFA" class="selectpicker" title="{{ lang.tfa.select }}">
+ <option value="yubi_otp">{{ lang.tfa.yubi_otp }}</option>
+ <option value="webauthn">{{ lang.tfa.webauthn }}</option>
+ <option value="totp">{{ lang.tfa.totp }}</option>
+ <option value="none">{{ lang.tfa.none }}</option>
+ </select>
+ </div>
+ </div>
+ <hr>
{# FIDO2 #}
<div class="row">
- <div class="col-sm-3 col-xs-12 text-right text-xs-left">
+ <div class="col-sm-3 col-12 text-sm-end text-start">
<p><i class="bi bi-shield-fill-check"></i> {{ lang.fido2.fido2_auth }}</p>
</div>
</div>
diff --cc data/web/user.php
index 1ab93e81,d8fc80c1..b92e87a7
--- a/data/web/user.php
+++ b/data/web/user.php
@@@ -88,11 -89,9 +89,10 @@@ elseif (isset($_SESSION['mailcow_cc_rol
'pushover_data' => $pushover_data,
'lang_user' => json_encode($lang['user']),
'number_of_app_passwords' => $number_of_app_passwords,
+ 'lang_datatables' => json_encode($lang['datatables']),
];
}
-
- if (!isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admin') {
+ else {
header('Location: /');
exit();
}