about summary refs log tree commit diff
path: root/deploy/setup-mastodon.sh
diff options
context:
space:
mode:
authorreverite <samantha@chalker.io>2018-03-27 22:05:35 -0700
committerreverite <samantha@chalker.io>2018-03-27 22:05:35 -0700
commit8550be23e6dd30ab24b109185ead7ae432903cce (patch)
tree944ec2ecd9e35c649d3fcc6827db2582a54e698e /deploy/setup-mastodon.sh
parent0e335fdbe68e827cbe23ea376c9efe28dc91aaef (diff)
rearrange
Diffstat (limited to 'deploy/setup-mastodon.sh')
-rwxr-xr-xdeploy/setup-mastodon.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/deploy/setup-mastodon.sh b/deploy/setup-mastodon.sh
new file mode 100755
index 0000000..14ae9af
--- /dev/null
+++ b/deploy/setup-mastodon.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+[ -z "$YML_LOC" ] && YML_LOC="$HOME"
+cd $YML_LOC
+
+echo "Setting up the instance..."
+echo
+
+curl -fsSL https://raw.githubusercontent.com/tootsuite/mastodon/master/.env.production.sample -o "$YML_LOC/.docker/mastodon/.env.production"
+
+MUID="$(docker-compose run --rm mstweb id -u 2>/dev/null)"
+SECRET_KEY_BASE=$(hexdump -vn 64 -e ' /1 "%02x"' /dev/urandom)
+OTP_SECRET=$(hexdump -vn 64 -e ' /1 "%02x"' /dev/urandom)
+
+sed -i 's|REDIS_HOST=redis|REDIS_HOST=mstredis|' $YML_LOC/.docker/mastodon/.env.production
+sed -i 's|DB_HOST=db|DB_HOST=mstdb|' $YML_LOC/.docker/mastodon/.env.production
+sed -i 's|ES_HOST=es|ES_HOST=mstes|' $YML_LOC/.docker/mastodon/.env.production
+sed -i "s|SECRET_KEY_BASE=|SECRET_KEY_BASE=$SECRET_KEY_BASE|" $YML_LOC/.docker/mastodon/.env.production
+sed -i "s|OTP_SECRET=|OTP_SECRET=$OTP_SECRET|" $YML_LOC/.docker/mastodon/.env.production
+
+docker-compose run --rm mstweb rake db:migrate
+(openssl dhparam -rand /dev/urandom -out $YML_LOC/.docker/nginx/dhparam.pem 4096 2>&1 >/dev/null) & pid=$!
+
+echo
+echo "Mostly set up. Modify .docker/mastodon/.env.production settings and then"
+echo "you can do a 'docker-compose up -d' on this instance. OpenSSL is still"
+echo "running, so wait a bit for it to finish too."