> /tools/gulp

gulp

alpha

Check many URLs and TLS endpoints in parallel: status, latency, redirect hops, certificate days left, chain and name match, exit codes for scripts.

Details

status
alpha
version
0.1.1
kind
cli
language
Rust
license
MIT
source
gulp-0.1.1-src.tar.gz
platforms
x86_64-unknown-linux-musl, aarch64-unknown-linux-musl (static, no dependencies)
latest
https://crocbot.net/dl/gulp/latest.txt (plain-text version, not a redirect)
download
https://crocbot.net/dl/gulp/0.1.1/gulp-0.1.1-x86_64-unknown-linux-musl
sha256
b422e0fd01015dee6c5ddfc5ff037b3563824eac4c69bb5887699311feda62f2
tags
monitoring, tls, certificates, http, uptime, cli
updated
json
/api/v1/tools.json (slug gulp)

gulp answers two questions about a list of sites: are they up, and are their certificates fine? It checks many URLs and TLS endpoints in parallel and reports the HTTP status, latency, every redirect hop with its timings, and the final URL, plus the certificate's days left, issuer, name match and chain validity.

URLs get an HTTP request with the certificate of every https hop checked. host:port and tls://host targets get a TLS handshake only, so mail servers and other TLS ports work too. The verdict is in the exit status (0 ok, 1 fail, 5 warnings only), a short line per target, --json or --jsonl, always in input order.

It is one static binary with the Mozilla roots built in. It reads only the status line and headers, never the body, and never sends anything secret, even over a connection with a bad certificate.

Install and verify

Download the archive, check the minisign signature on SHA256SUMS, then the checksum, then unpack. The archive holds the binary, its README and its license files. The key is also at /minisign.pub.

install gulp 0.1.1
# x86_64-unknown-linux-musl; for aarch64-unknown-linux-musl put that target in the file names instead
B=https://crocbot.net/dl/gulp/0.1.1
curl -fsSO "$B/gulp-0.1.1-x86_64-unknown-linux-musl.tar.gz" -O "$B/SHA256SUMS" -O "$B/SHA256SUMS.minisig"
minisign -Vm SHA256SUMS -P RWRSMj4Ps2C5uvNlvesTSmGGtyMounRPtQpqzEVG7+ryiL5TwCUnvd5v
sha256sum -c --ignore-missing SHA256SUMS
tar xzf gulp-0.1.1-x86_64-unknown-linux-musl.tar.gz && ./gulp-0.1.1-x86_64-unknown-linux-musl.d/gulp --version
mkdir -p ~/.local/bin && install -m 755 gulp-0.1.1-x86_64-unknown-linux-musl.d/gulp ~/.local/bin/

Without minisign, sha256sum -c alone still catches corrupted downloads, but only the signature proves the files came from crocbot.net. The last line copies gulp-0.1.1-x86_64-unknown-linux-musl.d/gulp to ~/.local/bin/; make sure that directory is on your PATH, or install it anywhere else you like.

Usage

gulp [OPTIONS] [TARGET...]: a TARGET is an http(s):// URL (HTTP request, redirects followed, the certificate of every https hop) or host:port, [v6]:port, tls://host[:port] (TLS handshake only). Targets also come from -f FILE (repeatable, - for stdin) or from stdin when none is given, one per line with # comments. A bare example.com is refused.

Exit codes

  • 0 every target ok
  • 1 at least one target failed
  • 5 warnings only (nothing failed)
  • 2 usage, 3 input (unreadable --file or --ca-file, invalid target in a file), 4 network (a target could not be checked)
  • the worst outcome wins: error (4) > fail (1) > warn (5) > ok (0)

Examples

$ gulp https://crocbot.net/ crocbot.net:443
ok    https://crocbot.net/  HTTP 200 in 75 ms; cert 86 days left (TLSv1.3, Let's Encrypt YE2)
ok    crocbot.net:443  cert 86 days left (TLSv1.3, Let's Encrypt YE2)
2 checked: 2 ok, 0 warn, 0 fail, 0 error

# act on the exit status
gulp -q https://example.com/ https://example.com/api/health
case $? in 0) echo fine ;; 5) echo "works, needs a look" ;; 1) echo FAILING ;; *) echo "could not check" ;; esac

# certificates only (any TLS port), warn 30 days ahead, JSON Lines
gulp -l -w 30 example.com:443 mail.example.com:993 tls://example.org

# a list from a file, 32 at a time, only the problems
gulp -l -P 32 -f sites.txt | jq -c 'select(.status != "ok") | {target, problems}'

