You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
677 B
Python
23 lines
677 B
Python
6 years ago
|
#!/usr/bin/python3
|
||
7 years ago
|
|
||
|
import os
|
||
|
import glob
|
||
6 years ago
|
import logging as log
|
||
|
import sys
|
||
5 years ago
|
from socrate import system, conf
|
||
7 years ago
|
|
||
6 years ago
|
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
|
||
6 years ago
|
|
||
|
# Actual startup script
|
||
6 years ago
|
|
||
5 years ago
|
os.environ["REDIS_ADDRESS"] = system.get_host_address_from_environment("REDIS", "redis")
|
||
6 years ago
|
|
||
5 years ago
|
if os.environ.get("ANTIVIRUS") == 'clamav':
|
||
5 years ago
|
os.environ["ANTIVIRUS_ADDRESS"] = system.get_host_address_from_environment("ANTIVIRUS", "antivirus:3310")
|
||
7 years ago
|
|
||
|
for rspamd_file in glob.glob("/conf/*"):
|
||
5 years ago
|
conf.jinja(rspamd_file, os.environ, os.path.join("/etc/rspamd/local.d", os.path.basename(rspamd_file)))
|
||
7 years ago
|
|
||
|
# Run rspamd
|
||
|
os.execv("/usr/sbin/rspamd", ["rspamd", "-i", "-f"])
|