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:
parent
ac0c339aa8
commit
3675fdb915
@ -1,9 +1,10 @@
|
||||
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
|
||||
|
||||
COPY conf/ /etc/rspamd
|
||||
COPY conf/ /conf
|
||||
COPY start.py /start.py
|
||||
|
||||
CMD ["rspamd", "-i", "-f"]
|
||||
CMD /start.py
|
||||
|
@ -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"
|
||||
}
|
3
services/rspamd/conf/worker-controller.inc
Normal file
3
services/rspamd/conf/worker-controller.inc
Normal file
@ -0,0 +1,3 @@
|
||||
bind_socket = "*:11334";
|
||||
password = "mailu";
|
||||
secure_ip = "{{ FRONT_ADDRESS }}";
|
@ -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"
|
||||
}
|
@ -1,7 +1,4 @@
|
||||
bind_socket = "*:11332";
|
||||
type = "proxy";
|
||||
milter = yes;
|
||||
timeout = 120s;
|
||||
upstream "local" {
|
||||
default = yes;
|
||||
self_scan = yes;
|
17
services/rspamd/start.py
Executable file
17
services/rspamd/start.py
Executable 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"])
|
Loading…
Reference in New Issue
Block a user