+++ date = "2023-01-08" tags = ["golang","sns","activitypub","fly"] title = "gotosocialを立ててみた時の話" slug = "gotosocial" +++ gotosocialは今現在最も簡単に建てられるactivitypubのインスタンスです。 https://github.com/superseriousbusiness/gotosocial golangを採用しているというのが大きく、dbもsqliteです。最もシンプルな構成だと思います。 sqliteは、あまり速くはないもののshellとの親和性が非常に高いため、dbの中では最も扱いやすい部類に入ります。あくまで個人感想。 fly.ioは、sqliteをvol mountで使用できるためserverを立てる必要がありません。したがって、全て一つのserver内で完結します。 例えば、mastodonの場合、web & api server, redis-server, pg-serverと3つが必要になります。 ただし、gotosocialは、最低限のweb-uiしか持ちません。したがって、通常操作するには、uiをつけるか、あるいはclientから行う必要があります。 これは、matrixの設計に似ています。 web-client : https://pinafore.social/ android : https://tusky.app/ ### fly.io > Dockerfile ``` FROM superseriousbusiness/gotosocial WORKDIR /gotosocial ADD config.yaml /gotosocial/ CMD ["--config-path", "/gotosocial/config.yaml"] ``` ```sh $ app=xxx $ fly launch --name $app $ fly vol create ${app}_data --size 1 -a $app ``` ### config ```yaml:config.yaml host: "$app.fly.dev" db-type: "sqlite" db-address: "/data/goto/sqlite.db" accounts-registration-open: false ``` ```toml:fly.toml [mounts] source="$app_data" destination="/data/goto" ``` ### deploy ```sh $ fly deploy ``` ### create user ```sh $ fly ssh consosh consolee $ /gotosocial/gotosocial --config-path /gotosocial/config.yaml admin account create --username $user --email $mail --password $pass $ /gotosocial/gotosocial --config-path /gotosocial/config.yaml admin account confirm --username $user $ /gotosocial/gotosocial --config-path /gotosocial/config.yaml admin account promote --username $user ``` ### domain https://github.com/superseriousbusiness/gotosocial/blob/main/example/config.yaml https://github.com/felx/mastodon-documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md > https://example.com/.well-known/host-meta ``` ``` ```yaml:config.yaml host: "$app.fly.dev" account-domain: "example.com" ``` ### post setting : /user web client : https://pinafore.social