Rip tabs, use env vars and drop old docs

This commit is contained in:
decentral1se 2021-05-28 15:29:46 +02:00
parent 0d70381552
commit 615a2c7f3e
Signed by: decentral1se
GPG Key ID: 92DAD76BD9567B8A
2 changed files with 24 additions and 26 deletions

View File

@ -23,7 +23,7 @@ Your self-hosted, globally interconnected microblogging community
1. `abra app YOURAPPDOMAIN config` - be sure to change `DOMAIN` to something that resolves to
your Docker swarm box.
1. Follow the [secrets setup documentation below](#secrets-setup)
1. Follow the [datbase setup documentation below](#database-setup)
1. `abra app YOURAPPDOMAIN setup` to setup the database and create the admin account
1. `abra app YOURAPPDOMAIN deploy --no-domain-poll`. App will fail for now.
1. Open the configured domain in your browser to finish set-up. To make an admin account `abra app mastodon run web "bin/tootctl accounts create coolusername --email helo@autonomic.zone --confirmed --role admin"`
@ -65,17 +65,3 @@ And finally, to end your whirlwind secrets loading adventure, get the `DB_PASS`
$ abra app YOURAPPDOMAIN secret generate db_password v1
$ abra app YOURDOMAIN secret insert smtp_password v1 YOURSMTPPASSWORD
```
## Database setup
You need to run `rake db:setup` against the database before the installation will be succesful. To do this, you need to shell into the `streaming` service and run the command while making some environment variables available.
```
$ abra app social.lumbung.space run streaming bash
$ export OTP_SECRET=$(cat /run/secrets/otp_secret)
$ export SECRET_KEY_BASE=$(cat /run/secrets/secret_key_base)
$ export DB_PASS=$(cat /run/secrets/db_password)
$ bundle exec rake db:setup
```
The rest of the services will then stabilise when they have a connection to the database.

34
abra.sh
View File

@ -3,25 +3,37 @@ export ENTRYPOINT_CONF_VERSION=v1
#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 "$@"
export OTP_SECRET=$(cat /run/secrets/otp_secret)
export SECRET_KEY_BASE=$(cat /run/secrets/secret_key_base)
export DB_PASS=$(cat /run/secrets/db_password)
# 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 "$@"
export OTP_SECRET=$(cat /run/secrets/otp_secret)
export SECRET_KEY_BASE=$(cat /run/secrets/secret_key_base)
export DB_PASS=$(cat /run/secrets/db_password)
# 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"
silence
sub_rake "db:setup"
unsilence
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
@ -34,14 +46,14 @@ sub_setup() {
# Not working atm
# abra_backup_app() {
# _abra_backup_dir $MASTO_APP_DIR
# _abra_backup_dir $MASTO_APP_DIR
# }
# abra_restore_app() {
# # shellcheck disable=SC2034
# {
# abra__src_="-"
# abra__dst_=$MASTO_APP_DIR
# abra__src_="-"
# abra__dst_=$MASTO_APP_DIR
# }
# zcat "$@" | sub_app_cp