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": {}
}

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

コメントを残す

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

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)