Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HaProxy password does not seem to support special characters #24

Closed
MaVdbussche opened this issue May 22, 2024 · 1 comment · Fixed by #25
Closed

HaProxy password does not seem to support special characters #24

MaVdbussche opened this issue May 22, 2024 · 1 comment · Fixed by #25

Comments

@MaVdbussche
Copy link

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 ;)

@bigcat88
Copy link
Member

Thank you for reporting this, the release with fixes will be in 1-3 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants