hometown/README.md

78 lines
3.0 KiB
Markdown
Raw Normal View History

2021-05-27 19:20:18 +00:00
# Hometown
2021-05-07 11:34:21 +00:00
2021-05-27 19:20:18 +00:00
A supported fork of Mastodon that provides local posting and a wider range of content types.
2021-06-23 15:37:00 +00:00
This repository is a copy of [coop-cloud/mastodon](https://git.autonomic.zone/coop-cloud/mastodon) but with a fresh README and some Hometown specific configuration. It seems like a good idea to keep the deployment separate since the apps may diverge in their deployment or configuration instructions at some point despite best wishes to remain as mainline Mastodon as possible.
2021-05-07 11:34:21 +00:00
<!-- metadata -->
2021-05-27 19:20:18 +00:00
* **Category**: Apps
* **Status**:
* **Image**: [`decentral1se/hometown`](https://hub.docker.com/r/decentral1se/hometown)
* **Healthcheck**:
* **Backups**:
* **Email**:
* **Tests**:
* **SSO**:
2021-05-28 10:56:17 +00:00
2021-05-07 11:34:21 +00:00
<!-- endmetadata -->
## Basic usage
1. Set up Docker Swarm and [`abra`]
2021-05-28 10:54:02 +00:00
1. Deploy [`coop-cloud/traefik`]
1. `abra app new mastodon`
2021-05-28 13:36:00 +00:00
1. Follow the [secrets setup docs](#secrets-setup)
1. `abra app config YOURAPPDOMAIN` - be sure to change `DOMAIN` to something that resolves to your Docker swarm box
1. `abra app deploy YOURAPPDOMAIN` to deploy the app
2021-06-23 15:35:51 +00:00
You'll need to run a `docker exec -it <streaming-service-id> /bin/bash` and do the following:
```
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
```
Then, on your host (outside of the containers), you'll need to fix permissions for the volume (see [#2](https://git.autonomic.zone/coop-cloud/hometown/issues/2)):
```
chown -R 991:991 /var/lib/docker/volumes/<service-name>_app/_data
```
2022-02-24 08:04:30 +00:00
And finally, within the `app` container, create an admin account:
2021-06-23 15:35:51 +00:00
```
2022-02-24 08:04:30 +00:00
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)
2021-06-23 15:35:51 +00:00
tootctl accounts create <username> --email <email> --confirmed --role admin
```
2021-05-07 11:34:21 +00:00
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
2021-05-28 10:54:02 +00:00
## Secrets setup
2022-05-09 05:51:47 +00:00
Mastodon expects secrets generated by specific tools. Uou can run these commands via the scripts interface with `abra`.
2021-05-28 10:54:02 +00:00
2022-05-09 05:51:47 +00:00
`abra app cmd <domain> secrets --local`
## Tips & Tricks
### Auto-complete is not working?
2022-09-14 13:39:00 +00:00
Check the sidekiq logs (`/sidekiq/retries`), is a bunch of stuff failing? What is the error?
If it looks anything like `blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];` then it might mean that your elastic search service has put itself into "read-only" state. This could be due to running close to no free disk space one time. ES doesn't undo this state, even when you have more free disk space once more, so you need to handle this manually:
```
abra app run <domain> es bash
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
```
Then head back to the sidekiq retries panel and retry one job. You should see
the ticket of retries go down by one if if passed. Then you can "retry all" and
they should get scheduled & run.