summaryrefslogtreecommitdiff
path: root/app-admin/vaultwarden/files/vaultwarden.service
blob: 4b6cbfc32341ae7de13ba01789afe170160c29a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[Unit]
Description=Unofficial Bitwarden compatible server written in Rust
Documentation=https://github.com/dani-garcia/vaultwarden
After=network.target mariadb.service mysqld.service postgresql.service

[Service]
ExecStart=/usr/bin/vaultwarden
WorkingDirectory=/var/lib/vaultwarden
User=vaultwarden
Group=vaultwarden

# Allow vaultwarden to bind ports in the range of 0-1024
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE

NoNewPrivileges=yes

LimitNOFILE=1048576
UMask=0077
LimitNPROC=64

ProtectSystem=strict
ProtectHome=true
ReadWriteDirectories=/var/lib/vaultwarden
PrivateUsers=yes
PrivateTmp=true
PrivateDevices=true
ProtectHostname=yes
ProtectClock=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
RemoveIPC=yes

SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
SystemCallArchitectures=native

Environment="WEB_VAULT_FOLDER=/usr/share/vaultwarden-web-vault/htdocs"
EnvironmentFile=/etc/vaultwarden.env

[Install]
WantedBy=multi-user.target