2023-03-24 13:11:13 +01:00
# GoToSocial
2023-03-24 23:51:37 +01:00
[GoToSocial ](https://gotosocial.org/ ) is a self-hosted [ActivityPub ](https://activitypub.rocks/ ) social network server, that this playbook can install, powered by the [mother-of-all-self-hosting/ansible-role-gotosocial ](https://github.com/mother-of-all-self-hosting/ansible-role-gotosocial ) Ansible role.
2023-03-24 13:11:13 +01:00
## Configuration
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation ](../installing.md ) process:
```yaml
########################################################################
# #
# gotosocial #
# #
########################################################################
gotosocial_enabled: true
2023-03-29 13:49:44 +02:00
# Hostname that this server will be reachable at.
# DO NOT change this after your server has already run once, or you will break things!
# Examples: ["gts.example.org","some.server.com"]
2023-03-24 13:11:13 +01:00
gotosocial_hostname: 'social.example.org'
2023-03-29 13:49:44 +02:00
# Domain to use when federating profiles. It defaults to `gotosocial_hostname` but you can cange it when you want your server to be at
# eg., `gotosocial_hostname: gts.example.org`, but you want the domain on accounts to be "example.org" because it looks better
# or is just shorter/easier to remember.
#
# Please read the appropriate section of the installation guide before you go messing around with this setting:
# https://docs.gotosocial.org/installation_guide/advanced/#can-i-host-my-instance-at-fediexampleorg-but-have-just-exampleorg-in-my-username
# gotosocial_account_domain: "example.org"
2023-03-24 13:11:13 +01:00
########################################################################
# #
# /gotosocial #
# #
########################################################################
```
2023-03-29 13:53:46 +02:00
After installation, you can use `just run-tags gotosocial-add-user --extra-vars=username=<username> --extra-vars=password=<password> --extra-vars=email=<email>"`
2023-03-24 15:35:53 +01:00
to create your a user. Change `--tags=gotosocial-add-user` to `--tags=gotosocial-add-admin` to create an admin account.
2023-03-24 13:11:13 +01:00
### Usage
2023-03-29 13:53:46 +02:00
After [installing ](../installing.md ), you can visit at the URL specified in `gotosocial_hostname` and should see your instance.
2023-03-24 15:35:53 +01:00
Start to customize it at `social.example.org/admin` .
Use the [GtS CLI Tool ](https://docs.gotosocial.org/en/latest/admin/cli/ ) to do admin & maintenance tasks. E.g. use
```bash
docker exec -it mash-gotosocial /gotosocial/gotosocial admin account demote --username < username >
```
to demote a user from admin to normal user.
2023-03-24 13:11:13 +01:00
2023-03-24 15:35:53 +01:00
Refer to the [great official documentation ](https://docs.gotosocial.org/en/latest/ ) for more information on GoToSocial.
2023-03-29 10:02:55 +02:00
## Migrate an existing instance
The following assumes you want to migrate from `serverA` to `serverB` (managed by mash) but you just cave to adjust the copy commands if you are on the same server.
Stop the initial instance on `serverA`
```bash
serverA$ systemctl stop gotosocial
```
Dump the database (depending on your existing setup you might have to adjust this)
```
serverA$ pg_dump gotosocial > latest.sql
```
Copy the files to the new server
```bash
serverA$ rsync -av -e "ssh" latest.sql root@serverB:/mash/gotosocial/
serverA$ rsync -av -e "ssh" data/* root@serverB:/mash/gotosocial/data/
```
Install (but don't start) the service and database on the server.
```bash
2023-03-29 13:31:17 +02:00
yourPC$ just run-tags install-all
2023-03-29 10:02:55 +02:00
yourPC$ just run-tags import-postgres --extra-vars=server_path_postgres_dump=/mash/gotosocial/latest.sql --extra-vars=postgres_default_import_database=mash-gotosocial
```
Start the services on the new server
```bash
2023-03-29 13:31:17 +02:00
yourPC$ just run-tags start
2023-03-29 10:02:55 +02:00
```
Done 🥳