Code Monkey home page Code Monkey logo

vaultwarden-deb's Introduction

deb packaging for vaultwarden

This debian source package builds vaultwarden natively on your build environment with mysql, postgresql and sqlite support. No annoying docker! It is managed with git-buildpackage and aims to be a pretty good quality debian source package. You can find the maintaining command summary in debian/gbp.conf.

You will also need vaultwarden-web-vault-deb.

Download prebuilt packages

Prebuild deb and src packages are automatically built in Github Actions for the latest Ubuntu LTS and Debian stable in various architectures (if applicable).

For manual installation they are available in the releases section and you can verify the signatures with this signing-key.

For using apt they are available on packagecloud. See their installation instructions on how to setup the apt source. Be aware that they use a different signing key. vaultwarden-web-vault-deb is also automatically uploaded to this repo.

Requirements

  • Installed git-buildpackage from your apt
  • Installed build dependencies as defined in debian/control Build-Depends (will notify you in the build process otherwise)
  • If rust/cargo is not recent enough:
    • Don't forget to look into your *-updates/*-backports apt sources for newer versions
    • This debian source also supports those installed with help of rustup
      • Requires preloaded rustup toolchain install <version> before invoking packaging

Packaging

  • Clone with git-buildpackage: gbp clone https://github.com/dionysius/vaultwarden-deb.git
  • Switch to the folder: cd vaultwarden-deb
  • Build with git-buildpackage: gbp buildpackage
    • There are many arguments to fine-tune the build (see gbp buildpackage --help and dpkg-buildpackage --help)
    • Notable options: -b (binary-only, no source files), -us (unsigned source package), -uc (unsigned .buildinfo and .changes file), --git-export-dir=<somedir> (before building the package export the source there), -d if you need to ignore build-depends (you probably still need them installed from a debian package)

TODOs

  • Automatic notification on new upstream releases. Optimally with automatic PR with those updates

vaultwarden-deb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chronum

vaultwarden-deb's Issues

Switch to argon2 as generated token by default

Since v1.28.0 vaultwarden added the option and recommendation to use argon2 as admin token instead of plaintext. Currently a plaintext token is generated using openssl and a notice is printed during installation.

  1. To use argon2 a password has to be provided by the user. I got a tip from the debian packaging IRC on how to handle such things (the debconf option seems the one to be explored):

Q: Hi, I can't find guidance on how to handle generated passwords for packages. There is no word about it in the policy manual. Mysql e.g. uses /etc/mysql/debian.cnf to store a root password for pkg use. So is placing such file in /etc still a viable solution?
A: for databases, there is dbconfig-common
A: more generally, ask for the password using debconf, then write the result to the config. the default should be loaded from the config file

Note that we can't load the existing password from the config as we only have the hash. I suggest we don't need to as we keep the current logic to only create a hash automatically (this time with user input) when missing. If a user wants to create a new hash afterwards he can use the vaultwarden hash command.

  1. Set the required packages as dependencies so this can be executed at postinst (if postinst is still the recommended way of the point above). Vaultwarden doesn't intent using their hash command for automatic purposes: (dani-garcia/vaultwarden#3411)

cargo supposedly not installed while being installed

I've installed the rust toolchain 1.78 with rustup. But gdb buildpackage for some reason refuses to find cargo:

gbp:info: Extracting 'vaultwarden_1.30.5.orig.tar.gz' to '/opt/vaultwarden-deb/vaultwarden-tmp'
gbp:info: Exporting 'HEAD' to '/opt/vaultwarden-deb/vaultwarden-tmp'
gbp:info: Moving '/opt/vaultwarden-deb/vaultwarden-tmp' to '/opt/vaultwarden-deb/vaultwarden-1.30.5'
gbp:info: Performing the build
 dpkg-buildpackage -us -uc -ui -i -I
dpkg-buildpackage: Information: Source package vaultwarden
dpkg-buildpackage: Information: Source version 1.30.5-1
dpkg-buildpackage: Information: source distribution unstable
dpkg-buildpackage: Information: Source changed by dionysius <[email protected]>
 dpkg-source -i -I --before-build .
