haproxy-config 0.4.1

Parse HAProxy configs and easily query it
Documentation
#  vim:ts=4:sts=4:sw=4:et
#
#  Author: Hari Sekhon
#  Date: 2017-12-16 09:14:31 +0000 (Sat, 16 Dec 2017)
#
#  https://github.com/HariSekhon/HAProxy-configs
#
#  License: see accompanying Hari Sekhon LICENSE file
#
#  If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
#  https://www.linkedin.com/in/HariSekhon
#

# ============================================================================ #
#                           H A P r o x y   S t a t s
# ============================================================================ #

userlist stats-auth
    group admin    users admin
    group readonly users haproxy
    user  admin     insecure-password test
    user  haproxy   insecure-password test

listen stats
    bind *:1936
    mode   http
    option httplog
    stats enable
    acl internal_networks src 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8 127.0.0.1
    stats http-request deny unless internal_networks
    stats uri /  # default: /haproxy?stats
    stats hide-version
    stats show-legends
    stats show-node
    # simple user - allow admin if localhost
    #stats auth haproxyuser:haproxypw
    #stats admin if LOCALHOST  # pre-defined acl -> src 127.0.0.1/8
    acl AUTH       http_auth(stats-auth)
    acl AUTH_ADMIN http_auth_group(stats-auth) admin
    stats http-request auth unless AUTH
    stats admin if AUTH_ADMIN