the empty spaces dictionary. [[ adapted from https://www.sheepwave.com/what-is-a ]]
https://what.is.a.dolly.sh
- Crystal 50.8%
- Nix 30.8%
- CSS 10.4%
- HTML 8%
|
|
||
|---|---|---|
| .woodpecker | ||
| nix | ||
| spec | ||
| src | ||
| static | ||
| .air.toml | ||
| .editorconfig | ||
| .envrc | ||
| .gitignore | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| shard.lock | ||
| shard.yml | ||
| shards.nix | ||
https://what.is.a.dolly.sh
or on dollnet https://what.is.a.doll
a faithful rebuild of sheepwave's "what is a"
supports different ways of querying the API, each by text/html, application/json, or text/plain. contributions/ideas of other insane mime types welcome.
developing
use nix, direnv supported.
# start the hot-reloading dev server
nix run
# -- or --
air
xdg-open http://localhost:3001
# start without air
# nix note: tests must pass.
nix run .#what-is-a
# -- or --
crystal run ./src/what-is-a.cr
# run checks and linters
nix flake check
# apply linters
nix fmt
# -- or --
crystal tool format
# run tests alone
crystal spec
using
- index: https://what.is.a.dolly.sh/
- random: https://what.is.a.dolly.sh/...?
- tag: https://what.is.a.dolly.sh/doll
- dictionary dump: https://what.is.a.dolly.sh/dictionary.json
- raw dictionary: https://what.is.a.dolly.sh/data/v1.6.0.txt
send Accept header to get any of these formats:
text/plain(default)text/htmlapplication/json
future stuff
file extensions as mime
allow .txt, .md, .json, . whatever
mime types
text/markdown/.mdapplication/x-pem-file/.pemandapplication/pkix-cert/.cerapplication/dnsandtext/dns/.zonetext/css/.css:>application/x-sh/.sh!!!image/svg+xml/.svgtext/troff/.7text/csv/.csvtext/markdoll/.doll
apis
- DNS-over-HTTP
/dns-query, wherecombat-doll TXT=> 3 TXT records - telnet??? especially if we do
.sh, we could do something funny with curl:curl https://what.is.a.dolly.sh | sh
deploying
the right way (nixos)
if for some reason this needs to be hosted again... this is a nix flake!
-
add this repo to inputs:
{ inputs = { #... what-is-a.url = "git+https://git.dolly.sh/doll/what-is-a"; }; } -
add the overlay (optional):
{ outputs = {nixpkgs, ...}@inputs: { # ... forEachSystem (system: let pkgs = import nixpkgs { inherit system; overlays = [ inputs.what-is-a.overlays.default ]; }; in { #... }) # ... } } -
add the binary cache (optional, risky):
{ inputs = { # ... }; nixConfig = { extra-substituters = [ "https://subby.blood.pet" ]; extra-trusted-public-keys = [ "subby.blood.pet:1xqRlAxaTPJi/URlleX0ggGECwKzJbX+EVu6xY54wrc=" ]; }; outputs = _: { # ... } } -
setup nixos module
{inputs, pkgs, ...}: { imports = [ inputs.what-is-a.nixosModules.default ]; services.what-is-a = { enable = true; port = 3000; # optionally set the package package = pkgs.what-is-a; # without overlay: # package = inputs.what-is-a.packages.${pkgs.stdenv.hostPlatform.system}.what-is-a; }; # example nginx config services.nginx = { enable = true; virtualHosts."what.is.a.dolly.sh" = { recommendedProxySettings = true; location."/" = { proxyPass = "http://127.0.0.1:3000"; }; }; }; }
the wrong way (oci/docker/whatever)
todo