mirror of
https://github.com/chatmail/relay.git
synced 2026-05-11 16:34:39 +00:00
Compare commits
2 Commits
docker-reb
...
newreadmea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
141bfbf2ea | ||
|
|
6fa5ec86f0 |
67
README.md
67
README.md
@@ -1,61 +1,40 @@
|
|||||||
# Chat Mail server configuration
|
# Chat Mail server configuration
|
||||||
|
|
||||||
This package deploys Postfix and Dovecot servers, including OpenDKIM for DKIM signing.
|
This repository setups a ready-to-go chatmail instance
|
||||||
|
comprised of a minimal setup of the battle-tested
|
||||||
Postfix uses Dovecot for authentication as described in <https://www.postfix.org/SASL_README.html#server_dovecot>
|
[postfix smtp server](https://www.postfix.org) and [dovecot imap server](https://www.dovecot.org).
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
prepare:
|
1. prepare your local system:
|
||||||
|
|
||||||
pip install -e chatmail-infra
|
scripts/init.sh
|
||||||
|
|
||||||
|
2. set environment variable to the chatmail domain you want to setup:
|
||||||
|
|
||||||
|
export CHATMAIL_DOMAIN=c1.testrun.org # replace with your host
|
||||||
|
|
||||||
|
3. run the deploy of the chat mail instance:
|
||||||
|
|
||||||
|
scripts/deploy.sh
|
||||||
|
|
||||||
|
|
||||||
then run with pyinfra command line tool:
|
## Running tests and benchmarks (offline and online)
|
||||||
|
|
||||||
CHATMAIL_DOMAIN=c1.testrun.org pyinfra --ssh-user root c1.testrun.org deploy.py
|
1. Set `CHATMAIL_SSH` so that `ssh root@$CHATMAIL_SSH` allows
|
||||||
|
to login to the chatmail instance server.
|
||||||
|
|
||||||
|
2. To run local and online tests:
|
||||||
|
|
||||||
## Structure (wip)
|
scripts/test.sh
|
||||||
```
|
|
||||||
|
|
||||||
# package doveauth tool and deploy chatmail server to a envvar-specified ssh-reachable host
|
3. To run benchmarks against your chatmail instance:
|
||||||
deploy.py
|
|
||||||
|
|
||||||
# chatmail pyinfra deploy package
|
scripts/bench.sh
|
||||||
chatmail-pyinfra
|
|
||||||
pyproject.toml
|
|
||||||
chatmail/__init__ ...
|
|
||||||
|
|
||||||
# doveauth tool used by dovecot's auth mechanism on the host system
|
## Running tests (offline and online)
|
||||||
doveauth
|
|
||||||
README.md
|
|
||||||
pyproject.toml
|
|
||||||
doveauth.py
|
|
||||||
test_doveauth.py
|
|
||||||
|
|
||||||
# lmtp server to block (outgoing) unencrypted messages
|
|
||||||
filtermail
|
|
||||||
README.md
|
|
||||||
pyproject.toml
|
|
||||||
....
|
|
||||||
|
|
||||||
# online tests (after deploy)
|
|
||||||
|
|
||||||
online-tests # runnable via pytest
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# scripts for setup/development/deployment
|
|
||||||
|
|
||||||
scripts/
|
|
||||||
init.sh # create venv/other perequires
|
|
||||||
deploy.sh # run pyinfra based deploy of everything
|
|
||||||
test.sh # run all local and online tests
|
|
||||||
bench.sh # run performance benchmark tests
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dovecot/Postfix configuration
|
## Dovecot/Postfix configuration
|
||||||
|
|
||||||
### Ports
|
### Ports
|
||||||
@@ -65,4 +44,6 @@ Dovecot listens on ports 143(imap) and 993 (imaps).
|
|||||||
|
|
||||||
## DNS
|
## DNS
|
||||||
|
|
||||||
For DKIM you must add a DNS entry as in /etc/opendkim/selector.txt (where selector is the opendkim_selector configured in the chatmail inventory).
|
For DKIM you must add a DNS entry as found in /etc/opendkim/selector.txt on your chatmail instance.
|
||||||
|
The above `scripts/deploy.sh` prints out the DKIM selector and DNS entry you
|
||||||
|
need to setup with your DNS provider.
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
: ${CHATMAIL_DOMAIN:=c1.testrun.org}
|
: ${CHATMAIL_DOMAIN:=c1.testrun.org}
|
||||||
export CHATMAIL_DOMAIN
|
export CHATMAIL_DOMAIN
|
||||||
|
|
||||||
venv/bin/python3 -m build -n --sdist chatmaild --outdir dist
|
chatmaild/venv/bin/python3 -m build -n --sdist chatmaild --outdir dist
|
||||||
|
|
||||||
deploy-chatmail/venv/bin/pyinfra --ssh-user root "$CHATMAIL_DOMAIN" deploy.py
|
deploy-chatmail/venv/bin/pyinfra --ssh-user root "$CHATMAIL_DOMAIN" \
|
||||||
|
deploy-chatmail/src/deploy_chatmail/deploy.py
|
||||||
|
|
||||||
rm -r dist/
|
rm -r dist/
|
||||||
|
|||||||
@@ -6,12 +6,8 @@ deploy-chatmail/venv/bin/pip install -e deploy-chatmail
|
|||||||
deploy-chatmail/venv/bin/pip install -e chatmaild
|
deploy-chatmail/venv/bin/pip install -e chatmaild
|
||||||
|
|
||||||
python3 -m venv chatmaild/venv
|
python3 -m venv chatmaild/venv
|
||||||
chatmaild/venv/bin/pip install pytest
|
chatmaild/venv/bin/pip install --upgrade pytest build 'setuptools>=68'
|
||||||
chatmaild/venv/bin/pip install -e chatmaild
|
chatmaild/venv/bin/pip install -e chatmaild
|
||||||
|
|
||||||
python3 -m venv online-tests/venv
|
python3 -m venv online-tests/venv
|
||||||
online-tests/venv/bin/pip install pytest pytest-timeout pdbpp deltachat pytest-benchmark
|
online-tests/venv/bin/pip install pytest pytest-timeout pdbpp deltachat pytest-benchmark
|
||||||
|
|
||||||
python3 -m venv venv
|
|
||||||
venv/bin/pip install build
|
|
||||||
venv/bin/pip install 'setuptools>=68'
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
: ${CHATMAIL_DOMAIN:=c1.testrun.org}
|
: ${CHATMAIL_DOMAIN:=c1.testrun.org}
|
||||||
: ${CHATMAIL_SSH_HOST:=$CHATMAIL_DOMAIN}
|
: ${CHATMAIL_SSH:=$CHATMAIL_DOMAIN}
|
||||||
|
|
||||||
rsync -avz . "root@$CHATMAIL_SSH_HOST:/root/chatmail" --exclude='/.git' --filter="dir-merge,- .gitignore"
|
rsync -avz . "root@$CHATMAIL_SSH:/root/chatmail" --exclude='/.git' --filter="dir-merge,- .gitignore"
|
||||||
ssh "root@$CHATMAIL_SSH_HOST" "cd /root/chatmail; apt install -y python3-venv; python3 -m venv venv; venv/bin/pip install pyinfra build; venv/bin/python3 -m build -n --sdist chatmaild --outdir dist; venv/bin/pip install -e ./deploy-chatmail -e ./chatmaild; export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN; venv/bin/pyinfra @local deploy.py"
|
ssh "root@$CHATMAIL_SSH" "cd /root/chatmail; apt install -y python3-venv; python3 -m venv venv; venv/bin/pip install pyinfra build; venv/bin/python3 -m build -n --sdist chatmaild --outdir dist; venv/bin/pip install -e ./deploy-chatmail -e ./chatmaild; export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN; venv/bin/pyinfra @local deploy.py"
|
||||||
|
|||||||
Reference in New Issue
Block a user