DocsSelf-hostInstaller & Déployer des GuidesDocker

Configuration de l'environnement auto-hébergé avec Forward Proxy

note

La configuration à l'aide d'un forward proxy ne doit être réalisée que par des utilisateurs avancés. Ce guide ne traite pas de la configuration du proxy direct lui-même.

Cet article présente les configurations nécessaires pour acheminer le trafic de votre instance Bitwarden auto-hébergée par le biais d'un proxy direct. Pour l'instant, seuls les environnements Linux Docker Compose prendront en charge cet environnement de proxy.

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.

Une fois que votre environnement auto-hébergé a été configuré par l'étape Créer un utilisateur local et un répertoire Bitwarden, vous pouvez revenir à ce guide et continuer avec la configuration du forward proxy.

Configurer Docker pour qu'il transmette à votre proxy

Configurer Docker pour qu'il achemine le trafic via votre proxy configuré :

  1. Créez et accédez au fichier 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. Dans le nouveau fichier, nous allons ajouter la configuration pour indiquer au proxy de tirer les requêtes HTTP et HTTPS à travers l'environnement du proxy, par exemple :

    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. Appliquer les changements :

    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. Restart Docker :

    Bash
    systemctl restart docker

Edit Bitwarden local user & directory

Maintenant que vous avez configuré Docker pour envoyer le trafic à travers le forward proxy, des configurations client supplémentaires seront nécessaires pour l'installation du forward proxy :

  1. Créez un répertoire .config dans les emplacements /opt/bitwarden.docker & /home/bitwarden.docker :

    Bash
    mkdir /opt/bitwarden/.docker && mkdir /home/bitwarden/.docker
  2. Créer un fichier config.json et ajouter des configurations pour le client 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. Copier config.json dans le répertoire /home/ de l'utilisateur bitwarden :

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

Ressemblera à quelque chose comme :

Une fois la configuration Docker terminée, nous pouvons poursuivre la procédure d'installation Linux auto-hébergée. Pour chaque guide de déploiement (déploiement standard Linux, déploiement manuel Linux et déploiement hors ligne Linux), les utilisateurs commenceront après l'étape Créer un utilisateur local et un répertoire Bitwarden pour terminer l'installation auto-hébergée.