Thanks to visit codestin.com
Credit goes to github.com

Skip to content

HaProxy password does not seem to support special characters #24

@MaVdbussche

Description

@MaVdbussche

Hello,

After trying to setup the Docker daemon proxy for a while, I think I was able to identify that the environment variable NC_HAPROXY_PASSWORD does not support special characters.

However, no warning at all is logged in the console : the container happily starts, but throws 401 errors when attempting to connect.

You can see below that my password is logged in plain text (something to probably address but it will be less of an issue when #22 is addressed). It contains a "#" character :

HaProxy config:
# Inspiration: https://github.com/ZoeyVid/docker-socket-proxy/blob/develop/haproxy.cfg
global
    log stdout local0 info
    maxconn 8192
    ca-base /etc/ssl/certs
defaults
    log global
    option httplog
    option dontlognull
    timeout connect 10s
    timeout client 30s
    timeout server 1800s
userlist app_api_credentials
    user app_api_haproxy_user insecure-password [REDACTED]er#
frontend docker_engine
    mode http
    bind *:2375 v4v6

This throws a 401 error when attempting to register or test the connection to the daemon :

<134>May 22 14:17:22 haproxy[13]: 10.10.149.3:47462 [22/May/2024:14:17:22.176] docker_engine docker_engine/<NOSRV> 0/-1/-1/-1/0 401 251 - - LR-- 1/1/0/0/0 0/0 "GET /v1.41/_ping HTTP/1.1"

The exact same password without the '#' character works (200 at the bottom) :

HaProxy config:
# Inspiration: https://github.com/ZoeyVid/docker-socket-proxy/blob/develop/haproxy.cfg
global
    log stdout local0 info
    maxconn 8192
    ca-base /etc/ssl/certs
defaults
    log global
    option httplog
    option dontlognull
    timeout connect 10s
    timeout client 30s
    timeout server 1800s
userlist app_api_credentials
    user app_api_haproxy_user insecure-password [REDACTED]er
frontend docker_engine
    mode http
    bind *:2375 v4v6
[REDUCED FOR READABILITY]
<134>May 22 14:19:06 haproxy[14]: 10.10.149.3:57692 [22/May/2024:14:19:06.069] docker_engine bk_docker_engine/dockersocket 0/0/0/0/0 200 289 - - ---- 1/1/0/0/0 0/0 "GET /v1.41/_ping HTTP/1.1"

The character '&' does something even weirder, trying to replace with some (to my knowledge undocumented) ENV variable :

HaProxy config:
# Inspiration: https://github.com/ZoeyVid/docker-socket-proxy/blob/develop/haproxy.cfg
global
    log stdout local0 info
    maxconn 8192
    ca-base /etc/ssl/certs
defaults
    log global
    option httplog
    option dontlognull
    timeout connect 10s
    timeout client 30s
    timeout server 1800s
userlist app_api_credentials
    user app_api_haproxy_user insecure-password NC_PASSWORD_PLACEHOLDERer
frontend docker_engine
    mode http
    bind *:2375 v4v6

According to me, this issue isn't coming from my compose file since I use quotes around my ENV variables there.

If this issue can't be fixed, I think it should at least be mentionned in the documentation to save some painful debugging hours to people ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions