Browse Source

Updated milter-sasl

tags/v2.0.0
Robin Thoni 1 year ago
parent
commit
d3b6f5f3e4

+ 13
- 19
milter-sasl/Dockerfile View File

@@ -1,30 +1,24 @@
1
-FROM debian:jessie
2
-
3
-MAINTAINER Robin Thoni <robin@rthoni.com>
1
+FROM debian:stretch as builder
4 2
 
5 3
 RUN apt-get update &&\
6
-    apt-get install -y gcc g++ cmake libssl-dev libjsoncpp-dev libmilter-dev git &&\
4
+    apt-get install -y gcc g++ cmake libssl-dev libjsoncpp-dev libmilter-dev wget unzip &&\
7 5
     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8 6
 
9
-RUN git clone https://git.rthoni.com/robin.thoni/milter-sasl &&\
7
+RUN wget https://git.rthoni.com/robin.thoni/milter-sasl/archive/v1.0.0.zip -O milter-sasl.zip &&\
8
+    unzip milter-sasl.zip &&\
10 9
     cd milter-sasl &&\
11 10
     mkdir build && cd build &&\
12
-    cmake .. && make &&\
13
-    cp src/milter-sasl /usr/local/bin
14
-
15
-RUN rm -rf /var/log/* &&\
16
-    mkfifo /var/log/syslog &&\
17
-    ln -s /dev/null /var/log/mail.log &&\
18
-    ln -s /dev/null /var/log/mail.err &&\
19
-    ln -s /dev/null /var/log/main.info &&\
20
-    ln -s /dev/null /var/log/messages
11
+    cmake .. && make
21 12
 
22
-COPY ./config /etc/milter-sasl/
13
+FROM debian:stretch
23 14
 
24
-COPY ./vars-vars /etc/vars-vars
15
+ADD https://raw.githubusercontent.com/docker-gcf/docker-gcf/v1.5.0/setup.sh /tmp/docker-utils-setup.sh
16
+RUN sh /tmp/docker-utils-setup.sh
17
+ENTRYPOINT ["gcf-entrypoint"]
18
+CMD ["milter-sasl"]
25 19
 
26
-COPY ./vars-files /etc/vars-files
20
+RUN pkgs-install libjsoncpp1 libmilter1.0.1
27 21
 
28
-COPY ./run.sh /run.sh
22
+COPY --from=builder /milter-sasl/build/src/milter-sasl /usr/local/bin/
29 23
 
30
-CMD ["/run.sh"]
24
+COPY ./config /etc/salt/base/

+ 0
- 4
milter-sasl/config/milter-sasl.json View File

@@ -1,4 +0,0 @@
1
-{
2
-  "key": "your key here",
3
-  "socket": "inet:MILTER_SASL_PORT@0.0.0.0"
4
-}

+ 9
- 0
milter-sasl/config/states/milter-sasl/init.sls View File

@@ -0,0 +1,9 @@
1
+milter-sasl-config-dir:
2
+  file.directory:
3
+    - name: /etc/milter-sasl/
4
+
5
+milter-sasl-config:
6
+  file.managed:
7
+    - name: /etc/milter-sasl/milter-sasl.json
8
+    - source: salt://milter-sasl/milter-sasl.json
9
+    - template: jinja

+ 4
- 0
milter-sasl/config/states/milter-sasl/milter-sasl.json View File

@@ -0,0 +1,4 @@
1
+{
2
+  "key": "{{ salt['pillar.get']('model:milterSasl:key') }}",
3
+  "socket": "inet:{{ salt['pillar.get']('model:milterSasl:port') }}@0.0.0.0"
4
+}

+ 0
- 29
milter-sasl/run.sh View File

@@ -1,29 +0,0 @@
1
-#! /usr/bin/env bash
2
-
3
-replace_var()
4
-{
5
-  file="${1}"
6
-  var="${2}"
7
-  sed -e "s?${var}?${!var}?g" -i "${file}"
8
-}
9
-
10
-replace_vars()
11
-{
12
-  file="${1}"
13
-  for var in $(cat /etc/vars-vars)
14
-  do
15
-    replace_var "${file}" "${var}"
16
-  done
17
-}
18
-
19
-replace_files()
20
-{
21
-  for file in $(cat /etc/vars-files)
22
-  do
23
-    replace_vars "${file}"
24
-  done
25
-}
26
-
27
-replace_files
28
-
29
-milter-sasl

+ 0
- 1
milter-sasl/vars-files View File

@@ -1 +0,0 @@
1
-/etc/milter-sasl/milter-sasl.json

+ 0
- 23
milter-sasl/vars-vars View File

@@ -1,23 +0,0 @@
1
-POSTGRES_HOST
2
-POSTGRES_USER
3
-POSTGRES_PASSWORD
4
-POSTGRES_DB
5
-
6
-MAIL_DOMAIN
7
-MAIL_HOSTNAME
8
-
9
-DOVECOT_HOST
10
-DOVECOT_SASL_PORT
11
-DOVECOT_LMTP_PORT
12
-
13
-POSTFIX_HOST
14
-
15
-OPENDKIM_HOST
16
-OPENDKIM_PORT
17
-
18
-MILTER_SASL_HOST
19
-MILTER_SASL_PORT
20
-
21
-EXIM_SMARTHOST_HOST
22
-EXIM_SMARTHOST_USER
23
-EXIM_SMARTHOST_PASSWORD

Loading…
Cancel
Save