From aac878dce51832827613c60d6f0cfafd1a5fa61d Mon Sep 17 00:00:00 2001 From: steadfasterX Date: Tue, 23 Nov 2021 17:06:17 +0100 Subject: [PATCH 01/11] fix: key flag id for KSK, fix format (#2063) as mentioned (https://github.com/mail-in-a-box/mailinabox/pull/2033#issuecomment-976365087) KSK is 257, not 256 --- management/status_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/status_checks.py b/management/status_checks.py index 1e7223a5..d3c642c6 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -646,7 +646,7 @@ def check_dnssec(domain, env, output, dns_zonefiles, is_checking_primary=False): output.print_line("Option " + str(i+1) + ":") output.print_line("----------") output.print_line("Key Tag: " + ds_suggestion['keytag']) - output.print_line("Key Flags: KSK (256)") + output.print_line("Key Flags: KSK / 257") output.print_line("Algorithm: %s / %s" % (ds_suggestion['alg'], ds_suggestion['alg_name'])) output.print_line("Digest Type: %s / %s" % (ds_suggestion['digalg'], ds_suggestion['digalg_name'])) output.print_line("Digest: " + ds_suggestion['digest']) From 50a5cb90bc63d3f492641bf39ed943886f9c4eab Mon Sep 17 00:00:00 2001 From: Ilnahro <36730161+Ilnahro@users.noreply.github.com> Date: Wed, 1 Dec 2021 00:50:01 +0000 Subject: [PATCH 02/11] Include rsync to the installed basic packages (#2067) Some VPS providers strip this package from their Ubuntu 18.04 VM images. This will help avoid errors. --- setup/management.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/management.sh b/setup/management.sh index 7e31fe00..8dc64f3b 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -25,7 +25,7 @@ done # # certbot installs EFF's certbot which we use to # provision free TLS certificates. -apt_install duplicity python-pip virtualenv certbot +apt_install duplicity python-pip virtualenv certbot rsync # b2sdk is used for backblaze backups. # boto is used for amazon aws backups. From 9850ae5420b1a090c27e15c922fdc8dfd4b1f18c Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Mon, 6 Dec 2021 23:22:11 +0100 Subject: [PATCH 03/11] upgrade nextcloud to 21 --- setup/nextcloud.sh | 53 ++++++++++++++++++++++++---------------------- setup/web.sh | 4 ++++ 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index e646d690..05cb7efc 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -100,8 +100,8 @@ InstallNextcloud() { } # Nextcloud Version to install. Checks are done down below to step through intermediate versions. -nextcloud_ver=20.0.14 -nextcloud_hash=92cac708915f51ee2afc1787fd845476fd090c81 +nextcloud_ver=21.0.7 +nextcloud_hash=f5c7079c5b56ce1e301c6a27c0d975d608bb01c9 contacts_ver=4.0.0 contacts_hash=f893ca57a543b260c9feeecbb5958c00b6998e18 calendar_ver=2.2.2 @@ -167,28 +167,33 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc CURRENT_NEXTCLOUD_VER="15.0.8" fi if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^15 ]]; then - InstallNextcloud 16.0.6 0bb3098455ec89f5af77a652aad553ad40a88819 3.3.0 e55d0357c6785d3b1f3b5f21780cb6d41d32443a 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 0.7.0 555a94811daaf5bdd336c5e48a78aa8567b86437 - CURRENT_NEXTCLOUD_VER="16.0.6" - fi - if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^16 ]]; then - InstallNextcloud 17.0.6 50b98d2c2f18510b9530e558ced9ab51eb4f11b0 3.3.0 e55d0357c6785d3b1f3b5f21780cb6d41d32443a 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 0.7.0 555a94811daaf5bdd336c5e48a78aa8567b86437 - CURRENT_NEXTCLOUD_VER="17.0.6" - fi - if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^17 ]]; then + InstallNextcloud 16.0.6 0bb3098455ec89f5af77a652aad553ad40a88819 3.3.0 e55d0357c6785d3b1f3b5f21780cb6d41d32443a 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 0.7.0 555a94811daaf5bdd336c5e48a78aa8567b86437 + CURRENT_NEXTCLOUD_VER="16.0.6" + fi + if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^16 ]]; then + InstallNextcloud 17.0.6 50b98d2c2f18510b9530e558ced9ab51eb4f11b0 3.3.0 e55d0357c6785d3b1f3b5f21780cb6d41d32443a 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 0.7.0 555a94811daaf5bdd336c5e48a78aa8567b86437 + CURRENT_NEXTCLOUD_VER="17.0.6" + fi + if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^17 ]]; then echo "ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR;" | sqlite3 $STORAGE_ROOT/owncloud/owncloud.db - InstallNextcloud 18.0.10 39c0021a8b8477c3f1733fddefacfa5ebf921c68 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a - CURRENT_NEXTCLOUD_VER="18.0.10" - fi - if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^18 ]]; then - InstallNextcloud 19.0.4 01e98791ba12f4860d3d4047b9803f97a1b55c60 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a - CURRENT_NEXTCLOUD_VER="19.0.4" - fi + InstallNextcloud 18.0.10 39c0021a8b8477c3f1733fddefacfa5ebf921c68 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a + CURRENT_NEXTCLOUD_VER="18.0.10" + fi + if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^18 ]]; then + InstallNextcloud 19.0.4 01e98791ba12f4860d3d4047b9803f97a1b55c60 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a + CURRENT_NEXTCLOUD_VER="19.0.4" + fi + if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^19 ]]; then + InstallNextcloud 19.0.4 01e98791ba12f4860d3d4047b9803f97a1b55c60 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a + InstallNextcloud 20.0.14 92cac708915f51ee2afc1787fd845476fd090c81 4.0.0 f893ca57a543b260c9feeecbb5958c00b6998e18 2.2.2 923846d48afb5004a456b9079cf4b46d23b3ef3a 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a + CURRENT_NEXTCLOUD_VER="20.0.14" + + # Nextcloud 20 needs to have some optional columns added + sudo -u www-data php /usr/local/lib/owncloud/occ db:add-missing-columns + fi fi InstallNextcloud $nextcloud_ver $nextcloud_hash $contacts_ver $contacts_hash $calendar_ver $calendar_hash $user_external_ver $user_external_hash - - # Nextcloud 20 needs to have some optional columns added - sudo -u www-data php /usr/local/lib/owncloud/occ db:add-missing-columns fi # ### Configuring Nextcloud @@ -359,11 +364,9 @@ tools/editconf.py /etc/php/$(php_version)/cli/conf.d/10-opcache.ini -c ';' \ opcache.save_comments=1 \ opcache.revalidate_freq=1 -# If apc is explicitly disabled we need to enable it -if grep -q apc.enabled=0 /etc/php/$(php_version)/mods-available/apcu.ini; then - tools/editconf.py /etc/php/$(php_version)/mods-available/apcu.ini -c ';' \ - apc.enabled=1 -fi +# Enable apc is required before installing nextcloud 21 +tools/editconf.py /etc/php/$(php_version)/mods-available/apcu.ini -c ';' \ + apc.enabled=1 # Set up a cron job for Nextcloud. cat > /etc/cron.d/mailinabox-nextcloud << EOF; diff --git a/setup/web.sh b/setup/web.sh index 12133fe2..b2cbaf6b 100755 --- a/setup/web.sh +++ b/setup/web.sh @@ -63,6 +63,10 @@ tools/editconf.py /etc/php/$(php_version)/fpm/php.ini -c ';' \ tools/editconf.py /etc/php/$(php_version)/fpm/pool.d/www.conf -c ';' \ env[PATH]=/usr/local/bin:/usr/bin:/bin \ +# Enable apc is required before installing nextcloud 21 +tools/editconf.py /etc/php/$(php_version)/mods-available/apcu.ini -c ';' \ + apc.enabled=1 + # Configure php-fpm based on the amount of memory the machine has # This is based on the nextcloud manual for performance tuning: https://docs.nextcloud.com/server/17/admin_manual/installation/server_tuning.html # Some synchronisation issues can occur when many people access the site at once. From fa9bcbe8d20a5968d5acc17b674e714fa4fdd2f3 Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Mon, 6 Dec 2021 23:25:31 +0100 Subject: [PATCH 04/11] move command to web.sh setup --- setup/nextcloud.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 05cb7efc..2612497a 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -364,10 +364,6 @@ tools/editconf.py /etc/php/$(php_version)/cli/conf.d/10-opcache.ini -c ';' \ opcache.save_comments=1 \ opcache.revalidate_freq=1 -# Enable apc is required before installing nextcloud 21 -tools/editconf.py /etc/php/$(php_version)/mods-available/apcu.ini -c ';' \ - apc.enabled=1 - # Set up a cron job for Nextcloud. cat > /etc/cron.d/mailinabox-nextcloud << EOF; #!/bin/bash From 507ac86999bb9ecbc2466c4f7ff4736db180b485 Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Mon, 6 Dec 2021 23:32:24 +0100 Subject: [PATCH 05/11] updated readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3847729..7a847453 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ Functionality changes and additions * Configure domain names for which only www will be hosted Edit /etc/miabwwwdomains.conf to configure. The box will handle incoming traffic asking for these domain names. The DNS entries are entered in an external DNS provider! If you want this box to handle the DNS entries, simply add a mail alias. (existing functionality of the vanilla Mail-in-a-Box) * Add some munin plugins -* Update nextcloud to 20.0.13 +* Update nextcloud to 21.0.7 + And updated apps * Add nextcloud notes app * Update roundcube carddav plugin to 4.1.1 * Add roundcube context menu plugin From 19be77176928c9778f61238f0af887dc4359941e Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Tue, 7 Dec 2021 22:41:00 +0100 Subject: [PATCH 06/11] upgraded nextcloud to 22 --- README.md | 2 +- setup/nextcloud.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7a847453..802e503c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Functionality changes and additions * Configure domain names for which only www will be hosted Edit /etc/miabwwwdomains.conf to configure. The box will handle incoming traffic asking for these domain names. The DNS entries are entered in an external DNS provider! If you want this box to handle the DNS entries, simply add a mail alias. (existing functionality of the vanilla Mail-in-a-Box) * Add some munin plugins -* Update nextcloud to 21.0.7 +* Update nextcloud to 22.2.3 And updated apps * Add nextcloud notes app * Update roundcube carddav plugin to 4.1.1 diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 2612497a..a7503495 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -100,8 +100,8 @@ InstallNextcloud() { } # Nextcloud Version to install. Checks are done down below to step through intermediate versions. -nextcloud_ver=21.0.7 -nextcloud_hash=f5c7079c5b56ce1e301c6a27c0d975d608bb01c9 +nextcloud_ver=22.2.3 +nextcloud_hash=58d2d897ba22a057aa03d29c762c5306211fefd2 contacts_ver=4.0.0 contacts_hash=f893ca57a543b260c9feeecbb5958c00b6998e18 calendar_ver=2.2.2 @@ -184,13 +184,16 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc CURRENT_NEXTCLOUD_VER="19.0.4" fi if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^19 ]]; then - InstallNextcloud 19.0.4 01e98791ba12f4860d3d4047b9803f97a1b55c60 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a InstallNextcloud 20.0.14 92cac708915f51ee2afc1787fd845476fd090c81 4.0.0 f893ca57a543b260c9feeecbb5958c00b6998e18 2.2.2 923846d48afb5004a456b9079cf4b46d23b3ef3a 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a CURRENT_NEXTCLOUD_VER="20.0.14" # Nextcloud 20 needs to have some optional columns added sudo -u www-data php /usr/local/lib/owncloud/occ db:add-missing-columns fi + if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^20 ]]; then + InstallNextcloud 21.0.7 f5c7079c5b56ce1e301c6a27c0d975d608bb01c9 4.0.0 f893ca57a543b260c9feeecbb5958c00b6998e18 2.2.2 923846d48afb5004a456b9079cf4b46d23b3ef3a 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a + CURRENT_NEXTCLOUD_VER="21.0.7" + fi fi InstallNextcloud $nextcloud_ver $nextcloud_hash $contacts_ver $contacts_hash $calendar_ver $calendar_hash $user_external_ver $user_external_hash From a85c429a857c21b64bf3c510f63f86bc2bf3d2df Mon Sep 17 00:00:00 2001 From: Arno Hautala Date: Sun, 19 Dec 2021 08:33:59 -0500 Subject: [PATCH 07/11] regex change to exclude comma from sasl_username (#2074) as proposed in #2071 by @jvolkenant --- management/mail_log.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/management/mail_log.py b/management/mail_log.py index 59c32c6e..bdf757cc 100755 --- a/management/mail_log.py +++ b/management/mail_log.py @@ -549,8 +549,9 @@ def scan_postfix_submission_line(date, log, collector): """ # Match both the 'plain' and 'login' sasl methods, since both authentication methods are - # allowed by Dovecot - m = re.match("([A-Z0-9]+): client=(\S+), sasl_method=(PLAIN|LOGIN), sasl_username=(\S+)", log) + # allowed by Dovecot. Exclude trailing comma after the username when additional fields + # follow after. + m = re.match("([A-Z0-9]+): client=(\S+), sasl_method=(PLAIN|LOGIN), sasl_username=(\S+)(? Date: Sat, 25 Dec 2021 07:17:34 -0800 Subject: [PATCH 08/11] Don't die if column already exists on Nextcloud 18 upgrade (#2078) --- setup/nextcloud.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index af848344..b43816e4 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -172,7 +172,8 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc CURRENT_NEXTCLOUD_VER="17.0.6" fi if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^17 ]]; then - echo "ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR;" | sqlite3 $STORAGE_ROOT/owncloud/owncloud.db + # Don't exit the install if this column already exists (see #2076) + (echo "ALTER TABLE oc_flow_operations ADD COLUMN entity VARCHAR;" | sqlite3 $STORAGE_ROOT/owncloud/owncloud.db 2>/dev/null) || true InstallNextcloud 18.0.10 39c0021a8b8477c3f1733fddefacfa5ebf921c68 3.4.1 aee680a75e95f26d9285efd3c1e25cf7f3bfd27e 2.0.3 9d9717b29337613b72c74e9914c69b74b346c466 1.0.0 3bf2609061d7214e7f0f69dd8883e55c4ec8f50a CURRENT_NEXTCLOUD_VER="18.0.10" fi From acc9ebd68f351209b5fc895f50b2b998c9fb9d18 Mon Sep 17 00:00:00 2001 From: "github@kiekerjan.isdronken.nl" Date: Wed, 29 Dec 2021 22:27:15 +0100 Subject: [PATCH 09/11] update nextcloud and webmail plugins --- setup/nextcloud.sh | 28 ++++++++++++++++++++-------- setup/webmail.sh | 6 +++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 144b224f..15834d1c 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -49,11 +49,23 @@ InstallNextcloud() { # their github repositories. mkdir -p /usr/local/lib/owncloud/apps - wget_verify https://github.com/nextcloud/contacts/releases/download/v$version_contacts/contacts.tar.gz $hash_contacts /tmp/contacts.tgz + contacts_cutoff="3.5.1" # this version was the last posted version on 12/27/2021 that supported the old url format + if [ ${contacts_cutoff//.} -gt ${version_contacts//.} ]; then + wget_verify https://github.com/nextcloud/contacts/releases/download/v$version_contacts/contacts.tar.gz $hash_contacts /tmp/contacts.tgz + else + wget_verify https://github.com/nextcloud-releases/contacts/releases/download/v$version_contacts/contacts-v$version_contacts.tar.gz $hash_contacts /tmp/contacts.tgz + fi + tar xf /tmp/contacts.tgz -C /usr/local/lib/owncloud/apps/ rm /tmp/contacts.tgz - wget_verify https://github.com/nextcloud/calendar/releases/download/v$version_calendar/calendar.tar.gz $hash_calendar /tmp/calendar.tgz + calendar_cutoff="2.0.5" # this version was the last posted version on 12/27/2021 that supported the old url format + if [ ${calendar_cutoff//.} -gt ${version_calendar//.} ]; then + wget_verify https://github.com/nextcloud/calendar/releases/download/v$version_calendar/calendar.tar.gz $hash_calendar /tmp/calendar.tgz + else + wget_verify https://github.com/nextcloud-releases/calendar/releases/download/v$version_calendar/calendar.tar.gz $hash_calendar /tmp/calendar.tgz + fi + tar xf /tmp/calendar.tgz -C /usr/local/lib/owncloud/apps/ rm /tmp/calendar.tgz @@ -102,12 +114,12 @@ InstallNextcloud() { # Nextcloud Version to install. Checks are done down below to step through intermediate versions. nextcloud_ver=22.2.3 nextcloud_hash=58d2d897ba22a057aa03d29c762c5306211fefd2 -contacts_ver=4.0.0 -contacts_hash=f893ca57a543b260c9feeecbb5958c00b6998e18 -calendar_ver=2.2.2 -calendar_hash=923846d48afb5004a456b9079cf4b46d23b3ef3a -user_external_ver=1.0.0 -user_external_hash=3bf2609061d7214e7f0f69dd8883e55c4ec8f50a +contacts_ver=4.0.7 +contacts_hash=8ab31d205408e4f12067d8a4daa3595d46b513e3 +calendar_ver=3.0.2 +calendar_hash=dcc62633f81c2cb53ce202348c79a0ab5bf4c9a8 +user_external_ver=2.1.0 +user_external_hash=6e5afe7f36f398f864bfdce9cad72200e70322aa # Current Nextcloud Version, #1623 # Checking /usr/local/lib/owncloud/version.php shows version of the Nextcloud application, not the DB diff --git a/setup/webmail.sh b/setup/webmail.sh index b2173b5b..e4ee18c4 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -36,8 +36,8 @@ HTML5_NOTIFIER_VERSION=68d9ca194212e15b3c7225eb6085dbcf02fd13d7 # version 0.6.4+ CONTEXT_MENU_VERSION=602a3812922fb8f71814eb3b8d91e9b7859aab7e # version 3.2.1 TWOFACT_COMMIT=a3944c4604fe86fc020847f281beea031e14e58e # master @ 17-10-2021 -CARDDAV_VERSION=4.1.1 -CARDDAV_HASH=87b73661b7799b2079c28324311eddb4241242bb +CARDDAV_VERSION=4.3.0 +CARDDAV_HASH=4ad7df8843951062878b1375f77c614f68bc5c61 UPDATE_KEY=$VERSION:$PERSISTENT_LOGIN_VERSION:$HTML5_NOTIFIER_VERSION:$CARDDAV_VERSION:$CONTEXT_MENU_VERSION:$TWOFACT_COMMIT @@ -78,7 +78,7 @@ if [ $needs_update == 1 ]; then # install roundcube html5_notifier plugin git_clone https://github.com/kitist/html5_notifier.git $HTML5_NOTIFIER_VERSION '' ${RCM_PLUGIN_DIR}/html5_notifier - # download and verify the full release of the carddav plugin. Can't use github because does not include all dependencies + # download and verify the full release of the carddav plugin. Can't use git_clone because repository does not include all dependencies wget_verify \ https://github.com/mstilkerich/rcmcarddav/releases/download/v${CARDDAV_VERSION}/carddav-v${CARDDAV_VERSION}.tar.gz \ $CARDDAV_HASH \ From 96768f1fcbd262dcd59249eae65cdb2bb7d0cf22 Mon Sep 17 00:00:00 2001 From: "github@kiekerjan.isdronken.nl" Date: Fri, 31 Dec 2021 00:33:34 +0100 Subject: [PATCH 10/11] backport fix for dns resolver in python3-dkim --- setup/dkim.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/dkim.sh b/setup/dkim.sh index c3092753..4d8e44aa 100755 --- a/setup/dkim.sh +++ b/setup/dkim.sh @@ -11,7 +11,7 @@ source /etc/mailinabox.conf # load global vars # Install DKIM... echo Installing DKIMpy/OpenDMARC... -apt_install dkimpy-milter opendmarc +apt_install dkimpy-milter python3-dkim opendmarc # Make sure configuration directories exist. mkdir -p /etc/dkim; @@ -121,6 +121,9 @@ tools/editconf.py /etc/postfix/main.cf \ # We need to explicitly enable the opendmarc service, or it will not start hide_output systemctl enable opendmarc +# There is a fault in the dkim code for Ubuntu 20.04, let's fix it. Not necessary for Ubuntu 21.04 or newer +sed -i 's/return b""\.join(r\.items\[0\]\.strings)/return b""\.join(list(r\.items)\[0\]\.strings)/' /usr/lib/python3/dist-packages/dkim/dnsplug.py + # Restart services. restart_service dkimpy-milter restart_service opendmarc From 21d4817998adde0726a53f9d3a2237d3b61b1869 Mon Sep 17 00:00:00 2001 From: "github@kiekerjan.isdronken.nl" Date: Thu, 6 Jan 2022 22:06:27 +0100 Subject: [PATCH 11/11] dkimpy dev and nextcloud installation details --- setup/dkim.sh | 28 ++++++++++++---------------- setup/mail-postfix.sh | 2 +- setup/nextcloud.sh | 8 +++++++- setup/web.sh | 4 ---- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/setup/dkim.sh b/setup/dkim.sh index 4d8e44aa..0fa303e2 100755 --- a/setup/dkim.sh +++ b/setup/dkim.sh @@ -25,22 +25,18 @@ echo "127.0.0.1" > /etc/dkim/TrustedHosts touch /etc/dkim/KeyTable touch /etc/dkim/SigningTable -if grep -q "ExternalIgnoreList" /etc/dkimpy-milter/dkimpy-milter.conf; then - true # already done #NODOC -else - # Add various configuration options to the end of `dkimpy-milter.conf`. - cat >> /etc/dkimpy-milter/dkimpy-milter.conf << EOF; -Canonicalization relaxed/simple -MinimumKeyBits 1024 -ExternalIgnoreList refile:/etc/dkim/TrustedHosts -InternalHosts refile:/etc/dkim/TrustedHosts -KeyTable refile:/etc/dkim/KeyTable -KeyTableEd25519 refile:/etc/dkim/KeyTableEd25519 -SigningTable refile:/etc/dkim/SigningTable -Socket inet:8892@127.0.0.1 -RequireSafeKeys false -EOF -fi +tools/editconf.py /etc/dkimpy-milter/dkimpy-milter.conf -s \ + "MacroList=daemon_name|ORIGINATING" + "MacroListVerify=daemon_name|VERIFYING" + "Canonicalization=relaxed/simple" + "MinimumKeyBits=1024" + "ExternalIgnoreList=refile:/etc/dkim/TrustedHosts" + "InternalHosts=refile:/etc/dkim/TrustedHosts" + "KeyTable=refile:/etc/dkim/KeyTable" + "KeyTableEd25519=refile:/etc/dkim/KeyTableEd25519" + "SigningTable=refile:/etc/dkim/SigningTable" + "Socket=inet:8892@127.0.0.1" + "RequireSafeKeys=false" # Create a new DKIM key. This creates mail.private and mail.txt # in $STORAGE_ROOT/mail/dkim. The former is the private key and diff --git a/setup/mail-postfix.sh b/setup/mail-postfix.sh index 308e1b53..96f86c45 100755 --- a/setup/mail-postfix.sh +++ b/setup/mail-postfix.sh @@ -92,7 +92,7 @@ tools/editconf.py /etc/postfix/master.cf -s -w \ -o smtpd_sasl_auth_enable=yes -o syslog_name=postfix/submission -o smtpd_milters=inet:127.0.0.1:8892 - -o milter_macro_daemon_name=VERIFYING + -o milter_macro_daemon_name=ORIGINATING -o cleanup_service_name=authclean" \ "submission=inet n - - - - smtpd -o smtpd_sasl_auth_enable=yes diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 15834d1c..46f1124e 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -16,6 +16,12 @@ apt_install php php-fpm \ php-dev php-gd php-xml php-mbstring php-zip php-apcu php-json \ php-intl php-imagick php-gmp php-bcmath +# Enable apc is required before installing nextcloud 21 +tools/editconf.py /etc/php/$(php_version)/mods-available/apcu.ini -c ';' \ + apc.enable_cli=1 + +restart_service php$(php_version)-fpm + InstallNextcloud() { version=$1 @@ -341,7 +347,7 @@ sudo -u www-data \ | (grep -v "No such app enabled" || /bin/true) # Install interesting apps -installed=$(sudo -u www-data php /usr/local/lib/owncloud/occ app:list | grep 'notes') +installed=$(sudo -u www-data php /usr/local/lib/owncloud/occ app:list | grep "notes") if [ -z "$installed" ]; then sudo -u www-data php /usr/local/lib/owncloud/occ app:install notes diff --git a/setup/web.sh b/setup/web.sh index b2cbaf6b..12133fe2 100755 --- a/setup/web.sh +++ b/setup/web.sh @@ -63,10 +63,6 @@ tools/editconf.py /etc/php/$(php_version)/fpm/php.ini -c ';' \ tools/editconf.py /etc/php/$(php_version)/fpm/pool.d/www.conf -c ';' \ env[PATH]=/usr/local/bin:/usr/bin:/bin \ -# Enable apc is required before installing nextcloud 21 -tools/editconf.py /etc/php/$(php_version)/mods-available/apcu.ini -c ';' \ - apc.enabled=1 - # Configure php-fpm based on the amount of memory the machine has # This is based on the nextcloud manual for performance tuning: https://docs.nextcloud.com/server/17/admin_manual/installation/server_tuning.html # Some synchronisation issues can occur when many people access the site at once.