caddy_trusted_gcp_cloudcdn

package module
v0.0.0-...-66661bc Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 9 Imported by: 0

README

trusted_proxies GCP Cloud CDN module for Caddy

The module auto trusted_proxies GCP CloudCDN EDGE servers from _cloud-eoips.googleusercontent.com TXT record

Doc: https://cloud.google.com/cdn/docs/set-up-external-backend-internet-neg

Install

The simplest, cross-platform way to get started is to download Caddy from GitHub Releases and place the executable file in your PATH.

Build from source

Requirements:

Build:

$ xcaddy build --with github.com/xcaddyplugins/caddy-trusted-gcp-cloudcdn

Caddyfile Syntax

trusted_proxies gcp_cloudcdn {
	interval <duration>
}
  • interval How often to fetch the latest IP list. format is caddy.Duration. For example 12h represents 12 hours, and "1d" represents one day. default value 1d.

Caddyfile Example

trusted_proxies gcp_cloudcdn {
	interval 1d
}
Caddyfile Use Default Settings Example
trusted_proxies gcp_cloudcdn

Caddyfile Global Trusted Example

Insert the following configuration of Caddyfile to apply it globally.

{
	servers {
		trusted_proxies gcp_cloudcdn
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaddyTrustedGCPCloudCDN

type CaddyTrustedGCPCloudCDN struct {
	// Interval to update the trusted proxies list. default: 1d
	Interval caddy.Duration `json:"interval,omitempty"`
	// contains filtered or unexported fields
}

The module auto trusted_proxies `GCP CloudCDN EDGE servers` from `_cloud-eoips.googleusercontent.com` TXT record Doc: https://cloud.google.com/cdn/docs/set-up-external-backend-internet-neg Range from: _cloud-eoips.googleusercontent.com

func (CaddyTrustedGCPCloudCDN) CaddyModule

func (CaddyTrustedGCPCloudCDN) CaddyModule() caddy.ModuleInfo

func (*CaddyTrustedGCPCloudCDN) GetIPRanges

func (s *CaddyTrustedGCPCloudCDN) GetIPRanges(_ *http.Request) []netip.Prefix

func (*CaddyTrustedGCPCloudCDN) Provision

func (s *CaddyTrustedGCPCloudCDN) Provision(ctx caddy.Context) error

func (*CaddyTrustedGCPCloudCDN) UnmarshalCaddyfile

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

UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:

gcp_cloudcdn {
   interval <duration>
}

Jump to

Keyboard shortcuts

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