- Go 59.6%
- TypeScript 33.9%
- CSS 4.5%
- Makefile 1.2%
- Dockerfile 0.4%
- Other 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| internal | ||
| ui | ||
| .dockerignore | ||
| .gitignore | ||
| .version | ||
| CLAUDE.md | ||
| default.pgo | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| Makefile | ||
| README.md | ||
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.
-
Make the master key on your computer.
keygenonly prints 32 random bytes in base64, soopensslgives the same result.openssl rand -base64 32 -
Keep a copy of the key outside the cluster. All pods must use the same key.
-
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>' -
In the Deployment, use
envFromwith the Secret, and setSHELLGRAPH_DATABASE_URL,SHELLGRAPH_PUBLIC_URL,SHELLGRAPH_ADMIN_GROUPand the LDAP or OIDC variables inenv. SetrunAsUser: 10001. Use/healthzon 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 formake runandmake test.make run: Go server and Vite dev server with hot reload.make test: Go tests and the UI type check.make image: container imageFROM scratch.make docker: build the image and push it togit.rda.run/shellgraph/server(runpodman login git.rda.runfirst).make help: all targets.
Documentation: the site repository, section /docs/server/ (content/docs/server/).