81 lines
1.7 KiB
Bash
81 lines
1.7 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
set -x
|
||
|
|
||
|
export DEBIAN_FRONTEND=noninteractive
|
||
|
|
||
|
MRUM="main restricted universe multiverse"
|
||
|
M="mirror://mirrors.ubuntu.com/mirrors.txt"
|
||
|
cat > /etc/apt/sources.list <<EOF
|
||
|
deb $M bionic $MRUM
|
||
|
deb $M bionic-updates $MRUM
|
||
|
deb $M bionic-security $MRUM
|
||
|
deb $M bionic-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_8.x | bash -
|
||
|
|
||
|
# same here
|
||
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||
|
echo "deb 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-core \
|
||
|
imagemagick \
|
||
|
libffi-dev \
|
||
|
libgdbm-dev \
|
||
|
libgdbm5 \
|
||
|
libicu-dev \
|
||
|
libidn11-dev \
|
||
|
libjemalloc-dev \
|
||
|
libncurses5-dev \
|
||
|
libpq-dev \
|
||
|
libprotobuf-dev \
|
||
|
libreadline6-dev \
|
||
|
libssl-dev \
|
||
|
libxml2-dev \
|
||
|
libxslt1-dev \
|
||
|
libyaml-dev \
|
||
|
nginx \
|
||
|
nodejs \
|
||
|
pkg-config \
|
||
|
postgresql \
|
||
|
postgresql-contrib \
|
||
|
protobuf-compiler \
|
||
|
redis-server \
|
||
|
redis-tools \
|
||
|
yarn \
|
||
|
zlib1g-dev
|
||
|
|
||
|
addgroup -g 991 mastodon
|
||
|
useradd --uid 991 --gid 991 -m -d /mastodon mastodon
|
||
|
|
||
|
exit 0
|
||
|
|
||
|
su - mastodon <<'EOF'
|
||
|
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
|
||
|
cd ~/.rbenv && src/configure && make -C src
|
||
|
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
|
||
|
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
|
||
|
source ~/.bashrc
|
||
|
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
|
||
|
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.6.1
|
||
|
rbenv global 2.6.1
|
||
|
gem update --system
|
||
|
gem install bundler --no-document
|
||
|
EOF
|