caddy_ask_redis

package module
v0.0.0-...-3fd1e7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 8 Imported by: 0

README

caddy-ask-redis

Caddy Server v2 module for use in tls_on_demand ask property. The module will check if requested domain is a member of the Redis set defined by key.

Installation

xcaddy build \
    --with github.com/randock/caddy-ask-redis

Usage

Caddyfile

# Global config
{
   	on_demand_tls {
		permission redis {
			address {$REDIS_HOST_PORT}
            username {$REDIS_USERNAME}
            password {$REDIS_PASSWORD}
        }
	}
}

Documentation

Index

Constants

View Source
const (
	DefaultRedisAddress  = "127.0.0.1:6379"
	DefaultRedisUsername = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionByRedis

type PermissionByRedis struct {
	Client *redis.Client

	WwwRegex *regexp.Regexp

	Address  string `json:"address"`
	Username string `json:"username"`
	Password string `json:"password"`
	Prefix   string `json:"prefix"`
	// contains filtered or unexported fields
}

func (PermissionByRedis) CaddyModule

func (PermissionByRedis) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (PermissionByRedis) CertificateAllowed

func (m PermissionByRedis) CertificateAllowed(ctx context.Context, name string) error

func (*PermissionByRedis) Cleanup

func (m *PermissionByRedis) Cleanup() error

func (*PermissionByRedis) Provision

func (m *PermissionByRedis) Provision(ctx caddy.Context) error

Provision implements the caddy.Provisioner interface.

func (*PermissionByRedis) UnmarshalCaddyfile

func (m *PermissionByRedis) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:

ask_redis <secret>

func (*PermissionByRedis) Validate

func (m *PermissionByRedis) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL