Skip to content

Commit 1e7aca4

Browse files
committed
feat(dhparam): optional generation of Diffie-Hellman Parameters
1 parent 73b0c14 commit 1e7aca4

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,8 @@ Available states
3737
------------
3838

3939
Installs and configures the dovecot package, and ensures that the associated dovecot service is running.
40+
41+
``dovecot.dh``
42+
--------------
43+
44+
Creates Diffie-Hellman Parameters at the path defined in Pillar `dovecot:ssl:dhparam:path`.

dovecot/dh.sls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{%- from "dovecot/map.jinja" import dovecot with context %}
2+
3+
dovecot-dh-create-dhparam-file:
4+
cmd.run:
5+
- name: "openssl dhparam {{ dovecot.ssl.dhparam.numbits }} > {{ dovecot.ssl.dhparam.path }}"
6+
- creates: {{ dovecot.ssl.dhparam.path }}
7+
- watch_in:
8+
- service: dovecot_service

dovecot/map.jinja

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
'ssl_certs_dir': '/usr/local/etc/ssl/certs',
7878
'ssl_keys_dir': '/usr/local/etc/ssl/private',
7979
},
80+
'ssl': {
81+
'dhparam': {
82+
'path': '/usr/local/etc/dovecot/dh.pem',
83+
'numbits': 2048
84+
}
85+
},
8086
'packages': ['dovecot'],
8187
'root_group': 'wheel',
8288
},
@@ -93,6 +99,12 @@
9399
'ssl_certs_dir': '/etc/ssl/private',
94100
'ssl_keys_dir': '/etc/ssl/private',
95101
},
102+
'ssl': {
103+
'dhparam': {
104+
'path': '/etc/dovecot/dh.pem',
105+
'numbits': 2048
106+
}
107+
},
96108
'packages': ['dovecot-core','dovecot-imapd'],
97109
'root_group': 'root',
98110
},

pillar.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ dovecot:
55
lookup:
66
enable_service_control: True
77
service_persistent: True
8+
ssl:
9+
dhparam:
10+
path: /etc/dovecot/dh.pem
11+
numbits: 2048
812
config:
913
local: |
1014
# main

0 commit comments

Comments
 (0)