Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.5.0 #1616

Merged
merged 10 commits into from
Dec 19, 2024
Merged

v4.5.0 #1616

Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 16 additions & 10 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
strategy:
matrix:
go_version: [ 'stable' ]
node_version: [ '20' ]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand All @@ -18,16 +22,17 @@ jobs:
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/.npm
~/.cache
~/go/pkg/mod
/usr/local/share/.cache/yarn
key: ${{ runner.os }}-koko
restore-keys: ${{ runner.os }}-koko
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-

- name: Get version
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
echo "TAG=$TAG" >> $GITHUB_ENV
echo "TAG=$TAG" >> $GITHUB_OUTPUT

- name: Create Release
id: create_release
Expand All @@ -36,23 +41,24 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-config.yml
version: ${{ env.TAG }}
tag: ${{ env.TAG }}
version: ${{ steps.get_version.outputs.TAG }}
tag: ${{ steps.get_version.outputs.TAG }}

- uses: actions/setup-node@v4
with:
node-version: '20.15'
node-version: ${{ matrix.node_version }}

- uses: actions/setup-go@v5
with:
go-version: '1.22' # The Go version to download (if necessary) and use.
go-version: ${{ matrix.go_version }}
cache: false

- name: Make Build
id: make_build
run: |
make all -s && ls build
env:
VERSION: ${{ env.TAG }}
VERSION: ${{ steps.get_version.outputs.TAG }}

- name: Release Upload Assets
uses: softprops/action-gh-release@v2
Expand Down
6 changes: 2 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ before:
- go mod tidy
- go generate ./...

snapshot:
version_template: "{{ .Tag }}-next"

