mastodon/abra.sh

51 lines
1.3 KiB
Bash
Raw Normal View History

2021-05-10 13:16:57 +00:00
# shellcheck disable=SC2148
export ENTRYPOINT_CONF_VERSION=v1
2021-05-10 13:52:24 +00:00
#MASTO_APP_DIR="mastodon/public"
2021-05-10 13:16:57 +00:00
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"
2021-05-10 13:52:24 +00:00
silence
2021-05-10 13:16:57 +00:00
sub_rake "db:setup"
2021-05-10 13:52:24 +00:00
unsilence
2021-05-10 13:16:57 +00:00
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'"
# }