quartz-research-note/content/Mastodon.md
Tomoya Matsuura(MacBookPro) 83d6da5087
All checks were successful
Build / build (push) Successful in 1m45s
[obsidian] vault backup: 2024-02-16 01:59:19[
2024-02-16 01:59:19 +09:00

1.8 KiB
Raw Blame History

date
2023-10-07T01:42:00+0900

#software #server #self-hosted

分散型SNS。

個人インスタンス https://social.matsuuratomoya.com を運用している。

運用のメモ

運用は省エネにしたいのでDocker。

リバースプロキシはNginxでチュートリアル通りにやってるが、それをCloudflare Tunnelで外に公開している。

本当はリバースプロキシはTraefikにしたい、というかSwarmとかk3sとかでクラスタにしたい無停止アップデートがしたい

定期メンテナンス

大体メディアキャッシュが50GBくらいある。

毎日一回実行

#!/bin/bash
cd /home/tomoya/mastodon
/usr/bin/docker-compose run --rm web bin/tootctl media remove --days 7 --concurrency 2
/usr/bin/docker-compose run --rm web bin/tootctl media remove --remove-headers --days 7 --concurrency 2;
/usr/bin/docker-compose run --rm web bin/tootctl preview_cards remove --days 4;
/usr/bin/docker-compose run --rm web bin/tootctl statuses remove --days 4;
/usr/bin/docker-compose run --rm web bin/tootctl media remove-orphans;

一応ElasticSearchも追加してるのでこれも

/usr/bin/docker-compose run --rm web bin/tootctl search deploy

あとFedifetcherでリモートのリプライなどを追加している

/usr/bin/docker run -v fedifetcher-artifacts:/app/artifacts --rm --name fedifetcher -it ghcr.io/nanos/fedifetcher:latest --access-token=XXXXXXXXXXXXXXX --server=social.matsuuratomoya.com --home-timeline-length=200 --max-followings=90 --reply-interval-in-hours=6 --lock-hours=1

Mastodonのデータベースが壊れたときにやったことv4.2.0

Mastodonのアップデートでいちいちdocker-あれcompose.ymlを一時的に書き換えない