builds:
- id: koko
main: ./cmd/koko/
Expand Down Expand Up @@ -87,6 +84,7 @@ archives:
- LICENSE
- README.md
- config_example.yml
- entrypoint.sh
- locale/*
- src: utils/init-kubectl.sh
dst: init-kubectl
Expand All @@ -98,7 +96,7 @@ archives:
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}"

checksum:
name_template: "{{ .ProjectName }}_checksums.txt"
name_template: "checksums.txt"

release:
draft: true
Expand Down
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM jumpserver/koko-base:20241030_063234 AS stage-build
FROM jumpserver/koko-base:20241217_053647 AS stage-build

WORKDIR /opt/koko
ARG TARGETARCH
Expand Down Expand Up @@ -31,18 +31,15 @@ ENV LANG=en_US.UTF-8
ARG DEPENDENCIES=" \
ca-certificates"

ARG APT_MIRROR=http://mirrors.ustc.edu.cn
ARG APT_MIRROR=http://deb.debian.org

RUN set -ex \
&& rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& apt-get clean all \
&& echo "no" | dpkg-reconfigure dash \
&& sed -i "s@# export @export @g" ~/.bashrc \
&& sed -i "s@# alias @alias @g" ~/.bashrc
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/koko

Expand Down
19 changes: 8 additions & 11 deletions Dockerfile-base
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM redis:6.2-bullseye AS redis-stage
FROM golang:1.22-bullseye AS stage-go-build
FROM golang:1.23-bullseye AS stage-go-build

FROM node:20.15-bullseye
COPY --from=stage-go-build /usr/local/go/ /usr/local/go/
Expand All @@ -10,18 +10,17 @@ ENV PATH=/go/bin:/usr/local/go/bin:$PATH
ARG TARGETARCH
ARG NPM_REGISTRY="https://registry.npmmirror.com"
ENV NPM_REGISTY=$NPM_REGISTRY
RUN set -ex \
&& echo "no" | dpkg-reconfigure dash

RUN set -ex \
&& npm config set registry ${NPM_REGISTRY} \
&& yarn config set registry ${NPM_REGISTRY}

WORKDIR /opt

ARG HELM_VERSION=v3.14.3
ARG KUBECTL_VERSION=v1.29.3
ARG CHECK_VERSION=v1.0.3
ARG USQL_VERSION=v0.0.4
ARG HELM_VERSION=v3.16.1
ARG KUBECTL_VERSION=v1.31.3
ARG CHECK_VERSION=v1.0.4
ARG USQL_VERSION=v0.0.5

RUN set -ex \
&& mkdir -p /opt/koko/bin \
Expand All @@ -32,19 +31,17 @@ RUN set -ex \
&& tar -xf helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz --strip-components=1 -C /opt/koko/bin/ linux-${TARGETARCH}/helm \
&& mv /opt/koko/bin/helm /opt/koko/bin/rawhelm \
&& wget https://github.com/jumpserver-dev/healthcheck/releases/download/${CHECK_VERSION}/check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/koko/bin/ \
&& tar -xf check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/koko/bin/ check \
&& wget https://github.com/jumpserver-dev/usql/releases/download/${USQL_VERSION}/usql-${USQL_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf usql-${USQL_VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/koko/bin/ \
&& wget -O /opt/koko/.kubectl_aliases https://github.com/ahmetb/kubectl-aliases/raw/master/.kubectl_aliases \
&& chmod 755 /opt/koko/bin/* \
&& chown root:root /opt/koko/bin/* \
&& rm -f *.tar.gz



WORKDIR /opt/koko

ARG MONGOSH_VERSION=2.3.2
ARG MONGOSH_VERSION=2.3.4
RUN set -ex \
&& mkdir -p /opt/koko/lib \
&& \
Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ define make_artifact_full
GOOS=$(1) GOARCH=$(2) $(K8SCMDBUILD) -o $(BUILDDIR)/kubectl-$(1)-$(2) $(KUBECTLFILE)
GOOS=$(1) GOARCH=$(2) $(K8SCMDBUILD) -o $(BUILDDIR)/helm-$(1)-$(2) $(HELMFILE)
mkdir -p $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/locale/

cp $(BUILDDIR)/$(NAME)-$(1)-$(2) $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/$(NAME)
cp $(BUILDDIR)/kubectl-$(1)-$(2) $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/kubectl
cp $(BUILDDIR)/helm-$(1)-$(2) $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/helm
cp -r $(BASEPATH)/locale/* $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/locale/
cp -r $(BASEPATH)/config_example.yml $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/config_example.yml
cp -r $(BASEPATH)/utils/init-kubectl.sh $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/init-kubectl.sh
cp $(BUILDDIR)/kubectl-$(1)-$(2) $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/kubectl
cp README.md $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/README.md
cp LICENSE $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/LICENSE
cp config_example.yml $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/config_example.yml
cp entrypoint.sh $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/entrypoint.sh
cp utils/init-kubectl.sh $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/init-kubectl.sh
cp -r locale/* $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)/locale/

cd $(BUILDDIR) && tar -czvf $(NAME)-$(VERSION)-$(1)-$(2).tar.gz $(NAME)-$(VERSION)-$(1)-$(2)
rm -rf $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2) $(BUILDDIR)/$(NAME)-$(1)-$(2) $(BUILDDIR)/kubectl-$(1)-$(2) $(BUILDDIR)/helm-$(1)-$(2)
Expand All @@ -61,6 +63,7 @@ all: koko-ui
$(call make_artifact_full,linux,ppc64le)
$(call make_artifact_full,linux,s390x)
$(call make_artifact_full,linux,riscv64)
$(call make_artifact_full,linux,loong64)

local: koko-ui
$(call make_artifact_full,$(shell go env GOOS),$(shell go env GOARCH))
Expand Down
57 changes: 38 additions & 19 deletions locale/en_US/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,20 @@ msgid "ACL reject"
msgstr ""

#. lang.T
#: pkg/handler/asset.go:223
msgid ""
"Face ACL is not supported yet. Please use the WebTerminal to connect the "
"asset."
msgstr ""

#. lang.T
#. lang.T
#: pkg/handler/asset.go:238 pkg/handler/asset.go:247
msgid "Unknown error code: %s, detail: %s"
msgstr ""

#. lang.T
#: pkg/handler/asset.go:231 pkg/handler/asset.go:248
#: pkg/handler/asset.go:258
msgid "get connect token err"
msgstr ""

Expand Down Expand Up @@ -226,10 +238,17 @@ msgstr ""
#. lang.T
#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:445
msgid ""
"Face verification is not supported yet. Please use the WebTerminal to "
"connect the asset."
msgstr ""

#. lang.T
#. lang.T
#: pkg/handler/direct_handler.go:433 pkg/handler/direct_handler.go:439
#: pkg/handler/direct_handler.go:453 pkg/handler/direct_handler.go:469
#. lang.T
#: pkg/handler/direct_handler.go:460 pkg/handler/direct_handler.go:476
#: pkg/handler/dispatch.go:139
msgid "Node: [ ID.Name(Asset amount) ]"
msgstr ""
Expand Down Expand Up @@ -383,14 +402,14 @@ msgid ""
msgstr ""

#. lang.T
#: pkg/proxy/parser.go:282
#: pkg/proxy/parser.go:283
msgid "The command '%s' requires review. Continue or not [Y/n]?"
msgstr ""

#. lang.T
#. lang.T
#. lang.T
#: pkg/proxy/parser.go:302 pkg/proxy/parser.go:309 pkg/proxy/parser.go:463
#: pkg/proxy/parser.go:303 pkg/proxy/parser.go:310 pkg/proxy/parser.go:463
msgid "Command `%s` is forbidden"
msgstr ""

Expand All @@ -400,14 +419,14 @@ msgid "have no permission to download file"
msgstr ""

#. lang.T
#: pkg/proxy/parser.go:608
#: pkg/proxy/parser.go:606
msgid ""
"Please waiting for the reviewers to confirm command `%s`, cancel by CTRL+C "
"or CTRL+D."
msgstr ""

#. lang.T
#: pkg/proxy/parser.go:618
#: pkg/proxy/parser.go:616
msgid ""
"Need ticket confirm to execute command, already send email to the reviewers"
msgstr ""
Expand All @@ -416,7 +435,7 @@ msgstr ""
#. lang.T
#. lang.T
#. lang.T
#: pkg/proxy/parser.go:619 pkg/proxy/parser.go:620 pkg/proxy/server.go:58
#: pkg/proxy/parser.go:617 pkg/proxy/parser.go:618 pkg/proxy/server.go:58
#: pkg/proxy/server.go:62
msgid ""
"HandleTask does not support protocol %s, please use web terminal to access"
Expand All @@ -428,45 +447,45 @@ msgid "Account <%s> and asset <%s> protocol are inconsistent."
msgstr ""

#. lang.T
#: pkg/proxy/server.go:101
#: pkg/proxy/server.go:102
msgid "You don't have permission login %s"
msgstr ""

#. lang.T
#: pkg/proxy/server.go:337
#: pkg/proxy/server.go:334
msgid "You get auth token failed"
msgstr ""

#. lang.T
#: pkg/proxy/server.go:348
#: pkg/proxy/server.go:345
msgid "Get auth password failed"
msgstr ""

#. lang.T
#. lang.T
#: pkg/proxy/server.go:364 pkg/proxy/server.go:421
#: pkg/proxy/server.go:361 pkg/proxy/server.go:418
msgid "Reuse SSH connections (%s@%s) [Number of connections: %d]"
msgstr ""

#. lang.T
#: pkg/proxy/server.go:677
#: pkg/proxy/server.go:674
msgid "Switched to %s"
msgstr ""

#. lang.T
#. lang.T
#: pkg/proxy/server.go:774 pkg/proxy/server.go:919
#: pkg/proxy/server.go:771 pkg/proxy/server.go:916
msgid "Connect with api server failed"
msgstr ""

#. lang.T
#: pkg/proxy/server.go:968
#: pkg/proxy/server.go:977
msgid "Start domain gateway failed %s"
msgstr ""

#. lang.T
#. lang.T
#: pkg/proxy/server.go:976 pkg/proxy/server_options.go:108
#: pkg/proxy/server.go:985 pkg/proxy/server_options.go:108
msgid "Manual"
msgstr ""

Expand Down Expand Up @@ -496,18 +515,18 @@ msgid "Connecting to Kubernetes %s container %s"
msgstr ""

#. lang.T
#: pkg/proxy/switch.go:325
#: pkg/proxy/switch.go:328
msgid "Session max time reached, disconnect"
msgstr ""

#. lang.T
#. lang.T
#: pkg/proxy/switch.go:336 pkg/proxy/switch.go:345
#: pkg/proxy/switch.go:337 pkg/proxy/switch.go:344
msgid "Permission has expired, disconnect"
msgstr ""

#. lang.T
#: pkg/proxy/switch.go:357
#: pkg/proxy/switch.go:354
msgid "Terminated by admin %s"
msgstr ""

Expand Down
Loading
Loading