snac.matoken.org is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.
This server runs the snac software and there is no automatic sign-up process.
boosted
さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.
ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はDebian trixie backports のsnac パッケージを使うよう設定してみます.
snac2 はDebian パッケージになっています.しかし,stable のDebian 13 trixie のsnac2 パッケージのバージョンは 2.75-2 で少し古いバージョンです.
stable-backports のパッケージのバージョンは現在の上流の最新と同じ 2.85 なのでこれを利用してみます.
$ rmadison snac2| grep -v debugsnac2 | 2.75-2~bpo12+1 | oldstable-backports | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390xsnac2 | 2.75-2 | stable | source, amd64, arm64, armel, armhf, i386, ppc64el, riscv64, s390xsnac2 | 2.84-3~bpo13+1 | stable-backports | source, riscv64snac2 | 2.85-1~bpo13+1 | stable-backports | source, amd64, arm64, armel, armhf, i386, ppc64el, s390xsnac2 | 2.85-1 | testing | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390xsnac2 | 2.85-1 | unstable | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x
Debian backports はDebian stable で一部のtesting パッケージを利用できるよう調整されたもので対応したパッケージであればstable より新しいバージョンが利用できます.
これを利用するためにはbackports 情報を sources.list に追加する必要があります.
ここでは公式ドキュメントと同じ /etc/apt/sources.list.d/debian-backports.sources としてファイルを作成しました.
/etc/apt/sources.list.d/debian-backports.sources を作成
Types: deb deb-srcURIs: http://deb.debian.org/debianSuites: trixie-backportsComponents: mainEnabled: yesSigned-By: /usr/share/keyrings/debian-archive-keyring.gpg
続いてパッケージ情報をbackports を含む最新状態にします.
パッケージ情報更新
$ sudo apt update
backpots のパッケージは通常のインストールでは導入されません.backports のパッケージを導入するにはパッケージ名に /trixie-backports を付けて導入します.
$ sudo apt install snac2/trixie-backports
もしくは -t trixie-backports を付けて導入すると不足した依存関係も導入されるようです.
$ sudo apt install -t trixie-backports snac2
$ dpkg-query -W snac2snac2 2.85-1~bpo13+1$ snac versionsnac 2.85 - A simple, minimalistic ActivityPub instanceCopyright (c) 2022 - 2025 grunfink et al. / MIT licenseupgrade {basedir} Upgrade to a new version導入されたbackports パッケージは通常と同じ優先度100に固定されるので導入後はいつもの apt upgrade でbackports パッケージも更新されます.つまり通常の運用で大丈夫です.
snac のバージョンアップ時にディスク構成が変わることがあり,その場合snac が起動しないようです.その場合snac の upgrade コマンドを実行する必要があるようです.
自分は念の為毎回実行しています.
snac(8)より
Upgrading to a new version Sometimes, the data storage disk layout changes between versions. If there is such a change, snac will refuse to run and require an upgrade. Do this by runningsnac upgrade $HOME/snac-dataTake special care to execute this upgrade operation without any snac processes serving on the same folder. You can break everything. I know this because Tyler knows this.
$ snac | grep upgradeupgrade {basedir} Upgrade to a new versionupgrade コマンドはデーモンが起動していない状態で実行する必要があるので一旦snac を停止してから実行,その後snac を起動します.
$ sudo service snac2 stop (1)$ sudo -u debian-snac snac upgrade /var/lib/snac2/ (2)19:45:50 Linux sandbox not compiled in19:45:50 OK$ sudo service snac2 start (3)$ w3m -dump https://snac.kagolug.org/info | tail -1 (4)about this site - powered by snac/2.83
snac 停止
snac upgrade
snac 起動
バージョン確認
という感じでDebian stable でも最新のsnac が利用できています.一旦設定すると通常のDebian パッケージ更新操作で追従してくれるので運用もいつもと変わりません.更新タイミングも公式と見比べると結構すぐ対応してくれているようです.
boosted
さくらのナレッジに軽量ActivityPub Server のsnac についての記事を寄稿しました.
ここに書かなかったsnac のことをいくつか書いていこうと思います.
今日はカスタム絵文字について.
ActivityPub 各インスタンスでよく使われているカスタム絵文字というものがあります.misskey.io なんかでは特に多用されているようです.
snac もカスタム絵文字に対応しています.
既定値で設定されているものとして例えばtoot 本文中に :-) と入力することで「🙂」が, :beer: と入力することで「🍺」が表示されます.他に :shrug2: で「¯\_(ツ)_/¯」なんでものも.でもこのあたりのUnicode絵文字などは日本語入力環境があるとあまり有り難みは感じなそうです.でも画像ファイルも利用できます.
自分で用意した絵文字を追加してみましょう.
カスタム絵文字を追加するにはsnac のデータディレクトリにある emojis.json を編集することでカスタマイズできます.
emojis.json の既定値はこんな感じです.
toot 本文中に記述するkey と,実際に評される値の組み合わせです.key は保管性を保つために : で囲むことが推奨されています.値は以下では数値文字参照及び文字列ですが,URL を指定することも出来ます.
{ ":-)": "🙂", ":-D": "😀", "X-D": "😆", ";-)": "😉", "B-)": "😎", ">:-(": "😡", ":-(": "😞", ":-*": "😘", ":-/": "😕", "8-o": "😲", "%-)": "🤪", ":_(": "😢", ":-|": "😐", "<3": "❤️", ":facepalm:": "🤦", ":shrug:": "🤷", ":shrug2:": "¯\\_(ツ)_/¯", ":eyeroll:": "🙄", ":beer:": "🍺", ":beers:": "🍻", ":munch:": "😱", ":thumb:": "👍"}ここにsnac デフォルトアイコンを追加してみます.snac のベースurl の下の /susie.png (kagolug では https://snac.kagolug.org/susie.png )にアクセスするとsnac デフォルトアイコンのsusie が表示されます.これを利用してみます.
emojis.json を以下のように書き換えます.
":beer:": "🍺", ":beers:": "🍻", ":munch:": "😱",- ":thumb:": "👍"+ ":thumb:": "👍",+ ":susie:": "https://snac.kagolug.org/susie.png" }
Tip
emojis.json は保存した時点で内容が反映されます.中途半端な状態で保存すると全てのカスタム絵文字が利用できなくなったりするので注意しましょう.
これで :susie: と入力することで
が表示されるようになります.
更にペンギンのTux とタスマニアデビルのTuz を追加してみます.
アイコンの画像ファイルを用意し,静的環境に設置,そのurl をemojis.json ファイルに記述します.
今回以下のようになりました.
":beer:": "🍺", ":beers:": "🍻", ":munch:": "😱",- ":thumb:": "👍"+ ":thumb:": "👍",+ ":susie:": "https://snac.kagolug.org/susie.png",+ ":tux:": "https://www.kagolug.org/snac-emoji/Tux.png",+ ":tuz:": "https://www.kagolug.org/snac-emoji/Tuz.png" }
これで :susie:, :tux:, :tuz: の3つの絵文字が利用できるようになりました.
toot して確認できます.
もしくは以下のようなサイトでMastodon カスタム絵文字API経由で絵文字一覧を確認することも出来ます.
]
snac のカスタム絵文字についての詳細はsnac(8) を参照してください.
Custom Emojis From version 2.51, support for customized Emojis in posts is available (previously, they were hardcoded). Emojis are read from the emojis.json file in the instance base directory, as a JSON object of key / value pairs (if this file does not exist, it will be created with the predefined set). Each key in the object contains the text to be found (e.g., the :-) for a smiling face), and its associated value, the text string that will replace it (in this example case, the HTML entity for the Unicode codepoint for the smiley or the Emoji itself as text).Emoji values can also be URLs to image files; in this case, they will not be substituted in the post content, but added to the 'tag' array as an ActivityPub standard 'Emoji' object (it's recommendable that the Emoji key be enclosedin colons for maximum compatibility with other ActivityPub implementations, like e.g. :happydoggo:). These images can be served from an external source or from the static directory of the instance admin.If you want to disable any Emoji substitution, change the file to contain just an empty JSON object ({}).