From e23f0f97525736228b84acbd4b04e14bc6d229b5 Mon Sep 17 00:00:00 2001 From: Roxie Gibson Date: Mon, 10 May 2021 14:16:57 +0100 Subject: [PATCH] Added setup commands --- abra.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ compose.yml | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 abra.sh diff --git a/abra.sh b/abra.sh new file mode 100644 index 0000000..15993e9 --- /dev/null +++ b/abra.sh @@ -0,0 +1,47 @@ +# shellcheck disable=SC2148 +MASTO_APP_DIR="mastodon/public" + +sub_rake() { + # shellcheck disable=SC2034 + abra__service_="streaming" + # Using streaming for rake since it is the least likely to flap + sub_app_run rake "$@" +} + +sub_tootctl() { + # shellcheck disable=SC2034 + abra__service_="web" + # Using streaming for rake since it is the least likely to flap + sub_app_run bin/tootctl "$@" +} + +sub_setup() { + info "Setting up mastodon database" + sub_rake "db:setup" + success "Mastodon's database is now up! 'web' and 'sidekiq' services should now stop failing." + echo "Do you want to create an admin user? (Extremely recommended!)" + prompt_confirm + read -rp "Username: " USERNAME + read -rp "Email: " EMAIL + warning "Password will be show on screen. Copy this down somewhere! Abra cannot show you this again!" + sub_tootctl accounts create $USERNAME --email $EMAIL --confirmed --role admin + success "Admin account created!" + success "Mastodon should be setup and ready to go!" +} + +# Not working atm +# abra_backup_app() { +# _abra_backup_dir $MASTO_APP_DIR +# } + +# abra_restore_app() { +# # shellcheck disable=SC2034 +# { +# abra__src_="-" +# abra__dst_=$MASTO_APP_DIR +# } + +# zcat "$@" | sub_app_cp + +# success "Restored 'app'" +# } diff --git a/compose.yml b/compose.yml index 786009a..4d3f9ac 100644 --- a/compose.yml +++ b/compose.yml @@ -74,7 +74,7 @@ services: - redis # - es volumes: &appVolume - - app:/mastodon/public/system + - app:/mastodon # secrets: &secrets # - secret_key_base # - otp_secret