DocsSelf-hostインストール&デプロイガイドドッカー

Forward Proxyでセルフホスト環境を設定する

note

フォワードプロキシを使用した構成は、上級ユーザーのみが完了してください。このガイドでは、フォワードプロキシ自体のセットアップについては説明しません。

この記事では、Bitwarden のセルフホストインスタンスのトラフィックをフォワードプロキシ経由でルーティングするために必要な設定を示します。現時点では、Linux Docker Compose 環境のみがこのプロキシ環境をサポートします。

note

In order to configure the forward proxy, follow the deployment steps for your Bitwarden self-hosted instance up to and including create a Bitwarden local users & directory.

セルフホスト環境が Create Bitwarden local user & directory ステップで設定されたら、このガイドに戻ってフォワードプロキシの設定を続けることができます。

プロキシに転送するように Docker を設定する

設定したプロキシを経由してトラフィックをルーティングするように Docker を設定します:

  1. systemd overrideファイルを作成してアクセスします:

    Bash
    # Create directory for docker.service.d sudo mkdir -p /etc/systemd/system/docker.service.d # create and edit http-proxy.conf in the new directory sudo nano -w /etc/systemd/system/docker.service.d/http-proxy.conf
  2. 新しいファイルに、例えばHTTPHTTPSリクエストをプロキシ環境を経由するようにプロキシに指示する設定を追加します:

    Bash
    [Service] Environment="HTTP_PROXY=http://10.138.0.3:3128" Environment="HTTPS_PROXY=http://10.138.0.3:3128" Environment="NO_PROXY=localhost,nginx,admin,mssql,sso,web,attachments,icons,notifications,icons"
    note

    Retrieve the information for the docker.service.d file from your proxy configuration file.

  3. 変更を適用する:

    Bash
    sudo systemctl daemon-reload
    note

    Configuring the proxy and any build-specific firewall configurations will require root access and sudo permission. These steps should be done before installing Bitwarden. When installing and setting up a Bitwarden self-host instance, using a dedicated Bitwarden user is required.

  4. Docker を再起動する:

    Bash
    systemctl restart docker

Bitwarden のローカルユーザーとディレクトリを編集する

これで Docker がフォワードプロキシを通してトラフィックを送信するように設定できたので、フォワードプロキシのセットアップに追加のクライアント設定が必要になります:

  1. opt/bitwarden.docker/home/bitwarden.dockerに.configディレクトリを作成します:

    Bash
    mkdir /opt/bitwarden/.docker && mkdir /home/bitwarden/.docker
  2. config.jsonファイルを作成し、Dockerクライアント用の設定を追加します:

    Bash
    sudo nano -w /opt/bitwarden/.docker/config.json # add configurations to config.json { "proxies": { "default": { "httpProxy": "http://10.138.0.3:3128", "httpsProxy": "http://10.138.0.3:3128", "noProxy": "localhost,nginx,admin,mssql,sso,web,attachments,icons,notifications,identity,api,events" } } }
  3. config.jsonbitwardenユーザーの/home/ディレクトリにコピーします:

    Plain Text
    sudo cp /opt/bitwarden/.docker/config.json /home/bitwarden/.docker

次のように見えるでしょう:

Dockerのコンフィギュレーションが完了したら、Linuxのセルフホストインストール手順を続行します。各デプロイメントガイド(Linux 標準デプロイメントLinux 手動デプロイメントLinux オフラインデプロイメント)では、ユーザーは[Create Bitwarden local user & directory(Bitwardenローカルユーザーとディレクトリの作成)]ステップの後に開始し、セルフホストインストールを完了します。