From 88260bb610a63f92155636360311f5e9f5e956a7 Mon Sep 17 00:00:00 2001 From: Adam Elaoumari Date: Wed, 8 Mar 2023 16:29:02 +0100 Subject: [PATCH 001/137] Fixed year in changelog (#2241) Fixed year of version 61.1 (2022 -> 2023) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dddbb546..16addb83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ CHANGELOG ========= -Version 61.1 (January 28, 2022) +Version 61.1 (January 28, 2023) ------------------------------- * Fixed rsync backups not working with the default port. From 01d8e9f3b4256084b73617188da0afe6ab2edd3a Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sat, 13 May 2023 06:17:49 -0400 Subject: [PATCH 002/137] Revert "Disable Roundcube password plugin since it was corrupting the user database (#2198)" This reverts commit 15872487621a66e900d550ba095b8cdd12c5fcc0. See subsequent commits. --- setup/webmail.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/webmail.sh b/setup/webmail.sh index 90e97aed..791bda57 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -134,7 +134,7 @@ cat > $RCM_CONFIG < ~256 bits for AES-256, see above -\$config['plugins'] = array('html5_notifier', 'archive', 'zipdownload', 'managesieve', 'jqueryui', 'persistent_login', 'carddav'); +\$config['plugins'] = array('html5_notifier', 'archive', 'zipdownload', 'password', 'managesieve', 'jqueryui', 'persistent_login', 'carddav'); \$config['skin'] = 'elastic'; \$config['login_autocomplete'] = 2; \$config['login_username_filter'] = 'email'; From 3c150816738d1fe555496642eaace79190cbcdd9 Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Sat, 5 Nov 2022 21:02:49 +0100 Subject: [PATCH 003/137] Remove journal PRAGMA from Roundcube source which broke the database for postfix See #2185. --- setup/webmail.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup/webmail.sh b/setup/webmail.sh index 791bda57..dee44f4c 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -23,7 +23,8 @@ echo "Installing Roundcube (webmail)..." apt_install \ dbconfig-common \ php${PHP_VER}-cli php${PHP_VER}-sqlite3 php${PHP_VER}-intl php${PHP_VER}-common php${PHP_VER}-curl php${PHP_VER}-imap \ - php${PHP_VER}-gd php${PHP_VER}-pspell php${PHP_VER}-mbstring libjs-jquery libjs-jquery-mousewheel libmagic1 + php${PHP_VER}-gd php${PHP_VER}-pspell php${PHP_VER}-mbstring libjs-jquery libjs-jquery-mousewheel libmagic1 \ + sqlite3 # Install Roundcube from source if it is not already present or if it is out of date. # Combine the Roundcube version number with the commit hash of plugins to track @@ -209,6 +210,16 @@ php$PHP_VER ${RCM_DIR}/bin/updatedb.sh --dir ${RCM_DIR}/SQL --package roundcube chown www-data:www-data $STORAGE_ROOT/mail/roundcube/roundcube.sqlite chmod 664 $STORAGE_ROOT/mail/roundcube/roundcube.sqlite +# Patch the Roundcube code to eliminate an issue that causes postfix to reject our sqlite +# user database (see https://github.com/mail-in-a-box/mailinabox/issues/2185) +sed -i.miabold 's/^[^#]\+.\+PRAGMA journal_mode = WAL.\+$/#&/' \ +/usr/local/lib/roundcubemail/program/lib/Roundcube/db/sqlite.php + +# Because Roundcube wants to set the PRAGMA we just deleted from the source, we apply it here +# to the roundcube database (see https://github.com/roundcube/roundcubemail/issues/8035) +# Database should exist, created by migration script +sqlite3 $STORAGE_ROOT/mail/roundcube/roundcube.sqlite 'PRAGMA journal_mode=WAL;' + # Enable PHP modules. phpenmod -v $PHP_VER imap restart_service php$PHP_VER-fpm From 8aa98b25b5e4d69d1aa61b57df867b91ab16e641 Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Thu, 27 Oct 2022 21:39:54 +0200 Subject: [PATCH 004/137] Update configuration of Roundcube password plugin for Roundcube 1.6 --- setup/webmail.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup/webmail.sh b/setup/webmail.sh index dee44f4c..e4429adf 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -185,10 +185,9 @@ cp ${RCM_PLUGIN_DIR}/password/config.inc.php.dist \ tools/editconf.py ${RCM_PLUGIN_DIR}/password/config.inc.php \ "\$config['password_minimum_length']=8;" \ "\$config['password_db_dsn']='sqlite:///$STORAGE_ROOT/mail/users.sqlite';" \ - "\$config['password_query']='UPDATE users SET password=%D WHERE email=%u';" \ - "\$config['password_dovecotpw']='/usr/bin/doveadm pw';" \ - "\$config['password_dovecotpw_method']='SHA512-CRYPT';" \ - "\$config['password_dovecotpw_with_method']=true;" + "\$config['password_query']='UPDATE users SET password=%P WHERE email=%u';" \ + "\$config['password_algorithm']='sha512-crypt';" \ + "\$config['password_algorithm_prefix']='{SHA512-CRYPT}';" # so PHP can use doveadm, for the password changing plugin usermod -a -G dovecot www-data From f72be0be7c71b96ebff7edbf782068342639e8ea Mon Sep 17 00:00:00 2001 From: Hugh Secker-Walker Date: Sat, 13 May 2023 06:36:31 -0400 Subject: [PATCH 005/137] feat(rsync-backup-ui): Add a Copy button to put public key on clipboard in rsync UI (#2227) --- management/templates/system-backup.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html index ad534f41..422b2a0e 100644 --- a/management/templates/system-backup.html +++ b/management/templates/system-backup.html @@ -73,6 +73,9 @@ passwordless authentication from your mail-in-a-box server and your backup server. +
+ +
@@ -374,4 +377,15 @@ const url_split = url => { } }; +// Hide Copy button if not in a modern clipboard-supporting environment. +// Using document API because jQuery is not necessarily available in this script scope. +if (!(navigator && navigator.clipboard && navigator.clipboard.writeText)) { + document.getElementById('copy_pub_key_div').hidden = true; +} + +function copy_pub_key_to_clipboard() { + const ssh_pub_key = $("#ssh-pub-key").val(); + navigator.clipboard.writeText(ssh_pub_key); +} + From 95530affbf701a3540e7d0d58d421874ad2708d6 Mon Sep 17 00:00:00 2001 From: Michael Heuberger Date: Sat, 13 May 2023 22:37:24 +1200 Subject: [PATCH 006/137] Bump Nextcloud to v23.0.12 and its apps (#2244) --- setup/nextcloud.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 50d1130a..b79de327 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -21,8 +21,8 @@ echo "Installing Nextcloud (contacts/calendar)..." # we automatically install intermediate versions as needed. # * The hash is the SHA1 hash of the ZIP package, which you can find by just running this script and # copying it from the error message when it doesn't match what is below. -nextcloud_ver=23.0.10 -nextcloud_hash=8831c7862e39460fbb789bacac8729fab0ba02dd +nextcloud_ver=23.0.12 +nextcloud_hash=d138641b8e7aabebe69bb3ec7c79a714d122f729 # Nextcloud apps # -------------- @@ -33,12 +33,12 @@ nextcloud_hash=8831c7862e39460fbb789bacac8729fab0ba02dd # https://github.com/nextcloud/user_external/blob/master/appinfo/info.xml # * The hash is the SHA1 hash of the ZIP package, which you can find by just running this script and # copying it from the error message when it doesn't match what is below. -contacts_ver=4.2.2 -contacts_hash=ca13d608ed8955aa374cb4f31b6026b57ef88887 -calendar_ver=3.5.1 -calendar_hash=c8136a3deb872a3ef73ce1155b58f3ab27ec7110 -user_external_ver=3.0.0 -user_external_hash=0df781b261f55bbde73d8c92da3f99397000972f +contacts_ver=4.2.5 +contacts_hash=8f898f003eb6b1a85c0c43b52f829d3aa759ed88 +calendar_ver=3.5.5 +calendar_hash=8505abcf7b3ab2f32d7ca1593b545e577cbeedb4 +user_external_ver=3.1.0 +user_external_hash=22cabc88b6fc9c26dad3b46be1a652979c9fcf15 # Clear prior packages and install dependencies from apt. @@ -69,8 +69,8 @@ InstallNextcloud() { echo "Upgrading to Nextcloud version $version" echo - # Download and verify - wget_verify https://download.nextcloud.com/server/releases/nextcloud-$version.zip $hash /tmp/nextcloud.zip + # Download and verify + wget_verify https://download.nextcloud.com/server/releases/nextcloud-$version.zip $hash /tmp/nextcloud.zip # Remove the current owncloud/Nextcloud rm -rf /usr/local/lib/owncloud From 9a33f9c5ff8d9802734f63b626d533b0ab009827 Mon Sep 17 00:00:00 2001 From: Tomas P <128642216+tpp-at-idx@users.noreply.github.com> Date: Sat, 13 May 2023 12:38:00 +0200 Subject: [PATCH 007/137] Fix dynazoom due to change in handling su (#2247) Seems that in Ubuntu 22.04 the behavior in su changed, making - ( alias for -l, --login ) mutually exclusive with --preserve-environment which is required for passing enviroment variables for cgi to work for dynazoom in munin.dropping - fixes the issue --- management/daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/daemon.py b/management/daemon.py index cbbfd6bf..47548531 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -709,7 +709,7 @@ def munin_cgi(filename): support infrastructure like spawn-fcgi. """ - COMMAND = 'su - munin --preserve-environment --shell=/bin/bash -c /usr/lib/munin/cgi/munin-cgi-graph' + COMMAND = 'su munin --preserve-environment --shell=/bin/bash -c /usr/lib/munin/cgi/munin-cgi-graph' # su changes user, we use the munin user here # --preserve-environment retains the environment, which is where Popen's `env` data is # --shell=/bin/bash ensures the shell used is bash From c9584148a025b668dffc49f25984bb0965d7bd1c Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Sat, 13 May 2023 12:39:46 +0200 Subject: [PATCH 008/137] Fix issue where sshkeygen fails when ipv6 is disabled (#2248) --- management/dns_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/dns_update.py b/management/dns_update.py index 6eaff52f..29372ddf 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -465,7 +465,7 @@ def build_sshfp_records(): pass break - keys = shell("check_output", ["ssh-keyscan", "-t", "rsa,dsa,ecdsa,ed25519", "-p", str(port), "localhost"]) + keys = shell("check_output", ["ssh-keyscan", "-4", "-t", "rsa,dsa,ecdsa,ed25519", "-p", str(port), "localhost"]) keys = sorted(keys.split("\n")) for key in keys: From 963fb9f2e6fb658a0e52326c699fb9df4325eb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20T=C3=B3th?= Date: Sat, 13 May 2023 12:40:31 +0200 Subject: [PATCH 009/137] email_administrator.py: fix report formatting (#2249) --- management/email_administrator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/email_administrator.py b/management/email_administrator.py index 8ed6e2a8..c87eda40 100755 --- a/management/email_administrator.py +++ b/management/email_administrator.py @@ -29,7 +29,7 @@ content = sys.stdin.read().strip() # If there's nothing coming in, just exit. if content == "": - sys.exit(0) + sys.exit(0) # create MIME message msg = MIMEMultipart('alternative') @@ -41,7 +41,7 @@ msg['From'] = "\"%s\" <%s>" % (env['PRIMARY_HOSTNAME'], admin_addr) msg['To'] = admin_addr msg['Subject'] = "[%s] %s" % (env['PRIMARY_HOSTNAME'], subject) -content_html = "
{}
".format(html.escape(content)) +content_html = '
{}
'.format(html.escape(content)) msg.attach(MIMEText(content, 'plain')) msg.attach(MIMEText(content_html, 'html')) From 6d43d24552b605974ce41859b05e7a1e96b5fb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20T=C3=B3th?= Date: Sat, 13 May 2023 12:49:34 +0200 Subject: [PATCH 010/137] Improve control panel panel switching behaviour by using the URL fragment (#2252) --- management/templates/aliases.html | 2 +- management/templates/custom-dns.html | 2 +- management/templates/index.html | 79 +++++++++++++++------------- management/templates/login.html | 13 ++++- management/templates/mail-guide.html | 2 +- management/templates/sync-guide.html | 4 +- management/templates/users.html | 4 +- management/templates/web.html | 4 +- 8 files changed, 62 insertions(+), 48 deletions(-) diff --git a/management/templates/aliases.html b/management/templates/aliases.html index c2a141f7..6c8b0376 100644 --- a/management/templates/aliases.html +++ b/management/templates/aliases.html @@ -7,7 +7,7 @@