dpkg-buildpackage: Information: host architecture amd64
dpkg-source: Information: Options from vaultwarden-1.30.5/debian/source/options are used: --extend-diff-ignore=(^|/)(.github|LICENSE|README|signing-key)
dpkg-checkbuilddeps: Error: Unfulfilled build dependencies: cargo
dpkg-buildpackage: Warning: Build dependencies/conflicts not fulfilled; abort
dpkg-buildpackage: Warning: (Use -d to override.)
debuild: fatal error at line 1184:
dpkg-buildpackage -us -uc -ui -i -I failed
gbp:error: 'debuild -i -I' failed: it exited with 29

But

cargo -V
cargo 1.78.0 (54d8815d0 2024-03-26)
which cargo
/usr/bin/cargo

So what exactly is it complaining about?

Permissions for /var/lib/vaultwarden/data missing

When starting vaultwarden the first time it throws an error, after trying to save the newly created key in /var/lib/vaultwarden/data.

It would help to change the owner of this folder to the vaultwarden user.

ADMIN_TOKEN_FILE gets set twice in the defaults file

Since v1.28.0 vaultwarden added the option and recommendation to use argon2 as admin token instead of plaintext. For this they added both options as comments to their env template.

This sed currently appends the ADMIN_TOKEN_FILE option after each # ADMIN_TOKEN=.* pattern, which now exists twice.

Be my guest if someone has more knowledge in sed or awk as I'd like have a fairly safe and understandable replacement for it. It should append it only once after the whole comment block.

process didn't exit successfully

I'm trying to compile the deb again in a Debian Stable VM, as I originally compiled it on Testing, but that won't be able to run on a Stable system. But the Stable systm doesn't have enough space for compiling. I've installed everything needed, including both the rust 1.78 toolchain via rustup and cargo (and with that the rust toolchain of Stable). For some reason toolchain 1.76 is being installed by the script (either by it or vaultwarden), but compilation fails with this message:
Screenshot from 2024-06-06 11-16-49

current cross-compilation issues

riscv:

  error: failed to run custom build command for `ring v0.16.20`
  
  Caused by:
    process didn't exit successfully: `/work/vaultwarden-1.27.0/target/release/build/ring-03adbee9b7db2dc2/build-script-build` (exit status: 101)
    --- stderr
    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:358:10
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

armv7:

  error: failed to compile `vaultwarden v1.0.0 (/work/vaultwarden-1.27.0)`, intermediate artifacts can be found at `/work/vaultwarden-1.27.0/target`
  
  Caused by:
    failed to load source for dependency `multer`
  
  Caused by:
    Unable to update https://github.com/BlackDex/multer-rs?rev=477d16b7fa0f361b5c2a5ba18a5b28bec6d26a8a
  
  Caused by:
    failed to clone into: /root/.cargo/git/db/multer-rs-4345aff1a2cb4345aff1a2cb7639
  
  Caused by:
    could not read directory '/root/.cargo/git/db/multer-rs-4345aff1a2cb7639/refs': Value too large for defined data type; class=Os (2)

aarch64:

error: could not compile `vaultwarden`
  
  Caused by:
    process didn't exit successfully: `rustc --crate-name vaultwarden --edition=2021 ... (signal: 9, SIGKILL: kill)
  error: failed to compile `vaultwarden v1.0.0 (/work/vaultwarden-1.27.0)`, intermediate artifacts can be found at `/work/vaultwarden-1.27.0/target`
  • github runners probably killing job for taking too long (at ~3h run time). Once it ran through taking 5h30min (probably luck). A better and more efficient way is needed to offer cross compiled packages.

No version information

Hi,

I don't know if this issue is linked to your repo or the original vaultwarden.
But neither at the cmd or the admin page I can see the version I installed.

cmd:

root@host:~# vaultwarden -v
vaultwarden (Version info from Git not present)

web:
grafik

What is going wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.