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 を設定します:
systemdoverrideファイルを作成してアクセスします: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新しいファイルに、例えば
HTTPとHTTPSリクエストをプロキシ環境を経由するようにプロキシに指示する設定を追加します: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.dfile from your proxy configuration file.変更を適用する:
Bashsudo systemctl daemon-reloadnote
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.
Docker を再起動する:
Bashsystemctl restart docker
Bitwarden のローカルユーザーとディレクトリを編集する
これで Docker がフォワードプロキシを通してトラフィックを送信するように設定できたので、フォワードプロキシのセットアップに追加のクライアント設定が必要になります:
opt/bitwarden.dockerと/home/bitwarden.dockerに.configディレクトリを作成します:Bashmkdir /opt/bitwarden/.docker && mkdir /home/bitwarden/.dockerconfig.jsonファイルを作成し、Dockerクライアント用の設定を追加します:Bashsudo 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" } } }config.jsonをbitwardenユーザーの/home/ディレクトリにコピーします:Plain Textsudo cp /opt/bitwarden/.docker/config.json /home/bitwarden/.docker
次のように見えるでしょう:
Dockerのコンフィギュレーションが完了したら、Linuxのセルフホストインストール手順を続行します。各デプロイメントガイド(Linux 標準デプロイメント、Linux 手動デプロイメント、Linux オフラインデプロイメント)では、ユーザーは[Create Bitwarden local user & directory(Bitwardenローカルユーザーとディレクトリの作成)]ステップの後に開始し、セルフホストインストールを完了します。