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é :
Créez et accédez au fichier
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.confDans le nouveau fichier, nous allons ajouter la configuration pour indiquer au proxy de tirer les requêtes
HTTPetHTTPSà 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.dfile from your proxy configuration file.Appliquer les changements :
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.
Restart Docker :
Bashsystemctl 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 :
Créez un répertoire .config dans les emplacements
/opt/bitwarden.docker&/home/bitwarden.docker:Bashmkdir /opt/bitwarden/.docker && mkdir /home/bitwarden/.dockerCréer un fichier
config.jsonet ajouter des configurations pour le client 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" } } }Copier
config.jsondans le répertoire/home/de l'utilisateurbitwarden:Plain Textsudo 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.