Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
Ambrose Chua | bf1b867dd4 | |
Ambrose Chua | 4439e925cd | |
Ambrose Chua | 47ebb3f376 | |
Ambrose Chua | f0707f5bfd | |
Ambrose Chua | 1313508713 | |
Ambrose Chua | 418187dc03 | |
Ambrose Chua | d3189dece2 | |
Ambrose Chua | 028133d29c | |
Ambrose Chua | 11cc028bdf | |
Ambrose Chua | f8e53694d9 |
34
.drone.yml
34
.drone.yml
|
@ -1,34 +0,0 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.14-alpine
|
||||
pull: true
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
commands:
|
||||
- cd coredns && go test
|
||||
- name: build
|
||||
image: golang:1.14-alpine
|
||||
pull: true
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
commands:
|
||||
- cd coredns && go build
|
||||
- name: release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
base_url: https://git.makerforce.io
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
files: coredns/coredns
|
||||
when:
|
||||
event: tag
|
||||
|
||||
# vim: ts=2:sw=2
|
|
@ -1 +1,2 @@
|
|||
coredns/build/
|
||||
coredns/coredns
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
# alias [![Build Status](https://ci.makerforce.io/api/badges/ambrose/alias/status.svg)](https://ci.makerforce.io/ambrose/alias)
|
||||
# alias
|
||||
|
||||
The *alias* plugin eliminates CNAME records from zone apex by making the subsequent resolved records look like they belong to the zone apex. This behaves similarily to [CloudFlare's Zone Flattening](https://support.cloudflare.com/hc/en-us/articles/200169056-CNAME-Flattening-RFC-compliant-support-for-CNAME-at-the-root).
|
||||
|
||||
|
@ -7,7 +7,7 @@ This plugin works only with plugins that produce A or AAAA records alongside the
|
|||
|
||||
> Preferrably, this should not be used in favour of the RFC drafts for the new [ANAME](https://tools.ietf.org/html/draft-ietf-dnsop-aname-00) records, but the DNS library used by CoreDNS does not support ANAME records yet.
|
||||
|
||||
Release builds can be found [here](https://git.makerforce.io/ambrose/alias/releases)
|
||||
Release builds can be found [here](https://github.com/serverwentdown/alias/releases)
|
||||
|
||||
## Syntax
|
||||
|
||||
|
@ -44,7 +44,7 @@ into
|
|||
example.com. 3600 IN A 127.0.0.1
|
||||
```
|
||||
|
||||
See [`examples/`](examples/) for a more extensive example.
|
||||
See [`example/`](example/) for a more extensive example.
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
6
alias.go
6
alias.go
|
@ -1,12 +1,12 @@
|
|||
package alias
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math"
|
||||
|
||||
"github.com/coredns/coredns/plugin"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"math"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// Rewrite is plugin to rewrite requests internally before being handled.
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
GO:=go
|
||||
NAME:=coredns
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
$(RM) -rf build && mkdir build
|
||||
GOOS=darwin GOARCH=amd64 $(GO) build -o build/coredns_darwin_amd64
|
||||
GOOS=windows GOARCH=amd64 $(GO) build -o build/coredns_windows_amd64.exe
|
||||
GOOS=linux GOARCH=amd64 $(GO) build -o build/coredns_linux_amd64
|
||||
GOOS=linux GOARCH=arm64 $(GO) build -o build/coredns_linux_arm64
|
|
@ -5,7 +5,7 @@ go 1.13
|
|||
replace github.com/serverwentdown/alias => ../
|
||||
|
||||
require (
|
||||
github.com/coredns/coredns v1.6.9
|
||||
github.com/miekg/dns v1.1.29
|
||||
github.com/coredns/coredns v1.11.1
|
||||
github.com/miekg/dns v1.1.55
|
||||
github.com/serverwentdown/alias v0.0.0-00010101000000-000000000000
|
||||
)
|
||||
|
|
3433
coredns/go.sum
3433
coredns/go.sum
File diff suppressed because it is too large
Load Diff
11
go.mod
11
go.mod
|
@ -1,10 +1,9 @@
|
|||
module github.com/serverwentdown/alias
|
||||
|
||||
go 1.13
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/caddyserver/caddy v1.0.5
|
||||
github.com/coredns/coredns v1.6.9
|
||||
github.com/miekg/dns v1.1.29
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
|
||||
)
|
||||
github.com/coredns/caddy v1.1.1
|
||||
github.com/coredns/coredns v1.11.1
|
||||
github.com/miekg/dns v1.1.55
|
||||
)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
package alias
|
||||
|
||||
func (al Alias) Ready() bool { return true }
|
10
setup.go
10
setup.go
|
@ -1,18 +1,12 @@
|
|||
package alias
|
||||
|
||||
import (
|
||||
"github.com/coredns/caddy"
|
||||
"github.com/coredns/coredns/core/dnsserver"
|
||||
"github.com/coredns/coredns/plugin"
|
||||
|
||||
"github.com/caddyserver/caddy"
|
||||
)
|
||||
|
||||
func init() {
|
||||
caddy.RegisterPlugin("alias", caddy.Plugin{
|
||||
ServerType: "dns",
|
||||
Action: setup,
|
||||
})
|
||||
}
|
||||
func init() { plugin.Register("alias", setup) }
|
||||
|
||||
func setup(c *caddy.Controller) error {
|
||||
c.Next()
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package alias
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/coredns/caddy"
|
||||
)
|
||||
|
||||
func TestSetup(t *testing.T) {
|
||||
c := caddy.NewTestController("dns", `alias`)
|
||||
if err := setup(c); err != nil {
|
||||
t.Fatalf("Expected no errors, but got: %v", err)
|
||||
}
|
||||
|
||||
c = caddy.NewTestController("dns", `alias more`)
|
||||
if err := setup(c); err == nil {
|
||||
t.Fatalf("Expected errors, but got: %v", err)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue