-
Notifications
You must be signed in to change notification settings - Fork 1
Leon/snapshot string in packages #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,68 +1,71 @@ | ||
| PROG:=dnstapir-cli | ||
| # ----- | ||
| VERSION:=`cat ./VERSION` | ||
| COMMIT:=`git describe --dirty=+WiP --always` | ||
| APPDATE=`date +"%Y-%m-%d-%H:%M"` | ||
| GOFLAGS:=-v -ldflags "-X app.version=$(VERSION)-$(COMMIT)" | ||
| ####################################### | ||
| # VERSION SOURCE OF TRUTH FOR PROJECT # | ||
| ####################################### | ||
| VERSION:=0.0.0 | ||
|
|
||
| PROG:=dnstapir-cli | ||
| OUT:=$$(pwd)/out | ||
| COMMIT:=$$(cat COMMIT 2> /dev/null || git describe --dirty=+WiP --always 2> /dev/null) | ||
| GOFLAGS:=-v -ldflags "-X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.name=$(PROG)'" | ||
| GOOS ?= $(shell uname -s | tr A-Z a-z) | ||
| GO:=GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go | ||
| INSTALL:=install -b -c -s -p -m 0755 | ||
|
|
||
| GO:=GOOS=$(GOOS) CGO_ENABLED=0 go | ||
| # GO:=GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=1 go | ||
| # For version snapshots of packages | ||
| RPM_VERSION:=$(VERSION) | ||
| DEB_VERSION:=$(VERSION) | ||
| ifeq ($(VERSION), 0.0.0) | ||
| RPM_VERSION=$(VERSION)^$$(date +%Y%m%d).$(COMMIT) | ||
| DEB_VERSION=$(VERSION)+local$$(date +%Y%m%d).$(COMMIT) | ||
| endif | ||
|
|
||
| SPECFILE:=rpm/SPECS/dnstapir-cli.spec | ||
| all: default | ||
|
|
||
| default: ${PROG} | ||
| default: $(PROG) | ||
|
|
||
| ${PROG}: build | ||
| $(PROG): build | ||
|
|
||
| build: | ||
| /bin/sh make-version.sh $(VERSION)-$(COMMIT) $(APPDATE) $(PROG) | ||
| $(GO) build $(GOFLAGS) -o ${PROG} | ||
| build: outdir | ||
| $(GO) build $(GOFLAGS) -o $(OUT)/$(PROG) | ||
|
|
||
| linux: | ||
| /bin/sh make-version.sh $(VERSION)-$(COMMIT) $(APPDATE) $(PROG) | ||
| GOOS=linux GOARCH=amd64 go build $(GOFLAGS) -o ${PROG}.linux | ||
| outdir: | ||
| @mkdir -p $(OUT) | ||
|
|
||
| netbsd: | ||
| /bin/sh make-version.sh $(VERSION)-$(COMMIT) $(APPDATE) $(PROG) | ||
| GOOS=netbsd GOARCH=amd64 go build $(GOFLAGS) -o ${PROG}.netbsd | ||
| install: | ||
| test -z "$(DESTDIR)" && $(INSTALL) $(OUT)/$(PROG) /usr/bin/ || $(INSTALL) $(OUT)/$(PROG) $(DESTDIR)$(prefix) | ||
|
|
||
| test: | ||
| $(GO) test -v -cover | ||
| lint: | ||
| go fmt ./... | ||
| go vet ./... | ||
| staticcheck ./... | ||
| gosec ./... | ||
| golangci-lint run | ||
|
|
||
| clean: SHELL:=/bin/bash | ||
| clean: | ||
| @rm -f $(PROG) *~ cmd/*~ | ||
| @rm -f *.tar.gz | ||
| @rm -f rpm/SOURCES/*.tar.gz | ||
| @rm -rf rpm/{BUILD,BUILDROOT,SRPMS,RPMS} | ||
| @rm -rf deb/usr | ||
| @rm -rf deb/etc | ||
| @rm -rf deb/var | ||
| @rm -f *.deb | ||
| @rm -rf $(OUT) | ||
|
|
||
| install: | ||
| install -b -c -s ${PROG} /usr/local/bin/ | ||
|
|
||
| tarball: | ||
| git archive --format=tar.gz --prefix=$(PROG)/ -o $(PROG)-$(VERSION).tar.gz HEAD | ||
| tarball: outdir | ||
| @echo "$(COMMIT)" > $(OUT)/COMMIT | ||
| @test -z "$$(git status --porcelain)" && git archive --format=tar.gz --prefix=$(PROG)/ -o $(OUT)/$(PROG).tar.gz --add-file $(OUT)/COMMIT HEAD || echo "won't make tarball from dirty history" | ||
|
|
||
| srpm: SHELL:=/bin/bash | ||
| srpm: tarball | ||
| test $$(rpmspec -q --qf '%{version}' $(SPECFILE) 2>/dev/null || grep '^Version:' $(SPECFILE) | awk '{print $$2}') == $(VERSION) | ||
| mkdir -p rpm/{BUILD,RPMS,SRPMS} | ||
| cp $(PROG)-$(VERSION).tar.gz rpm/SOURCES/ | ||
| rpmbuild -bs --define "%_topdir ./rpm" --undefine=dist $(SPECFILE) | ||
| test -z "$(outdir)" || cp rpm/SRPMS/*.src.rpm "$(outdir)" | ||
| cp -r rpm $(OUT) | ||
| sed -e "s/@@VERSION@@/$(RPM_VERSION)/g" $(OUT)/rpm/SPECS/dnstapir-cli.spec.in > $(OUT)/rpm/SPECS/dnstapir-cli.spec | ||
| cp $(OUT)/$(PROG).tar.gz $(OUT)/rpm/SOURCES/ | ||
| rpmbuild -bs --define "%_topdir $(OUT)/rpm" --undefine=dist $(OUT)/rpm/SPECS/dnstapir-cli.spec | ||
| cp $(OUT)/rpm/SRPMS/$(PROG)-$(RPM_VERSION)-*.src.rpm $(OUT) | ||
| test -z "$(outdir)" || cp $(OUT)/$(PROG)-$(RPM_VERSION)-*.src.rpm "$(outdir)" | ||
|
|
||
| rpm: srpm | ||
| rpmbuild --recompile --define "%_topdir $(OUT)/rpm" --undefine=dist $(OUT)/$(PROG)-$(RPM_VERSION)-*.src.rpm | ||
|
|
||
| deb: build | ||
| mkdir -p deb/usr/bin | ||
| mkdir -p deb/etc/dnstapir/certs | ||
| mkdir -p deb/usr/lib/systemd/system | ||
| cp dnstapir-cli deb/usr/bin | ||
| cp rpm/SOURCES/dnstapir-renew.service deb/usr/lib/systemd/system | ||
| cp rpm/SOURCES/dnstapir-renew.timer deb/usr/lib/systemd/system | ||
| dpkg-deb -b deb/ $(PROG)-$(VERSION).deb | ||
| cp -r deb $(OUT) | ||
| mkdir -p $(OUT)/deb/usr/bin | ||
| mkdir -p $(OUT)/deb/etc/dnstapir/certs | ||
| mkdir -p $(OUT)/deb/usr/lib/systemd/system | ||
| cp $(OUT)/$(PROG) $(OUT)/deb/usr/bin | ||
| sed -e "s/@@VERSION@@/$(DEB_VERSION)/g" $(OUT)/deb/DEBIAN/control.in > $(OUT)/deb/DEBIAN/control | ||
| dpkg-deb -b $(OUT)/deb/ $(OUT)/$(PROG)-$(DEB_VERSION).deb | ||
|
|
||
| .PHONY: build clean | ||
| .PHONY: all default build install lint tarball srpm rpm deb clean |
This file contains hidden or 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,71 +1,71 @@ | ||
| # tapir-cli | ||
| # dnstapir-cli | ||
|
|
||
| CLI utility primarily to interact with other DNS TAPIR components. | ||
| For this the config details needed to connect to eg. TAPIR-POP are | ||
| For this the config details needed to connect to eg. dnstapir-pop are | ||
| located in the config files in the /etc/dnstapir/ directory. | ||
|
|
||
| For some uses, though, `tapir-cli` is used in "standalone" mode. One | ||
| example of this is the creation anad manipulation of DAWG files | ||
| For some uses, though, `dnstapir-cli` is used in "standalone" mode. One | ||
| example of this is the creation and manipulation of DAWG files | ||
| containing large lists of domain names in a compact format. To run | ||
| `tapir-cli` in standalone mode, without the need for any config files, | ||
| `dnstapir-cli` in standalone mode, without the need for any config files, | ||
| use the command flag `--standalone`. | ||
|
|
||
| `tapir-cli` has a large number of commands and subcommands. The entire | ||
| `dnstapir-cli` has a large number of commands and subcommands. The entire | ||
| set of commands is structured as a tree with the root in the | ||
| `tapi-cli` command. All commands, regardless of where in the tree of | ||
| commands they are located, have online help via the flag `-h`. I.e. to | ||
| get help on the `tapir-cli pop ping` command, run: | ||
| get help on the `dnstapir-cli pop ping` command, run: | ||
|
|
||
| ``` | ||
| tapir-cli pop ping -h | ||
| Send an API ping request to TAPIR-POP and present the response | ||
| dnstapir-cli pop ping -h | ||
| Send an API ping request to dnstapir-pop and present the response | ||
|
|
||
| Usage: | ||
| tapir-cli pop ping [flags] | ||
| dnstapir-cli pop ping [flags] | ||
|
|
||
| Flags: | ||
| -c, --count int #pings to send | ||
| -h, --help help for ping | ||
| -n, --newapi use new api client | ||
|
|
||
| Global Flags: | ||
| --config string config file (default is /etc/dnstapir/tapir-pop.yaml) | ||
| --config string config file (default is /etc/dnstapir/dnstapir-pop.yaml) | ||
| -d, --debug Debugging output | ||
| -H, --headers Show column headers | ||
| --tls Use a TLS connection to TAPIR-POP (default true) | ||
| --tls Use a TLS connection to dnstapir-pop (default true) | ||
| -v, --verbose Verbose mode | ||
| ``` | ||
|
|
||
| The flag `-h` also lists all subcommands underneath the command in question. | ||
|
|
||
| The `tapir-cli` command has a number of subcommands, each of which is a command group. The command groups are: | ||
| The `dnstapir-cli` command has a number of subcommands, each of which is a command group. The command groups are: | ||
|
|
||
| ``` | ||
| tapir-cli -h | ||
| CLI utility used to interact with TAPIR-POP, i.e. the TAPIR Policy Processor | ||
| dnstapir-cli -h | ||
| CLI utility used to interact with dnstapir-pop, i.e. the DNS TAPIR Policy Processor | ||
|
|
||
| Usage: | ||
| tapir-cli [command] | ||
| dnstapir-cli [command] | ||
|
|
||
| Available Commands: | ||
| api request a TAPIR-POP api summary | ||
| bump Instruct TAPIR-POP to bump the SOA serial of the RPZ zone | ||
| api request a dnstapir-pop api summary | ||
| bump Instruct dnstapir-pop to bump the SOA serial of the RPZ zone | ||
| completion Generate the autocompletion script for the specified shell | ||
| dawg Generate or interact with data stored in a DAWG file; only useable via sub-commands | ||
| debug A brief description of your command | ||
| help Help about any command | ||
| pop Prefix command, only usable via sub-commands | ||
| rpz Instruct TAPIR-POP to modify the RPZ zone; must use sub-command | ||
| rpz Instruct dnstapir-pop to modify the RPZ zone; must use sub-command | ||
|
|
||
| Flags: | ||
| --config string config file (default is /etc/dnstapir/tapir-pop.yaml) | ||
| --config string config file (default is /etc/dnstapir/dnstapir-pop.yaml) | ||
| -d, --debug Debugging output | ||
| -H, --headers Show column headers | ||
| -h, --help help for tapir-cli | ||
| --tls Use a TLS connection to TAPIR-POP (default true) | ||
| -h, --help help for dnstapir-cli | ||
| --tls Use a TLS connection to dnstapir-pop (default true) | ||
| -v, --verbose Verbose mode | ||
|
|
||
| Use "tapir-cli [command] --help" for more information about a command. | ||
| Use "dnstapir-cli [command] --help" for more information about a command. | ||
| ``` | ||
|
|
||
| Many of the commands are only there as debugging tools. They are not intended for use in production. | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.