hwdns

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 3 Imported by: 0

README

Huawei Cloud DNS module for Caddy

This package contains a DNS provider module for Caddy. It can be used to manage DNS records with Huawei Cloud accounts.

Caddy module name

dns.providers.hwdns

Config examples

To use this module for the ACME DNS challenge, configure the ACME issuer in your Caddy JSON like so:

{
  "module": "acme",
  "challenges": {
    "dns": {
      "provider": {
        "name": "hwdns",
        "access_key_id":"YOUR_HUAWEICLOUD_ACCESS_KEY_ID",
        "secret_access_key":"YOUR_HUAWEICLOUD_SECRET_ACCESS_KEY",
        "region": "PREFERRED_REGION_ID"
      }
    }
  }
}

or with the Caddyfile:

# globally

acme_dns hwdns {
  access_key_id {env.HUAWEICLOUD_ACCESS_KEY_ID}
  secret_access_key {env.HUAWEICLOUD_SECRET_ACCESS_KEY}
  region PREFERRED_REGION_ID
}
# one site

tls {
  # you may need to add this when DNS challenge times out
  resolvers ns1.huaweicloud-dns.org
  dns hwdns {
    access_key_id {env.HUAWEICLOUD_ACCESS_KEY_ID}
    secret_access_key {env.HUAWEICLOUD_SECRET_ACCESS_KEY}
    region PREFERRED_REGION_ID
  }
}

You can replace {env.HUAWEICLOUD_ACCESS_KEY_ID},{env.HUAWEICLOUD_SECRET_ACCESS_KEY} with the actual auth token in the "" if you prefer to put it directly in your config instead of an environment variable.

You can omit the "region" if you don't have any specific requirements.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{ *libhw.Provider }

Provider wraps the provider implementation as a Caddy module.

func (Provider) CaddyModule

func (Provider) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Provider) Provision

func (p *Provider) Provision(ctx caddy.Context) error

Provision implements the Provisioner interface to initialize the client

func (*Provider) UnmarshalCaddyfile

func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Syntax:

hwdns {
    access_key_id <string>
    secret_access_key <string>
    region <string>
}

Jump to

Keyboard shortcuts

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