mastodon-docker/prereqs.sh

71 lines
1.5 KiB
Bash

#!/bin/bash
set -x
export DEBIAN_FRONTEND=noninteractive
MRUM="main restricted universe multiverse"
COUNTRY="$(curl ipinfo.io | jq -r .country)"
#M="mirror://mirrors.ubuntu.com/mirrors.txt"
M="http://$COUNTRY.archive.ubuntu.com/ubuntu"
R="$(lsb_release -cs)"
cat > /etc/apt/sources.list <<EOF
deb $M $R $MRUM
deb $M $R-updates $MRUM
deb $M $R-security $MRUM
deb $M $R-backports $MRUM
EOF
# these instructions are cribbed from
# https://docs.joinmastodon.org/administration/installation/
# this is fine, totally secure, nothing to see here
curl -sL https://deb.nodesource.com/setup_16.x | bash -
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install -y \
autoconf \
bison \
build-essential \
daemontools \
ffmpeg \
file \
g++ \
gcc \
git \
imagemagick \
libffi-dev \
libgdbm-dev \
libgdbm6 \
libicu-dev \
libidn11-dev \
libjemalloc-dev \
libncurses5-dev \
libpq-dev \
libprotobuf-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
libyaml-dev \
mailutils \
nginx \
nodejs \
pkg-config \
postfix \
postgresql \
postgresql-contrib \
protobuf-compiler \
redis-server \
redis-tools \
rsync \
yarn \
zlib1g-dev
addgroup --gid $GID mastodon
useradd --uid $UID --gid $GID --shell /bin/bash -m -d /mastodon mastodon