| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| computing:chatmail [2026/09/08 02:20] – oemb1905 | computing:chatmail [2026/09/23 23:16] (current) – oemb1905 |
|---|
| When exchanging keys, you will need to use the ''-f'' flag. Okay, now let's set perms and start configuring the instance. | When exchanging keys, you will need to use the ''-f'' flag. Okay, now let's set perms and start configuring the instance. |
| |
| chmod 600 ~/.ssh/config | chmod 700 ~/.ssh |
| git clone https://github.com/chatmail/chatmail.git | |
| cd ~/relay | |
| scripts/initenv.sh | |
| scripts/cmdeploy status | |
| mkdir -p ~/Repositories | |
| cd ~/Repositories | |
| git clone https://github.com/chatmail/relay | git clone https://github.com/chatmail/relay |
| cd relay | cd relay |
| scripts/initenv.sh | scripts/initenv.sh |
| scripts/cmdeploy init mail.haacknet.org | scripts/cmdeploy init mail.gnulinux.online |
| | scripts/cmdeploy run |
| | scripts/cmdeploy dns |
| | scripts/cmdeploy status |
| |
| This creates ''chatmail.ini'' for you so that when you run cmdeploy it knows where to ssh and which instance to control, etc. Now, we setup the instance: | This creates ''chatmail.ini'' for you so that when you run cmdeploy it knows where to ssh and which instance to control, etc. Now, we setup the instance: |
| touch /etc/chatmail-nocreate | touch /etc/chatmail-nocreate |
| | |
| The primary page I used for setup was here: | If you need to setup a firewall, I recommend ufw: |
| | |
| | ufw allow 22/tcp |
| | ufw allow 25/tcp |
| | ufw allow 80/tcp |
| | ufw allow 143/tcp |
| | ufw allow 443/tcp |
| | ufw allow 465/tcp |
| | ufw allow 587/tcp |
| | ufw allow 993/tcp |
| | #ufw allow 3340/tcp #used by nginx and IROH, if one box only, keep closed |
| | ufw allow 8443/tcp |
| | ufw allow 3478/tcp #used by stock turn, but kept open in case chatmail-turn library uses it |
| | ufw allow 3478/udp |
| | ufw allow 7842/udp |
| | ufw allow 49152:65535/udp #recommended for turn rfc 6335/8656, needs custom rule, see below |
| | ufw enable |
| | |
| | By default, ''chatmail-turn'' will take any free udp port that the kernel offers it. On Debian systems, this ephemeral range default can be queried with ''cat /proc/sys/net/ipv4/ip_local_port_range'' and, at least on my systems is ''32768-60999''. This range is apparently the default on many Linux kernels, however, [[https://www.rfc-editor.org/rfc/rfc8656.html|RFC8656]] and [[https://www.rfc-editor.org/rfc/rfc6335.html|RFC6335]] suggest ''49152-65535''. For this reason, and since these are dedicated chatmail boxes, I figured it was wiser to tightly restrict ephemeral port usage to this recommended range only. I did that with ''sysctl'' by opening ''sudo nano /etc/sysctl.d/99-ephemeral-rfc6335.conf'' and entering: |
| | |
| | net.ipv4.ip_local_port_range = 49152 65535 |
| | |
| | Then, either reboot the server or run ''sysctl --system'' and then confirm the rule stuck with ''cat /proc/sys/net/ipv4/ip_local_port_range'' and you should see ''49152 65535'' as the output. Once this was done, I made a simple script to see RAM use, storage use, and track total users: |
| | |
| | <code> |
| | cat << 'EOF' > /usr/local/bin/chatmail-report.sh |
| | #!/bin/bash |
| | DATE=$(date +"%Y%m%d-%H:%M:%S") |
| | LOG="/home/logs/chatmail-report.log" |
| | echo "Jonathan, at $(date), your vitals for $(hostname -f) were as follows:" > $LOG |
| | echo "" >> $LOG |
| | echo "Here's the df and ram report ..." >> $LOG |
| | df -h >> $LOG |
| | free -h >> $LOG |
| | echo "" >> $LOG |
| | echo "Here are the mail directories for mail.haacknet.org ..." >> $LOG |
| | echo "Total users: $(find /home/vmail/mail/mail.haacknet.org -mindepth 1 -maxdepth 1 -type d | wc -l)" >> $LOG |
| | find /home/vmail/mail/mail.haacknet.org -mindepth 1 -maxdepth 1 -type d >> $LOG |
| | echo "" >> $LOG |
| | printf "To: email@haacksnetworking.org\nSubject: [%s]-chatmail-report-%s\n\n" "mail.haacknet.org" "$(date)" | cat - "$LOG" | sendmail -t |
| | rm -f /tmp/chatmail-report.lock |
| | EOF |
| | chmod 750 /usr/local/bin/chatmail-report.sh |
| | </code> |
| |
| --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/09/08 02:12// | --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/09/23 23:16// |