[Unit]
Description=Anastasis key recovery backend
After=postgresql.service network.target
Requires=anastasis-httpd.socket

[Service]
User=anastasis-httpd
Type=simple
Restart=always
RestartMode=direct
RestartSec=1s
RestartPreventExitStatus=9

# Disable the service if more than 5 restarts are encountered within 5s.
# These are usually the systemd defaults, but can be overwritten, thus we set
# them here explicitly, as the exchange code assumes StartLimitInterval
# to be >=5s.
StartLimitBurst=5
StartLimitInterval=5s

ExecStart=/usr/bin/anastasis-httpd -c /etc/anastasis/anastasis.conf -L INFO
EnvironmentFile=/etc/anastasis/anastasis.env

RuntimeMaxSec=3600s
StandardOutput=journal
StandardError=journal
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full

[Install]
WantedBy=multi-user.target
