Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0211fa9
Migrate to metal-apiserver
majst01 Aug 20, 2025
a70fc7d
pass context
majst01 Aug 20, 2025
00b454e
Explain admin usage
majst01 Aug 20, 2025
7638412
Updates
majst01 Sep 1, 2025
9bad904
Update deps
majst01 Oct 9, 2025
05c0dd6
Update api
majst01 Oct 17, 2025
2c10566
Update api
majst01 Jan 5, 2026
f1d7f25
Update to go-1.26
majst01 Feb 12, 2026
121f898
component ping
majst01 Feb 22, 2026
ea6babd
update api
majst01 Apr 9, 2026
061adf1
Update deps
majst01 May 18, 2026
32ba79e
fix some ai findings
majst01 May 18, 2026
000f3c6
Update deps
majst01 Aug 14, 2026
0fc9601
Make metal-console apiv1 and apiv2 compatible
majst01 Aug 14, 2026
7805b41
Parse token only once
majst01 Aug 14, 2026
c7eea64
Simplify
majst01 Aug 14, 2026
9ff28f3
Remove CONTRIBUTING.md
Gerrit91 Aug 14, 2026
4d7e087
Merge main
majst01 Aug 14, 2026
69b6af6
Migrate to actions-common.
Gerrit91 Aug 14, 2026
fb97193
Fix component
majst01 Aug 14, 2026
86d2c32
Debug logs
majst01 Aug 14, 2026
a580030
Debug logs
majst01 Aug 14, 2026
b80610c
Debug logs
majst01 Aug 14, 2026
231f7d5
Fix npe
majst01 Aug 14, 2026
dd5ef4a
Logging
majst01 Aug 15, 2026
d4fb3ec
Use default (5m) tokenfilerereadduration
majst01 Aug 15, 2026
c6e47b0
Try api client fix
majst01 Aug 15, 2026
7f5baae
Try api client fix
majst01 Aug 15, 2026
312bd3c
Try api client fix
majst01 Aug 15, 2026
8680925
Next try
majst01 Aug 15, 2026
d072eaa
Update deps
majst01 Aug 24, 2026
ae0e193
Update deps
majst01 Aug 28, 2026
f3fdc06
go-1.27
majst01 Aug 28, 2026
9ce8271
Remove unused
majst01 Aug 29, 2026
a0d5ed0
Refactor tokentype detection
majst01 Aug 29, 2026
e0ef689
factor out v1 code
majst01 Aug 29, 2026
95bb0bc
refactor key loading
majst01 Aug 29, 2026
a8a4ec8
Refactor
majst01 Aug 31, 2026
b93480f
First batch of findings
majst01 Sep 2, 2026
ebcbd01
no global metal adapter
majst01 Sep 2, 2026
d258093
configurable bmc keys
majst01 Sep 2, 2026
fb7690d
close all goroutines on session termination
majst01 Sep 2, 2026
6068c23
close all goroutines on session termination
majst01 Sep 2, 2026
a6220bb
Clear createdAts after session close
majst01 Sep 2, 2026
609aa54
Some tests
majst01 Sep 2, 2026
a4d656f
Some tests
majst01 Sep 2, 2026
1acb52a
integration test
majst01 Sep 2, 2026
8d91083
Lint
majst01 Sep 2, 2026
9df73eb
Better publicKey check
majst01 Sep 2, 2026
1e7f5b3
Check authenticated and isadmin early
majst01 Sep 3, 2026
6801b11
Remove isadmin env variable which is not required anymore
majst01 Sep 4, 2026
3fff885
Prevent NPE
majst01 Sep 4, 2026
f441578
Detect actual window size
majst01 Sep 4, 2026
0ad8f21
Only one server test
majst01 Sep 4, 2026
3c4b2ff
Go dependencies
majst01 Sep 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/release-drafter.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: metal-stack component release

on:
pull_request:
branches:
- master
release:
types:
- published
push:
branches:
- master

jobs:
draft:
uses: metal-stack/actions-common/.github/workflows/release-drafter.yaml@v1

go-build:
uses: metal-stack/actions-common/.github/workflows/go-build.yaml@v1
secrets: inherit
with:
build-command: make console
56 changes: 0 additions & 56 deletions .github/workflows/docker.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/release-drafter.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions CONTRIBUTING.md

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.25 AS builder
FROM golang:1.27 AS builder
WORKDIR /work
COPY . .
RUN make

