No description
  • Go 59.6%
  • TypeScript 33.9%
  • CSS 4.5%
  • Makefile 1.2%
  • Dockerfile 0.4%
  • Other 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-16 18:55:36 -03:00
internal store: accept a host identity only with the known SSH host key 2026-11-16 18:30:02 -03:00
ui ui: update the dependencies 2026-11-16 18:46:47 -03:00
.dockerignore treewide: initial import of shellgraph-server 2026-10-17 20:35:57 -03:00
.gitignore treewide: initial import of shellgraph-server 2026-10-17 20:35:57 -03:00
.version version: bump to 1.2.2 2026-11-16 18:55:36 -03:00
CLAUDE.md docs: note the tested Pocket ID version 2.19.3 2026-11-16 18:48:12 -03:00
default.pgo treewide: move store to PostgreSQL and redesign the UI 2026-10-18 21:49:16 -03:00
Dockerfile Dockerfile: pin the base image by digest 2026-11-16 18:28:42 -03:00
go.mod go.mod: update Go to 1.27.4 and update the modules 2026-11-16 18:43:56 -03:00
go.sum go.mod: update Go to 1.27.4 and update the modules 2026-11-16 18:43:56 -03:00
main.go main: set read and write timeouts on the HTTP server 2026-11-16 16:10:35 -03:00
Makefile map: group other VLAN and LAN addresses in network nodes 2026-10-23 14:42:57 -03:00
README.md docs: update the session and map notes 2026-11-16 18:41:19 -03:00

shellgraph-server

The ShellGraph web server. It keeps the configuration and the collected data in PostgreSQL, shows the web UI and the dependency map, and receives the reports of the collectors. It never connects to the target hosts.

Quick start

make build
export SHELLGRAPH_KEY="$(./bin/shellgraph-server keygen)"   # keep this key in a safe place
export SHELLGRAPH_DATABASE_URL=postgres://shellgraph@db.example.net/shellgraph   # PGPASSWORD gives the password
export SHELLGRAPH_ADMIN_GROUP=shellgraph-admins
export SHELLGRAPH_LDAP_URL=ldaps://ldap.example.net
export SHELLGRAPH_LDAP_USER_BASE=ou=people,dc=example,dc=net   # or OIDC
./bin/shellgraph-server serve

Open http://localhost:8080 and log in with a user of the admin group. Login: LDAP and OIDC only (see the site repository, content/docs/server/how-to/ldap.md and oidc-pocket-id.md).

Kubernetes

The image git.rda.run/shellgraph/server:<version> runs as the user 10001, has the public CA certificates and needs no volume. Configure it with environment variables only.

  1. Make the master key on your computer. keygen only prints 32 random bytes in base64, so openssl gives the same result.

    openssl rand -base64 32
    
  2. Keep a copy of the key outside the cluster. All pods must use the same key.

  3. Put the secrets in a Secret.

    kubectl create secret generic shellgraph \
      --from-literal=SHELLGRAPH_KEY='<key>' \
      --from-literal=PGPASSWORD='<database password>' \
      --from-literal=SHELLGRAPH_OIDC_CLIENT_SECRET='<client secret>'
    
  4. In the Deployment, use envFrom with the Secret, and set SHELLGRAPH_DATABASE_URL, SHELLGRAPH_PUBLIC_URL, SHELLGRAPH_ADMIN_GROUP and the LDAP or OIDC variables in env. Set runAsUser: 10001. Use /healthz on port 8080 for the probes.

More than one replica is safe: the migrations use an advisory lock, and the sessions are in the database. All replicas must use the same SHELLGRAPH_KEY. For a private CA, mount its PEM file in a directory and set SSL_CERT_DIR to that directory. The complete manifests are in the site repository, content/docs/server/how-to/kubernetes.md.

Development

  • make db: local PostgreSQL container for make run and make test.
  • make run: Go server and Vite dev server with hot reload.
  • make test: Go tests and the UI type check.
  • make image: container image FROM scratch.
  • make docker: build the image and push it to git.rda.run/shellgraph/server (run podman login git.rda.run first).
  • make help: all targets.

Documentation: the site repository, section /docs/server/ (content/docs/server/).