mirror of
https://github.com/chatmail/relay.git
synced 2026-05-13 17:34:38 +00:00
Compare commits
9 Commits
link2xt/av
...
custom-ngi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bedfc09e8e | ||
|
|
3ce350de9e | ||
|
|
1e05974970 | ||
|
|
577c04d537 | ||
|
|
d880937d44 | ||
|
|
46d2334e9c | ||
|
|
0ba94dc613 | ||
|
|
d379feea4f | ||
|
|
e82abee1b9 |
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
## untagged
|
## untagged
|
||||||
|
|
||||||
|
- Allow custom nginx config files
|
||||||
|
([#617](https://github.com/chatmail/relay/pull/617))
|
||||||
|
|
||||||
|
- Check whether GCC is installed in initenv.sh
|
||||||
|
([#608](https://github.com/chatmail/relay/pull/608))
|
||||||
|
|
||||||
- Expire push notification tokens after 90 days
|
- Expire push notification tokens after 90 days
|
||||||
([#583](https://github.com/chatmail/relay/pull/583))
|
([#583](https://github.com/chatmail/relay/pull/583))
|
||||||
|
|
||||||
@@ -14,6 +20,9 @@
|
|||||||
- Reconfigure Dovecot imap-login service to high-performance mode
|
- Reconfigure Dovecot imap-login service to high-performance mode
|
||||||
([#578](https://github.com/chatmail/relay/pull/578))
|
([#578](https://github.com/chatmail/relay/pull/578))
|
||||||
|
|
||||||
|
- Set timezone to improve dovecot performance
|
||||||
|
([#584](https://github.com/chatmail/relay/pull/584))
|
||||||
|
|
||||||
- Increase nginx connection limits
|
- Increase nginx connection limits
|
||||||
([#576](https://github.com/chatmail/relay/pull/576))
|
([#576](https://github.com/chatmail/relay/pull/576))
|
||||||
|
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -255,6 +255,19 @@ This starts a local live development cycle for chatmail web pages:
|
|||||||
|
|
||||||
- Starts a browser window automatically where you can "refresh" as needed.
|
- Starts a browser window automatically where you can "refresh" as needed.
|
||||||
|
|
||||||
|
#### Custom web pages
|
||||||
|
|
||||||
|
If you want to include other pages,
|
||||||
|
they need their separate nginx config
|
||||||
|
under `/etc/nginx/sites-enabled/`.
|
||||||
|
Note that they need to listen on port 8443 instead of 443.
|
||||||
|
|
||||||
|
To request TLS certificates for the corresponding domains,
|
||||||
|
point the DNS records to your Server and run `acmetool want <domain>`.
|
||||||
|
You can find the TLS certificates under `/var/lib/acme/live`.
|
||||||
|
They will be automatically renewed.
|
||||||
|
|
||||||
|
|
||||||
## Mailbox directory layout
|
## Mailbox directory layout
|
||||||
|
|
||||||
Fresh chatmail addresses have a mailbox directory that contains:
|
Fresh chatmail addresses have a mailbox directory that contains:
|
||||||
@@ -541,3 +554,6 @@ Here are some related projects that you may be interested in:
|
|||||||
progress](https://github.com/mjl-/mox/issues/251) to modify it to support all
|
progress](https://github.com/mjl-/mox/issues/251) to modify it to support all
|
||||||
of the features and configuration settings required to operate as a chatmail
|
of the features and configuration settings required to operate as a chatmail
|
||||||
relay.
|
relay.
|
||||||
|
- [Maddy-Chatmail](https://github.com/sadraiiali/maddy_chatmail): a plugin for the
|
||||||
|
[Maddy email server](https://maddy.email/) which aims to implement the
|
||||||
|
chatmail relay features and configuration options.
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ def _install_dovecot_package(package: str, arch: str):
|
|||||||
src=url,
|
src=url,
|
||||||
dest=deb_filename,
|
dest=deb_filename,
|
||||||
sha256sum=sha256,
|
sha256sum=sha256,
|
||||||
cache_time=9999999999999, # never redownload the package
|
cache_time=60 * 60 * 24 * 365 * 10, # never redownload the package
|
||||||
)
|
)
|
||||||
|
|
||||||
apt.deb(name=f"Install dovecot-{package}", src=deb_filename)
|
apt.deb(name=f"Install dovecot-{package}", src=deb_filename)
|
||||||
@@ -410,6 +410,13 @@ def _configure_dovecot(config: Config, debug: bool = False) -> bool:
|
|||||||
persist=True,
|
persist=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
timezone_env = files.line(
|
||||||
|
name="Set TZ environment variable",
|
||||||
|
path="/etc/environment",
|
||||||
|
line="TZ=:/etc/localtime",
|
||||||
|
)
|
||||||
|
need_restart |= timezone_env.changed
|
||||||
|
|
||||||
return need_restart
|
return need_restart
|
||||||
|
|
||||||
|
|
||||||
@@ -417,6 +424,12 @@ def _configure_nginx(config: Config, debug: bool = False) -> bool:
|
|||||||
"""Configures nginx HTTP server."""
|
"""Configures nginx HTTP server."""
|
||||||
need_restart = False
|
need_restart = False
|
||||||
|
|
||||||
|
files.link(
|
||||||
|
name="disable nginx default site",
|
||||||
|
path="/etc/nginx/sites-enabled/default",
|
||||||
|
present=False,
|
||||||
|
)
|
||||||
|
|
||||||
main_config = files.template(
|
main_config = files.template(
|
||||||
src=importlib.resources.files(__package__).joinpath("nginx/nginx.conf.j2"),
|
src=importlib.resources.files(__package__).joinpath("nginx/nginx.conf.j2"),
|
||||||
dest="/etc/nginx/nginx.conf",
|
dest="/etc/nginx/nginx.conf",
|
||||||
@@ -709,9 +722,10 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
|
|||||||
packages="postfix",
|
packages="postfix",
|
||||||
)
|
)
|
||||||
|
|
||||||
_install_dovecot_package("core", host.get_fact(facts.server.Arch))
|
if not "dovecot.service" in host.get_fact(SystemdEnabled):
|
||||||
_install_dovecot_package("imapd", host.get_fact(facts.server.Arch))
|
_install_dovecot_package("core", host.get_fact(facts.server.Arch))
|
||||||
_install_dovecot_package("lmtpd", host.get_fact(facts.server.Arch))
|
_install_dovecot_package("imapd", host.get_fact(facts.server.Arch))
|
||||||
|
_install_dovecot_package("lmtpd", host.get_fact(facts.server.Arch))
|
||||||
|
|
||||||
apt.packages(
|
apt.packages(
|
||||||
name="Install nginx",
|
name="Install nginx",
|
||||||
@@ -808,8 +822,14 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
|
|||||||
name="Ensure cron is installed",
|
name="Ensure cron is installed",
|
||||||
packages=["cron"],
|
packages=["cron"],
|
||||||
)
|
)
|
||||||
git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode()
|
try:
|
||||||
git_diff = subprocess.check_output(["git", "diff"]).decode()
|
git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode()
|
||||||
|
except Exception:
|
||||||
|
git_hash = "unknown\n"
|
||||||
|
try:
|
||||||
|
git_diff = subprocess.check_output(["git", "diff"]).decode()
|
||||||
|
except Exception:
|
||||||
|
git_diff = ""
|
||||||
files.put(
|
files.put(
|
||||||
name="Upload chatmail relay git commiit hash",
|
name="Upload chatmail relay git commiit hash",
|
||||||
src=StringIO(git_hash + git_diff),
|
src=StringIO(git_hash + git_diff),
|
||||||
|
|||||||
@@ -136,4 +136,7 @@ http {
|
|||||||
return 301 $scheme://{{ config.domain_name }}$request_uri;
|
return 301 $scheme://{{ config.domain_name }}$request_uri;
|
||||||
access_log syslog:server=unix:/dev/log,facility=local7;
|
access_log syslog:server=unix:/dev/log,facility=local7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Include custom pages; they need to listen on port 8443 instead of port 443
|
||||||
|
include /etc/nginx/sites-enabled/*;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ class TestSSHExecutor:
|
|||||||
assert (now - since_date).total_seconds() < 60 * 60 * 51
|
assert (now - since_date).total_seconds() < 60 * 60 * 51
|
||||||
|
|
||||||
|
|
||||||
|
def test_timezone_env(remote):
|
||||||
|
for line in remote.iter_output("env"):
|
||||||
|
print(line)
|
||||||
|
if line == "tz=:/etc/localtime":
|
||||||
|
return True
|
||||||
|
pytest.fail("TZ is not set")
|
||||||
|
|
||||||
|
|
||||||
def test_remote(remote, imap_or_smtp):
|
def test_remote(remote, imap_or_smtp):
|
||||||
lineproducer = remote.iter_output(imap_or_smtp.logcmd)
|
lineproducer = remote.iter_output(imap_or_smtp.logcmd)
|
||||||
imap_or_smtp.connect()
|
imap_or_smtp.connect()
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ if command -v lsb_release 2>&1 >/dev/null; then
|
|||||||
echo "You need to install python3-dev for installing the other dependencies."
|
echo "You need to install python3-dev for installing the other dependencies."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if ! gcc --version 2>&1 >/dev/null
|
||||||
|
then
|
||||||
|
echo "You need to install gcc for building Python dependencies."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user