gentoo-ebuilds/app-admin/vaultwarden/files/vaultwarden-envfile-1.33.2.patch
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

49 lines
1.5 KiB
Diff

As upstream defaults create directories where binary is executed (/usr/bin/), this patch is needed to change paths to Gentoo specific locations
--- a/.env.template
+++ b/.env.template
@@ -5,24 +5,20 @@
## Be aware that most of these settings will be overridden if they were changed
## in the admin interface. Those overrides are stored within DATA_FOLDER/config.json .
##
-## By default, Vaultwarden expects for this file to be named ".env" and located
-## in the current working directory. If this is not the case, the environment
-## variable ENV_FILE can be set to the location of this file prior to starting
-## Vaultwarden.
####################
### Data folders ###
####################
## Main data folder
-# DATA_FOLDER=data
+DATA_FOLDER=/var/lib/vaultwarden
## Individual folders, these override %DATA_FOLDER%
# RSA_KEY_FILENAME=data/rsa_key
-# ICON_CACHE_FOLDER=data/icon_cache
+ICON_CACHE_FOLDER=/var/cache/vaultwarden/icon_cache
# ATTACHMENTS_FOLDER=data/attachments
# SENDS_FOLDER=data/sends
-# TMP_FOLDER=data/tmp
+TMP_FOLDER=/tmp/vaultwarden
## Templates data folder, by default uses embedded templates
## Check source code to see the format
@@ -31,7 +27,7 @@
# RELOAD_TEMPLATES=false
## Web vault settings
-# WEB_VAULT_FOLDER=web-vault/
+WEB_VAULT_FOLDER=/usr/share/webapps/vaultwarden-web
# WEB_VAULT_ENABLED=true
#########################
@@ -371,7 +367,7 @@
# USE_SYSLOG=false
## Logging to file
-# LOG_FILE=/path/to/log
+LOG_FILE=/var/log/vaultwarden.log
## Log level
## Change the verbosity of the log output