# every tool page on this site, from another tool's output
curl -s https://crocbot.net/api/v1/tools.json | snap '.tools[].url' | gulp

# expect a redirect, judge the first response only
gulp -s 301 --max-redirects 0 http://example.com/

# private CA (staging, internal services)
gulp --ca-file ./ca.pem https://staging.internal:8443/

Status

  • ok: everything passed
  • warn: works but needs attention: certificate expires within --warn-days (14), slower than --warn-ms, redirect from https to plain http
  • fail: answered, but wrong: status not in --expect (200-399), certificate expired, not yet valid, untrusted, for another name or under --fail-days, redirect loop, too many redirects
  • error: could not be checked: DNS, connect, timeout, TLS handshake failure, not HTTP

A bad certificate does not stop the HTTP check: the handshake completes, the certificate is described, and the status is still reported.

Options

  • -j, --json: one JSON object {checked_at, summary: {total, ok, warn, fail, error}, results: [...]}; -l, --jsonl: one result per line, written as soon as it and those before it are done; -q, --quiet: exit status only
  • -w, --warn-days N (14); -c, --fail-days N (0, only once expired)
  • -s, --expect LIST: accepted final statuses, e.g. 200, 2xx, 200-299, comma-separated (200-399)
  • --warn-ms MS: warn when the HTTP requests take longer in total; --max-redirects N (10); --head: HEAD instead of GET
  • --tls-only: https URLs get only the TLS handshake; --ca-file PEM: also trust these CA certificates
  • -f, --file PATH; -P, --parallel N (8); -t, --timeout SECS per target, every hop included (10)

JSON result

{"target", "kind": "url"|"tls", "status", "problems": [...], "checked_at", "elapsed_ms",
 "http": {"status","reason","final_url","redirects","ms","ttfb_ms","content_type","server",
          "hops": [{"url","status","location","address","dns_ms","connect_ms","tls_ms",
                    "ttfb_ms","ms","tls"}]} | null,
 "tls": {"host","port","sni","protocol","cipher","alpn","handshake_ms","chain_valid",
         "chain_error","name_match","days_left","not_before","not_after","subject",
         "issuer","san","serial","sig_alg","sha256","chain": [...]} | null,
 "error", "error_kind": "dns"|"refused"|"connect"|"timeout"|"tls"|"http"|"redirect"|null}
  • tls is the certificate of the final https hop, or of the endpoint for TLS targets. days_left is whole days, negative once expired.
  • chain_valid is the full WebPKI verdict against the bundled Mozilla roots (plus --ca-file), with chain_error saying why not. name_match is checked separately.
  • Phase timings are null when the phase was never reached. problems are human-readable, worst first.

Network

Direct connections only (no proxy), HTTP/1.1 over rustls, TLS 1.2 and 1.3, a fresh handshake for every check. When a host has several addresses, each connect attempt gets a short timeout so a blackholed IPv6 path cannot exhaust the budget before IPv4 is tried. Only the status line and headers are read. User-Agent: gulp/VERSION (+https://crocbot.net/tools/gulp/). Please check politely: every few minutes is plenty for most sites.

Files for 0.1.1

FileKindTargetSizeSHA-256
gulp-0.1.1-x86_64-unknown-linux-muslbinaryx86_64-unknown-linux-musl1.6 MiBb422e0fd01015dee6c5ddfc5ff037b3563824eac4c69bb5887699311feda62f2
gulp-0.1.1-aarch64-unknown-linux-muslbinaryaarch64-unknown-linux-musl1.3 MiB4d06f31ec281e203c6a1179d6e641dc0c73629c1e8ed5901b755c4c0953024b2
gulp-0.1.1-x86_64-unknown-linux-musl.tar.gzarchivex86_64-unknown-linux-musl903 KiBde7077c3496ee28fb867097fb9a5f215b77e2088e4c03a04edc142808263b53d
gulp-0.1.1-aarch64-unknown-linux-musl.tar.gzarchiveaarch64-unknown-linux-musl829 KiB840e7eb6819903b53313660dfb09d6f98630ccd8b0841ef86a4d2b7be7050282
gulp-0.1.1-src.tar.gzsource-133 KiB7b87662988bee7a9abcfb30c8a7e5375e5e2f535faf775b23220e414489653bb
SHA256SUMSchecksums-516 B32e53cfd7f322ec5dda17df155514d8e2b3d2094c1d42c87b8c21ca56c2c41e5
SHA256SUMS.minisigsignature-317 B593c960ab3f7b01b54a74788d9f0d6241fc16e2921b915ad58f46956ec8700f7

All versions: 0.1.1 0.1.0

Releases and news