aboutsummaryrefslogblamecommitdiffstats
path: root/mkosi.postinst
blob: e04f0be42e74194c335152e430fd1163a56abb4c (plain) (tree)

































                                                                                                  
#!/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 ${RELEASE}-security main universe" >> /etc/apt/sources.list
echo "deb http://no.archive.ubuntu.com ${RELEASE}-updates main universe" >> /etc/apt/sources.list
apt update && apt --yes full-upgrade && apt --yes autoremove

# locales
sed -i 's/# en_IE.UTF-8 UTF-8/en_IE.UTF-8 UTF-8/' /etc/locale.gen
locale-gen

groupadd --system app
useradd --system --home-dir /app --gid app --shell /usr/sbin/nologin app

git clone https://github.com/mozilla-services/syncserver /app
mkdir /data
chown -R app:app /app /data
cd /app

sudo -u app -H make build

./local/bin/pip install psycopg2

systemctl enable ffsync.service