Skip to content

Commit

Permalink
Version 2.5.2: DELETE on k-v.io returns no TXT records
Browse files Browse the repository at this point in the history
The original behavior was to return the deleted record, which
inadvertently prolonged the lifetime (in DNS cache) of the record which
was meant to expire as soon as possible.

- Removed the instructions to create a BOSH release. We are no longer
  creating a BOSH release because we needed to colocate an etcd release
  alongside the BOSH release, and we couldn't find an etcd BOSH release.
- Updated the instructions to run a quick test against the sslip.io DNS
  server locally (sanity check) instead of deploying a VM with the BOSH
  release & testing against that.
- Updated the instructions for updating ns-azure's DNS server. ns-azure
  is no longer a BOSH-deployed VM.
  • Loading branch information
cunnie committed Apr 13, 2022
1 parent 0c18937 commit f6827fd
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 60 deletions.
2 changes: 1 addition & 1 deletion bin/make_all
Expand Up @@ -4,7 +4,7 @@
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR/../src/sslip.io-dns-server
ldflags="-X xip/xip.VersionSemantic=2.5.1 \
ldflags="-X xip/xip.VersionSemantic=2.5.2 \
-X xip/xip.VersionDate=$(date +%Y/%m/%d-%H:%M:%S%z) \
-X xip/xip.VersionGitHash=$(git rev-parse --short HEAD)"
export GOOS GOARCH
Expand Down
2 changes: 1 addition & 1 deletion bosh-release/packages/sslip.io-dns-server/packaging
Expand Up @@ -7,7 +7,7 @@ mv sslip.io-dns-server/{go.*,main.go,xip} src/
cd src/
ldflags="-X xip/xip.VersionSemantic=2.5.1 \
-X xip/xip.VersionDate=$(date +%Y/%m/%d-%H:%M:%S%z) \
-X xip/xip.VersionGitHash=c3c1d2a"
-X xip/xip.VersionGitHash=0c18937"
go build \
-ldflags="$ldflags" \
-o ${BOSH_INSTALL_TARGET}/bin/sslip.io-dns-server
91 changes: 36 additions & 55 deletions docs/DEVELOPER.md
Expand Up @@ -4,14 +4,13 @@ These instructions are meant primarily for me when deploying a new BOSH release;
they might not make sense unless you're on my workstation.

