Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 884 Bytes

README.md

File metadata and controls

41 lines (31 loc) · 884 Bytes

libdns-sitehost

This is a SiteHost provider for the libdns project. It provides functionality to manage DNS records on SiteHost. This can be used for projects like certmagic for DNS based challenges.

Installation

go get -u github.com/sitehostnz/libdns-sitehost

Usage

package main

import (
	"os"

	"github.com/libdns/libdns"
	sitehost "github.com/sitehostnz/libdns-sitehost"
)

func main() {
	// Set up certmagic to use DNS challenge/response
	certmagic.DefaultACME.DNS01Solver = &certmagic.DNS01Solver{
		DNSProvider: &sitehost.Provider{
			ClientID: os.Getenv("SITEHOST_CLIENT_ID"),
			APIKey:   os.Getenv("SITEHOST_API_KEY"),
		},
	}

	// Start serving HTTP/HTTPS
	err := certmagic.HTTPS([]string{"yourdomain.co.nz"}, HTTP_HANDLER)
	if err != nil {
		panic(err)
	}
}