1
0
Fork 0

Compare commits

...

11 Commits

Author SHA1 Message Date
Ambrose Chua bf1b867dd4 Update CoreDNS version 2023-09-11 00:37:57 +08:00
Ambrose Chua 4439e925cd Update link to releases 2021-01-24 09:40:55 +08:00
Ambrose Chua 47ebb3f376 Add build scripts and cleanup 2021-01-24 09:38:16 +08:00
Ambrose Chua f0707f5bfd Update to match new CoreDNS version
Closes #6
2021-01-24 09:20:40 +08:00
Ambrose Chua 1313508713 Add coredns to gitignore
continuous-integration/drone/push Build is passing Details
2020-04-25 23:43:43 +08:00
Ambrose Chua 418187dc03 Add attachments during release 2020-04-25 23:24:32 +08:00
Ambrose Chua d3189dece2 Add multiarch builds
continuous-integration/drone/push Build is passing Details
2020-04-25 20:39:19 +08:00
Ambrose Chua 028133d29c Add release script
Gitea can't notify Drone of new tags synced from GitHub, so this script
serves to generate releases.
2020-04-25 20:34:35 +08:00
Ambrose Chua 11cc028bdf Update README.md example link
continuous-integration/drone/push Build is passing Details
2020-04-25 19:13:52 +08:00
Ambrose Chua f8e53694d9 Do builds only on tag
continuous-integration/drone/push Build is passing Details
2020-04-25 18:16:57 +08:00
Ambrose Chua 2476d2939b Add link to releases
continuous-integration/drone/push Build is passing Details
2020-04-25 18:14:35 +08:00
12 changed files with 6315 additions and 487 deletions

View File

@ -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
.gitignore vendored
View File

@ -1 +1,2 @@
coredns/build/
coredns/coredns

View File

@ -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,6 +7,8 @@ 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://github.com/serverwentdown/alias/releases)
## Syntax
```
@ -42,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

View File

@ -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.

10
coredns/Makefile Normal file
View File

@ -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

View File

@ -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
)

File diff suppressed because it is too large Load Diff

11
go.mod
View File

@ -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
)

3265
go.sum

File diff suppressed because it is too large Load Diff

3
ready.go Normal file
View File

@ -0,0 +1,3 @@
package alias
func (al Alias) Ready() bool { return true }

View File

@ -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()

19
setup_test.go Normal file
View File

@ -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)
}
}