Skip to content

Instantly share code, notes, and snippets.

@agates
Created June 8, 2023 16:26
Show Gist options
  • Save agates/3a3ffe0b257ad8d542255e72dbc16cd1 to your computer and use it in GitHub Desktop.
Save agates/3a3ffe0b257ad8d542255e72dbc16cd1 to your computer and use it in GitHub Desktop.
[Unit]
After=snap.certbot.renew.service
Wants=snap.certbot.renew.service
Description=Transform example.com cert into pkcs12 format
PartOf=snap.certbot.renew.service
[Service]
Type=oneshot
ExecStart=/usr/bin/openssl pkcs12 -export -out /home/user/config/certificate.p12 -inkey /etc/letsencrypt/live/example.com/privkey.pem -in /etc/letsencrypt/live/example.com/cert.pem -certfile /etc/letsencrypt/live/example.com/chain.pem -passout pass:
ExecStartPost=/bin/chown appuser:users /home/user/config/certificate.p12
PrivateTmp=true
[Install]
WantedBy=snap.certbot.renew.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment