aboutsummaryrefslogblamecommitdiffstats
path: root/mkosi.build
blob: 745345909d1b3bd8ec48a6a4b201e30b52b78fde (plain) (tree)
1
2
3
4
5
6
7
8
9
10

         


                                    
                            
                      
                            

                               
                                                         


                

                            

                                                                                                                           

                         

 
                               
 
                                                                                                              








                                                                                                     
 
 


                                           
 
 

                        
                                          
#!/bin/sh

export RUSTUP_HOME=/root/.rustup \
       CARGO_HOME=/root/.cargo \
       PATH=/root/.cargo/bin:$PATH \
       RUST_VERSION=1.40.0 \
       DB=postgresql \
       VAULT_VERSION=v2.15.1

mkdir /root/src && cd /root/src
git clone https://github.com/dani-garcia/bitwarden_rs.git


## get vault ## 
mkdir /root/src/bitwarden_rs
cd /root/src/bitwarden_rs

curl -L https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz | tar xz

cd /root/src/bitwarden_rs


## Setting up rust for build ##

# Later we can use https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init to get latest
wget "https://static.rust-lang.org/rustup/archive/1.20.2/x86_64-unknown-linux-gnu/rustup-init"
echo "e68f193542c68ce83c449809d2cad262cc2bbb99640eb47c58fc1dc58cc30add *rustup-init" | sha256sum -c -
chmod +x rustup-init
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION
rm rustup-init
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
rustup --version
cargo --version
rustc --version


## building bitwarden_rs ##

cargo build --features postgresql --release


## move stuff ##
mv web-vault ${DESTDIR}/
mv target/release/bitwarden_rs ${DESTDIR}/