Added setup commands

This commit is contained in:
Roxie Gibson 2021-05-10 14:16:57 +01:00
parent d566060e5c
commit e23f0f9752
Signed by untrusted user: roxxers
GPG Key ID: 5D0140EDEE123F4D
2 changed files with 48 additions and 1 deletions

47
abra.sh Normal file
View File

@ -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'"
# }

View File

@ -74,7 +74,7 @@ services:
- redis
# - es
volumes: &appVolume
- app:/mastodon/public/system
- app:/mastodon
# secrets: &secrets
# - secret_key_base
# - otp_secret