blob: 363f4680decf7eaad8aa294c227ddca162a19acd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/env bash
#
if [ "$UID" != 0 ]; then
echo "Must be run with superuser privileges"
exit 2
fi
set +x
# Make sure repositories are up to date
apt-get update -qq
# Needed for ES
apt-get install -y -qq default-jre-headless
# ES
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.0.deb
dpkg -i elasticsearch-6.6.0.deb
sed -i -e 's/\(-Xm[sx]\)1g/\1256m/' /etc/elasticsearch/jvm.options
# Fail if ES doesnt work
service elasticsearch start
sleep 2
service elasticsearch status
echo "Testing if ElasticSearch is working..."
[[ -z $(wget -qO - http://localhost:9200) ]] && { echo "It is not..."; exit 1; }
# Everything else apt can get
apt-get install -y -qq cmake curl ffmpeg gifsicle git inkscape libcurl4-openssl-dev libicu-dev libjpeg-progs libopencv-dev libpq-dev libreadline-dev libxml2-dev nginx nodejs optipng postgresql-9.6 redis-server
# Bundler
gem install bundler
bundler config github.https true
# Postgres has some stupid defaults
sed -i -e 's/md5/trust/' /etc/postgresql/9.6/main/pg_hba.conf
# Make postgres user
service postgresql start
su - postgres -c "psql -c \"CREATE USER derpibooru PASSWORD 'password' CREATEDB;\""
|