-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from lfaoro/develop
release-v2
- Loading branch information
Showing
91 changed files
with
5,986 additions
and
9,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
idea.md | ||
*.bind | ||
.dockerignore | ||
flaredns | ||
*.cast | ||
.vscode/ | ||
.idea/ | ||
.idea/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -mod=vendor | ||
goos: | ||
- darwin | ||
- linux | ||
- freebsd | ||
goarch: | ||
- 386 | ||
- amd64 | ||
- arm64 | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
sign: | ||
artifacts: checksum | ||
snapshot: | ||
name_template: "{{ .Tag }}" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^vendor:' | ||
- '^refactor:' | ||
|
||
brew: | ||
# Repository to push the tap to. | ||
github: | ||
owner: lfaoro | ||
name: tap | ||
|
||
# Git author used to commit to the repository. | ||
# Defaults are shown. | ||
commit_author: | ||
name: Leonardo Faoro | ||
email: [email protected] | ||
|
||
# Your app's homepage. | ||
# Default is empty. | ||
homepage: "https://github.com/lfaoro/flares" | ||
|
||
# Your app's description. | ||
# Default is empty. | ||
description: "Flares is a CloudFlare DNS backup tool" | ||
|
||
# Setting this will prevent goreleaser to actually try to commit the updated | ||
# formula - instead, the formula file will be stored on the dist folder only, | ||
# leaving the responsibility of publishing it to the user. | ||
# If set to auto, the release will not be uploaded to the homebrew tap | ||
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 | ||
# Default is false. | ||
skip_upload: false | ||
|
||
# So you can `brew test` your formula. | ||
# Default is empty. | ||
test: | | ||
system "#{bin}/flares --version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
MIT License | ||
Copyright (c) 2019 Leonardo Faoro. All rights reserved. | ||
|
||
Copyright (c) 2018 The Flares Authors. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following disclaimer | ||
in the documentation and/or other materials provided with the | ||
distribution. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
* Neither the name of Leonardo Faoro nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,75 @@ | ||
# Flares 🔥 | ||
|
||
Flares is a CloudFlare DNS backup tool: every time it runs, dumps your DNS table to the screen. | ||
|
||
Optionally exports the data into (BIND formatted) zone files. | ||
Flares is a CloudFlare DNS backup tool, it dumps your DNS table to the screen or exports it as BIND formatted zone | ||
files. | ||
|
||
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/lfaoro/flares)](https://goreportcard.com/report/github.com/lfaoro/flares) | ||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flfaoro%2Fflares.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flfaoro%2Fflares?ref=badge_shield) | ||
|
||
![flaredns_demo](static/flaredns_demo.gif) | ||
## Quick Start | ||
|
||
## Quick Start - docker (painless) | ||
### [Video Tutorial](https://asciinema.org/a/NLVa6TyQzvTEhnzZDdH1q79lO) | ||
|
||
### Docker | ||
```bash | ||
# CloudFlare API key is here: | ||
# Fetch your CloudFlare API key from here: | ||
# https://dash.cloudflare.com/profile -> Global API Key -> View | ||
|
||
$ export CF_API_KEY=abcdef1234567890 | ||
$ export [email protected] | ||
|
||
$ docker run -it --rm \ | ||
-e CF_API_KEY="$CF_API_KEY" \ | ||
-e CF_API_EMAIL="$CF_API_EMAIL" \ | ||
lfaoro/flares domain1.tld domain2.tld | ||
``` | ||
|
||
## Quick Start - compile (full control) | ||
|
||
Golang must be installed: https://golang.org/dl/ | ||
|
||
### macOS | ||
```bash | ||
# flaredns | ||
$ go get -u github.com/lfaoro/flares/cmd/flaredns | ||
$ cd $GOPATH/src/github.com/lfaoro/flares/ | ||
# flarelogs (TODO: coming soon) | ||
# $ go get -u github.com/lfaoro/flares/cmd/flarelogs | ||
brew install lfaoro/tap/flares | ||
``` | ||
|
||
### Set the CF_API_KEY and CF_API_EMAIL | ||
### Linux (soon) | ||
```bash | ||
curl apionic.com/flares.sh | bash | ||
``` | ||
|
||
### Developers | ||
> Go installer: https://golang.org/dl/ | ||
```bash | ||
$ flaredns auth # (TODO: coming soon) opens the dashboard at https://dash.cloudflare.com/profile | ||
$ export CF_API_KEY=abcdef1234567890 | ||
$ export [email protected] | ||
go get -u github.com/lfaoro/flares | ||
make install | ||
flares -h | ||
|
||
make test | ||
``` | ||
|
||
### Run the app | ||
## Examples | ||
|
||
```bash | ||
$ make install | ||
$ flaredns -h | ||
$ flaredns domain.tld | ||
$ flaredns domain.tld --export /tmp/tables | ||
$ flares -h | ||
|
||
$ flares domain1.tld | ||
;; | ||
;; Domain: domain1.tld | ||
;; Exported: 2019-06-03 06:31:29 | ||
...continued | ||
|
||
$ flares --export domain1.tld domain2.tld | ||
BIND table for domain1.tld successfully exported | ||
BIND table for domain2.tld successfully exported | ||
$ ls | ||
domain1.tld domain2.tld | ||
``` | ||
|
||
### Run backup with Gitlab-CI | ||
## Automation | ||
|
||
- Copy [.gitlab-ci.yml](.gitlab-ci.yml) inside an empty gitlab project | ||
- Use the [pipeline schedule feature](https://gitlab.com/help/user/project/pipelines/schedules) | ||
- Each task run will store backup as artifacts | ||
### GitLab CI/CD | ||
|
||
- Copy [.gitlab-ci.yml](.gitlab-ci.yml) inside your repo | ||
- Use the [pipeline schedules](https://gitlab.com/help/user/project/pipelines/schedules) feature | ||
- Each run of the task will generate a DNS backup stored as a downloadable artifact | ||
|
||
# Contributing | ||
|
||
|
@@ -67,13 +81,6 @@ $ flaredns domain.tld --export /tmp/tables | |
- Push to the branch `git push origin my-new-feature` | ||
- Create a new pull request against the master branch | ||
|
||
## TODO | ||
|
||
- [x] use https://github.com/spf13/cobra for the CLI interface | ||
- [x] add `all` keyword to export all the domains available in the account | ||
- [ ] add `auth` command, automatically opens CloudFlare dashboard | ||
- [ ] add the flarelogs command | ||
|
||
## License | ||
|
||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flfaoro%2Fflares.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Flfaoro%2Fflares?ref=badge_large) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.