gentoo-ebuilds/app-admin/vaultwarden/files/vaultwarden-1.33.2.service
Rahil Bhimjiani ca1b0dc5d7
app-admin/vaultwarden: Unofficial Bitwarden compatible server in Rust
Explaination of some design decisions:
* Icon cache folder & tmp folder paths have been changed from default
  /var/cache/... & /tmp/... respectively so that backing up
  /var/lib/vaultwarden backs up everything needed minus extra
  fluff. Also having them at linux standard locations allow users to
  take advantage of tmpfs on /tmp and other fine tunings.
* USE +web pulls in dependency www-apps/vaultwarden-web instead of just
  downloading tarball conditionally because sometimes only web frontend gets
  updated but not backend. So it doesn't make sense to recompile
  backend (rust package which takes ~20 minutes to compile) just to
  update frontend (*js, *css, *html files)

Thanks Fabian Groffen <grobian@gentoo.org> for taking interest &
good suggestions

Closes: https://github.com/gentoo/gentoo/pull/41864
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2025-06-01 10:56:57 +02:00

45 lines
949 B
Desktop File

[Unit]
Description=Vaultwarden, unofficial Bitwarden compatible password manager
Documentation=https://github.com/dani-garcia/vaultwarden
After=network.target
Wants=network.target
[Service]
Environment=ENV_FILE=/etc/%N/%N.conf
ExecStart=/usr/bin/%N
WorkingDirectory=/var/lib/%N
User=%N
Group=%N
UMask=0027
# Sandboxing and hardening systemd.exec(5)
PrivateUsers=yes
ProtectClock=yes
ProtectHostname=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
RestrictNamespaces=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
RestrictSUIDSGID=yes
RemoveIPC=yes
RestrictRealtime=yes
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
# set entire file system to read only except following paths
ProtectSystem=strict
ReadWritePaths=/var/lib/%N -/var/log/%N.log
CacheDirectory=%N
# Set reasonable connection and process limits
LimitNOFILE=1048576
LimitNPROC=64
[Install]
WantedBy=multi-user.target