summarylogtreecommitdiffstats
path: root/cloudreve.service
diff options
context:
space:
mode:
Diffstat (limited to 'cloudreve.service')
-rw-r--r--cloudreve.service32
1 files changed, 32 insertions, 0 deletions
diff --git a/cloudreve.service b/cloudreve.service
new file mode 100644
index 000000000000..2694ef264066
--- /dev/null
+++ b/cloudreve.service
@@ -0,0 +1,32 @@
+[Unit]
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+Type=simple
+User=cloudreve
+Restart=on-faliure
+RestartSec=3
+ExecStartPre=cp /usr/lib/cloudreve/cloudreve /var/lib/cloudreve/cr
+ExecStart=/var/lib/cloudreve/cr -c /etc/cloudreve/config.ini
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+WorkingDirectory=/var/lib/cloudreve
+RuntimeDirectory=cloudreve
+ProtectHome=true
+ProtectSystem=strict
+ReadWritePaths=/etc/cloudreve
+ReadWritePaths=/var/lib/cloudreve
+NoNewPrivileges=true
+ProtectKernelTunables=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+MemoryDenyWriteExecute=true
+ProtectClock=true
+RestrictRealtime=true
+PrivateDevices=true
+PrivateTmp=true
+ProtectHostname=true
+
+[Install]
+WantedBy=multi-user.target