coreos-home-server/config/service/rspamd/systemd/rspamd-dkim-generate@.service
Alex Palaistras 3254ead3a7 Simplify systemd services, use volumes
This commit represents a large amount of work toward moving services to
a more standard approach to storing data, and a simplification in how
networks are managed.
2021-06-27 18:36:06 +01:00

15 lines
573 B
Desktop File

[Unit]
Description=DKIM key for %I
Wants=rspamd.service
After=rspamd.service
[Service]
Type=oneshot
ExecStartPre=/bin/podman exec rspamd install -d /var/lib/rspamd/dkim
ExecStart=/bin/podman exec rspamd openssl genrsa -out /var/lib/rspamd/dkim/%i.dkim.key 1024
ExecStartPost=/bin/podman exec rspamd chmod 644 /var/lib/rspamd/dkim/%i.dkim.key
ExecStartPost=/bin/podman exec rspamd sh -c 'echo "Public DKIM key:"; openssl rsa -in /var/lib/container-service/rspamd/dkim/%i.dkim.key -pubout -outform der 2> /dev/null | openssl base64 -A'
[Install]
WantedBy=multi-user.target