Skip to content

Commit e0966d3

Browse files
authored
Merge pull request #11 from mook-as/embedded-dashboard
Embedded dashboard
2 parents ca85713 + 1e9b721 commit e0966d3

11 files changed

Lines changed: 550 additions & 98 deletions

File tree

.dockerignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.drone.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,51 @@ on:
55
tags:
66
- v*
77

8+
permissions: {}
9+
810
jobs:
911
build:
1012
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
1115
steps:
12-
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
13-
with:
14-
go-version: 1.24.x
15-
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
with:
1818
fetch-depth: 1
1919
submodules: recursive
2020
persist-credentials: false
21+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
22+
with:
23+
go-version-file: go.mod
2124

2225
- name: Build Steve API
23-
run: |
24-
cd bin/
25-
chmod +x build.sh
26-
./build.sh
26+
# Parallel make doesn't seem to actually make this faster, even if we do
27+
# `go mod download` ahead of time.
28+
run: make release/steve.sha512sum
2729

2830
- name: Upload Build
2931
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
3032
with:
31-
path: ./release/*
33+
path: |
34+
release/*.tar.gz
35+
release/*.sha512sum
3236
if-no-files-found: error
3337

38+
release:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
steps:
44+
- name: Download built assets
45+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
46+
with:
47+
path: .
48+
merge-multiple: true
3449
- name: Create Release and Upload Assets
3550
env:
3651
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3752
run: |
38-
# Create a release using the tag
39-
gh release create "${{ github.ref_name }}" --generate-notes
40-
# Upload all files in the release directory
41-
for asset in ./release/*; do
42-
gh release upload "${{ github.ref_name }}" "$asset"
43-
done
53+
# Create a release using the tag, and upload assets.
54+
gh release create --repo "${{ github.repository }}" \
55+
"${{ github.ref_name }}" --generate-notes *

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/.dapper
2-
/.cache
3-
/certs
4-
/dist
51
*.swp
62
.idea
7-
steve
3+
/dashboard/
4+
/dashboard.tgz
5+
/release/

Dockerfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

Makefile

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
1-
build:
2-
docker build -t steve .
1+
DASHBOARD_VERSION := v2.11.1.rd4
2+
DASHBOARD_CHECKSUM := 22839af7ae78f1c9dbf2559a0be8a6cd355426b6dc31795ce8fd86a4257d4d509778b07b4cee36088c0c5ec072e6c09e2d8e7bbb4d070d0b70cd2c158abfe668
33

4-
run: build
5-
docker run $(DOCKER_ARGS) --rm -p 8989:9080 -it -v ${HOME}/.kube:/root/.kube steve --https-listen-port 0
4+
PLATFORMS := darwin-amd64 darwin-arm64 linux-amd64 linux-arm64 windows-amd64
65

7-
run-host: build
8-
docker run $(DOCKER_ARGS) --net=host --uts=host --rm -it -v ${HOME}/.kube:/root/.kube steve --kubeconfig /root/.kube/config --http-listen-port 8989 --https-listen-port 0
6+
.DELETE_ON_ERROR:
7+
8+
# Default target: build the checksum file, which requires all the tarballs.
9+
release/steve.sha512sum: $(foreach p,$(PLATFORMS),release/steve-$(p).tar.gz)
10+
cd $(@D) && sha512sum $(^F) > "$(@F)"
11+
12+
# Determine the executable suffix based on platform.
13+
EXE_SUFFIX = $(if $(findstring windows,$(1)),.exe)
14+
15+
# Define explicit rules for each tarball, to ensure it does not conflict with
16+
# the wildcard rule for executables.
17+
define ARCHIVE_RULE
18+
release/steve-$(1).tar.gz: release/$(1)/steve$(call EXE_SUFFIX,$(1))
19+
tar -czf "$$@" -C "$$(<D)" "$$(<F)"
20+
endef
21+
$(foreach p,$(PLATFORMS),$(eval $(call ARCHIVE_RULE,$(p))))
22+
23+
# Define explicit rules for each executable, to handle the .exe suffix on
24+
# Windows. Requires dashboard.
25+
GOLANG_SOURCES := $(shell find pkg -name '*.go') main.go go.mod go.sum
26+
# For release/steve-$(GOOS)-$(GOARCH)
27+
GOOS = $(firstword $(subst -, ,$(1)))
28+
GOARCH = $(lastword $(subst -, ,$(1)))
29+
define EXECUTABLE_RULE
30+
release/$(1)/steve$(call EXE_SUFFIX,$(1)): dashboard/index.html $$(GOLANG_SOURCES) $$(MAKEFILE_LIST)
31+
mkdir -p "$$(@D)"
32+
env GOOS=$(call GOOS,$(1)) GOARCH=$(call GOARCH,$(1)) CGO_ENABLED=0 \
33+
go build -ldflags '-extldflags -static -s -w -X main.dashboardChecksum=$(DASHBOARD_CHECKSUM)' \
34+
-trimpath -o "$$@"
35+
endef
36+
$(foreach p,$(PLATFORMS),$(eval $(call EXECUTABLE_RULE,$(p))))
37+
38+
# The dashboard requires the downloaded dashboard archive.
39+
dashboard/index.html: dashboard.tgz $(MAKEFILE_LIST)
40+
echo "$(DASHBOARD_CHECKSUM) $<" | sha512sum -c -
41+
-rm -rf "$(@D)"
42+
mkdir -p "$(@D)"
43+
tar -xzf "$<" -C "$(@D)"
44+
45+
# The dashboard archive is downloaded.
46+
dashboard.tgz:
47+
wget --no-verbose --output-document "$@" \
48+
"https://github.com/rancher-sandbox/rancher-desktop-dashboard/releases/download/desktop-$(DASHBOARD_VERSION)/rancher-dashboard-desktop-embed.tar.gz"
49+
echo "$(DASHBOARD_CHECKSUM) $@" | sha512sum -c -
50+
51+
.PHONY: clean
52+
clean:
53+
rm -rf release dashboard dashboard.tgz

bin/build.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

go.mod

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/rancher/steve
22

3-
go 1.13
3+
go 1.26
44

55
replace (
66
github.com/crewjam/saml => github.com/rancher/saml v0.0.0-20180713225824-ce1532152fde
@@ -14,7 +14,6 @@ require (
1414
github.com/adrg/xdg v0.3.1
1515
github.com/gorilla/mux v1.8.0
1616
github.com/gorilla/websocket v1.4.2
17-
github.com/imdario/mergo v0.3.8 // indirect
1817
github.com/pborman/uuid v1.2.0
1918
github.com/pkg/errors v0.9.1
2019
github.com/prometheus/client_golang v1.12.1
@@ -38,3 +37,76 @@ require (
3837
k8s.io/kube-aggregator v0.24.0
3938
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42
4039
)
40+
41+
require (
42+
github.com/PuerkitoBio/purell v1.1.1 // indirect
43+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
44+
github.com/beorn7/perks v1.0.1 // indirect
45+
github.com/blang/semver/v4 v4.0.0 // indirect
46+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
47+
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
48+
github.com/davecgh/go-spew v1.1.1 // indirect
49+
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
50+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
51+
github.com/felixge/httpsnoop v1.0.1 // indirect
52+
github.com/ghodss/yaml v1.0.0 // indirect
53+
github.com/go-logr/logr v1.2.0 // indirect
54+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
55+
github.com/go-openapi/jsonreference v0.19.5 // indirect
56+
github.com/go-openapi/swag v0.19.14 // indirect
57+
github.com/gogo/protobuf v1.3.2 // indirect
58+
github.com/golang/protobuf v1.5.2 // indirect
59+
github.com/google/gnostic v0.5.7-v3refs // indirect
60+
github.com/google/go-cmp v0.5.5 // indirect
61+
github.com/google/gofuzz v1.1.0 // indirect
62+
github.com/google/uuid v1.1.2 // indirect
63+
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
64+
github.com/imdario/mergo v0.3.8 // indirect
65+
github.com/josharian/intern v1.0.0 // indirect
66+
github.com/json-iterator/go v1.1.12 // indirect
67+
github.com/mailru/easyjson v0.7.6 // indirect
68+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
69+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
70+
github.com/modern-go/reflect2 v1.0.2 // indirect
71+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
72+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
73+
github.com/pmezard/go-difflib v1.0.0 // indirect
74+
github.com/prometheus/client_model v0.2.0 // indirect
75+
github.com/prometheus/common v0.32.1 // indirect
76+
github.com/prometheus/procfs v0.7.3 // indirect
77+
github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08 // indirect
78+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
79+
github.com/spf13/pflag v1.0.5 // indirect
80+
go.opentelemetry.io/contrib v0.20.0 // indirect
81+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
82+
go.opentelemetry.io/otel v0.20.0 // indirect
83+
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
84+
go.opentelemetry.io/otel/metric v0.20.0 // indirect
85+
go.opentelemetry.io/otel/sdk v0.20.0 // indirect
86+
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
87+
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
88+
go.opentelemetry.io/otel/trace v0.20.0 // indirect
89+
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
90+
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
91+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
92+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
93+
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
94+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
95+
golang.org/x/text v0.3.7 // indirect
96+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
97+
google.golang.org/appengine v1.6.7 // indirect
98+
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect
99+
google.golang.org/grpc v1.40.0 // indirect
100+
google.golang.org/protobuf v1.27.1 // indirect
101+
gopkg.in/inf.v0 v0.9.1 // indirect
102+
gopkg.in/yaml.v2 v2.4.0 // indirect
103+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
104+
k8s.io/component-base v0.24.0 // indirect
105+
k8s.io/klog/v2 v2.60.1 // indirect
106+
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
107+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 // indirect
108+
sigs.k8s.io/cli-utils v0.16.0 // indirect
109+
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
110+
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
111+
sigs.k8s.io/yaml v1.2.0 // indirect
112+
)

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,12 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
8989
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
9090
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
9191
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
92-
github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs=
9392
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
9493
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
9594
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
9695
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
9796
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
9897
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
99-
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
10098
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
10199
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
102100
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
@@ -129,7 +127,6 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
129127
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
130128
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
131129
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
132-
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
133130
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
134131
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
135132
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -590,7 +587,6 @@ github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uY
590587
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
591588
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
592589
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
593-
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
594590
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
595591
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
596592
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
@@ -787,7 +783,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
787783
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
788784
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
789785
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
790-
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
791786
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
792787
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
793788
golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1294,7 +1289,6 @@ sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5
12941289
sigs.k8s.io/kustomize/kyaml v0.4.0/go.mod h1:XJL84E6sOFeNrQ7CADiemc1B0EjIxHo3OhW4o1aJYNw=
12951290
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
12961291
sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA=
1297-
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU=
12981292
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18=
12991293
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
13001294
sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=

0 commit comments

Comments
 (0)