FROM gcr.io/distroless/static-debian12:nonroot
FROM gcr.io/distroless/static-debian13:nonroot
COPY --from=builder /work/bin/metal-console /
CMD ["/metal-console"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ If the machine uuid is a valid machine, it will then use the provided private ke

`metal-console` figures out in which partition the machine is located and then opens a tls socket connection to `metal-bmc` running on the management server in this partition. `metal-bmc` checks if the tls client certificate matches. If this is the case, it looks up the machine ipmi details from `metal-api` and starts a ipmi sol session to the machine.

## Configuration

The `metal-console` can be configured through environment variables.
Every configuration needs to be prefixed with `METAL_CONSOLE_`.

All configuration options can be found in the implementation [internal/console/spec.go](./internal/console/spec.go).

## Possible access patterns

| machine state | who wants access | allowed | how is access granted |
|--------------------|------------------|---------|-----------------------------------------------------------------------------------------------------------------------------|
| waiting machine | end user | no | only admins can connect to waiting machines |
| waiting machine | admin editor | yes | provided token is checked if it contains admin editor rights |
| allocated machine | end user | yes | allowed if token rights allow fetching this machine and provided ssh keys match publickeys stored in the machine allocation |
| allocated machine | admin editor | yes | provided token is checked if it contains admin editor rights |
| allocated firewall | end user | no | denied because only admins are allowed to connect to firewall |
| allocated firewall | admin editor | yes | provided token is checked if it contains admin editor rights |

## TODO

- If a second console access starts to same machine, kill existing one
102 changes: 58 additions & 44 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,63 +1,77 @@
module github.com/metal-stack/metal-console

go 1.25.4
go 1.27

require (
github.com/gliderlabs/ssh v0.3.8
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/metal-stack/metal-go v0.42.0
github.com/metal-stack/metal-lib v0.23.3
github.com/metal-stack/api v0.5.5
github.com/metal-stack/metal-go v0.45.0
github.com/metal-stack/metal-lib v0.26.3
github.com/metal-stack/v v1.0.3
github.com/stretchr/testify v1.11.1
golang.org/x/crypto v0.54.0
github.com/stretchr/testify v1.12.1
github.com/tailscale/gliderssh v0.3.4-0.20260716005906-1a0f895faf28
golang.org/x/crypto v0.56.0
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect
connectrpc.com/connect v1.20.0 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/coreos/go-oidc/v3 v3.15.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/coreos/go-oidc/v3 v3.21.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
github.com/go-jose/go-jose/v4 v4.1.5 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.2 // indirect
github.com/go-openapi/jsonpointer v0.21.2 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.28.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/go-openapi/analysis v1.0.0 // indirect
github.com/go-openapi/errors v0.22.8 // indirect
github.com/go-openapi/jsonpointer v1.0.1 // indirect
github.com/go-openapi/jsonreference v1.0.2 // indirect
github.com/go-openapi/loads v0.25.3 // indirect
github.com/go-openapi/runtime v0.33.2 // indirect
github.com/go-openapi/runtime/server-middleware v0.33.2 // indirect
github.com/go-openapi/spec v1.0.1 // indirect
github.com/go-openapi/strfmt v0.27.2 // indirect
github.com/go-openapi/swag v0.29.1 // indirect
github.com/go-openapi/swag/cmdutils v0.29.1 // indirect
github.com/go-openapi/swag/conv v0.29.1 // indirect
github.com/go-openapi/swag/fileutils v0.29.1 // indirect
github.com/go-openapi/swag/jsonutils v0.29.1 // indirect
github.com/go-openapi/swag/loading v0.29.1 // indirect
github.com/go-openapi/swag/mangling v0.29.1 // indirect
github.com/go-openapi/swag/netutils v0.29.1 // indirect
github.com/go-openapi/swag/pools v0.29.1 // indirect
github.com/go-openapi/swag/stringutils v0.29.1 // indirect
github.com/go-openapi/swag/typeutils v0.29.1 // indirect
github.com/go-openapi/swag/yamlutils v0.29.1 // indirect
github.com/go-openapi/validate v1.0.0 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/goccy/go-json v0.10.6 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.20.0 // indirect
github.com/klauspost/connect-compress/v2 v2.1.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.6 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx/v2 v2.1.6 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/metal-stack/security v0.9.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/segmentio/asm v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.17.7 // indirect
github.com/lestrrat-go/httprc/v3 v3.0.6 // indirect
github.com/lestrrat-go/jwx/v3 v3.2.0 // indirect
github.com/lestrrat-go/option/v2 v2.0.0 // indirect
github.com/metal-stack/security v0.9.7 // indirect
github.com/minio/minlz v1.2.0 // indirect
github.com/oklog/ulid/v2 v2.1.2 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/valyala/fastjson v1.6.10 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.16.0 // indirect
go.opentelemetry.io/otel v1.46.0 // indirect
go.opentelemetry.io/otel/metric v1.46.0 // indirect
go.opentelemetry.io/otel/trace v1.46.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/net v0.58.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
golang.org/x/text v0.41.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
)
Loading