Consolidate Tech Working Group wiki authored by Ed Summers's avatar Ed Summers
This commit moves information from the Technical Working Group's (TWG)
[git.coop
wiki](https://git.coop/social.coop/tech/operations/-/wikis/home) into a
subdirectory of the main wiki. The current TWG wiki on git.coop is
currently public. These changes are predicated on the idea that we want
to move forward with the
[proposal](https://www.loomio.com/d/2Rwh5z3H/time-to-consolidate-wikis-/69)
to consolidate wikis in preparation for the move to a more user friendly
wiki platform.

**Note:** This commit includes an update to the Tech Working Group section of the
Bylaws to point to the relevant section in the general wiki rather than
the old TWG specific git.coop wiki.

Quite a bit of the information contained in these pages needs to be
consolidated and/or updated. But for historical purposes the thought was
to bring these pages over largely unchanged and then update them either
here in Git, or once the content has been moved to a new wiki.

If/when this merge request is pulled in the Tech Working Group pages
should become available at wiki.social.coop. At that point the old
https://git.coop/social.coop/tech/operations repository can be [archived](https://docs.gitlab.com/ee/user/project/settings/#archive-a-project).
[Elasticsearch](https://github.com/elastic/elasticsearch) is the standard method for providing full-text search for a Mastodon instance. See the [Mastodon docs](https://docs.joinmastodon.org/admin/optional/elasticsearch/) for general information about installation and usage.
While our instance is deployed as a set of Docker containers, our Elasticsearch instance runs on the host machine rather than in a container. This is partially because at the time @redoak didn't know a whole lot about Docker, and partially because he was impatient/lazy and wanted to see results quickly. He is exactly the correct amount of sorry for this.
## Implementation Details
Our deployment isn't terribly exceptional, but in the interest of future maintainability, here are some notes about our setup:
- ES is bound to the docker network interface at `_docker0_`. This setting lives in `/etc/elasticsearch/elasticsearch.yml`.
- ES expects connections on the port range 9200:9300. It's not safe to expose Elasticsearch publicly, so there is a [ufw](http://manpages.ubuntu.com/manpages/precise/man8/ufw.8.html) rule allowing access to those ports only from the IP subnet that our docker containers use.
- to wit: `sudo ufw allow from 172.31.0.1/16 to any port 9200:9300 proto tcp`
- The environment variables enabling and configuring Mastodon's connection to ES are set in `/opt/social.coop/sauce/.env.production`. changing these settings only takes effect after running `docker compose up`.
## Commands
Should it ever become desirable to rebuild the ES indices again, this can be achieved by:
```bash
$ sudo docker exec -it docker_web_1 /bin/bash
$ nohup tootctl search deploy --concurrency 6 2>&1 > es.log &
```
Consult the Mastodon docs linked above for more info on related commands and options.