GNU socialでNodeInfoを有効にする

GNU socialのIssueで気になるものが.

インスタンス情報を確認できるエンドポイントがあると便利だよねってIssueでそれを実現する以下のプラグインが紹介されていました.

これがなくても以下で補足されているようですが,もっと簡単に情報を提供できそうです.

入れてみました.

$ git clone https://github.com/chimo/gs-nodeinfo
$ sudo -u www-data rsync -avn --exclude="gs-nodeinfo/.git/" ./gs-nodeinfo /var/www/gnusocial.matoken.org/plugins/
$ sudo -u www-data rsync -av --exclude="gs-nodeinfo/.git/" ./gs-nodeinfo /var/www/gnusocial.matoken.org/plugins/
$ sudo mv /var/www/gnusocial.matoken.org/plugins/gs-nodeinfo /var/www/gnusocial.matoken.org/plugins/Nodeinfo
$ echo 'addPlugin('Nodeinfo');' | sudo tee -a /var/www/gnusocial.matoken.org/config.php 
addPlugin(Nodeinfo);

とりあえず動かしてみます.

$ w3m -dump https://gnusocial.matoken.org/.well-known/nodeinfo
{"links":[{"rel":"http:\/\/nodeinfo.diaspora.software\/ns\/schema\/2.0","href":"https:\/\/gnusocial.matoken.org\/nodeinfo\/2.0"}]}

見にくいのでjqに食わせてみます.

$ w3m -dump https://gnusocial.matoken.org/.well-known/nodeinfo|jq
{
  "links": [
    {
      "rel": "http://nodeinfo.diaspora.software/ns/schema/2.0",
      "href": "https://gnusocial.matoken.org/nodeinfo/2.0"
    }
  ]
}

詳細情報も.こちらは10秒くらい掛かります.

$ w3m -dump https://gnusocial.matoken.org/nodeinfo/2.0|jq
{
  "version": "2.0",
  "software": {
    "name": "gnusocial",
    "version": "1.2.0-beta5"
  },
  "protocols": [
    "ostatus"
  ],
  "services": {
    "inbound": [
      "atom1.0",
      "rss2.0",
      "gnusocial"
    ],
    "outbound": [
      "atom1.0",
      "rss2.0",
      "twitter",
      "gnusocial"
    ]
  },
  "openRegistrations": false,
  "usage": {
    "users": {
      "total": 5,
      "activeHalfyear": 2,
      "activeMonth": 1
    },
    "localPosts": 3448,
    "localComments": 427
  },
  "metadata": {}
}

使われるかわからないけどとりあえず.

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.