1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Install the proper rspamd modules on top of Alpine

This commit is contained in:
kaiyou 2017-11-10 14:48:13 +01:00
parent ac0c339aa8
commit 3675fdb915
12 changed files with 24 additions and 22 deletions

View File

@ -1,9 +1,10 @@
FROM alpine:edge FROM alpine:edge
RUN apk add --no-cache rspamd ca-certificates RUN apk add --no-cache python py-jinja2 rspamd rspamd-controller rspamd-proxy ca-certificates
RUN mkdir /run/rspamd RUN mkdir /run/rspamd
COPY conf/ /etc/rspamd COPY conf/ /conf
COPY start.py /start.py
CMD ["rspamd", "-i", "-f"] CMD /start.py

View File

@ -1,11 +0,0 @@
worker {
bind_socket = "*:11334";
type = "controller";
count = 1;
password = "mailu";
secure_ip = "127.0.0.1";
secure_ip = "::1";
static_dir = "${WWWDIR}";
.include(try=true; priority=1) "$LOCAL_CONFDIR/local.d/worker-controller.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc"
}

View File

@ -0,0 +1,3 @@
bind_socket = "*:11334";
password = "mailu";
secure_ip = "{{ FRONT_ADDRESS }}";

View File

@ -1,5 +0,0 @@
worker "rspamd_proxy" {
bind_socket = "*:11332";
.include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-proxy.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-proxy.inc"
}

View File

@ -1,7 +1,4 @@
bind_socket = "*:11332"; bind_socket = "*:11332";
type = "proxy";
milter = yes;
timeout = 120s;
upstream "local" { upstream "local" {
default = yes; default = yes;
self_scan = yes; self_scan = yes;

17
services/rspamd/start.py Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/python
import jinja2
import os
import socket
import glob
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
# Actual startup script
os.environ["FRONT_ADDRESS"] = socket.gethostbyname("front")
for rspamd_file in glob.glob("/conf/*"):
convert(rspamd_file, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
# Run rspamd
os.execv("/usr/sbin/rspamd", ["rspamd", "-i", "-f"])