[Unit]
Description=SoftEther VPN Server
After=network.target auditd.service
ConditionPathExists=!@DIR@/softether/vpnserver/do_not_run

[Service]
Type=forking
TasksMax=16777216
EnvironmentFile=-@DIR@/softether/vpnserver
ExecStart=@DIR@/softether/vpnserver/vpnserver start
ExecStop=@DIR@/softether/vpnserver/vpnserver stop
KillMode=process
Restart=on-failure

# Hardening
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=full
ReadOnlyDirectories=/
ReadWriteDirectories=-@DIR@/softether/vpnserver
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYSLOG CAP_SETUID

[Install]
WantedBy=multi-user.target