Add a mail alias

-

Aliases are email forwarders. An alias can forward email to a mail user or to any email address.

+

Aliases are email forwarders. An alias can forward email to a mail user or to any email address.

To use an alias or any address besides your own login username in outbound mail, the sending user must be included as a permitted sender for the alias.

diff --git a/management/templates/custom-dns.html b/management/templates/custom-dns.html index c59624eb..e19bdddf 100644 --- a/management/templates/custom-dns.html +++ b/management/templates/custom-dns.html @@ -77,7 +77,7 @@

Using a secondary nameserver

-

If your TLD requires you to have two separate nameservers, you can either set up external DNS and ignore the DNS server on this box entirely, or use the DNS server on this box but add a secondary (aka “slave”) nameserver.

+

If your TLD requires you to have two separate nameservers, you can either set up external DNS and ignore the DNS server on this box entirely, or use the DNS server on this box but add a secondary (aka “slave”) nameserver.

If you choose to use a secondary nameserver, you must find a secondary nameserver service provider. Your domain name registrar or virtual cloud provider may provide this service for you. Once you set up the secondary nameserver service, enter the hostname (not the IP address) of their secondary nameserver in the box below.

diff --git a/management/templates/index.html b/management/templates/index.html index 323789ca..3c6d449e 100644 --- a/management/templates/index.html +++ b/management/templates/index.html @@ -11,9 +11,9 @@