```bash
export OLD_VERSION=2.5.0
export VERSION=2.5.1
export OLD_VERSION=2.5.1
export VERSION=2.5.2
cd ~/workspace/sslip.io
git pull -r --autostash
# update the version number for the TXT record for version.status.sslip.io
sed -i '' "s/$OLD_VERSION/$VERSION/g" \
bin/make_all \
bosh-release/packages/sslip.io-dns-server/packaging \
spec/check-dns_spec.rb
# update the download instructions on the website
sed -i '' "s~/$OLD_VERSION/~/$VERSION/~g" \
Expand All @@ -20,84 +19,66 @@ sed -i '' "s~/$OLD_VERSION/~/$VERSION/~g" \
# update the git hash for the TXT record for version.status.sslip.io for BOSH release
sed -i '' "s/VersionGitHash=[0-9a-fA-F]*/VersionGitHash=$(git rev-parse --short HEAD)/g" \
bosh-release/packages/sslip.io-dns-server/packaging
# let's get the BOSH creds
cd bosh-release/
lpass show a # refresh LastPass token
. ~/workspace/deployments/.envrc # set BOSH auth
export BOSH_DEPLOYMENT=sslip.io-dns-server
# create the BOSH release
bosh create-release --force
# upload the release
bosh upload-release
# deploy the release
bosh -n -d sslip.io-dns-server deploy ~/workspace/deployments/sslip.io-dns-server.yml --recreate
# find the IP of the deployed DNS server
IP=$(bosh is --json | jq -r '.Tables[0].Rows[0].ips'); echo $IP
# run the tests!
dig +short 127.0.0.1.example.com @$IP
bin/make_all
# Start the server, assuming macOS M1. Adjust path for GOOS, GOARCH. Linux requires `sudo`
bin/sslip.io-dns-server-darwin-arm64
# In another window
export DNS_SERVER_IP=127.0.0.1
export VERSION=2.5.2
# quick sanity test
dig +short 127.0.0.1.example.com @$DNS_SERVER_IP
echo 127.0.0.1
dig +short ns example.com @$IP
dig +short ns example.com @$DNS_SERVER_IP
printf "ns-aws.sslip.io.\nns-azure.sslip.io.\nns-gce.sslip.io.\n"
dig +short mx example.com @$IP
dig +short mx example.com @$DNS_SERVER_IP
echo "0 example.com."
dig +short mx sslip.io @$IP
dig +short mx sslip.io @$DNS_SERVER_IP
printf "10 mail.protonmail.ch.\n20 mailsec.protonmail.ch.\n"
dig +short txt sslip.io @$IP
dig +short txt sslip.io @$DNS_SERVER_IP
printf "\"protonmail-verification=ce0ca3f5010aa7a2cf8bcc693778338ffde73e26\"\n\"v=spf1 include:_spf.protonmail.ch mx ~all\"\n"
dig +short txt 127.0.0.1.sslip.io @$IP # no records
dig +short cname sslip.io @$IP # no records
dig +short cname protonmail._domainkey.sslip.io @$IP
dig +short txt 127.0.0.1.sslip.io @$DNS_SERVER_IP # no records
dig +short cname sslip.io @$DNS_SERVER_IP # no records
dig +short cname protonmail._domainkey.sslip.io @$DNS_SERVER_IP
echo protonmail.domainkey.dw4gykv5i2brtkjglrf34wf6kbxpa5hgtmg2xqopinhgxn5axo73a.domains.proton.ch.
dig a _Acme-ChallengE.127-0-0-1.sslip.io @$IP | grep "^127"
dig a _Acme-ChallengE.127-0-0-1.sslip.io @$DNS_SERVER_IP | grep "^127"
echo "127-0-0-1.sslip.io. 604800 IN A 127.0.0.1"
dig +short sSlIp.Io
echo 78.46.204.247
dig @$IP txt ip.sslip.io +short | tr -d '"'
curl curlmyip.org; echo
dig @$IP txt version.status.sslip.io +short | grep $VERSION
dig @$DNS_SERVER_IP txt ip.sslip.io +short | tr -d '"'
echo 127.0.0.1
dig @$DNS_SERVER_IP txt version.status.sslip.io +short | grep $VERSION
echo "\"$VERSION\""
dig @$IP my-key.k-v.io txt +short # returns nothing
dig @$DNS_SERVER_IP my-key.k-v.io txt +short # returns nothing
echo " ===" # separator because the results are too similar
dig @$IP put.MyValue.my-key.k-v.io txt +short
dig @$DNS_SERVER_IP put.MyValue.my-key.k-v.io txt +short
echo "\"MyValue\""
echo " ===" # separator because the results are too similar
dig @$IP MY-KEY.k-v.io txt +short
dig @$DNS_SERVER_IP MY-KEY.k-v.io txt +short
echo "\"MyValue\""
echo " ===" # separator because the results are too similar
dig @$IP delete.my-key.k-v.io txt +short
echo "\"MyValue\""
dig @$DNS_SERVER_IP delete.my-key.k-v.io txt +short
echo
echo " ===" # separator because the results are too similar
dig @$IP my-key.k-v.io txt +short # returns nothing
dig @$IP metrics.status.sslip.io txt +short | grep '"Queries: '
dig @$DNS_SERVER_IP my-key.k-v.io txt +short # returns nothing
dig @$DNS_SERVER_IP metrics.status.sslip.io txt +short | grep '"Queries: '
echo '"Queries: 16"'
# pop up a directory
pushd ..
# close the second window
exit
# stop the DNS server; we don't need it anymore
# let's add our changes
git add -p
# and commit (but DON'T push)
git ci -vm"BOSH release: $VERSION: block phishers"
popd
# upload the blobs
bosh upload-blobs
# create the release
bosh create-release \
--final \
--tarball ~/Downloads/sslip.io-release-${VERSION}.tgz \
--version ${VERSION}
# add the changes
git add -N releases/ .final_builds/
git add -p
git ci --amend
# tag the release
git ci -vm"Version $VERSION: DELETE on k-v.io returns no TXT records"
git tag $VERSION
git push
git push --tags
bosh upload-release
cd ..
bin/make_all
scp bin/sslip.io-dns-server-linux-arm64 ns-aws:
scp bin/sslip.io-dns-server-linux-amd64 ns-azure:
ssh ns-aws sudo install sslip.io-dns-server-linux-arm64 /usr/bin/sslip.io-dns-server
ssh ns-aws sudo shutdown -r now
while ! dig @ns-aws.sslip.io ns-aws.sslip.io; do sleep 5; done # wait until it's back up before rebooting ns-azure
ssh ns-azure sudo install sslip.io-dns-server-linux-amd64 /usr/bin/sslip.io-dns-server
ssh ns-azure sudo shutdown -r now
```
- Browse to <https://github.com/cunnie/sslip.io/releases/new> to draft a new release
- Drag and drop `~/Downloads/sslip.io-release-${VERSION}.tgz` to the _Attach
Expand Down
2 changes: 1 addition & 1 deletion k8s/Dockerfile-sslip.io-dns-server
Expand Up @@ -26,7 +26,7 @@ LABEL maintainer="brian.cunnie@gmail.com"
RUN apk update && apk add bind-tools

ARG TARGETARCH # amd64, arm64 (so I can run on AWS graviton2)
RUN wget https://github.com/cunnie/sslip.io/releases/download/2.5.1/sslip.io-dns-server-linux-$TARGETARCH \
RUN wget https://github.com/cunnie/sslip.io/releases/download/2.5.2/sslip.io-dns-server-linux-$TARGETARCH \
-O /usr/sbin/sslip.io-dns-server; \
chmod 755 /usr/sbin/sslip.io-dns-server

Expand Down
2 changes: 1 addition & 1 deletion k8s/document_root/index.html
Expand Up @@ -156,7 +156,7 @@ <h3 id="server">But I Want My Own DNS Server!</h3>
install & run our server within a docker container:</p>
<pre>
docker run -it --rm fedora
curl -L https://github.com/cunnie/sslip.io/releases/download/2.5.1/sslip.io-dns-server-linux-amd64 -o dns-server
curl -L https://github.com/cunnie/sslip.io/releases/download/2.5.2/sslip.io-dns-server-linux-amd64 -o dns-server
chmod +x dns-server
./dns-server 2&gt; dns-server.log &
dnf install -y bind-utils
Expand Down
2 changes: 1 addition & 1 deletion spec/check-dns_spec.rb
Expand Up @@ -18,7 +18,7 @@ def get_whois_nameservers(domain)
end

domain = ENV['DOMAIN'] || 'example.com'
sslip_version = '2.5.1'
sslip_version = '2.5.2'
whois_nameservers = get_whois_nameservers(domain)

describe domain do
Expand Down

0 comments on commit f6827fd

Please sign in to comment.