From fb7e2341207eb7bc51dac37f4663ef105e0f302f Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 30 Sep 2022 11:38:43 +0200 Subject: [PATCH 1/7] move guid to debug.php --- data/web/admin.php | 1 - data/web/debug.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/admin.php b/data/web/admin.php index a68ec033..e53d18fd 100644 --- a/data/web/admin.php +++ b/data/web/admin.php @@ -90,7 +90,6 @@ $template_data = [ 'fido2_cid' => @$_SESSION['fido2_cid'], 'fido2_data' => $fido2_data, 'gal' => @$_SESSION['gal'], - 'license_guid' => license('guid'), 'api' => [ 'ro' => admin_api('ro', 'get'), 'rw' => admin_api('rw', 'get'), diff --git a/data/web/debug.php b/data/web/debug.php index e9b426c4..5d50dc85 100644 --- a/data/web/debug.php +++ b/data/web/debug.php @@ -69,6 +69,7 @@ $template_data = [ 'vmail_df' => $vmail_df, 'hostname' => $hostname, 'timezone' => $timezone, + 'license_guid' => license('guid'), 'ips' => $ips, 'solr_status' => $solr_status, 'solr_uptime' => round($solr_status['status']['dovecot-fts']['uptime'] / 1000 / 60 / 60), From 10e560c5b22c41e54c28c7a5b4d631c2858cff39 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Sat, 1 Oct 2022 15:56:45 +0200 Subject: [PATCH 2/7] fix set rspamd worker password --- data/Dockerfiles/dockerapi/dockerapi.py | 21 ++++--------------- data/Dockerfiles/rspamd/Dockerfile | 1 + .../Dockerfiles/rspamd/set_worker_password.sh | 12 +++++++++++ docker-compose.yml | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) create mode 100755 data/Dockerfiles/rspamd/set_worker_password.sh diff --git a/data/Dockerfiles/dockerapi/dockerapi.py b/data/Dockerfiles/dockerapi/dockerapi.py index 1ce47265..965fc906 100644 --- a/data/Dockerfiles/dockerapi/dockerapi.py +++ b/data/Dockerfiles/dockerapi/dockerapi.py @@ -494,27 +494,14 @@ class DockerUtils: for container in (await self.docker_client.containers.list()): if container._id == container_id: - cmd = "/usr/bin/rspamadm pw -e -p '" + request_json['raw'].replace("'", "'\\''") + "' 2> /dev/null" + cmd = "./set_worker_password.sh '" + request_json['raw'].replace("'", "'\\''") + "' 2> /dev/null" rspamd_password_exec = await container.exec(cmd, user='_rspamd') async with rspamd_password_exec.start(detach=False) as stream: rspamd_password_return = await stream.read_out() - - matched = False - for line in rspamd_password_return.data.decode('utf-8').split("\n"): - if '$2$' in line: - hash = line.strip() - hash_out = re.search('\$2\$.+$', hash).group(0) - rspamd_passphrase_hash = re.sub('[^0-9a-zA-Z\$]+', '', hash_out.rstrip()) - rspamd_password_filename = "/etc/rspamd/override.d/worker-controller-password.inc" - cmd = '''/bin/echo 'enable_password = "%s";' > %s && cat %s''' % (rspamd_passphrase_hash, rspamd_password_filename, rspamd_password_filename) - rspamd_password_exec = await container.exec(cmd, user='_rspamd') - async with rspamd_password_exec.start(detach=False) as stream: - rspamd_password_return = await stream.read_out() - - if rspamd_passphrase_hash.startswith("$2$") and rspamd_passphrase_hash in rspamd_password_return.data.decode('utf-8'): - await container.restart() - matched = True + if "OK" in rspamd_password_return.data.decode('utf-8'): + matched = True + await container.restart() if matched: res = { diff --git a/data/Dockerfiles/rspamd/Dockerfile b/data/Dockerfiles/rspamd/Dockerfile index 23fcbb3f..2520ddcc 100644 --- a/data/Dockerfiles/rspamd/Dockerfile +++ b/data/Dockerfiles/rspamd/Dockerfile @@ -26,6 +26,7 @@ RUN apt-get update && apt-get install -y \ COPY settings.conf /etc/rspamd/settings.conf COPY metadata_exporter.lua /usr/share/rspamd/plugins/metadata_exporter.lua +COPY set_worker_password.sh /set_worker_password.sh COPY docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/data/Dockerfiles/rspamd/set_worker_password.sh b/data/Dockerfiles/rspamd/set_worker_password.sh new file mode 100755 index 00000000..7205e888 --- /dev/null +++ b/data/Dockerfiles/rspamd/set_worker_password.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +password_file='/etc/rspamd/override.d/worker-controller-password.inc' +password_hash=`/usr/bin/rspamadm pw -e -p $1` + +echo 'enable_password = "'$password_hash'";' > $password_file + +if grep -q "$password_hash" "$password_file"; then + echo "OK" +else + echo "ERROR" +fi \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index da2b7e0d..5ae00ade 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,7 +76,7 @@ services: - clamd rspamd-mailcow: - image: mailcow/rspamd:1.90 + image: mailcow/rspamd:1.91 stop_grace_period: 30s depends_on: - dovecot-mailcow @@ -509,7 +509,7 @@ services: - watchdog dockerapi-mailcow: - image: mailcow/dockerapi:1.43 + image: mailcow/dockerapi:1.44 security_opt: - label=disable restart: always From 645e8f426cd7f2a8b556541c426e76e142ebfed8 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 11 Oct 2022 11:35:07 +0200 Subject: [PATCH 3/7] shift datatable child toggle function to api.js --- data/web/js/build/012-api.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/data/web/js/build/012-api.js b/data/web/js/build/012-api.js index b9887940..c657c134 100644 --- a/data/web/js/build/012-api.js +++ b/data/web/js/build/012-api.js @@ -380,4 +380,18 @@ $(document).ready(function() { $('#ConfirmDeleteModal').modal('hide'); }); }); + + // toggle jquery datatables child rows + $('button[data-datatables-expand], a[data-datatables-expand]').on('click', function (e) { + e.preventDefault(); + var tableId = e.target.getAttribute("data-datatables-expand"); + var table = $("#" + tableId).DataTable(); + table.rows(':not(.parent)').nodes().to$().find('td:first-child').trigger('click'); + }); + $('button[data-datatables-collapse], a[data-datatables-collapse]').on('click', function (e) { + e.preventDefault(); + var tableId = e.target.getAttribute("data-datatables-collapse"); + var table = $("#" + tableId).DataTable(); + table.rows('.parent').nodes().to$().find('td:first-child').trigger('click'); + }); }); From 8c4dbaec4f0d75c6d9bd79e46495dbed46de9fee Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 11 Oct 2022 11:41:06 +0200 Subject: [PATCH 4/7] rework datatables --- data/web/js/site/debug.js | 54 +++-- data/web/js/site/mailbox.js | 151 +++++++------ data/web/js/site/user.js | 11 +- data/web/lang/lang.de.json | 2 + data/web/lang/lang.en.json | 2 + .../templates/admin/tab-config-admins.twig | 4 +- .../templates/admin/tab-config-customize.twig | 2 +- data/web/templates/admin/tab-config-dkim.twig | 2 +- data/web/templates/admin/tab-config-f2b.twig | 2 +- .../templates/admin/tab-config-fwdhosts.twig | 2 +- .../templates/admin/tab-config-oauth2.twig | 2 +- .../admin/tab-config-password-policy.twig | 2 +- .../admin/tab-config-quarantine.twig | 2 +- .../web/templates/admin/tab-config-quota.twig | 2 +- .../templates/admin/tab-config-rsettings.twig | 2 +- .../templates/admin/tab-config-rspamd.twig | 2 +- .../admin/tab-globalfilter-regex.twig | 2 +- data/web/templates/admin/tab-ldap.twig | 2 +- data/web/templates/admin/tab-mailq.twig | 2 +- data/web/templates/admin/tab-routing.twig | 2 +- data/web/templates/admin/tab-sys-mails.twig | 2 +- data/web/templates/debug.twig | 212 ++++++++++++------ data/web/templates/edit.twig | 4 +- data/web/templates/mailbox/tab-bcc.twig | 77 +++++-- .../templates/mailbox/tab-domain-aliases.twig | 35 ++- data/web/templates/mailbox/tab-domains.twig | 54 +++-- data/web/templates/mailbox/tab-filters.twig | 48 ++-- .../mailbox/tab-mailbox-defaults.twig | 2 +- data/web/templates/mailbox/tab-mailboxes.twig | 141 +++++++++++- .../templates/mailbox/tab-mbox-aliases.twig | 45 +++- data/web/templates/mailbox/tab-resources.twig | 44 ++-- data/web/templates/mailbox/tab-syncjobs.twig | 37 ++- .../web/templates/mailbox/tab-tls-policy.twig | 37 ++- data/web/templates/quarantine.twig | 21 +- data/web/templates/user/AppPasswds.twig | 31 ++- data/web/templates/user/Pushover.twig | 2 +- data/web/templates/user/SpamAliases.twig | 2 +- data/web/templates/user/Spamfilter.twig | 18 +- data/web/templates/user/Syncjobs.twig | 31 ++- data/web/templates/user/tab-user-auth.twig | 10 +- data/web/templates/user/tab-user-details.twig | 2 +- .../web/templates/user/tab-user-settings.twig | 2 +- 42 files changed, 799 insertions(+), 310 deletions(-) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index deb0215e..03189e93 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -90,6 +90,7 @@ jQuery(function($){ title: lang.time, data: 'time', defaultContent: '', + responsivePriority: 1, render: function(data, type){ var date = new Date(data ? data * 1000 : 0); return date.toLocaleDateString(undefined, {year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit"}); @@ -98,22 +99,27 @@ jQuery(function($){ { title: 'User-Agent', data: 'ua', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md', + responsivePriority: 5 }, { title: 'Username', data: 'user', - defaultContent: '' + defaultContent: '', + responsivePriority: 4 }, { title: 'IP', data: 'ip', - defaultContent: '' + defaultContent: '', + responsivePriority: 2 }, { title: 'Service', data: 'service', - defaultContent: '' + defaultContent: '', + responsivePriority: 3 } ] }); @@ -155,7 +161,8 @@ jQuery(function($){ { title: lang.message, data: 'message', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md text-break' } ] }); @@ -240,7 +247,7 @@ jQuery(function($){ title: 'URI', data: 'uri', defaultContent: '', - className: 'text-break min-tablet none' + className: 'dtr-col-md dtr-break-all' }, { title: 'Method', @@ -255,7 +262,8 @@ jQuery(function($){ { title: 'Data', data: 'data', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md dtr-break-all' } ] }); @@ -394,28 +402,32 @@ jQuery(function($){ { title: 'User', data: 'user', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-sm' }, { title: 'Role', data: 'role', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-sm' }, { title: 'IP', data: 'remote', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md dtr-break-all' }, { title: lang.message, data: 'msg', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md dtr-break-all' }, { title: 'Call', data: 'call', defaultContent: '', - className: 'none text-break' + className: 'none dtr-col-md dtr-break-all' } ] }); @@ -453,7 +465,8 @@ jQuery(function($){ { title: 'IP', data: 'real_rip', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md text-break' }, { title: lang.login_time, @@ -499,7 +512,8 @@ jQuery(function($){ { title: lang.message, data: 'message', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md dtr-break-all' } ] }); @@ -541,7 +555,8 @@ jQuery(function($){ { title: lang.message, data: 'message', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md text-break' } ] }); @@ -583,7 +598,8 @@ jQuery(function($){ { title: lang.message, data: 'message', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md text-break' } ] }); @@ -625,7 +641,8 @@ jQuery(function($){ { title: lang.message, data: 'message', - defaultContent: '' + defaultContent: '', + className: 'dtr-col-md text-break' } ] }); @@ -757,7 +774,8 @@ jQuery(function($){ { title: 'Symbols', data: 'symbols', - defaultContent: '' + defaultContent: '', + className: 'none dtr-col-md' }, { title: 'Msg size', diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index c74494aa..77da5029 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -142,7 +142,9 @@ jQuery(function($){ $(".refresh_table").on('click', function(e) { e.preventDefault(); var table_name = $(this).data('table'); - $('#' + table_name).DataTable().ajax.reload(); + + if ($.fn.DataTable.isDataTable('#' + table_name)) + $('#' + table_name).DataTable().ajax.reload(); }); function draw_domain_table() { // just recalc width if instance already exists @@ -177,9 +179,9 @@ jQuery(function($){ item.chkbox = ''; item.action = '
'; if (role == "admin") { - item.action += ' ' + lang.edit + '' + - ' ' + lang.remove + '' + - ' DNS
'; + item.action += ' ' + lang.edit + '' + + ' ' + lang.remove + '' + + ' DNS'; } else { item.action += ' ' + lang.edit + '' + @@ -288,18 +290,20 @@ jQuery(function($){ { title: lang.domain_admins, data: 'domain_admins', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: 'Tags', data: 'tags', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.active, data: 'active', defaultContent: '', - responsivePriority: 5, + responsivePriority: 6, render: function (data, type) { return 1==data?'':(0==data?'':2==data&&'—'); } @@ -307,7 +311,7 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md', responsivePriority: 5, defaultContent: '' }, @@ -378,11 +382,11 @@ jQuery(function($){ if (acl_data.login_as === 1) { item.action = '
' + - ' ' + lang.edit + '' + - ' ' + lang.remove + '' + - ''; + ' ' + lang.edit + '' + + ' ' + lang.remove + '' + + ''; if (ALLOW_ADMIN_EMAIL_LOGIN) { - item.action += ''; + item.action += ''; } item.action += '
'; } @@ -431,13 +435,13 @@ jQuery(function($){ { title: lang.username, data: 'username', - responsivePriority: 1, + responsivePriority: 3, defaultContent: '' }, { title: lang.domain_quota, data: 'quota', - responsivePriority: 2, + responsivePriority: 8, defaultContent: '', render: function (data, type) { data = data.split("/"); @@ -449,7 +453,7 @@ jQuery(function($){ title: lang.last_mail_login, data: 'last_mail_login', defaultContent: '', - responsivePriority: 3, + responsivePriority: 7, render: function (data, type) { res = data.split("/"); return '
IMAP @ ' + unix_time_format(Number(res[0])) + '

' + @@ -466,57 +470,68 @@ jQuery(function($){ title: lang.in_use, data: 'in_use', defaultContent: '', - responsivePriority: 4 + responsivePriority: 9, + className: 'dt-data-w100' }, { title: lang.fname, data: 'name', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.domain, data: 'domain', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.tls_enforce_in, data: 'tls_enforce_in', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.tls_enforce_out, data: 'tls_enforce_out', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: 'SMTP', data: 'smtp_access', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: 'IMAP', data: 'imap_access', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: 'POP3', data: 'pop3_access', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: 'SIEVE', data: 'sieve_access', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.quarantine_notification, data: 'quarantine_notification', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.quarantine_category, data: 'quarantine_category', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.msg_num, @@ -527,13 +542,14 @@ jQuery(function($){ { title: 'Tags', data: 'tags', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.active, data: 'active', defaultContent: '', - responsivePriority: 6, + responsivePriority: 4, render: function (data, type) { return 1==data?'':(0==data?'':2==data&&'—'); } @@ -541,8 +557,8 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', - responsivePriority: 5, + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md', + responsivePriority: 6, defaultContent: '' }, ] @@ -572,8 +588,8 @@ jQuery(function($){ item.multiple_bookings = '' + lang.booking_custom_short + ' (' + item.multiple_bookings + ')'; } item.action = ''; item.chkbox = ''; item.name = escapeHtml(item.name); @@ -639,9 +655,9 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', responsivePriority: 5, - defaultContent: '' + defaultContent: '', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right' }, ] }); @@ -691,8 +707,8 @@ jQuery(function($){ dataSrc: function(json){ $.each(json, function (i, item) { item.action = ''; item.chkbox = ''; item.local_dest = escapeHtml(item.local_dest); @@ -763,7 +779,7 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', responsivePriority: 5, defaultContent: '' }, @@ -791,8 +807,8 @@ jQuery(function($){ item.recipient_map_old = escapeHtml(item.recipient_map_old); item.recipient_map_new = escapeHtml(item.recipient_map_new); item.action = ''; item.chkbox = ''; }); @@ -832,7 +848,8 @@ jQuery(function($){ { title: lang.recipient_map_new, data: 'recipient_map_new', - defaultContent: '' + defaultContent: '', + responsivePriority: 4 }, { title: lang.active, @@ -845,8 +862,8 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', - responsivePriority: 4, + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', + responsivePriority: 5, defaultContent: '' }, ] @@ -867,6 +884,7 @@ jQuery(function($){ type: "GET", url: "/api/v1/get/tls-policy-map/all", dataSrc: function(json){ + console.log(json); if (role !== "admin") return null; $.each(json, function (i, item) { @@ -878,8 +896,8 @@ jQuery(function($){ item.parameters = '' + escapeHtml(item.parameters) + ''; } item.action = ''; item.chkbox = ''; }); @@ -914,7 +932,8 @@ jQuery(function($){ { title: lang.tls_map_dest, data: 'dest', - defaultContent: '' + defaultContent: '', + responsivePriority: 4 }, { title: lang.tls_map_policy, @@ -926,12 +945,6 @@ jQuery(function($){ data: 'parameters', defaultContent: '' }, - { - title: lang.domain, - data: 'domain', - responsivePriority: 4, - defaultContent: '' - }, { title: lang.active, data: 'active', @@ -943,7 +956,7 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', responsivePriority: 5, defaultContent: '' }, @@ -967,8 +980,8 @@ jQuery(function($){ dataSrc: function(json){ $.each(json, function (i, item) { item.action = ''; item.chkbox = ''; item.goto = escapeHtml(item.goto.replace(/,/g, " ")); @@ -1083,7 +1096,7 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', responsivePriority: 5, defaultContent: '' }, @@ -1107,9 +1120,9 @@ jQuery(function($){ dataSrc: function(json){ $.each(json, function (i, item) { item.action = '' + + ' ' + lang.edit + '' + + ' ' + lang.remove + '' + + ' DNS' + ''; item.chkbox = ''; if(item.parent_is_backupmx == '1') { @@ -1163,7 +1176,7 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', responsivePriority: 5, defaultContent: '' }, @@ -1195,8 +1208,8 @@ jQuery(function($){ } item.server_w_port = escapeHtml(item.user1) + '@' + item.host1 + ':' + item.port1; item.action = ''; item.chkbox = ''; if (item.is_running == 1) { @@ -1290,17 +1303,19 @@ jQuery(function($){ { title: lang.excludes, data: 'exclude', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.mins_interval, data: 'mins_interval', - defaultContent: '' + defaultContent: '', + className: 'none' }, { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', responsivePriority: 5, defaultContent: '' }, @@ -1329,11 +1344,11 @@ jQuery(function($){ } else { item.active = '' + lang.inactive + ''; } - item.script_data = '
' + escapeHtml(item.script_data) + '
' + item.script_data = '
' + escapeHtml(item.script_data) + '
' item.filter_type = '
' + item.filter_type.charAt(0).toUpperCase() + item.filter_type.slice(1).toLowerCase() + '
' item.action = ''; item.chkbox = '' }); @@ -1396,7 +1411,7 @@ jQuery(function($){ { title: lang.action, data: 'action', - className: 'text-md-end dt-sm-head-hidden dt-body-right', + className: 'dt-sm-head-hidden dt-data-w100 dtr-col-md dt-body-right', responsivePriority: 5, defaultContent: '' }, diff --git a/data/web/js/site/user.js b/data/web/js/site/user.js index 2d09bcea..36bcfa63 100644 --- a/data/web/js/site/user.js +++ b/data/web/js/site/user.js @@ -276,14 +276,16 @@ jQuery(function($){ data: null, searchable: false, orderable: false, - defaultContent: '' + defaultContent: '', + responsivePriority: 1 }, { title: '', data: 'chkbox', searchable: false, orderable: false, - defaultContent: '' + defaultContent: '', + responsivePriority: 2 }, { title: 'ID', @@ -299,7 +301,8 @@ jQuery(function($){ { title: lang.username, data: 'user1', - defaultContent: '' + defaultContent: '', + responsivePriority: 3 }, { title: lang.last_run, @@ -328,7 +331,7 @@ jQuery(function($){ title: lang.status, data: 'is_running', defaultContent: '', - responsivePriority: 4 + responsivePriority: 5 }, { title: lang.encryption, diff --git a/data/web/lang/lang.de.json b/data/web/lang/lang.de.json index 98c2cc3b..3086c1c7 100644 --- a/data/web/lang/lang.de.json +++ b/data/web/lang/lang.de.json @@ -466,8 +466,10 @@ "yotp_verification_failed": "Yubico OTP-Verifizierung fehlgeschlagen: %s" }, "datatables": { + "collapse_all": "Alle Einklappen", "decimal": "", "emptyTable": "Keine Daten in der Tabelle vorhanden", + "expand_all": "Alle Ausklappen", "info": "_START_ bis _END_ von _TOTAL_ Einträgen", "infoEmpty": "0 bis 0 von 0 Einträgen", "infoFiltered": "(gefiltert von _MAX_ Einträgen)", diff --git a/data/web/lang/lang.en.json b/data/web/lang/lang.en.json index ea7ed96d..5bc9ca39 100644 --- a/data/web/lang/lang.en.json +++ b/data/web/lang/lang.en.json @@ -466,8 +466,10 @@ "yotp_verification_failed": "Yubico OTP verification failed: %s" }, "datatables": { + "collapse_all": "Collapse All", "decimal": "", "emptyTable": "No data available in table", + "expand_all": "Expand All", "info": "Showing _START_ to _END_ of _TOTAL_ entries", "infoEmpty": "Showing 0 to 0 of 0 entries", "infoFiltered": "(filtered from _MAX_ total entries)", diff --git a/data/web/templates/admin/tab-config-admins.twig b/data/web/templates/admin/tab-config-admins.twig index 1d2d05f2..0221a8e7 100644 --- a/data/web/templates/admin/tab-config-admins.twig +++ b/data/web/templates/admin/tab-config-admins.twig @@ -1,6 +1,6 @@
-
+
@@ -193,7 +193,7 @@
-
+
diff --git a/data/web/templates/admin/tab-config-customize.twig b/data/web/templates/admin/tab-config-customize.twig index cdfa085d..4ec6aecb 100644 --- a/data/web/templates/admin/tab-config-customize.twig +++ b/data/web/templates/admin/tab-config-customize.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-dkim.twig b/data/web/templates/admin/tab-config-dkim.twig index 28de6473..8dbccf79 100644 --- a/data/web/templates/admin/tab-config-dkim.twig +++ b/data/web/templates/admin/tab-config-dkim.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-f2b.twig b/data/web/templates/admin/tab-config-f2b.twig index d189b91b..bbd3e367 100644 --- a/data/web/templates/admin/tab-config-f2b.twig +++ b/data/web/templates/admin/tab-config-f2b.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-fwdhosts.twig b/data/web/templates/admin/tab-config-fwdhosts.twig index 71087c4d..0f77048f 100644 --- a/data/web/templates/admin/tab-config-fwdhosts.twig +++ b/data/web/templates/admin/tab-config-fwdhosts.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-oauth2.twig b/data/web/templates/admin/tab-config-oauth2.twig index a2c3ef79..07f9e772 100644 --- a/data/web/templates/admin/tab-config-oauth2.twig +++ b/data/web/templates/admin/tab-config-oauth2.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-password-policy.twig b/data/web/templates/admin/tab-config-password-policy.twig index 075fb75a..fb6ec7fb 100644 --- a/data/web/templates/admin/tab-config-password-policy.twig +++ b/data/web/templates/admin/tab-config-password-policy.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-quarantine.twig b/data/web/templates/admin/tab-config-quarantine.twig index 54d49e0c..91d9d539 100644 --- a/data/web/templates/admin/tab-config-quarantine.twig +++ b/data/web/templates/admin/tab-config-quarantine.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-quota.twig b/data/web/templates/admin/tab-config-quota.twig index a0b5dfa9..c8f2e929 100644 --- a/data/web/templates/admin/tab-config-quota.twig +++ b/data/web/templates/admin/tab-config-quota.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-rsettings.twig b/data/web/templates/admin/tab-config-rsettings.twig index 9157e606..4212271a 100644 --- a/data/web/templates/admin/tab-config-rsettings.twig +++ b/data/web/templates/admin/tab-config-rsettings.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-config-rspamd.twig b/data/web/templates/admin/tab-config-rspamd.twig index d6fbafad..5cbdc591 100644 --- a/data/web/templates/admin/tab-config-rspamd.twig +++ b/data/web/templates/admin/tab-config-rspamd.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-globalfilter-regex.twig b/data/web/templates/admin/tab-globalfilter-regex.twig index 0d5d17f5..e5970570 100644 --- a/data/web/templates/admin/tab-globalfilter-regex.twig +++ b/data/web/templates/admin/tab-globalfilter-regex.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-ldap.twig b/data/web/templates/admin/tab-ldap.twig index 41f4a0b9..b69817c1 100644 --- a/data/web/templates/admin/tab-ldap.twig +++ b/data/web/templates/admin/tab-ldap.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-mailq.twig b/data/web/templates/admin/tab-mailq.twig index 67ec436d..34c271af 100644 --- a/data/web/templates/admin/tab-mailq.twig +++ b/data/web/templates/admin/tab-mailq.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-routing.twig b/data/web/templates/admin/tab-routing.twig index 28cde82c..630709eb 100644 --- a/data/web/templates/admin/tab-routing.twig +++ b/data/web/templates/admin/tab-routing.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/admin/tab-sys-mails.twig b/data/web/templates/admin/tab-sys-mails.twig index dc602134..056d193b 100644 --- a/data/web/templates/admin/tab-sys-mails.twig +++ b/data/web/templates/admin/tab-sys-mails.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/debug.twig b/data/web/templates/debug.twig index fd917ccf..2a542da6 100644 --- a/data/web/templates/debug.twig +++ b/data/web/templates/debug.twig @@ -31,8 +31,8 @@
-
-

mailcow

+
+ mailcow
@@ -155,8 +155,8 @@
-
-

{{ lang.debug.containers_info }}

+
+ {{ lang.debug.containers_info }}
@@ -324,15 +324,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Postfix +
+
+ Postfix
- - - +
@@ -340,15 +347,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Mailcow UI +
+
+ Mailcow UI
- - - +
@@ -356,15 +370,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
SASL +
+
+ SASL
- - - +
@@ -372,15 +393,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Dovecot +
+
+ Dovecot
- - - +
@@ -388,15 +416,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
SOGo +
+
+ SOGo
- - - +
@@ -404,15 +439,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Netfilter +
+
+ Netfilter
- - - +
@@ -420,12 +462,11 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Rspamd history +
+
+ Rspamd history
- - - +
@@ -434,6 +475,14 @@
{{ lang.debug.history_all_servers }}
+ {{ lang.mailbox.quick_actions }} +
@@ -441,15 +490,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Autodiscover +
+
+ Autodiscover
- - - +
@@ -457,15 +513,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Watchdog +
+
+ Watchdog
- - - +
@@ -473,15 +536,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
ACME +
+
+ ACME
- - - +
@@ -489,15 +559,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
API +
+
+ API
- - - +
@@ -505,15 +582,22 @@
{{ lang.debug.log_info|format(log_lines+1)|raw }}
-
-
Ratelimits +
+
+ Ratelimits
- - - +
diff --git a/data/web/templates/edit.twig b/data/web/templates/edit.twig index 11d64e82..21c01348 100644 --- a/data/web/templates/edit.twig +++ b/data/web/templates/edit.twig @@ -4,8 +4,8 @@
-
-

{{ lang.edit.title }}

+
+ {{ lang.edit.title }}
{% block inner_content %} diff --git a/data/web/templates/mailbox/tab-bcc.twig b/data/web/templates/mailbox/tab-bcc.twig index e25fdfd2..7f8319e7 100644 --- a/data/web/templates/mailbox/tab-bcc.twig +++ b/data/web/templates/mailbox/tab-bcc.twig @@ -1,24 +1,20 @@
-
+
{{ lang.mailbox.bcc_maps }} -
- +
-
+
{{ lang.mailbox.recipient_maps }} -
- +
-

{{ lang.mailbox.recipient_map_info }}

- {#
#} -
- diff --git a/data/web/templates/mailbox/tab-domain-aliases.twig b/data/web/templates/mailbox/tab-domain-aliases.twig index f8ecbd93..f2037766 100644 --- a/data/web/templates/mailbox/tab-domain-aliases.twig +++ b/data/web/templates/mailbox/tab-domain-aliases.twig @@ -1,30 +1,47 @@
-
+
{{ lang.mailbox.domain_aliases }} -
- +
- {#
#} -
- diff --git a/data/web/templates/mailbox/tab-domains.twig b/data/web/templates/mailbox/tab-domains.twig index 99692a3f..d3d88246 100644 --- a/data/web/templates/mailbox/tab-domains.twig +++ b/data/web/templates/mailbox/tab-domains.twig @@ -1,35 +1,55 @@
-
- {{ lang.mailbox.domains }} - -
- {% if mailcow_cc_role == 'admin' %} - - {% endif %} + +
- {#
#} -
-
+ {#
#} + +
+
+
+ + + + {% if mailcow_cc_role == 'admin' %} + {% endif %}
diff --git a/data/web/templates/mailbox/tab-filters.twig b/data/web/templates/mailbox/tab-filters.twig index 42db65fd..942f784f 100644 --- a/data/web/templates/mailbox/tab-filters.twig +++ b/data/web/templates/mailbox/tab-filters.twig @@ -1,24 +1,20 @@
-
+
{{ lang.mailbox.filters }} -
- +
-

{{ lang.mailbox.sieve_info|raw }}


- {#
#} -
-
+ +

{{ lang.mailbox.sieve_info|raw }}


+
+
@@ -44,8 +64,8 @@
- - + +
@@ -62,8 +82,8 @@
- - + +
diff --git a/data/web/templates/mailbox/tab-mailbox-defaults.twig b/data/web/templates/mailbox/tab-mailbox-defaults.twig index e7ef33ad..20f1b229 100644 --- a/data/web/templates/mailbox/tab-mailbox-defaults.twig +++ b/data/web/templates/mailbox/tab-mailbox-defaults.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/mailbox/tab-mailboxes.twig b/data/web/templates/mailbox/tab-mailboxes.twig index 7f5e21a3..d04cf0d8 100644 --- a/data/web/templates/mailbox/tab-mailboxes.twig +++ b/data/web/templates/mailbox/tab-mailboxes.twig @@ -1,24 +1,24 @@
-
+
{{ lang.mailbox.mailboxes }} -
- +
-
-
-
-
- {{ lang.mailbox.toggle_all }} - {{ lang.mailbox.quick_actions }} +
+ - +
+
+ +
{{ lang.mailbox.toggle_all }} + {{ lang.mailbox.quick_actions }} +
{{ lang.mailbox.mailbox }}
-
+

-
+ -
+

{{ lang.user.spamfilter_bl }}

{{ lang.user.spamfilter_bl_desc|raw }}

@@ -73,6 +78,11 @@ diff --git a/data/web/templates/user/Syncjobs.twig b/data/web/templates/user/Syncjobs.twig index 0588949e..322e8536 100644 --- a/data/web/templates/user/Syncjobs.twig +++ b/data/web/templates/user/Syncjobs.twig @@ -1,14 +1,13 @@
-
+
{{ lang.user.sync_jobs }}
-
-
-
+
+ +
+
+
+ diff --git a/data/web/templates/user/tab-user-auth.twig b/data/web/templates/user/tab-user-auth.twig index d34d2613..646c7910 100644 --- a/data/web/templates/user/tab-user-auth.twig +++ b/data/web/templates/user/tab-user-auth.twig @@ -1,6 +1,6 @@
-
+
@@ -145,8 +145,8 @@

[{{ lang.user.client_configuration }}]

[{{ lang.user.show_sieve_filters }}]


- - diff --git a/data/web/templates/user/tab-user-details.twig b/data/web/templates/user/tab-user-details.twig index 48d2577e..573cd498 100644 --- a/data/web/templates/user/tab-user-details.twig +++ b/data/web/templates/user/tab-user-details.twig @@ -1,6 +1,6 @@
-
+
diff --git a/data/web/templates/user/tab-user-settings.twig b/data/web/templates/user/tab-user-settings.twig index 14f06b71..a1426fa2 100644 --- a/data/web/templates/user/tab-user-settings.twig +++ b/data/web/templates/user/tab-user-settings.twig @@ -1,6 +1,6 @@
-
+
From ef70457a4889f2039134375b53698b36e9aa2cee Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 11 Oct 2022 11:48:46 +0200 Subject: [PATCH 5/7] shift datatable css to new file --- data/web/css/build/013-mailcow.css | 53 ------------------ data/web/css/build/015-datatables.css | 80 +++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 53 deletions(-) create mode 100644 data/web/css/build/015-datatables.css diff --git a/data/web/css/build/013-mailcow.css b/data/web/css/build/013-mailcow.css index 9580492d..374d484d 100644 --- a/data/web/css/build/013-mailcow.css +++ b/data/web/css/build/013-mailcow.css @@ -275,23 +275,6 @@ code { 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(0, 0, 0, 0.129); - padding: 0.5em 0; -} .tag-box { display: flex; @@ -339,42 +322,6 @@ table.dataTable>tbody>tr.child ul.dtr-details>li { 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; diff --git a/data/web/css/build/015-datatables.css b/data/web/css/build/015-datatables.css new file mode 100644 index 00000000..e5518ff8 --- /dev/null +++ b/data/web/css/build/015-datatables.css @@ -0,0 +1,80 @@ +.dataTables_info { + margin: 15px 0 !important; + padding: 0px !important; +} +.dataTables_paginate, .dataTables_length, .dataTables_filter { + margin: 15px 0 !important; +} +.dtr-details { + width: 100%; +} +.table-striped>tbody>tr:nth-of-type(odd) { + background-color: #F2F2F2; +} +td.child>ul>li { + display: flex; +} +table.dataTable>tbody>tr.child ul.dtr-details>li { + border-bottom: 1px solid rgba(0, 0, 0, 0.129); + padding: 0.5em 0; +} +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; +} +td.dtr-col-lg { + min-width: 350px; + word-break: break-word; +} +td.dtr-col-md { + min-width: 250px; + word-break: break-word; +} +td.dtr-col-sm { + min-width: 125px; + word-break: break-word; +} +.dt-data-w100 .dtr-data { + width: 100%; +} +li .dtr-data { + word-break: break-all; + flex: 1; + padding-left: 5px; + padding-right: 5px; +} +table.dataTable>tbody>tr.child span.dtr-title { + width: 30%; + max-width: 250px; +} \ No newline at end of file From 3912fcb23852dec4193c39642d77df25b0f2f774 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 11 Oct 2022 17:40:46 +0200 Subject: [PATCH 6/7] shift get_public_ips to json_api.php --- data/web/debug.php | 16 ---------------- data/web/js/site/debug.js | 18 +++++++++++++++++- data/web/json_api.php | 24 ++++++++++++++++++++++-- data/web/templates/debug.twig | 4 ++-- 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/data/web/debug.php b/data/web/debug.php index 5d50dc85..5618ec00 100644 --- a/data/web/debug.php +++ b/data/web/debug.php @@ -47,21 +47,6 @@ foreach ($containers as $container => $container_info) { // get mailcow data $hostname = getenv('MAILCOW_HOSTNAME'); $timezone = getenv('TZ'); -// get public ips -$curl = curl_init(); -curl_setopt($curl, CURLOPT_URL, 'http://ipv4.mailcow.email'); -curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); -curl_setopt($curl, CURLOPT_POST, 0); -$ipv4 = curl_exec($curl); -curl_setopt($curl, CURLOPT_URL, 'http://ipv6.mailcow.email'); -curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); -curl_setopt($curl, CURLOPT_POST, 0); -$ipv6 = curl_exec($curl); -$ips = array( - "ipv4" => $ipv4, - "ipv6" => $ipv6 -); -curl_close($curl); $template = 'debug.twig'; $template_data = [ @@ -70,7 +55,6 @@ $template_data = [ 'hostname' => $hostname, 'timezone' => $timezone, 'license_guid' => license('guid'), - 'ips' => $ips, 'solr_status' => $solr_status, 'solr_uptime' => round($solr_status['status']['dovecot-fts']['uptime'] / 1000 / 60 / 60), 'clamd_status' => $clamd_status, diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 03189e93..dcc04210 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -47,7 +47,9 @@ $(document).ready(function() { if (mailcow_info.branch === "master"){ check_update(mailcow_info.version_tag, mailcow_info.project_url); } - update_container_stats() + // get public ips + get_public_ips(); + update_container_stats(); }); jQuery(function($){ if (localStorage.getItem("current_page") === null) { @@ -1218,6 +1220,20 @@ function update_container_stats(timeout=5){ // run again in n seconds setTimeout(update_container_stats, timeout * 1000); } +// get public ips +function get_public_ips(){ + window.fetch("/api/v1/get/status/host/ip", {method:'GET',cache:'no-cache'}).then(function(response) { + return response.json(); + }).then(function(data) { + console.log(data); + + if (data){ + // display host ips + $("#host_ipv4").text(data.ipv4); + $("#host_ipv6").text(data.ipv6); + } + }); +} // format hosts uptime seconds to readable string function formatUptime(seconds){ seconds = Number(seconds); diff --git a/data/web/json_api.php b/data/web/json_api.php index 15bc8b5e..1953d17c 100644 --- a/data/web/json_api.php +++ b/data/web/json_api.php @@ -1506,8 +1506,28 @@ if (isset($_GET['query'])) { )); break; case "host": - $stats = docker("host_stats"); - echo json_encode($stats); + if (!$extra){ + $stats = docker("host_stats"); + echo json_encode($stats); + } + else if ($extra == "ip") { + // get public ips + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'http://ipv4.mailcow.email'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_POST, 0); + $ipv4 = curl_exec($curl); + curl_setopt($curl, CURLOPT_URL, 'http://ipv6.mailcow.email'); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_POST, 0); + $ipv6 = curl_exec($curl); + $ips = array( + "ipv4" => $ipv4, + "ipv6" => $ipv6 + ); + curl_close($curl); + echo json_encode($ips); + } break; case "version": echo json_encode(array( diff --git a/data/web/templates/debug.twig b/data/web/templates/debug.twig index 2a542da6..7c36501e 100644 --- a/data/web/templates/debug.twig +++ b/data/web/templates/debug.twig @@ -52,8 +52,8 @@ IPs - {{ ips.ipv4 }} - {{ ips.ipv6 }} + - + - From 174b5c8f7fe663997df8d0df13cf4988b45b8bad Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Tue, 11 Oct 2022 19:20:49 +0200 Subject: [PATCH 7/7] add goto previous page btn to top --- data/web/templates/edit.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/web/templates/edit.twig b/data/web/templates/edit.twig index 21c01348..29f36435 100644 --- a/data/web/templates/edit.twig +++ b/data/web/templates/edit.twig @@ -1,7 +1,8 @@ {% extends 'base.twig' %} {% block content %} -