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


                                     
 




                                
                                                            
                                                                          

                                                                                                         
                                                                        
 

                                                  
 



                                                           
 
                            
#!/bin/sh
set -ex
export DEBIAN_FRONTEND=noninteractive


# motd
chmod 644 /etc/update-motd.d/*
systemctl mask motd-news.service
systemctl mask motd-news.timer

# Add update- and security-repositories, and perform upgrade
RELEASE=$(grep DISTRIB_CODENAME /etc/lsb-release | awk -F'=' '{print $2}')
echo "deb http://no.archive.ubuntu.com/ubuntu ${RELEASE}-security main universe" >> /etc/apt/sources.list
echo "deb http://no.archive.ubuntu.com/ubuntu ${RELEASE}-updates main universe" >> /etc/apt/sources.list
apt-get update && apt-get --yes full-upgrade && apt-get --yes autoremove

# set up vaultwarden
mv /vaultwarden /usr/local/bin/ || echo "building"

mkdir /var/lib/vaultwarden /etc/vaultwarden
useradd -d /var/lib/vaultwarden --system vaultwarden
chown -R vaultwarden: /var/lib/vaultwarden /etc/vaultwarden
chmod 700 /var/lib/vaultwarden /etc/vaultwarden

systemctl enable vaultwarden