update account creation process to use abra cmd to fix issues with postgres secrets not being properly handled

This commit is contained in:
brooke 2025-04-25 14:50:04 -04:00
parent 8f42b85aa3
commit 30768016fd
2 changed files with 52 additions and 4 deletions

View File

@ -44,13 +44,13 @@ COMPOSE_FILE="$COMPOSE_FILE:compose.postgres.yml"
## [Add your first account](https://docs.gotosocial.org/en/latest/getting_started/user_creation/)
Create the account
>Note: Redeploying the app is required after creating new accounts using the cli, this is expected to change in future updates of GtS
> Note: Redeploying the app is required after creating or promoting new accounts using the cli, this is expected to change in future updates of GtS
```
abra app run <app-domain> app ./gotosocial admin account create --username <user-name> --email <user-email> --password '<a-secure-password>'
abra app cmd <domain> app newuser <user-name> <email> '<password>'
```
Make them an admin
```
abra app run <app-domain> app ./gotosocial admin account promote --username <user-name>
abra app cmd <domain> app admin <user-name>
```
## [Federation mode](https://docs.gotosocial.org/en/latest/admin/federation_modes/)

50
abra.sh
View File

@ -1,3 +1,51 @@
export ENTRYPOINT_VERSION=v1
export PG_BACKUP_VERSION=v1
export CONFIG_VERSION=v1
export CONFIG_VERSION=v1
environment() {
if [ -f /run/secrets/oidc_secret ]; then
export GTS_OIDC_CLIENT_SECRET=$(cat /run/secrets/oidc_secret)
else
echo "OIDC secret not found, skipping."
fi
if [ -f /run/secrets/smtp_password ]; then
export GTS_SMTP_PASSWORD=$(cat /run/secrets/smtp_password)
else
echo "SMTP password secret not found, skipping."
fi
if [ -f /run/secrets/db_password ]; then
export GTS_DB_PASSWORD=$(cat /run/secrets/db_password)
else
echo "DB password secret not found, skipping."
fi
}
newuser() {
environment
USERNAME="$1"
EMAIL="$2"
PASSWORD="$3"
if [ -z "$USERNAME" ] || [ -z "$EMAIL" ] || [ -z "$PASSWORD" ]; then
echo "Usage: abra app cmd <domain> admin -- <username> <email> <password>"
exit 1
fi
./gotosocial admin account create --username "$USERNAME" --email "$EMAIL" --password "$PASSWORD"
}
admin() {
environment
USERNAME="$1"
if [ -z "$USERNAME" ]; then
echo "Usage: abra app cmd <domain> admin <username>"
exit 1
fi
./gotosocial admin account promote --username "$USERNAME"
}