2016-11-07 00:54:32 +01:00
|
|
|
[Unit]
|
2016-12-28 21:52:19 +01:00
|
|
|
Description=Rest Server
|
2016-11-07 00:54:32 +01:00
|
|
|
After=syslog.target
|
|
|
|
After=network.target
|
2023-07-13 18:28:33 +02:00
|
|
|
Requires=rest-server.socket
|
|
|
|
After=rest-server.socket
|
2021-08-09 16:06:35 +02:00
|
|
|
|
2016-11-07 00:54:32 +01:00
|
|
|
[Service]
|
|
|
|
Type=simple
|
2021-05-31 11:39:29 +01:00
|
|
|
# You may prefer to use a different user or group on your system.
|
2016-11-07 00:54:32 +01:00
|
|
|
User=www-data
|
|
|
|
Group=www-data
|
2020-09-13 14:04:21 +02:00
|
|
|
ExecStart=/usr/local/bin/rest-server --path /path/to/backups
|
2016-11-07 00:54:32 +01:00
|
|
|
Restart=always
|
|
|
|
RestartSec=5
|
2021-05-31 11:39:29 +01:00
|
|
|
|
|
|
|
# The following options are available (in systemd v247) to restrict the
|
|
|
|
# actions of the rest-server.
|
|
|
|
|
|
|
|
# As a whole, the purpose of these are to provide an additional layer of
|
|
|
|
# security by mitigating any unknown security vulnerabilities which may exist
|
|
|
|
# in rest-server or in the libraries, tools and operating system components
|
|
|
|
# which it relies upon.
|
|
|
|
|
|
|
|
# IMPORTANT!
|
|
|
|
# The following line must be customised to your individual requirements.
|
|
|
|
ReadWritePaths=/path/to/backups
|
|
|
|
|
2025-02-17 22:40:32 +01:00
|
|
|
# Set to `UMask=007` and pass `--group-accessible-repos` to rest-server to
|
|
|
|
# make created files group-readable
|
|
|
|
UMask=077
|
2016-11-07 00:54:32 +01:00
|
|
|
|
2021-05-31 11:39:29 +01:00
|
|
|
# If your system doesn't support all of the features below (e.g. because of
|
|
|
|
# the use of an older version of systemd), you may wish to comment-out
|
|
|
|
# some of the lines below as appropriate.
|
2021-04-02 19:45:37 +01:00
|
|
|
CapabilityBoundingSet=
|
|
|
|
LockPersonality=true
|
|
|
|
MemoryDenyWriteExecute=true
|
2020-09-13 14:04:21 +02:00
|
|
|
NoNewPrivileges=yes
|
2023-07-13 18:28:33 +02:00
|
|
|
|
|
|
|
# As the listen socket is created by systemd via the rest-server.socket unit, it is
|
|
|
|
# no longer necessary for rest-server to have access to the host network namespace.
|
|
|
|
PrivateNetwork=yes
|
|
|
|
|
2020-09-13 14:04:21 +02:00
|
|
|
PrivateTmp=yes
|
2021-04-02 19:45:37 +01:00
|
|
|
PrivateDevices=true
|
|
|
|
PrivateUsers=true
|
2020-09-13 14:04:21 +02:00
|
|
|
ProtectSystem=strict
|
|
|
|
ProtectHome=yes
|
2021-04-02 19:45:37 +01:00
|
|
|
ProtectClock=true
|
|
|
|
ProtectControlGroups=true
|
|
|
|
ProtectKernelLogs=true
|
|
|
|
ProtectKernelModules=true
|
|
|
|
ProtectKernelTunables=true
|
|
|
|
ProtectProc=invisible
|
|
|
|
ProtectHostname=true
|
|
|
|
RemoveIPC=true
|
|
|
|
RestrictNamespaces=true
|
2023-07-13 18:28:33 +02:00
|
|
|
RestrictAddressFamilies=none
|
2021-04-02 19:45:37 +01:00
|
|
|
RestrictSUIDSGID=true
|
|
|
|
RestrictRealtime=true
|
2023-02-01 00:10:46 +01:00
|
|
|
# if your service crashes with "code=killed, status=31/SYS", you probably tried to run linux_i386 (32bit) binary on a amd64 host
|
2021-04-02 19:45:37 +01:00
|
|
|
SystemCallArchitectures=native
|
|
|
|
SystemCallFilter=@system-service
|
2020-09-13 14:04:21 +02:00
|
|
|
|
2021-05-31 11:40:11 +01:00
|
|
|
# Additionally, you may wish to use some of the systemd options documented in
|
|
|
|
# systemd.resource-control(5) to limit the CPU, memory, file-system I/O and
|
|
|
|
# network I/O that the rest-server is permitted to consume according to the
|
|
|
|
# individual requirements of your installation.
|
|
|
|
#CPUQuota=25%
|
2023-01-21 21:43:56 -05:00
|
|
|
#MemoryHigh=bytes
|
2021-05-31 11:40:11 +01:00
|
|
|
#MemoryMax=bytes
|
|
|
|
#MemorySwapMax=bytes
|
|
|
|
#TasksMax=N
|
|
|
|
#IOReadBandwidthMax=device bytes
|
|
|
|
#IOWriteBandwidthMax=device bytes
|
|
|
|
#IOReadIOPSMax=device IOPS, IOWriteIOPSMax=device IOPS
|
|
|
|
#IPAccounting=true
|
|
|
|
#IPAddressAllow=
|
|
|
|
|
2016-11-07 00:54:32 +01:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|