Compare commits
2 Commits
1fc84b3ee3
...
7a7e50bf34
Author | SHA1 | Date | |
---|---|---|---|
7a7e50bf34 | |||
89c122f270 |
10
README.md
10
README.md
@ -4,19 +4,19 @@ CLI tool to manage cloudflare DNS records
|
||||
|
||||
### Using [go](https://go.dev)
|
||||
```bash
|
||||
❯ go install go.balki.me/cloudflare-dns-cli@latest
|
||||
go install go.balki.me/cloudflare-dns-cli@latest
|
||||
|
||||
# Run directly without installing
|
||||
❯ go run go.balki.me/cloudflare-dns-cli@latest -h
|
||||
go run go.balki.me/cloudflare-dns-cli@latest -h
|
||||
|
||||
```
|
||||
### Using [docker](https://www.docker.com)
|
||||
```bash
|
||||
❯ mkdir -p $HOME/bin
|
||||
❯ docker run --pull=always --rm -v "$HOME/bin:/op" golang sh -c "go install go.balki.me/cloudflare-dns-cli@latest && install -o $(id -u) -g $(id -g) /go/bin/cloudflare-dns-cli /op/"
|
||||
mkdir -p $HOME/bin
|
||||
docker run --pull=always --rm -v "$HOME/bin:/op" golang sh -c "go install go.balki.me/cloudflare-dns-cli@latest && install -o $(id -u) -g $(id -g) /go/bin/cloudflare-dns-cli /op/"
|
||||
|
||||
# Run directly without installing
|
||||
❯ docker run --pull=always --rm golang go run go.balki.me/cloudflare-dns-cli@latest -h
|
||||
docker run --pull=always --rm golang go run go.balki.me/cloudflare-dns-cli@latest -h
|
||||
```
|
||||
|
||||
## Features
|
||||
|
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
||||
module go.balki.me/cloudflare-dns-cli
|
||||
|
||||
go 1.20
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/libdns/cloudflare v0.1.0
|
||||
|
10
main.go
10
main.go
@ -113,6 +113,16 @@ func main() {
|
||||
flag.BoolVar(&mx, "m", mx, "Set mx record with cname value")
|
||||
flag.Parse()
|
||||
|
||||
if token == "" {
|
||||
flag.Usage()
|
||||
log.Panicln("empty cloudflare api token")
|
||||
}
|
||||
|
||||
if domain == "" {
|
||||
flag.Usage()
|
||||
log.Panicln("empty domain name")
|
||||
}
|
||||
|
||||
provider := cloudflare.Provider{APIToken: token}
|
||||
zone := domain + "."
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user