.PHONY: debian VERSION = $(shell git describe --tags) BUILDTIME = $(shell date +%Y.%m.%d) all: build ./control-panel-dns build: GO111MODULE=off go build \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" verbose: GO111MODULE=off go build -v -x \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" install: GO111MODULE=off go install \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" # embed the toolkit plugins in the binary embed: -rm resources/*.so touch resources/blank.so cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ goimports: goimports -w *.go redomod: rm -f go.* GO111MODULE= go mod init GO111MODULE= go mod tidy reset: # clear your terminal reset stderr: build ./control-panel-dns >/tmp/witgui.log.stderr 2>&1 log: reset tail -f /tmp/guilogfile /tmp/witgui.* /tmp/gadget* gocui: build reset # ./control-panel-dns --gui gocui --tmp-log >/tmp/witgui.log.stderr 2>&1 # ./control-panel-dns --gui gocui ./control-panel-dns --gui gocui >/tmp/witgui.log.stderr 2>&1 nocui: reset build ./control-panel-dns --gui nocui check-git-clean: @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1) build-release: reset go get -v -u -x . go build # This will git pull all the git repo dependencies goGetUpdate: GO111MODULE="off" go get -v -u . # ./control-panel-dns.v1: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./control-panel-dns.v1) # ./control-panel-dns.v1: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./control-panel-dns.v1) # compiling with CGO disabled means it compiles but then plugins don't load GLIBC_2.34-error: GO111MODULE="off" CGO_ENABLED=0 go build -v -o control-panel-dns test: GO111MODULE="off" go test -v update: GO111MODULE="off" go get -v -u -x . clean: -rm control-panel-dns -rm -rf files/ -rm -f resources/*.so -rm *.deb netlink: GO111MODULE="off" go get -v -u github.com/vishvananda/netlink ####### MODULE STUFF DOWN HERE # # What again is the 'right' way to do this? # maybe it's settled down finally. Use GO111MODULE="off" when you are developing. # When you are ready to release, version this and all the packages correctly. # # At least, that is what I'm going to try to do as of Feb 1 2024. # build-with-custom-go.mod: go build -modfile=local.go.mod ./... # notes on certs. move this somewhere else # replace github.com/versent/saml2aws/v2 v2.35.0 => github.com/marcottedan/saml2aws/v2 master # replace github.com/versent/saml2aws/v2 => /Users/dmarcotte/git/saml2aws/ # # https://crt.sh/?q=check.lab.wit.com # # https://letsencrypt.org/certificates/ # openssl s_client -connect check.lab.wit.com:443 -showcerts # openssl s_client -CApath /etc/ssl/certs/ -connect check.lab.wit.com:443 -showcerts -trace -debug # openssl s_client -CAfile isrgrootx1.pem -connect check.lab.wit.com:443 -showcerts # cat isrgrootx1.pem lets-encrypt-r3.pem > full-chain.pem # full-chain.pem # openssl s_client -CAfile /etc/ssl/certs/wit-full-chain.pem -connect check.lab.wit.com:443 -showcerts check-cert: reset openssl s_client -CApath /etc/ssl/certs/ -connect go.wit.com:443 -showcerts ssl-cert-hash: openssl x509 -hash -noout -in wit-full-chain.pem # cd /etc/ssl/certs && ln -s wit-full-chain.pem 4042bcee.0 openssl x509 -hash -noout -in isrgrootx1.pem openssl x509 -hash -noout -in lets-encrypt-r3.pem sudo-cp: sudo cp -a lets-encrypt-r3.pem 8d33f237.0 /etc/ssl/certs/ # apt install uml-utilities fake0-up: tunctl -t fake0 ifconfig fake0 up # ifconfig fake0 inet6 add 2001:470:1f12:2cd::2/64 ifconfig fake0 inet6 add 2604:BBC0:1234:1234::1234/128 fake0-down: ifconfig fake0 down tunctl -d fake0