gamalan / caddy-tlsredis

Redis Storage using for Caddy TLS Data
Apache License 2.0
94 stars 31 forks source link

password field does not work, but CADDY_CLUSTERING_REDIS_PASSWORD does in caddy v2 #13

Closed regbo closed 3 years ago

regbo commented 3 years ago

See subject.

To reproduce:

docker run -it --rm --name redis -e REDIS_PASSWORD=password123 -p 6379:6379 bitnami/redis:latest

This does not work:

    "storage": {
        "aes_key": "redistls-01234567890-caddytls-32",
        "db": 1,
        "host": "localhost",
        "key_prefix": "caddytls",
        "module": "redis",
        "password": "password123",
        "port": "6379",
        "timeout": 5,
        "tls_enabled": false,
        "tls_insecure": true,
        "value_prefix": "caddy-storage-redis"
    }

This does work:

export CADDY_CLUSTERING_REDIS_PASSWORD=password123

with this config:

    "storage": {
        "aes_key": "redistls-01234567890-caddytls-32",
        "db": 1,
        "host": "localhost",
        "key_prefix": "caddytls",
        "module": "redis",
        "password": "",
        "port": "6379",
        "timeout": 5,
        "tls_enabled": false,
        "tls_insecure": true,
        "value_prefix": "caddy-storage-redis"
    }

error log:

2020/09/30 21:02:49.419 INFO    caddy.storage.redis     TLS Storage are using Redis, on 127.0.0.1:6379
2020/09/30 21:02:49.422 ERROR   admin.api       request error   {"error": "loading config: loading new config: loading storage module: loading module 'redis': provision caddy.storage.redis: NOAUTH Authentication required.", "status_code": 400}
2020/09/30 21:02:49.919 INFO    admin   stopped previous server
gamalan commented 3 years ago

which caddy2 version do you use?

regbo commented 3 years ago

Sorry for the late reply, the latest version built with xcaddy.