Skip to content

Commit 6809f21

Browse files
committed
migrate ricoberger -> bakito
use gin optimisations
1 parent 01dc355 commit 6809f21

File tree

204 files changed

+795
-2075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+795
-2075
lines changed

.github/dependabot.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
schedule:
6+
interval: "weekly"
7+
ignore:
8+
- dependency-name: k8s.io/client-go
9+
- dependency-name: k8s.io/apimachinery

.github/workflows/docker.yaml

-29
This file was deleted.

.github/workflows/go.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Go
2-
on: [pull_request, release]
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
38
jobs:
49
build-release:
510
name: Build
@@ -19,6 +24,3 @@ jobs:
1924

2025
- name: Test
2126
run: go test ./...
22-
23-
- name: Build
24-
run: make build

.github/workflows/helm.yaml

-38
This file was deleted.

.github/workflows/publish.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: docker-image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Get current date
16+
id: date
17+
run: echo "::set-output name=date::$(date --utc +%Y-%m-%dT%H:%M:%SZ)"
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v1
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
- name: Login to ghcr.io
23+
uses: docker/login-action@v1
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.repository_owner }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Login to Quay
29+
uses: docker/login-action@v1
30+
with:
31+
registry: quay.io
32+
username: ${{ secrets.QUAY_USERNAME }}
33+
password: ${{ secrets.QUAY_PASSWORD }}
34+
- name: Build and push ${{github.event.release.tag_name }}
35+
id: docker_build_release
36+
uses: docker/build-push-action@v2
37+
if: ${{ github.event.release.tag_name != '' }}
38+
with:
39+
push: true
40+
tags: ghcr.io/bakito/sealed-secrets-web:latest,ghcr.io/bakito/sealed-secrets-web:${{ github.event.release.tag_name }},quay.io/bakito/sealed-secrets-web:latest,quay.io/bakito/sealed-secrets-web:${{ github.event.release.tag_name }}
41+
platforms: linux/amd64,linux/arm64
42+
build-args: |
43+
VERSION=${{ github.event.release.tag_name }}
44+
BUILD=${{ steps.date.outputs.date }}
45+
46+
- name: Build and push main
47+
id: docker_build_main
48+
uses: docker/build-push-action@v2
49+
if: ${{ github.event.release.tag_name == '' }}
50+
with:
51+
push: true
52+
tags: ghcr.io/bakito/sealed-secrets-web:main,quay.io/bakito/sealed-secrets-web:main
53+
platforms: linux/amd64,linux/arm64
54+
build-args: |
55+
VERSION=main
56+
BUILD=${{ steps.date.outputs.date }}
57+
- name: Image digest
58+
run: echo ${{ steps.docker_build.outputs.digest }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,4 @@ bin
119119

120120
# idea
121121
/.idea
122+
/dist

.goreleaser.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
before:
2+
hooks:
3+
- helm package ./charts/sealed-secrets-web/ --version {{ .Version }} --app-version {{ .Version }} -d {{ .Env.CR_PACKAGE_PATH }}
4+
builds:
5+
- skip: true
6+
main: ./main.go
7+
checksum:
8+
name_template: 'checksums.txt'
9+
snapshot:
10+
name_template: "{{ .Tag }}-next"
11+
changelog:
12+
sort: asc
13+
filters:
14+
exclude:
15+
- '^docs:'
16+
- '^test:'

Dockerfile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM bitnami/golang:1.16 as builder
2+
3+
WORKDIR /go/src/app
4+
5+
RUN apt-get update && apt-get install -y upx
6+
7+
ARG VERSION=main
8+
ARG BUILD="N/A"
9+
10+
ENV GOPROXY=https://goproxy.io \
11+
GO111MODULE=on \
12+
CGO_ENABLED=0 \
13+
GOOS=linux
14+
15+
ADD ./go.mod /tmp/go.mod
16+
RUN export KUBESEAL_VERSION=$(cat /tmp/go.mod | grep github.com/bitnami-labs/sealed-secrets | awk '{print $2}') && \
17+
export KUBESEAL_ARCH=$(dpkg --print-architecture) && \
18+
if [ "${KUBESEAL_ARCH}" = "arm64" ]; then \
19+
export KUBESEAL_FILE="kubeseal-${KUBESEAL_ARCH}"; \
20+
else \
21+
export KUBESEAL_FILE="kubeseal-linux-${KUBESEAL_ARCH}"; \
22+
fi && \
23+
export KUBESEAL_URL="https://github.com/bitnami-labs/sealed-secrets/releases/download/${KUBESEAL_VERSION}/${KUBESEAL_FILE}"; \
24+
echo "Download kubeseal ${KUBESEAL_VERSION}/${KUBESEAL_ARCH} from ${KUBESEAL_URL}" && \
25+
curl -L ${KUBESEAL_URL} -o /tmp/kubeseal && \
26+
chmod +x /tmp/kubeseal && \
27+
upx -q /tmp/kubeseal
28+
29+
ADD . /go/src/app/
30+
31+
RUN go build -a -installsuffix cgo -ldflags="-w -s -X github.com/bakito/sealed-secrets-web/pkg/version.Version=${VERSION} -X github.com/bakito/sealed-secrets-web/pkg/version.Build=${BUILD}" -o sealed-secrets-web . && \
32+
upx -q sealed-secrets-web
33+
34+
35+
# application image
36+
FROM alpine:latest
37+
WORKDIR /opt/go
38+
39+
LABEL maintainer="bakito <[email protected]>"
40+
EXPOSE 8080
41+
RUN apk add --no-cache dumb-init
42+
ENTRYPOINT ["/usr/bin/dumb-init", "--","/opt/go/sealed-secrets-web"]
43+
COPY --from=builder /go/src/app/sealed-secrets-web /opt/go/sealed-secrets-web
44+
COPY --from=builder /tmp/kubeseal /usr/local/bin/kubeseal
45+
USER 1001

Makefile

+14-90
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,14 @@
1-
WHAT := sealedsecretsweb
2-
3-
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
4-
BUILDTIME ?= $(shell date '+%Y%m%d-%H:%M:%S')
5-
BUILDUSER ?= $(shell id -un)
6-
PWD ?= $(shell pwd)
7-
REPO ?= github.com/ricoberger/sealed-secrets-web
8-
REVISION ?= $(shell git rev-parse HEAD)
9-
VERSION ?= $(shell git describe --tags)
10-
11-
.PHONY: build build-darwin-amd64 build-linux-amd64 build-windows-amd64 clean docker-build docker-publish release release-major release-minor release-patch
12-
13-
build:
14-
for target in $(WHAT); do \
15-
go build -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} \
16-
-X ${REPO}/pkg/version.Revision=${REVISION} \
17-
-X ${REPO}/pkg/version.Branch=${BRANCH} \
18-
-X ${REPO}/pkg/version.BuildUser=${BUILDUSER} \
19-
-X ${REPO}/pkg/version.BuildDate=${BUILDTIME}" \
20-
-o ./bin/$$target ./cmd/$$target; \
21-
done
22-
23-
build-darwin-amd64:
24-
for target in $(WHAT); do \
25-
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -a -installsuffix cgo -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} \
26-
-X ${REPO}/pkg/version.Revision=${REVISION} \
27-
-X ${REPO}/pkg/version.Branch=${BRANCH} \
28-
-X ${REPO}/pkg/version.BuildUser=${BUILDUSER} \
29-
-X ${REPO}/pkg/version.BuildDate=${BUILDTIME}" \
30-
-o ./bin/$$target-darwin-amd64 ./cmd/$$target; \
31-
done
32-
33-
build-linux-amd64:
34-
for target in $(WHAT); do \
35-
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -a -installsuffix cgo -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} \
36-
-X ${REPO}/pkg/version.Revision=${REVISION} \
37-
-X ${REPO}/pkg/version.Branch=${BRANCH} \
38-
-X ${REPO}/pkg/version.BuildUser=${BUILDUSER} \
39-
-X ${REPO}/pkg/version.BuildDate=${BUILDTIME}" \
40-
-o ./bin/$$target-linux-amd64 ./cmd/$$target; \
41-
done
42-
43-
build-windows-amd64:
44-
for target in $(WHAT); do \
45-
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -a -installsuffix cgo -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} \
46-
-X ${REPO}/pkg/version.Revision=${REVISION} \
47-
-X ${REPO}/pkg/version.Branch=${BRANCH} \
48-
-X ${REPO}/pkg/version.BuildUser=${BUILDUSER} \
49-
-X ${REPO}/pkg/version.BuildDate=${BUILDTIME}" \
50-
-o ./bin/$$target-windows-amd64.exe ./cmd/$$target; \
51-
done
52-
53-
clean:
54-
rm -rf ./bin
55-
56-
docker-build: build-linux-amd64
57-
for target in $(WHAT); do \
58-
docker build -f cmd/$$target/Dockerfile -t "$$target:${VERSION}" --build-arg REVISION=${REVISION} --build-arg VERSION=${VERSION} .; \
59-
done
60-
61-
docker-publish:
62-
for target in $(WHAT); do \
63-
docker tag $$target:${VERSION} ricoberger/sealed-secrets-web:${VERSION}; \
64-
docker tag $$target:${VERSION} docker.pkg.github.com/ricoberger/sealed-secrets-web/sealed-secrets-web:${VERSION}; \
65-
docker push ricoberger/sealed-secrets-web:${VERSION}; \
66-
docker push docker.pkg.github.com/ricoberger/sealed-secrets-web/sealed-secrets-web:${VERSION}; \
67-
done
68-
69-
release: clean docker-build docker-publish
70-
71-
release-major:
72-
$(eval MAJORVERSION=$(shell git describe --tags --abbrev=0 | sed s/v// | awk -F. '{print $$1+1".0.0"}'))
73-
git checkout master
74-
git pull
75-
git tag -a $(MAJORVERSION) -m 'release $(MAJORVERSION)'
76-
git push origin --tags
77-
78-
release-minor:
79-
$(eval MINORVERSION=$(shell git describe --tags --abbrev=0 | sed s/v// | awk -F. '{print $$1"."$$2+1".0"}'))
80-
git checkout master
81-
git pull
82-
git tag -a $(MINORVERSION) -m 'release $(MINORVERSION)'
83-
git push origin --tags
84-
85-
release-patch:
86-
$(eval PATCHVERSION=$(shell git describe --tags --abbrev=0 | sed s/v// | awk -F. '{print $$1"."$$2"."$$3+1}'))
87-
git checkout master
88-
git pull
89-
git tag -a $(PATCHVERSION) -m 'release $(PATCHVERSION)'
90-
git push origin --tags
1+
release: semver
2+
@version=$$(semver); \
3+
git tag -s $$version -m"Release $$version"
4+
goreleaser --rm-dist
5+
cr upload --skip-existing
6+
cr index
7+
8+
test-release:
9+
goreleaser --skip-publish --snapshot --rm-dist
10+
11+
semver:
12+
ifeq (, $(shell which semver))
13+
$(shell go get -u github.com/bakito/semver)
14+
endif

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
**sealed-secrets-web** can be installed via our Helm chart:
2121

2222
```sh
23-
helm repo add ricoberger https://ricoberger.github.io/helm-charts
23+
helm repo add bakito https://bakito.github.io/helm-charts
2424
helm up
2525

26-
helm upgrade --install sealed-secrets-web ricoberger/sealed-secrets-web
26+
helm upgrade --install sealed-secrets-web bakito/sealed-secrets-web
2727
```
2828

2929
To modify the settings for Sealed Secrets you can modify the arguments for the Docker image with the `--set` flag. For example you can set a different `controller-name` during the installation with the following command:
3030

3131
```sh
32-
helm upgrade --install sealed-secrets-web ricoberger/sealed-secrets-web --set image.args={"--kubeseal-arguments=--controller-name=sealed-secrets"}
32+
helm upgrade --install sealed-secrets-web bakito/sealed-secrets-web --set image.args={"--kubeseal-arguments=--controller-name=sealed-secrets"}
3333
```
3434

3535
## Development
@@ -62,7 +62,7 @@ Finally we can install **Sealed Secrets Web** using the provided Helm chart:
6262
```sh
6363
kubectl create namespace sealed-secrets-web
6464

65-
helm upgrade --install sealed-secrets-web ricoberger/sealed-secrets-web --namespace sealed-secrets-web --set image.args={"--kubeseal-arguments=--controller-name=sealed-secrets"} --set image.repository=localhost:5000/sealed-secrets-web --set image.tag=dev --set image.pullPolicy=Always
65+
helm upgrade --install sealed-secrets-web bakito/sealed-secrets-web --namespace sealed-secrets-web --set image.args={"--kubeseal-arguments=--controller-name=sealed-secrets"} --set image.repository=localhost:5000/sealed-secrets-web --set image.tag=dev --set image.pullPolicy=Always
6666

6767
# Access the Web UI:
6868
kubectl port-forward svc/sealed-secrets-web 8080:80

charts/sealed-secrets-web/Chart.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
apiVersion: v1
2-
appVersion: 2.4.0
1+
apiVersion: v2
2+
appVersion: v2.5.0
33
description: A web interface for Sealed Secrets by Bitnami.
4-
home: https://github.com/ricoberger/sealed-secrets-web
5-
icon: https://raw.githubusercontent.com/ricoberger/sealed-secrets-web/master/assets/logo.png
4+
home: https://github.com/bakito/sealed-secrets-web
5+
icon: https://raw.githubusercontent.com/bakito/sealed-secrets-web/master/assets/logo.png
66
maintainers:
7-
- name: Rico Berger
8-
url: https://ricoberger.de
7+
- name: bakito
8+
url: https://github.com/bakito
99
name: sealed-secrets-web
10-
version: 2.4.0
10+
version: 2.5.0

charts/sealed-secrets-web/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
serviceAccountName: {{ template "sealed-secrets-web.serviceAccountName" . }}
2424
containers:
2525
- name: {{ .Chart.Name }}
26-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
26+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
2727
imagePullPolicy: {{ .Values.image.pullPolicy }}
2828
args:
2929
{{- toYaml .Values.image.args | nindent 12 }}

charts/sealed-secrets-web/values.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
replicaCount: 1
22

33
image:
4-
repository: ricoberger/sealed-secrets-web
5-
tag: 2.4.0
4+
repository: ghcr.io/bakito/sealed-secrets-web
5+
# default version .Chart.AppVersion
6+
tag:
67
pullPolicy: IfNotPresent
78
args: []
89

0 commit comments

Comments
 (0)