Skip to content
Redis Storage using for Caddy TLS Data
Go
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore first commit Aug 12, 2019
LICENSE first commit Aug 12, 2019
README.md first commit Aug 12, 2019
crypto.go first commit Aug 12, 2019
crypto_test.go first commit Aug 12, 2019
go.mod skip test if no redis storage Aug 14, 2019
go.sum skip test if no redis storage Aug 14, 2019
options.go first commit Aug 12, 2019
options_test.go first commit Aug 12, 2019
storageredis.go update comment Aug 14, 2019
storageredis_test.go skip test if no redis storage Aug 14, 2019

README.md

Caddy Cluster / Certmagic TLS cluster support for Redis

This plugin is based on similar plugin using Consul. Most of the aspect is also similar, I pretty much copy the crypto implementation. The reason I use Redis is because it easier to setup.

For now, this will support redis as single instance, or with replica, but NOT the cluster. This plugin utilize go-redis/redis for its client access and redislock for it's locking mechanism. See distlock for the lock algorithm.

This plugin currently work with versions of Caddy that use https://github.com/mholt/certmagic and its new storage interface (> 0.11.1)

Configuration

You enable Consul storage with Caddy by setting the CADDY_CLUSTERING environment variable to redis.

There are additional environment variable for this plugin:

  • CADDY_CLUSTERING_REDIS_HOST defines Redis Host, default is 127.0.0.1
  • CADDY_CLUSTERING_REDIS_PORT defines Redis Port, default is 6379
  • CADDY_CLUSTERING_REDIS_PASSWORD defines Redis Password, default is empty
  • CADDY_CLUSTERING_REDIS_DB defines Redis DB, default is 0
  • CADDY_CLUSTERING_REDIS_TIMEOUT defines Redis Dial,Read,Write timeout, default is set to 5 for 5 seconds
  • CADDY_CLUSTERING_REDIS_AESKEY defines your personal AES key to use when encrypting data. It needs to be 32 characters long.
  • CADDY_CLUSTERING_REDIS_KEYPREFIX defines the prefix for the keys. Default is caddytls
  • CADDY_CLUSTERING_REDIS_VALUEPREFIX defines the prefix for the values. Default is caddy-storage-redis

TODO

  • Add Redis Cluster or Sentinel support (probably need to update the distlock implementation first)
You can’t perform that action at this time.