Skip to content

MeisskeyController

Tatsuya Koishi edited this page Dec 1, 2020 · 42 revisions

めいすきー等、Misskey 10.xからのフォーク(MongoDBを使用したもの)に対するコントローラー。
本家Misskey用はMisskeyControllerを参照。

対応API

ハンドラへの制約

以下のハンドラは実行できない。

その他の制約

nginxの設定例

Misskey公式の設定例を使用し、 同一ホストにモロヘイヤを置く想定で。

  location = /api/notes/create {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_http_version 1.1;
    proxy_redirect off;
    if ($http_x_mulukhiya != '') {
      proxy_pass http://localhost:3000;
    }
    if ($http_x_mulukhiya = '') {
      proxy_pass http://localhost:3008;
    }
  }
  location = /api/drive/files/create {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_http_version 1.1;
    proxy_redirect off;
    if ($http_x_mulukhiya != '') {
      proxy_pass http://localhost:3000;
    }
    if ($http_x_mulukhiya = '') {
      proxy_pass http://localhost:3008;
    }
  }
  location = /api/notes/favorites/create {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_http_version 1.1;
    proxy_redirect off;
    if ($http_x_mulukhiya != '') {
      proxy_pass http://localhost:3000;
    }
    if ($http_x_mulukhiya = '') {
      proxy_pass http://localhost:3008;
    }
  }
  location = /api/messaging/messages/create {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_http_version 1.1;
    proxy_redirect off;
    if ($http_x_mulukhiya != '') {
      proxy_pass http://localhost:3000;
    }
    if ($http_x_mulukhiya = '') {
      proxy_pass http://localhost:3008;
    }
  }
  location ^~ /mulukhiya {
    proxy_pass http://localhost:3008;
  }

設定ファイルのサンプル

environment: production
controller: meisskey
meisskey:
  url: https://meisskey.example.com/
agent:
  test:
    token: hogehoge
  info:
    token: fugafuga
mongo:
  dsn: mongo://localhost:27017/misskey
user_config:
  redis:
    dsn: redis://localhost:6379/1
sidekiq:
  redis:
    dsn: redis://localhost:6379/2
  auth:
    password: your_password
slack:
  hooks:
    - https://hooks.slack.com/services/xxxxx
    - https://discordapp.com/api/webhooks/xxxxx/slack
amazon:
  associate_tag: hoge
  access_key: fuga
  secret_key: piyo
  affiliate: true
spotify:
  client:
    id: hoge
    secret: fuga
google:
  api:
    key: xxxxx
tagging:
  default_tags:
    - デフォルトタグ1
    - デフォルトタグ2
  dictionaries:
    - url: https://mstdn.example.com/dictionaries/dic1
      fields:
        - cure_name
        - human_name
        - cv
    - url: https://mstdn.example.com/dictionaries/dic2
      fields:
        - field1
        - field2
    - url: https://mstdn.example.com/dictionaries/dic3
      type: relative
    - url: https://mstdn.example.com/dictionaries/dic4
      type: mecab
crypt:
  salt: your_salt
  password: your_password
Clone this wiki locally