2026-05-04 11:44:20 +01:00
2026-05-04 10:36:34 +01:00
2026-05-04 11:19:06 +01:00
2026-05-04 11:19:06 +01:00
2026-05-04 11:44:20 +01:00
2026-05-04 11:19:06 +01:00
2026-05-04 11:19:06 +01:00
2026-05-04 11:19:06 +01:00
2026-05-04 11:19:06 +01:00

OpenStaticFish MicroServices

Basic local Kubernetes development setup using Nix, Kind, Tilt, Docker, and small Go microservices.

Requirements

  • Nix with flakes enabled
  • Docker running and reachable by your user
  • Git

All project CLI dependencies are provided by flake.nix, including:

  • tilt
  • kind
  • kubectl
  • docker
  • helm
  • go
  • doppler

Quick Start

Create or select the local Kind cluster:

nix run .#setup-kind

Start Tilt:

nix run .#tilt -- up

Open the Tilt UI:

http://localhost:10350

Test the scraper service:

curl http://localhost:8080/health

Analyze a site once Tilt is running:

scripts/analyze-site adaptive.co.uk

Stop Tilt resources:

nix run .#tilt -- down

Dev Shell

You can also enter the Nix development shell and run commands directly:

nix develop

Inside the shell:

setup-kind
tilt up
tilt down
kubectl get pods
docker ps
doppler secrets

Project Commands

Nix Commands

nix develop

Enter the dev shell with all dependencies on PATH.

nix run .#setup-kind

Create the openstaticfish Kind cluster if needed, select the kind-openstaticfish Kubernetes context, and print cluster info.

nix run .#tilt -- up

Run Tilt with the required runtime tools available, including kind, kubectl, and docker.

nix run .#tilt -- down

Tear down Kubernetes resources managed by Tilt.

nix flake show

Validate and display flake outputs.

Tilt Commands

tilt up

Build images, deploy Kubernetes manifests, start file watching, and open the Tilt UI.

tilt down

Remove deployed Tilt resources from the current Kubernetes context.

tilt logs

Stream aggregated logs from Tilt resources.

tilt status

Show current resource status.

tilt ui

Open the Tilt web UI.

Kubernetes Commands

kubectl config use-context kind-openstaticfish

Select the project Kind cluster.

kubectl cluster-info

Verify Kubernetes connectivity.

kubectl get pods

List running pods.

kubectl logs -f deployment/site-analyzer-deployment

Stream logs from the site analyzer deployment.

kubectl get svc

List Kubernetes services.

Docker Commands

docker ps

List running containers, including Kind node containers.

docker build -t site-analyzer ./services/site-analyzer

Build the site analyzer image manually outside Tilt.

Site Analyzer

The site-analyzer service accepts a URL and returns JSON describing visible site infrastructure and technology signals.

Endpoint:

POST http://localhost:8090/analyze

Request:

{
  "url": "https://example.com"
}

Wrapper script:

scripts/analyze-site https://example.com

Override the endpoint if needed:

scripts/analyze-site --endpoint http://localhost:8090/analyze example.com

The response includes:

  • hosting.provider: the visible edge/provider inferred from DNS, reverse DNS, and HTTP headers
  • hosting.cdn: CDN detected from headers, for example Cloudflare, Fastly, CloudFront, or Akamai
  • hosting.origin_provider: best-effort origin/platform inference, for example Pantheon when pantheonsite.io hints are exposed
  • hosting.origin_evidence: specific signals used for origin inference
  • dns: nameservers and common DNS records
  • technologies: CMS/framework/server signals such as Drupal, WordPress, React, Next.js, or Cloudflare
  • security: TLS/HSTS/security-header information

CDNs can hide the real origin. If a site is proxied through Cloudflare, the public DNS and IPs usually identify Cloudflare rather than the origin host. Origin detection is therefore best-effort and depends on leaked signals such as CSP entries, headers, HTML references, or provider-specific domains.

Secrets

Runtime secrets are managed with Doppler in the openstaticfish-microservices project using the dev config.

Initial setup after cloning:

doppler login
doppler setup --no-interactive

Run commands with secrets injected:

doppler run -- your-command

Tilt uses Doppler to create the local Kubernetes webshare-api secret for the scraper service. Do not commit local .env files; .env and .env.* are ignored by Git.

Layout

.
├── flake.nix
├── doppler.yaml
├── Tiltfile
├── k8s/
│   ├── scraper.yaml
│   └── site-analyzer.yaml
├── scripts/
│   ├── analyze-site
│   └── setup-kind
└── services/
    ├── scraper/
    │   ├── Dockerfile
    │   ├── go.mod
    │   └── main.go
    └── site-analyzer/
        ├── Dockerfile
        ├── go.mod
        └── main.go

Notes

Nix flakes only see files that are tracked by Git. If nix run says a path is not visible to Nix, stage the file:

git add <file>

For this repo setup, staging all project files is usually enough:

git add -A

The Tiltfile allows only the kind-openstaticfish Kubernetes context to avoid accidentally deploying to another cluster.

If Tilt reports that it cannot connect to Kubernetes, rerun:

nix run .#setup-kind

Then restart Tilt.

S
Description
No description provided
Readme
182 KiB
Languages
Go 66.1%
Shell 24.1%
Nix 4.8%
Starlark 3.2%
Dockerfile 1.8%