From b05aec72c2c7402773ba693ed99b35b8c994f6dd Mon Sep 17 00:00:00 2001 From: Christian Hagenest Date: Sun, 26 May 2024 19:46:43 +0200 Subject: [PATCH] Revert "add a doc about dovecot building based on internal sysadmin docs" (#308) * Revert "clarify backports policy" This reverts commit 610675452e7f446f6836d7746cb88eecb245ed1b. * Revert "Add OBS" This reverts commit 83387f5d080add2cca6cd0bd4d8b369ab8e2473f. * Revert "fix up readme for dovecot script" This reverts commit 142206529cf08dbd6b71ca92e8c1699ebd2ca2c9. * Revert "move SCRIPT_DIR" This reverts commit c0f200b1a9635adc96c7a50d8c96aad5fcf2a194. * Revert "Update scripts/dovecot/README.md" This reverts commit 6d55f75bee672dd669a1c9451614dfc426fc2e50. * Revert "Update scripts/dovecot/build-obs.sh" This reverts commit c68cbf18067303f6b71d493686a37e07bb69f4e3. * Revert "edit README" This reverts commit 9677617c7f36faad7f047a89a78b1fb9c1bc865c. * Revert "move readme wip" This reverts commit d8cf282953c431f7ab02e9d74e4890331db5f3ff. * Revert "remove unnecessary dependencies" This reverts commit b959f570586d4c5c0ec24c3832464803f7a23739. * Revert "clean up" This reverts commit 8768e6fd0bd167c4ef3681a8e2a44512a2ba5d2c. * Revert "wip" This reverts commit acbf37038339056053ed33140879b166ddc15bef. * Revert "wip test without curl" This reverts commit 80dfdaee06d173a6df3104d639ce79375225bec7. * Revert "wip try dpkg-source" This reverts commit 4d15ae945294c4ba8ae62ffea9653b8cff8ac220. * Revert "wip hack" This reverts commit 9a68d42ee877461c471c43be8f653e3d70a5fa6c. * Revert "wip hack" This reverts commit d732d099ac0f486e1ded8b1f47d4b9d4ee43476b. * Revert "hack for file length problem" This reverts commit 582a2af7991a8c27b645737f6888a32ad68ed2a4. * Revert "clean curl" This reverts commit fba3963d479d438f5e5186b74bbfda42d94d51cc. * Revert "move obs dir into script dir" This reverts commit e80d33e2e088d0632397f7dc928dc65fa0e09594. * Revert "it works" This reverts commit 6a3001bf227100cc6485482be230752cd3ae1fc9. * Revert "WIP: Build builds, OBS pushes, OBs doesn't build :( problem with .dsc" This reverts commit 368c41ba27b470d30cddf59dce6e6c0affc39fba. * Revert "WIP IT BUILDS" This reverts commit fa0d8432bc4d85036d2de34a86b5ebda3c9f9c9a. * Revert "WIP" This reverts commit 2811e08563619ddf1b7441880fc1b85787e54559. * Revert "WIP build-obs.sh" This reverts commit 846a4066d83ca31d2f7c1db8165226d0e2636a4a. * Revert "add precise links for dovecot unstable" This reverts commit 6e1477666ec983a67c63646d0b25a1e5549f7d0a. * Revert "WIP build-obs.sh" This reverts commit 013def94f94c4382d0cb3f309d7f660810aade3c. * Revert "track discussion from chat" This reverts commit 468bb04149c4a393fd4173041b3578a4bee53cd8. * Revert "add a doc about dovecot building based on internal sysadmin docs" This reverts commit 30a23dad179625d9208af843eab90615176bbafd. --- scripts/dovecot/README.md | 80 ------------------------------------ scripts/dovecot/build-obs.sh | 54 ------------------------ 2 files changed, 134 deletions(-) delete mode 100644 scripts/dovecot/README.md delete mode 100644 scripts/dovecot/build-obs.sh diff --git a/scripts/dovecot/README.md b/scripts/dovecot/README.md deleted file mode 100644 index 9c27a23b..00000000 --- a/scripts/dovecot/README.md +++ /dev/null @@ -1,80 +0,0 @@ -## Introduction to custom Dovecot builds - -Chatmail servers use a custom Debian build of the IMAP 'dovecot' server software because - -a) Dovecot developers did not yet merge a [pull request](https://github.com/dovecot/core/pull/216) - which majorly speeds up message delivery by removing a hardcoded 0.5 second delay - on relaying incoming messages. - -b) Even if merged, it would take years for it to reach Debian stable. - -c) The modified dovecot has been successfully used since December 2023 without issues - and we see no noticeable downside (theoretically higher CPU usage but not measureable) - but a considerable upside as the delay-removal facilitates end-to-end message - delivery of 200 ms in real networks. - -The modified forked dovecot code lives at -[https://github.com/chatmail/dovecot](https://github.com/chatmail/dovecot). -The remainder of this document describes the setup of the Debian repository -containing the patched dovecot version. - -## Building Debian packages at build.opensuse.org - -Delta Chat developers maintain an [account](https://build.opensuse.org/project/show/home:deltachat) -in the [Open Build Service (OBS)](https://openbuildservice.org/), -where the [resulting package](https://build.opensuse.org/package/show/home:deltachat/dovecot) -is now used in deploying chatmail servers. - -The Open Build Service (OBS) is a platform for building and distributing software packages -across various operating systems and architectures. -It supports openSUSE, Fedora, Debian, Ubuntu and Arch. -It's [primary instance](https://build.opensuse.org/) is ran by the openSUSE project -and is part of the pipeline of the creation of SUSE Linux Enterprise. - -The OBS provides a mercurial-like interface to create source repositories -that are then automatically built. -While in theory a package can be created entirely over the web interface, -the use of the cli-tool `osc` is more convenient and is described in the [official documentation](https://openbuildservice.org/help/manuals/obs-user-guide/art.obs.bg#sec.obsbg.obsconfig). - -### How to build the dovecot debian package on the OBS via our script - -In scripts/dovecot/ is a shell script that prepares the required files and pushes them to build.opensuse.org. - -Before using the script, you should have osc set up as described in the [official documentation](https://openbuildservice.org/help/manuals/obs-user-guide/art.obs.bg#sec.obsbg.obsconfig). - -The script assumes you are on Debian. It automatically installs any needed dependencies and creates the source package. To upload the resulting source package to the OBS you need to enter the username and password for deltachat on build.opensuse.org in the last step of the script. - -Use `source build-obs.sh` to run it. - -### Adding the resulting OBS repository to Debian 12 - -Our dovecot fork is automatically installed as part of the chatmail deployment. You can see it in cmdeploy/src/cmdeploy/__init__.py. If you want to add our fork manually to a system, you can do the following: - -First add our signing key to your apt keyring: - -``` -sudo cp cmdeploy/src/cmdeploy/obs-home-deltachat.gpg /etc/apt/keyrings/obs-home-deltachat.gpg` -``` - -Now add our repository and key to /etc/apt/sources.list with a text editor of your choice: - -``` -deb [signed-by=/etc/apt/keyrings/obs-home-deltachat.gpg] https://download.opensuse.org/repositories/home:/deltachat/Debian_12/ ./ -``` - -You can now install dovecot like normal. - -``` -sudo apt update -sudo apt install dovecot-core -``` - -### Security concerns - -The signing of the patched dovecot package is done in the OBS and -in theory SUSE could make changes to the package delivered. -It is probably reasonable to trust SUSE to not mess with the build -process because it would cause serious negative reputation damage for them -if they tried and someone finds out. - -Our dovecot fork will receive the same security backports as the dovecot package in Debian Sid. diff --git a/scripts/dovecot/build-obs.sh b/scripts/dovecot/build-obs.sh deleted file mode 100644 index 2d599465..00000000 --- a/scripts/dovecot/build-obs.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -# Install dependencies -echo "Installing dependencies for this script:" -sudo apt install -y devscripts build-essential osc curl git debhelper-compat - -# Define path of your local OBS repository -SCRIPT_DIR=$PWD -OBS_PATH=$SCRIPT_DIR/obs -REPO_PATH=$OBS_PATH/home:deltachat/dovecot/ - -# Download Debian Source Files -echo "Downloading precise files from Debian unstable repository..." -mkdir dovecot-build -cd dovecot-build - -# taken May 6th 2024, from https://packages.debian.org/unstable/dovecot-core -curl http://deb.debian.org/debian/pool/main/d/dovecot/dovecot_2.3.21+dfsg1-3.debian.tar.xz -O -curl http://deb.debian.org/debian/pool/main/d/dovecot/dovecot_2.3.21+dfsg1.orig.tar.gz -O -curl http://deb.debian.org/debian/pool/main/d/dovecot/dovecot_2.3.21+dfsg1.orig-pigeonhole.tar.gz -O - -# Clone the Chatmail Dovecot Repo -echo "Cloning the Chatmail Dovecot fork..." -git clone https://github.com/chatmail/dovecot.git - -# Build the source package -echo "Building the source package" -cd dovecot -dpkg-source -b . - -# Setting up OSC -echo "Setting up OBS home repository" -mkdir $OBS_PATH -cd $OBS_PATH -rm -rf home:deltachat/dovecot -osc checkout home:deltachat/dovecot - -# Copy Files to Your Local OBS Repository, -echo "Copying files to your local OBS repository..." -cd $SCRIPT_DIR/dovecot-build -cp -rf dovecot_2.3.21+dfsg1-3.debian.tar.xz $REPO_PATH -cp -rf dovecot_2.3.21+dfsg1.orig.tar.gz $REPO_PATH -cp -rf dovecot_2.3.21+dfsg1.orig-pigeonhole.tar.gz $REPO_PATH -cp -rf dovecot_2.3.21+dfsg1-3.dsc $REPO_PATH - -# Push Changes to OBS -echo "Pushing changes to OBS..." -cd $REPO_PATH -osc up -osc add dovecot_2.3.21+dfsg1-3.debian.tar.xz -osc add dovecot_2.3.21+dfsg1.orig.tar.gz -osc add dovecot_2.3.21+dfsg1.orig-pigeonhole.tar.gz -osc add dovecot_2.3.21+dfsg1-3.dsc -osc commit