From b71e24d6a1d4bcd67a2d97609b70899104a508c8 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sat, 9 Dec 2023 02:07:09 +0100 Subject: [PATCH] draft init flow --- .gitignore | 3 -- README.md | 22 +++++-------- .../chatmail-testrun.org.ini | 15 +-------- defaults/chatmail.ini | 32 +++++++++++++++++++ scripts/deploy.sh | 3 +- scripts/init.sh | 1 + 6 files changed, 44 insertions(+), 32 deletions(-) rename chatmail.ini => defaults/chatmail-testrun.org.ini (61%) create mode 100644 defaults/chatmail.ini diff --git a/.gitignore b/.gitignore index a4d3ddee..ea2b8481 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,6 @@ __pycache__/ *.py[cod] *$py.class *.swp -www/privacy.html* -www/index.html* -www/info.html* *qr-*.png diff --git a/README.md b/README.md index 87750d16..63cfff50 100644 --- a/README.md +++ b/README.md @@ -15,26 +15,20 @@ after which the initially specified password is required for using them. ## Getting Started deploying your own chatmail instance -1. Prepare your local (presumably Linux) system: +1. Setup a domain with `A` and `AAAA` records for your chatmail server. - scripts/init.sh +2. Prepare your local system for deploying to $CHATMAIL_DOMAIN: -2. Setup a domain with `A` and `AAAA` records for your chatmail server. + scripts/init.sh $CHATMAIL_DOMAIN -3. Set environment variable to the chatmail domain you want to setup: +3. Edit the generated `chatmail.ini` file - export CHATMAIL_DOMAIN=c1.testrun.org # replace with your host +4. Deploy chatmail services remotely: -4. Fill in privacy contact data into the `chatmail.ini` file + scripts/deploy.sh chatmail.ini -5. Deploy the chat mail instance to your chatmail server: - - scripts/deploy.sh - - This script remotely sets up packages and configures the chatmail provider. - -6. Run `scripts/generate-dns-zone.sh` and - transfer the generated DNS records at your DNS provider +5. Run `scripts/generate-dns-zone.sh` and + transfer the generated DNS `chatmail.zone` records to your DNS provider ### Home page and getting started for users diff --git a/chatmail.ini b/defaults/chatmail-testrun.org.ini similarity index 61% rename from chatmail.ini rename to defaults/chatmail-testrun.org.ini index 86ee980c..5d422faa 100644 --- a/chatmail.ini +++ b/defaults/chatmail-testrun.org.ini @@ -1,24 +1,11 @@ -[params] - -# how many mails a user can send out per minute +mailname = {mailname} max_user_send_per_minute = 60 - -# list of e-mail recipients for which to accept outbound un-encrypted mails passthrough_recipients = privacy@testrun.org xstore@testrun.org -# where the filtermail SMTP service listens filtermail_smtp_port = 10080 - -# to which port to re-inject messages after they passed filtermail postfix_reinject_port = 10025 - -[privacy:testrun] - -# the settings in this section are only applied -# if the instantiated mail domain shell-matches the 'domain' setting -domain = *.testrun.org privacy_postal = Merlinux GmbH, Represented by the managing director H. Krekel, Reichgrafen Str. 20, 79102 Freiburg, Germany diff --git a/defaults/chatmail.ini b/defaults/chatmail.ini new file mode 100644 index 00000000..25adaefa --- /dev/null +++ b/defaults/chatmail.ini @@ -0,0 +1,32 @@ + +# mail domain (MUST be set to fully qualified chat mail domain) +domain = {mailname} + +# +# If you only do private test deploys, you don't need to modify any settings below +# + +# how many mails a user can send out per minute +max_user_send_per_minute = 60 + +# list of e-mail recipients for which to accept outbound un-encrypted mails +passthrough_recipients = + +# where the filtermail SMTP service listens +filtermail_smtp_port = 10080 + +# postfix accepts on the localhost reinject SMTP port +postfix_reinject_port = 10025 + +# postal address of privacy contact +privacy_postal = + +# email address of privacy contact +privacy_mail = + +# postal address of the privacy data officer +privacy_pdo = + +# postal address of the privacy supervisor +privacy_supervisor = + diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 0bcef825..e3def8ec 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -4,5 +4,6 @@ echo ----------------------------------------- echo deploying to $CHATMAIL_DOMAIN echo ----------------------------------------- + venv/bin/pyinfra --ssh-user root "$CHATMAIL_DOMAIN" \ - deploy-chatmail/src/deploy_chatmail/deploy.py + deploy-chatmail/src/deploy_chatmail/deploy.py run chatmail.ini diff --git a/scripts/init.sh b/scripts/init.sh index 3e19cf36..f658cdb0 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -6,3 +6,4 @@ pip=venv/bin/pip $pip install pyinfra pytest build 'setuptools>=68' tox $pip install -e deploy-chatmail $pip install -e chatmaild +venv/bin/deploy-chatmail init $*