Help us shape the future of Go! Take the 2026 Go Developer Survey

njalla

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 4 Imported by: 0

README

Njalla for Caddy

DNS provider module backed by libdns/njalla. Use it to solve the ACME DNS-01 challenge and to manage records in Njalla zones.

Module name: dns.providers.njalla

Install

Caddy does not ship this module. Build it in with xcaddy:

xcaddy build --with github.com/caddy-dns/njalla

The included Dockerfile builds a Caddy image with the module baked in:

docker build -t caddy-njalla .

Authentication

Create a token under Settings → API. For the DNS-01 challenge, pick the ACME option: it grants add-record, edit-record, remove-record, and list-records, scoped to TXT records under _acme-challenge.

The libdns provider README lists the full permissions and the provider's behaviour.

Usage

Keep the token in an environment variable. Caddy resolves placeholders when it provisions the module, and a literal string also works.

Caddyfile

One site, through the tls directive:

tls {
	dns njalla {env.NJALLA_API_TOKEN}
}

Every site, through global options:

{
	acme_dns njalla {env.NJALLA_API_TOKEN}
}

The token also takes a block:

tls {
	dns njalla {
		api_token {env.NJALLA_API_TOKEN}
	}
}
JSON

Configure the ACME issuer:

{
  "module": "acme",
  "challenges": {
    "dns": {
      "provider": {
        "name": "njalla",
        "api_token": "{env.NJALLA_API_TOKEN}"
      }
    }
  }
}

Troubleshooting

Symptom Cause
API token is empty after resolving placeholders The placeholder resolved to nothing. Set the variable for the process running Caddy. A systemd unit ignores your shell environment, so declare it with Environment= or EnvironmentFile=.
The challenge record stays in the zone The token cannot call remove-record for _acme-challenge. Njalla's ACME token option covers it.
A wildcard certificate fails Request the certificate for the Njalla domain. If you delegated a subdomain elsewhere, that provider serves it and this module cannot write there.
unrecognized subdirective The block accepts api_token and nothing else. Check the spelling.

Testing

go test ./...

Confirm the module links into a real Caddy build:

xcaddy build --with github.com/caddy-dns/njalla=.
./caddy list-modules | grep dns.providers.njalla

Documentation

Overview

Package njalla provides a Caddy DNS provider module for Njalla, wrapping the libdns implementation at github.com/libdns/njalla.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{ *libdnsnjalla.Provider }

Provider wraps the Njalla libdns provider 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 resolves placeholders in the API token before it is used. Implements caddy.Provisioner.

func (*Provider) UnmarshalCaddyfile

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

UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens. Two syntaxes are supported:

njalla <api_token>

njalla {
    api_token <api_token>
}

Placeholders such as {env.NJALLA_API_TOKEN} are resolved during provisioning.

Jump to

Keyboard shortcuts

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