Commit Graph

53 Commits

Author SHA1 Message Date
Brian Cunnie
51ed47317e BOSH release: 2.5.0: block phishers 2022-02-06 19:51:06 -08:00
Brian Cunnie
d42ce54947 Notes to self: how to examine logs 2022-01-23 07:46:07 -08:00
Brian Cunnie
d35cc1faa6 Release procedure has slightly better instructions 2022-01-22 10:20:12 -08:00
Brian Cunnie
8f2890d90e BOSH release: 2.4.2: fix panic() 2022-01-22 09:41:49 -08:00
Brian Cunnie
3e502731d4 🐞 Fix panic: runtime error: index out of range
Previously I never checked if `net.ParseIP()` returned `nil` for an IPv4
address—I couldn't imagine my IPv4 regex was incomplete. I was wrong.

Moral of the story: always check for errors, always check for nil.

Oddly, I checked for IPv6 addresses—I guess I wasn't as confident about
the regex used.

Drive-bys:
- updated SOA with today's date
- updated dependencies `go get -u`

[fixes #15]
2022-01-22 09:12:13 -08:00
Brian Cunnie
6b2d65c778 🐞 Update links to use main branch, not master
...because the website wasn't updating
2022-01-20 12:15:00 -08:00
Brian Cunnie
b496e68423 Website explains what each metric means
Drive-by: updated publishing docs.
2022-01-20 09:29:06 -08:00
Brian Cunnie
bbf1925be4 BOSH release: 2.4.1: fewer panics
customized records w/ non-existent TXTs don't panic().
2022-01-20 08:10:03 -08:00
Brian Cunnie
b119442a37 BOSH release: 2.4.0: metrics.status.sslip.io returns metrics
Also, I moved the "versio" endpoint: `version.sslip.io` →
`version.status.sslip.io`. It seemed to make more sense to corral the
special endpoints under `status`.
2022-01-20 05:02:21 -08:00
Brian Cunnie
bf4f039001 Metrics are served via metrics.status.sslip.io
- The metrics aren't fleshed out. In fact, there's only two so far:
  1. uptime
  2. number of queries
- Even though the metrics aren't complete, I'm checking it in because
  this commit is already much too big.
- I moved the version information to `version.status.sslip.io`;
  previously it was at `version.sslip.io`. I didn't want one endpoint
  for both metrics & version (worry: DNS amplification), and I wanted a
  consistent subdomain to find that information (i.e.
  `status.sslip.io`).
- I'm not worried about atomic updates to the metrics; if a metric is
  off by one, if I skip a count because two lookups are happening at the
  exact same time, I don't care.
- The `Metrics` struct is a pointer within `Xip` because I might have
  several copies of `Xip` (if I'm binding to several interfaces
  individually), but I must only have one copy of `Metrics`
- I only include the metrics I'm interested in, usually because it took
  some work to implement that feature. I don't care about MX records,
  but I care about IPv6 lookups, DNS-01 challenges, public IP lookups.
- got rid of a section of unreachable code at the end of
  `ProcessQuestion()`; I was tired of Goland flagging it. I had it there
  mostly because I was paranoid of falling through a `switch` statement
2022-01-19 06:47:21 -08:00
Brian Cunnie
bd63421c3f BOSH release: 2.3.0: kv.sslip.io key-value store 2021-12-04 08:16:53 -08:00
Brian Cunnie
b8b4786387 Update ns-aws.sslip.io's HTML assets
i.e.: <https://52-0-56-137.sslip.io/>

Previously I didn't update `index.html` properly because it wasn't
documented, and the content had become stale.
2021-11-28 20:08:52 -08:00
Brian Cunnie
2599def6b6 Upgrading (Developer) notes: manually trigger job
Because it's a manual job currently because if it was automatic it'd
trigger & fail because the required executable isn't yet downloadable.
2021-11-28 19:45:14 -08:00
Brian Cunnie
90b94baa29 BOSH release: 2.2.4: Deprecate nono.io nameservers 2021-11-28 13:08:49 -08:00
Brian Cunnie
690e0ad618 New Release Documentation: no more manual Docker images
The Docker images are now created automatically with our pipeline.
That's right: with 80 hours of work we saved 30 seconds of work! We are
nothing if not efficient.
2021-11-27 15:53:44 -08:00
Brian Cunnie
56191a2ef7 HTML: remove the "new software" warning
It's not new after a year. I also updated the version numbers returned
because, well, it makes the website more "fresh".
2021-11-27 12:29:58 -08:00
Brian Cunnie
4e22123114 BOSH release: 2.2.3: Include sslip.io nameservers 2021-11-27 11:35:01 -08:00
Brian Cunnie
1d4e1af656 Production test: all servers run same version 2021-11-02 05:02:46 -07:00
Brian Cunnie
9dd1a78447 Dockerfile cunnie/sslip.io-dns-server: bump 2.2.1 → 2.2.2
Also, remove redundant "attach binaries", and change the order in which
the Dockerfile is updated.
2021-11-01 07:53:50 -07:00
Brian Cunnie
eed67fdf4d BOSH release: 2.2.2: ip.sslip.io TXT returns IP
Our documentation was wrong; our homepage said to get the origin IP
address by querying the TXT record of the root, i.e. `dig
@ns-aws.nono.io txt . +short`; however, our code worked differently: it
returned the origin IP when the `.ip` TLD was queried.

The new behavior is that it returns the origin IP when `ip.sslip.io.` is
queried, and the documentation now reflects that behavior.

Also, that behavior is marked "experimental" to give us leeway to
change.

[fixes #11]
2021-11-01 07:24:54 -07:00
Brian Cunnie
e133149beb New release instructions include updating k8s 2021-10-06 10:52:42 -07:00
Brian Cunnie
259da8bfb8 Docs: tweak new release instructions 2021-10-06 10:27:54 -07:00
Brian Cunnie
8ce23653bb BOSH release: 2.2.1: version.sslip.io TXT
- Returns version information for DNS server
- Contains 3 strings:
  - Semantic version, e.g. "2.2.1"
  - Date of compilation
  - Latest git hash

Note: the BOSH Release will have a different compilation date &
different git hash than the released executables; the semantic version
will be the same.
2021-10-06 05:16:46 -07:00
Brian Cunnie
f1f66a0f3b dig txt version.sslip.io returns version
I needed a way of determining the version that a server was running. I
orginally considered a command-line argument, but then I thought, "Why
not create a DNS record for it? That way I can query running servers
without needing to ssh onto the machine."

The TXT record consists of three distinct strings: version, compile
date, and git hash.

```bash
dig txt version.sslip.io +short
    "2.2.1"
    "2021/10/03-15:08:54+0100"
    "6a928eb"
```
2021-10-03 15:34:52 +01:00
Brian Cunnie
88e5fdedff Dockerfile cunnie/sslip.io-dns-server: bump 2.1.2 → 2.2.0 2021-06-21 09:21:46 -07:00
Brian Cunnie
cb01b261ee Developer DOCs: tweak cutting a new release 2021-06-20 21:18:43 -07:00
Brian Cunnie
55e23e34a3 BOSH release: 2.2.0: TXT records return IP addrs 2021-06-20 20:52:10 -07:00
Brian Cunnie
fe3d81f194 Wildcard instructions: formatting, typos 2021-02-08 09:10:58 -08:00
Brian Cunnie
73a735bf37 Wildcard instructions: incorporate Norman's suggestions
Drive-by: update version numbers in `DEVELOPER.md`.
2021-02-06 14:02:21 -08:00
Brian Cunnie
041744312f BOSH release: 2.1.2: case-insensitive custom records matching 2021-01-30 19:37:45 -08:00
Brian Cunnie
c349b45ea6 Docs: Securing a wildcard cert from Let's Encrypt
We are pleased to announce that these instructions finally work.

[#6]
2021-01-20 16:45:01 -08:00
Brian Cunnie
0be7a8c7e6 Dockerfile: cunnie/sslip.io-dns-server → 2.1.1 2021-01-20 16:03:57 -08:00
Brian Cunnie
5429c71c87 BOSH release: 2.1.1: case-insensitive _acme-challenge matching 2021-01-20 15:51:00 -08:00
Brian Cunnie
a3de35fa45 Dockerfile: cunnie/sslip.io-dns-server → 2.1.0 2021-01-20 11:59:42 -08:00
Brian Cunnie
3025c8186d BOSH release: 2.1.0: moar _acme-challenge delegation 2021-01-20 08:54:00 -08:00
Brian Cunnie
1b6d72cf49 🐞 dig: "any" type query works on macOS & Linux
The behavior of `dig` version **9.11.25-RedHat-9.11.25-2.fc32** differs
from macOS's `dig` version **9.10.6**. In other words, this test passes
on my mac but not until now on (Linux-based) CI.

I also took the opportunity to refactor our `dig` arguments to conform with
the suggested usage:

> Usage:  dig [@global-server] [domain] [q-type] [q-class] {q-opt}

fixes <https://ci.nono.io/teams/main/pipelines/sslip.io/jobs/unit/builds/145>:
```
  Expected
      <int>: 9
  to match exit code:
      <int>: 0
```

Note that for the `any` test I had to append an additional `+notcp`
argument to avoid an attempted TCP connection. I suspect a bug in `dig`:
```
dig any sslip.io @localhost
;; Connection to 127.0.0.1#53(127.0.0.1) for sslip.io failed: connection refused.
```
2021-01-19 07:05:17 -08:00
Brian Cunnie
bdb0b08de8 🐞 wildcard-dns-http-server: multiple TXT records
- it appears that Let's Encrypt requires setting at least two TXT
records; before I only allowed one to be set; now you can set as many as
you want.

- our records had a TTL of 0 seconds; I bumped it to 60: long enough to
get a cert, short enough to refesh for a second attempt if the first one
failed.
2021-01-18 16:52:27 -08:00
Brian Cunnie
b2396ff081 🐞 bin/make_all compiles in correct directory
We had moved the DNS server to a sub-directory to make room for a
sibling application, a small DNS server + small HTTP server.

fixes:
```
cannot find package "main.go" in any of:
	/usr/local/Cellar/go/1.15.6/libexec/src/main.go (from $GOROOT)
	/Users/cunnie/go/src/main.go (from $GOPATH)
```
2021-01-18 10:42:54 -08:00
Brian Cunnie
eb032a78d8 BOSH release: 2.0.0: 🐞 _acme-challenge. delegation 2021-01-18 10:21:09 -08:00
Brian Cunnie
7c099f5843 Docs: procuring a wildcard certificate (beta)
The docs are correct, but the code isn't yet ready.
2021-01-16 11:48:02 -08:00
Brian Cunnie
0d0acfe318 Docs: update sample procedure to procure wildcard
**This process still does not work**. We need to fix our sslip.io DNS
server code. That being said, once our DNS server code is fixed, this
process _should_ work.

As much as we'd have liked to use `joohoi/acme-dns`, it didn't work with
our setup, possibly due to our DNS server code brokenness, mentioned
above. At any rate, we have our own `acme-dns` replacement, which we
intend to use going forward.
2021-01-11 07:37:50 -08:00
Brian Cunnie
0614f2b059 Custom DNS Server returns only TXT records
This small DNS server only returns one type of record, a TXT record,
meant to be a token assigned by a certificate authority (e.g. Let's
Encrypt) to verify domain ownership.

The TXT record will be updateable by an API endpoint on the webserver
(same executable as the DNS server), but I haven't yet written that
portion.

Drive-by: in our _other_ (main) sslip.io DNS server, I changed `break` →
`continue` in the main loop. Had we gotten a malformed UDP packet, we
would have exited, but now we continue to the next packet. Exiting is
not that big a deal—`monit` would have restarted the server—but moving
on to the next packet is a more robust approach.

[#6]
2021-01-09 10:41:21 -08:00
Brian Cunnie
404e9b2365 Instructions for procuring a wildcard certificate
Warning: these instructions do not work & are incomplete.

I had high hopes for [acme-dns](https://github.com/joohoi/acme-dns), but
it seems much too baroque for my purposes—authentication, subdomains,
CNAMEs. It seems quite clever for a use case that is much more
complicated than mine.

I've resolved to write an _acme-dns_-compatible HTTP server & DNS server
to meet my much simpler needs.
2021-01-03 19:15:48 -08:00
Brian Cunnie
a4bb454118 Dockerfile: cunnie/sslip.io-dns-server → 1.3.1 2020-12-24 12:32:22 -08:00
Brian Cunnie
bea9cde6f0 BOSH release: 1.3.1: Special NS records for _acme-challenge.
`DEVELOPER.md` had the wrong tests (mostly missing newlines); that's
been fixed. Also, I added a new test for DNS records which contain
`_acme-challenge.`, which may enable users to generate wildcard certs
for their sslip.io domains.
2020-12-24 12:11:58 -08:00
Brian Cunnie
91048d058b BOSH release: 1.3.0: CNAME records 2020-12-19 17:51:22 -08:00
Brian Cunnie
28aee851d2 🐞 Dockerfile: cunnie/sslip.io-dns-server → 1.2.2
Rather than using Docker Hub's automated build feature (which doesn't
seem to work when setting up new repositories), I've opted to manually
build & push the images.

There are workarounds which might allow me to use GitHub's automated
build feature, like creating an organization, moving the repos to the
new organization, and creating a 'bot' user to publish the images, but
that seems like a lot of work for little gain.

fixes:

> Fetch source repositories failed.

> Connect a GitHub account to cunnie to enable automated builds. If it is already connected, please re-link the source provider.
2020-12-18 08:26:03 -08:00
Brian Cunnie
1fe1ea1519 Dockerfile for our new Golang-based DNS server
We use the Alpine image; it's a lean 5.6 MB, and our 3 MB server keeps
it lean at below 9 MB.

Though we include instructions to build the Dockerfile, we plan to use
Docker Hub's automated builds feature.
2020-12-18 07:37:36 -08:00
Brian Cunnie
ef868f7fdb BOSH release: 1.2.2: TXT records, this time without bugs 2020-12-16 09:28:00 -08:00
Brian Cunnie
8da410c029 BOSH release: 1.2.1 TXT records
The compelling reason was to to enable Protonmail for sslip.io email;
they require specific TXT records.
2020-12-16 08:06:53 -08:00