mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-09 15:13:31 -04:00
app-admin/vaultwarden: treeclean, promoted to ::gentoo
Signed-off-by: Vivian Heisz (vhz) <demize@unstable.systems>
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
DIST vaultwarden-1.33.2-deps.tar.xz 55221392 BLAKE2B e3fc484ef3c1608332130498721240e968b83b9c80e10a139623780dbe6b46d4fa3f75ce926175f5d708e831ab6c211a10e55b5cf4b7cbeae496818a1de1a226 SHA512 2f15d3c4d404efc23afa602b00eb003d067c380d0a84e7bfc03345054340dade54005064b80a9e04e63965751d6be9f631142547ccbb16952bb204d6cd206f8b
|
||||
DIST vaultwarden-1.33.2-docs.tar.xz 75976 BLAKE2B 398487cb7c9b50f5bd60a43e4e2324da0cc4d7757ba0b341142aa18531887267324659a9b874309ef09149bb8f5f0758942ea2a619a6995a5dc663873f3d626f SHA512 e7d7c1c7a0171e714b237eddb0a0c52f941e281e330f984557bd01dd04b4e0fb01f60ced4fec385cb736c415946c09170706d86422706ab2776db45f08500199
|
||||
DIST vaultwarden-1.33.2.tar.gz 638237 BLAKE2B 515c8c6ec4ca6d6347f421057bbc8b1509ae789fb8ac88189dffe0380a2034bee8d87660de8b8cab94c710fa1de0ff5d897da48d0077f82d1c0463f977b4afe2 SHA512 51f1d431794f2b4bf1f3b70a66f3fc9329cf74732201faaa0948ac0025f1384a486d0a5c757506068ea822f13c6c5bf10429cfe1a291e4bb154bc2332aba778d
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
set -a && . ../"${RC_SVCNAME}".env && set +a
|
||||
|
||||
name="Vaultwarden"
|
||||
description="Unofficial Bitwarden compatible password manager server in Rust"
|
||||
command="/usr/bin/${RC_SVCNAME}"
|
||||
command_user="${RC_SVCNAME}:${RC_SVCNAME}"
|
||||
command_background="true"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
output_log="/var/log/${RC_SVCNAME}.log"
|
||||
error_log="/var/log/${RC_SVCNAME}.log"
|
||||
directory="${DATA_FOLDER:-/var/lib/${RC_SVCNAME}}"
|
||||
umask=0027
|
||||
|
||||
depend() {
|
||||
after net
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
[Unit]
|
||||
Description=Vaultwarden, password manager server writen in Rust
|
||||
Documentation=https://github.com/dani-garcia/vaultwarden
|
||||
|
||||
After=network.target
|
||||
Wants=network.target
|
||||
|
||||
After=mariadb.service
|
||||
Wants=mariadb.service
|
||||
|
||||
After=mysqld.service
|
||||
Wants=mysqld.service
|
||||
|
||||
After=postgresql-12.service postgresql-13.service postgresql-14.service postgresql-15.service postgresql-16.service
|
||||
Wants=postgresql-12.service postgresql-13.service postgresql-14.service postgresql-15.service postgresql-16.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/%N.env
|
||||
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 ReadWritePaths
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=/var/lib/%N /var/log/%N.log
|
||||
|
||||
# Set reasonable connection and process limits
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=64
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,54 +0,0 @@
|
||||
--- a/.env.template
|
||||
+++ b/.env.template
|
||||
@@ -15,24 +15,24 @@
|
||||
####################
|
||||
|
||||
## 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
|
||||
-# ATTACHMENTS_FOLDER=data/attachments
|
||||
-# SENDS_FOLDER=data/sends
|
||||
-# TMP_FOLDER=data/tmp
|
||||
+# RSA_KEY_FILENAME=/var/lib/vaultwarden/rsa_key
|
||||
+# ICON_CACHE_FOLDER=/var/lib/vaultwarden/icon_cache
|
||||
+# ATTACHMENTS_FOLDER=/var/lib/vaultwarden/attachments
|
||||
+# SENDS_FOLDER=/var/lib/vaultwarden/sends
|
||||
+# TMP_FOLDER=/var/lib/vaultwarden/tmp
|
||||
|
||||
## Templates data folder, by default uses embedded templates
|
||||
## Check source code to see the format
|
||||
-# TEMPLATES_FOLDER=data/templates
|
||||
+# TEMPLATES_FOLDER=/var/lib/vaultwarden/templates
|
||||
## Automatically reload the templates for every request, slow, use only for development
|
||||
# RELOAD_TEMPLATES=false
|
||||
|
||||
## Web vault settings
|
||||
-# WEB_VAULT_FOLDER=web-vault/
|
||||
-# WEB_VAULT_ENABLED=true
|
||||
+WEB_VAULT_FOLDER=/usr/share/webapps/vaultwarden-web
|
||||
+WEB_VAULT_ENABLED=false
|
||||
|
||||
#########################
|
||||
### Database settings ###
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
## Database URL
|
||||
## When using SQLite, this is the path to the DB file, default to %DATA_FOLDER%/db.sqlite3
|
||||
-# DATABASE_URL=data/db.sqlite3
|
||||
+# DATABASE_URL=/var/lib/vaultwarden/db.sqlite3
|
||||
## When using MySQL, specify an appropriate connection URI.
|
||||
## Details: https://docs.diesel.rs/2.1.x/diesel/mysql/struct.MysqlConnection.html
|
||||
# DATABASE_URL=mysql://user:password@host[:port]/database_name
|
||||
@@ -361,7 +361,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
|
||||
@@ -1,5 +0,0 @@
|
||||
# Fields: type; path; mode; uid; gid; age; argument
|
||||
# tmpfiled.d(5)
|
||||
d /var/lib/vaultwarden 0750 vaultwarden vaultwarden
|
||||
d /var/lib/vaultwarden/tmp 0750 vaultwarden vaultwarden 1d
|
||||
f /var/log/vaultwarden.log 0640 vaultwarden vaultwarden
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>me@rahil.rocks</email>
|
||||
<name>Rahil Bhimjiani</name>
|
||||
</maintainer>
|
||||
<maintainer type="person">
|
||||
<email>julien@jroy.ca</email>
|
||||
<name>Julien Roy</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="cli">
|
||||
Install client with the Command-Line Interface
|
||||
</flag>
|
||||
<flag name="web">
|
||||
Install client with Web UI
|
||||
</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
<remote-id type="github">dani-garcia/vaultwarden</remote-id>
|
||||
<bugs-to>https://github.com/dani-garcia/vaultwarden/issues</bugs-to>
|
||||
<doc>https://github.com/dani-garcia/vaultwarden/blob/main/README.md</doc>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
@@ -1,133 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cargo check-reqs readme.gentoo-r1 systemd tmpfiles
|
||||
|
||||
DESCRIPTION="Unofficial Bitwarden compatible password manager server written in Rust"
|
||||
HOMEPAGE="https://github.com/dani-garcia/vaultwarden"
|
||||
|
||||
if [[ ${PV} == 9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/dani-garcia/vaultwarden.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/dani-garcia/vaultwarden/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
|
||||
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
|
||||
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/wiki.tar.xz -> ${P}-docs.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="AGPL-3"
|
||||
# Dependent crate licenses
|
||||
LICENSE+=" 0BSD Apache-2.0 BSD ISC MIT MPL-2.0 Unicode-3.0"
|
||||
|
||||
SLOT="0"
|
||||
IUSE="cli mysql postgres +sqlite web"
|
||||
REQUIRED_USE="|| ( mysql postgres sqlite )"
|
||||
|
||||
RDEPEND="
|
||||
acct-user/vaultwarden
|
||||
acct-group/vaultwarden
|
||||
dev-libs/openssl:=
|
||||
cli? ( app-admin/bitwarden-cli-bin )
|
||||
mysql? ( dev-db/mysql-connector-c:= )
|
||||
postgres? ( dev-db/postgresql:* )
|
||||
sqlite? ( dev-db/sqlite:3 )
|
||||
web? ( www-apps/vaultwarden-web-bin )
|
||||
"
|
||||
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="virtual/pkgconfig"
|
||||
|
||||
QA_FLAGS_IGNORED="usr/bin/${PN}"
|
||||
QA_PRESTRIPPED="usr/bin/${PN}"
|
||||
ECARGO_VENDOR="${WORKDIR}/vendor"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/vaultwarden-envfile-1.30.3.patch
|
||||
)
|
||||
|
||||
CHECKREQS_MEMORY=3G
|
||||
CHECKREQS_DISK_BUILD=2G
|
||||
|
||||
DOC_CONTENTS="\n
|
||||
Configuration file: /etc/${PN}.env\n
|
||||
Data directory: /var/lib/${PN}\n
|
||||
\n
|
||||
MySQL & PostgreSQL users must set DATABASE_URL in config\n
|
||||
\n
|
||||
Default server: http://0.0.0.0:8000\n
|
||||
Admin interface: http://0.0.0.0:8000/admin
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
check-reqs_pkg_setup
|
||||
rust_pkg_setup
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999* ]]; then
|
||||
# clone vaultwarden
|
||||
git-r3_src_unpack
|
||||
|
||||
# clone vaultwarden.wiki
|
||||
EGIT_REPO_URI="https://github.com/dani-garcia/vaultwarden.wiki.git"
|
||||
EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}.wiki"
|
||||
git-r3_src_unpack
|
||||
|
||||
cargo_live_src_unpack
|
||||
else
|
||||
cargo_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
if [[ ${PV} != 9999* ]]; then
|
||||
cat <<-'EOF' >> "${ECARGO_HOME}"/config.toml || die
|
||||
[source."git+https://github.com/BlackDex/yubico-rs?rev=00df14811f58155c0f02e3ab10f1570ed3e115c6"]
|
||||
git = "https://github.com/BlackDex/yubico-rs"
|
||||
rev = "00df14811f58155c0f02e3ab10f1570ed3e115c6"
|
||||
replace-with = "gentoo"
|
||||
EOF
|
||||
fi
|
||||
use web && { sed -i -e 's|^WEB_VAULT_ENABLED=false|WEB_VAULT_ENABLED=true|g;' .env.template || die; }
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local myfeatures=(
|
||||
$(usev sqlite)
|
||||
$(usev mysql)
|
||||
$(usev postgres postgresql )
|
||||
)
|
||||
cargo_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# https://github.com/dani-garcia/vaultwarden/blob/main/build.rs
|
||||
[[ ${PV} != 9999* ]] && export VW_VERSION="${PV}"
|
||||
cargo_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin "$(cargo_target_dir)/${PN}"
|
||||
systemd_newunit "${FILESDIR}"/vaultwarden-1.30.3.service "${PN}".service
|
||||
newinitd "${FILESDIR}"/vaultwarden-1.30.3.initd "${PN}"
|
||||
newtmpfiles "${FILESDIR}"/vaultwarden-tmpfiles-1.30.3.conf "${PN}".conf
|
||||
insinto /etc
|
||||
newins .env.template "${PN}".env
|
||||
dosym -r /etc/"${PN}".env /etc/conf.d/"${PN}"
|
||||
keepdir /var/lib/"${PN}"
|
||||
|
||||
readme.gentoo_create_doc
|
||||
einstalldocs
|
||||
dodoc -r ../"${PN}".wiki/*
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
tmpfiles_process "${PN}".conf
|
||||
readme.gentoo_print_elog
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit cargo check-reqs readme.gentoo-r1 systemd tmpfiles
|
||||
|
||||
DESCRIPTION="Unofficial Bitwarden compatible password manager server written in Rust"
|
||||
HOMEPAGE="https://github.com/dani-garcia/vaultwarden"
|
||||
|
||||
if [[ ${PV} == 9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/dani-garcia/vaultwarden.git"
|
||||
else
|
||||
SRC_URI="
|
||||
https://github.com/dani-garcia/vaultwarden/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
|
||||
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/deps.tar.xz -> ${P}-deps.tar.xz
|
||||
https://github.com/rahilarious/gentoo-distfiles/releases/download/${P}/wiki.tar.xz -> ${P}-docs.tar.xz
|
||||
"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
LICENSE="AGPL-3"
|
||||
# Dependent crate licenses
|
||||
LICENSE+=" 0BSD Apache-2.0 BSD ISC MIT MPL-2.0 Unicode-3.0"
|
||||
|
||||
SLOT="0"
|
||||
IUSE="cli mysql postgres +sqlite web"
|
||||
REQUIRED_USE="|| ( mysql postgres sqlite )"
|
||||
|
||||
RDEPEND="
|
||||
acct-user/vaultwarden
|
||||
acct-group/vaultwarden
|
||||
dev-libs/openssl:=
|
||||
cli? ( app-admin/bitwarden-cli-bin )
|
||||
mysql? ( dev-db/mysql-connector-c:= )
|
||||
postgres? ( dev-db/postgresql:* )
|
||||
sqlite? ( dev-db/sqlite:3 )
|
||||
web? ( www-apps/vaultwarden-web-bin )
|
||||
"
|
||||
|
||||
DEPEND="${RDEPEND}"
|
||||
BDEPEND="virtual/pkgconfig"
|
||||
|
||||
QA_FLAGS_IGNORED="usr/bin/${PN}"
|
||||
QA_PRESTRIPPED="usr/bin/${PN}"
|
||||
ECARGO_VENDOR="${WORKDIR}/vendor"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/vaultwarden-envfile-1.30.3.patch
|
||||
)
|
||||
|
||||
CHECKREQS_MEMORY=3G
|
||||
CHECKREQS_DISK_BUILD=2G
|
||||
|
||||
DOC_CONTENTS="\n
|
||||
Configuration file: /etc/${PN}.env\n
|
||||
Data directory: /var/lib/${PN}\n
|
||||
\n
|
||||
MySQL & PostgreSQL users must set DATABASE_URL in config\n
|
||||
\n
|
||||
Default server: http://0.0.0.0:8000\n
|
||||
Admin interface: http://0.0.0.0:8000/admin
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
check-reqs_pkg_setup
|
||||
rust_pkg_setup
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == 9999* ]]; then
|
||||
# clone vaultwarden
|
||||
git-r3_src_unpack
|
||||
|
||||
# clone vaultwarden.wiki
|
||||
EGIT_REPO_URI="https://github.com/dani-garcia/vaultwarden.wiki.git"
|
||||
EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}.wiki"
|
||||
git-r3_src_unpack
|
||||
|
||||
cargo_live_src_unpack
|
||||
else
|
||||
cargo_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
if [[ ${PV} != 9999* ]]; then
|
||||
cat <<-'EOF' >> "${ECARGO_HOME}"/config.toml || die
|
||||
[source."git+https://github.com/BlackDex/yubico-rs?rev=00df14811f58155c0f02e3ab10f1570ed3e115c6"]
|
||||
git = "https://github.com/BlackDex/yubico-rs"
|
||||
rev = "00df14811f58155c0f02e3ab10f1570ed3e115c6"
|
||||
replace-with = "gentoo"
|
||||
EOF
|
||||
fi
|
||||
use web && { sed -i -e 's|^WEB_VAULT_ENABLED=false|WEB_VAULT_ENABLED=true|g;' .env.template || die; }
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local myfeatures=(
|
||||
$(usev sqlite)
|
||||
$(usev mysql)
|
||||
$(usev postgres postgresql )
|
||||
)
|
||||
cargo_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# https://github.com/dani-garcia/vaultwarden/blob/main/build.rs
|
||||
[[ ${PV} != 9999* ]] && export VW_VERSION="${PV}"
|
||||
cargo_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin "$(cargo_target_dir)/${PN}"
|
||||
systemd_newunit "${FILESDIR}"/vaultwarden-1.30.3.service "${PN}".service
|
||||
newinitd "${FILESDIR}"/vaultwarden-1.30.3.initd "${PN}"
|
||||
newtmpfiles "${FILESDIR}"/vaultwarden-tmpfiles-1.30.3.conf "${PN}".conf
|
||||
insinto /etc
|
||||
newins .env.template "${PN}".env
|
||||
dosym -r /etc/"${PN}".env /etc/conf.d/"${PN}"
|
||||
keepdir /var/lib/"${PN}"
|
||||
|
||||
readme.gentoo_create_doc
|
||||
einstalldocs
|
||||
dodoc -r ../"${PN}".wiki/*
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
tmpfiles_process "${PN}".conf
|
||||
readme.gentoo_print_elog
|
||||
}
|
||||
Reference in New Issue
Block a user