首页 > 解决方案 > Influx 中的身份验证允许所有用户名

问题描述

标签: pythondockerinfluxdbinfluxdb-python

解决方案


要激活身份验证系统,您必须设置INFLUXDB_HTTP_AUTH_ENABLEDtrue

如,根据https://github.com/influxdata/influxdb/blob/1.8/docker/init-influxdb.sh

...
AUTH_ENABLED="$INFLUXDB_HTTP_AUTH_ENABLED"

if [ -z "$AUTH_ENABLED" ]; then
    AUTH_ENABLED="$(grep -iE '^\s*auth-enabled\s*=\s*true' /etc/influxdb/influxdb.conf | grep -io 'true' | cat)"
else
    AUTH_ENABLED="$(echo ""$INFLUXDB_HTTP_AUTH_ENABLED"" | grep -io 'true' | cat)"
fi
...

推荐阅读