Misskey: Basic認証を必要とするElasticSearchサーバーの設定

Created on 15 Mar 2020  ·  3Comments  ·  Source: syuilo/misskey

Summary

elastic.co などのManagedサービスで提供されるElasticSearchはセキュリティ対策の為ユーザー認証が必要だけど、今のところ対応してない

試したもの

elasticsearch:
  host: misskey\:[email protected]
  port: 9200
  ssl: true
  index: misskey_note

→動かない(Mastodonはこういうふうに設定して動いた)

Workaround

→ NginXでプロキシさせることにしたら一応動いた
/etc/nginx/sites-enabled/es.proxy

server {
  listen 127.0.0.1:9200;
  listen [::1]:9200;

  location / {
    proxy_set_header Host               "hoge.elastic.co:9200";
    proxy_set_header X-Real-IP          $remote_addr;
    proxy_set_header X-Forwarded-Host   "hoge.elastic.co:9200";
    proxy_set_header X-Forwarded-Proto  https;
    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;

    proxy_pass https://hoge.elastic.co:9200;
    proxy_set_header Authorization      "Basic <id:pass をbase64 にした文字列>";
    proxy_redirect http:// https://;
  }
}

.config/default.yml

elasticsearch:
  host: localhost
  port: 9200
  #ssl: true
  index: misskey_note
✨Feature

Most helpful comment

host: misskey\:[email protected]

\いらないかも

All 3 comments

host: misskey\:[email protected]

\いらないかも

host: misskey\:[email protected]

\いらないかも

\なしでもう一度試してみたら普通に設定できました😆🤯💥

なんかconfigにpass設定できるのにその値見てない

Was this page helpful?
0 / 5 - 0 ratings