Correction : vm_remote : uniformise rule_runit_configure avec vm_hosted .
[lhc/ateliers.git] / etc / sv / dovecot / remote.sh
diff --git a/etc/sv/dovecot/remote.sh b/etc/sv/dovecot/remote.sh
new file mode 100644 (file)
index 0000000..0de2eaa
--- /dev/null
@@ -0,0 +1,14 @@
+rule _x509_site_key_decrypt imap."$vm_domainname" |
+rule ssh -l root ' \
+       sudo install -d -m 770 -o root -g root \
+        /etc/dovecot/'"$vm_domainname"'/ \
+        /etc/dovecot/'"$vm_domainname"'/imap \
+        /etc/dovecot/'"$vm_domainname"'/imap/x509 ; \
+       sudo install -m 644 -o root -g root /dev/stdin \
+        /etc/dovecot/'"$vm_domainname"'/imap/x509/.gitignore <<-EOF
+               key.pem
+               EOF
+       sudo install -m 400 -o root -g root \
+        /dev/stdin \
+        /etc/dovecot/"$vm_domainname"/imap/x509/key.pem
+ '