Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.
Tatsuya Koishi edited this page Feb 8, 2019 · 5 revisions

onionbot

Chinachuのイベントを、Slack(及び互換性があるwebhook)に通知するBOT。
現在は録画の開始と終了にのみ対応。

■設置の手順

リポジトリをクローン

git clone git@github.com:pooza/onionbot.git

依存するgemのインストール

cd onionbot
bundle install

local.yamlを編集

vi config/local.yaml

以下、設定例。 /slack/hooks/* に、SlackのWebhookと互換性のあるものを列挙。
(拙作tomato-tootも該当)

chinachu:
  url: http://localhost:20772/ #ChinachuのURL
slack:
  hooks:
    - https://hooks.slack.com/services/xxxxx
    - https://discordapp.com/api/webhooks/xxxxx/slack
    - https://mstdn.b-shock.org/webhook/v1.0/toot/xxxxx

syslog設定

onionbotというプログラム名で、syslogに出力している。
以下、rsyslogでの設定例。

:programname, isequal, "onionbot" -/var/log/onionbot.log

■操作

loader.rbを実行する。root権限不要。
通常はcronで5分毎等で起動すればよいと思う。

■設定ファイルの検索順

local.yamlは、上記設置例ではconfigディレクトリ内に置いているが、 実際には以下の順に検索している。(ROOT_DIRは設置先)

  • /usr/local/etc/onionbot/local.yaml
  • /usr/local/etc/onionbot/local.yml
  • /etc/onionbot/local.yaml
  • /etc/onionbot/local.yml
  • ROOT_DIR/config/local.yaml
  • ROOT_DIR/config/local.yml

Clone this wiki locally