Skip to content

Add support for setting a username for Redis connections in Environment variables #72

@jwiren

Description

@jwiren

Is this a new feature request?

  • I have searched the existing issues

Wanted change

Adding support for setting a username in Redis configuration, via the Environment variables.

I have a Redis cluster and need to use a username/password to connect to it, but this container provides no option to set the username via environment variables.

I got it working by editing the configuration file manually inside the container, after starting it.

In /config/configuration.py with specific details changed:

REDIS = {
'tasks': {
'HOST': 'rediscluster.domain',
'PORT': 6379,
# Comment out HOST and PORT lines and uncomment the following if using Redis Sentinel
# 'SENTINELS': [('mysentinel.redis.example.com', 6379)],
# 'SENTINEL_SERVICE': 'netbox',
'PASSWORD': 'bbb',
'DATABASE': 0,
'USERNAME': 'aaa',
'SSL': False,
# Set this to True to skip TLS certificate verification
# This can expose the connection to attacks, be careful
# 'INSECURE_SKIP_TLS_VERIFY': False,
},
'caching': {
'HOST': 'rediscluster.domain',
'PORT': 6379,
# Comment out HOST and PORT lines and uncomment the following if using Redis Sentinel
# 'SENTINELS': [('mysentinel.redis.example.com', 6379)],
# 'SENTINEL_SERVICE': 'netbox',
'PASSWORD': 'yyy',
'USERNAME': 'zzz',
'DATABASE': 1,
'SSL': False,
# Set this to True to skip TLS certificate verification
# 'INSECURE_SKIP_TLS_VERIFY': False,
}
}

"USERNAME" line above.

Reason for change

Containers should be cattle, and if this needs to be changed manually, it becomes hard to maintain and update, and adding a line to the environment settings would make it usable in more use-cases with small effort.

Proposed code change

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions