Skip to content

Seednode/query

Repository files navigation

About

A bunch of useless tools, all available via convenient HTTP endpoints!

Feature requests, code criticism, bug reports, general chit-chat, and unrelated angst accepted at query@seedno.de.

Static binary builds available here.

x86_64 and ARM Docker images of latest version: oci.seedno.de/seednode/query:latest.

Dockerfile available here.

An example instance with all features enabled can be found here.

Configuration

The following configuration methods are accepted, in order of highest to lowest priority:

  • Command-line flags
  • Environment variables

Currently available tools

Dice roll

Roll a specified number of dice.

Optionally display individual roll results, as well as total, by appending ?verbose.

Examples:

DNS

Look up DNS records for a given host.

An alternate DNS resolver can be specified via --dns-resolver (e.g. --dns-resolver "1.1.1.1:53"). If none is provided, the system default is used.

This uses Team Cymru's IP to ASN mapping service, so please be considerate about traffic volume.

Examples:

Hashing

Hash the provided string using the requested algorithm.

Examples:

In addition to providing the value to be hashed in the URL, you can submit it as the body of a GET request, so long as no value is provided in the URL.

For example, curl -X GET https://q.seedno.de/hash/sha512-224/ -d "test" will return the SHA512/224 hash for test.

HTTP Status Codes

Receive the requested HTTP response status code.

Examples:

IP address

View your current public IP.

Examples:

MAC Lookup

Look up the vendor associated with any MAC address.

The Wireshark manufacturer database is embedded in the generated binary, but a local version can be used instead by providing the --oui-file argument.

Examples:

QR Codes

Encode a string as a QR code (either a PNG or an ASCII string).

Examples:

Time

Look up the current time in a given timezone and format.

Values can optionally be formatted via the ?format= query parameter by specifying any layout from the Go time package.

Format values are case-insensitive.

Examples:

Environment variables

Almost all options configurable via flags can also be configured via environment variables.

The associated environment variable is the prefix QUERY_ plus the flag name, with the following changes:

  • Leading hyphens removed
  • Converted to upper-case
  • All internal hyphens converted to underscores

For example:

  • --dns-resolver 1.1.1.1:53 becomes QUERY_DNS_RESOLVER=1.1.1.1:53
  • --max-dice-rolls 256 becomes QUERY_MAX_DICE_ROLLS=256.

Usage output

Serves a variety of web-based utilities.

Usage:
  query [flags]

Flags:
      --all                   enable all features
  -b, --bind string           address to bind to (default "0.0.0.0")
      --dns                   enable DNS lookup
      --dns-resolver string   custom DNS server IP and port to query (e.g. 8.8.8.8:53)
      --exit-on-error         shut down webserver on error, instead of just printing the error
      --hash                  enable hashing
  -h, --help                  help for query
      --http-status           enable HTTP response status codes
      --ip                    enable IP lookups
      --mac                   enable MAC lookups
      --max-dice-rolls int    maximum number of dice per roll (default 1024)
      --max-dice-sides int    maximum number of sides per die (default 1024)
      --oui-file string       path to Wireshark manufacturer database file
  -p, --port uint16           port to listen on (default 8080)
      --profile               register net/http/pprof handlers
      --qr                    enable QR code generation
      --qr-size int           height/width of PNG-encoded QR codes (in pixels) (default 256)
      --roll                  enable dice rolls
      --subnet                enable subnet calculator
      --time                  enable time lookup
      --tls-cert string       path to TLS certificate
      --tls-key string        path to TLS keyfile
  -v, --verbose               log tool usage to stdout
  -V, --version               display version and exit

Building the Docker image

From inside the cloned repository, build the image using the following command:

REGISTRY=<registry url> LATEST=yes TAG=alpine ./build-docker.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published