Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c68bb54
perf: update for new client
ibuler Jul 8, 2026
5ebe341
Merge remote-tracking branch 'origin/dev' into new_terminal
Zxc4wonder Jul 8, 2026
ec53bf1
Merge pull request #179 from jumpserver/pr@new_terminal@merge_dev_new…
Zxc4wonder Jul 8, 2026
7b17e68
Merge pull request #186 from jumpserver/pr@new_terminal@sync_dev
Zxc4wonder Jul 15, 2026
386ef73
fix: validate DataView change_limit values
Zxc4wonder Jul 16, 2026
3bde6e8
Merge pull request #188 from jumpserver/pr@new_terminal@fix_dataview_…
Zxc4wonder Jul 16, 2026
2f58e29
Merge pull request #189 from jumpserver/dev
Zxc4wonder Jul 16, 2026
2fc8b43
Merge remote-tracking branch 'origin/dev' into sync_dev_20260721
Zxc4wonder Jul 21, 2026
5f33ccb
Merge pull request #195 from jumpserver/pr@new_terminal@sync_dev_2026…
Zxc4wonder Jul 21, 2026
b7450fd
feat:support dataview edit
Zxc4wonder Jul 27, 2026
4a1c9d9
fix(dataview): evaluate ACL per statement in batch saves
Zxc4wonder Jul 27, 2026
f02778d
refactor(dataview): introduce save execution context"
Zxc4wonder Jul 27, 2026
de8f3c0
feat(query-console): track server transaction state
Zxc4wonder Jul 27, 2026
eb6df1b
fix(query-console): serialize jdbc operations and close connections
Zxc4wonder Jul 27, 2026
f7ac3dd
fix(acl): avoid transaction-unsafe impact estimation
Zxc4wonder Jul 27, 2026
65301db
feat(dataview): add database transaction probes and savepoints
Zxc4wonder Jul 27, 2026
a2dab43
fix(query-console): save dataview changes on session connection
Zxc4wonder Jul 27, 2026
edc9143
fix(dataview): prevent stale and concurrent save state
Zxc4wonder Jul 27, 2026
280caa3
feat:
Zxc4wonder Jul 27, 2026
9aed712
feat(dataview): enable New Query preview and remove redundant save logic
Zxc4wonder Jul 27, 2026
776ea4b
fix(query-console): complete preview flow and isolate ACL review context
Zxc4wonder Jul 27, 2026
806772f
refactor(query-console): simplify transaction inspection and cleanup …
Zxc4wonder Jul 27, 2026
ff8db8f
fix(query-console): inspect MySQL transaction state via driver
Zxc4wonder Jul 27, 2026
e7f451d
fix(dataview): handle uncertain save outcomes safely
Zxc4wonder Jul 28, 2026
48dabd8
feat:
Zxc4wonder Jul 29, 2026
c1e3d78
fix: harden DataView save transaction lifecycle
Zxc4wonder Jul 29, 2026
5a1dfd4
fix: harden console lifecycle and audit error handling
Zxc4wonder Jul 29, 2026
3bfca3b
fix: use explicit resource actions for tree double click
Zxc4wonder Jul 29, 2026
831be00
feat:back
Zxc4wonder Jul 29, 2026
0f047a2
Merge pull request #203 from jumpserver/pr@new_terminal@feat_dataview…
Zxc4wonder Jul 29, 2026
ee95021
build: switch to JumpServer Druid from FIT2CLOUD
Zxc4wonder Jul 31, 2026
1e9f3fb
perf: Update Dockerfile with new base image tag
github-actions[bot] Jul 31, 2026
1e0df20
Merge pull request #214 from jumpserver/pr@new_terminal@build_druid_m…
Zxc4wonder Jul 31, 2026
9ee0154
feat:new console
Zxc4wonder Jul 31, 2026
4b10013
feat: add lazy CodeMirror SQL completion
Zxc4wonder Aug 4, 2026
de10c83
fix: harden SQL metadata context and identifier resolution
Zxc4wonder Aug 4, 2026
e02e92f
Merge pull request #215 from jumpserver/pr@new_terminal@feat_chen_new…
Zxc4wonder Aug 5, 2026
20664c6
fix(console): preserve execution and audit state
Zxc4wonder Aug 5, 2026
7f9fbb0
perf: update docker dev env
ibuler Aug 7, 2026
81070ae
perf: update dev run
ibuler Aug 7, 2026
9b1280c
perf: update env
ibuler Aug 7, 2026
e7b82c2
Merge pull request #219 from jumpserver/pr@new_terminal@fix-new-conso…
Zxc4wonder Aug 10, 2026
e95686f
fix(console): improve cancellation
Zxc4wonder Aug 10, 2026
1a2fd10
fix(console): handle chunking and cancellation
Zxc4wonder Aug 10, 2026
f615c00
Merge pull request #221 from jumpserver/pr@new_terminal@feat_console_…
Zxc4wonder Aug 11, 2026
a476ecd
feat: add filter
ibuler Aug 12, 2026
a4e207b
Merge pull request #217 from jumpserver/pr@new_terminal@feat_sql_comp…
Zxc4wonder Aug 13, 2026
c1c1d40
feat(ai): integrate Wisp SQL assistant (#223)
fit2bot Aug 13, 2026
ec947b2
feat(console): support native SQL execution
Zxc4wonder Aug 17, 2026
045d15a
fix(console): harden raw SQL execution
Zxc4wonder Aug 17, 2026
f01b9aa
Merge pull request #227 from jumpserver/pr@new_terminal@feat_jdbc_con…
Zxc4wonder Aug 18, 2026
12e678d
feat(metadata): add canonical metadata foundation (provider + catalog)
Zxc4wonder Aug 19, 2026
1744649
feat(metadata): add canonical metadata provider and catalog
Zxc4wonder Aug 19, 2026
a40d56b
fix(metadata): dedupe function-based index parts
Zxc4wonder Aug 19, 2026
e1aeb92
refactor(resource): migrate tree to MetadataCatalog
Zxc4wonder Aug 19, 2026
3d6906a
refactor(metadata): migrate completion and overview to MetadataCatalog
Zxc4wonder Aug 19, 2026
bda8253
refactor(metadata): migrate hints and table properties to catalog
Zxc4wonder Aug 19, 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
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.github
.idea
.vscode
**/.DS_Store
**/*.iml
**/target
data
node_modules
frontend/node_modules
frontend/dist
backend/web/src/main/resources/static
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node-terminal",
"name": "Docker: Chen Backend",
"request": "launch",
"command": "docker compose up --build",
"cwd": "${workspaceFolder}"
}
]
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"java.configuration.runtimes": [
{
"name": "JavaSE-21",
"path": "/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home",
"default": true
},
{
"name": "JavaSE-17",
"path": "/Users/guang/Library/Java/JavaVirtualMachines/jbr-17.0.9/Contents/Home"
}
],
"java.jdt.ls.java.home": "/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home",
"java.compile.nullAnalysis.mode": "disabled"
}
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
FROM jumpserver/chen-base:20260701_092702 AS stage-build
FROM jumpserver/chen-base:20260731_025640 AS stage-build
ENV LANG=en_US.UTF-8

WORKDIR /opt/chen/
COPY . .

RUN cd frontend \
&& npm run build

RUN mvn clean package -Dmaven.test.skip=true

Expand Down
52 changes: 52 additions & 0 deletions Dockerfile.wisp-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# syntax=docker/dockerfile:1.7

ARG GO_VERSION=1.25
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS stage-build

ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG WISP_BUILD_PROCS=2
ARG WISP_BUILD_MEMORY=1GiB

ENV CGO_ENABLED=0
WORKDIR /opt/wisp

COPY --from=wisp-source go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod,sharing=locked \
GOMAXPROCS=${WISP_BUILD_PROCS} \
GOMEMLIMIT=${WISP_BUILD_MEMORY} \
go mod download

COPY --from=wisp-source main.go ./
COPY --from=wisp-source cmd ./cmd
COPY --from=wisp-source pkg ./pkg
COPY --from=wisp-source protobuf-go ./protobuf-go

RUN --mount=type=cache,target=/go/pkg/mod,sharing=locked \
--mount=type=cache,target=/root/.cache/go-build,sharing=locked \
GOMAXPROCS=${WISP_BUILD_PROCS} \
GOMEMLIMIT=${WISP_BUILD_MEMORY} \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
go build -p=${WISP_BUILD_PROCS} -trimpath -o /out/wisp .

FROM debian:bookworm-slim

ARG APT_MIRROR=http://deb.debian.org
RUN set -ex \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources \
&& apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates netcat-openbsd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/wisp
COPY --from=stage-build /out/wisp ./wisp

VOLUME ["/opt/wisp/data"]
EXPOSE 9090

HEALTHCHECK --interval=2s --timeout=1s --start-period=5s --retries=30 \
CMD ["nc", "-z", "127.0.0.1", "9090"]

CMD ["./wisp"]
80 changes: 80 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
SHELL := /bin/bash
.DEFAULT_GOAL := help
.NOTPARALLEL:

DOCKER_COMPOSE ?= docker compose
COMPOSE_PARALLEL_LIMIT ?= 1
WISP_IMAGE_REPOSITORY ?= ghcr.io/jumpserver/wisp
WISP_BRANCH ?=
export WISP_BRANCH
WISP_TAG ?= $(shell ./scripts/resolve-wisp-tag.sh)
WISP_IMAGE ?= $(WISP_IMAGE_REPOSITORY):$(WISP_TAG)
WISP_PULL_POLICY ?= missing

export COMPOSE_PARALLEL_LIMIT
export WISP_IMAGE_REPOSITORY
export WISP_TAG
export WISP_IMAGE
export WISP_PULL_POLICY
export WISP_SOURCE

DEV_COMPOSE_FILES := -f docker-compose.yml -f docker-compose.wisp-dev.yml
ifneq ($(strip $(WISP_SOURCE)),)
DEV_COMPOSE_FILES += -f docker-compose.wisp-source.yml
endif
DEV_COMPOSE := $(DOCKER_COMPOSE) $(DEV_COMPOSE_FILES)

.PHONY: help dev run dev-run dev-up dev-wisp dev-wisp-image dev-logs dev-ps dev-config dev-down proto-sync

help:
@printf '%s\n' \
'Chen development commands:' \
' make dev Run in the foreground (make dev run also works)' \
' make dev-up Build and run in the background' \
' make dev-wisp Rebuild/recreate only Wisp' \
' make dev-wisp-image Show the resolved Wisp image' \
' make dev-logs Follow Chen and Wisp logs' \
' make dev-ps Show development services' \
' make dev-config Render the merged Compose configuration' \
' make dev-down Stop and remove development services' \
' make proto-sync Copy generated Java protobuf files from Wisp' \
'' \
'Wisp source mode:' \
' make dev WISP_SOURCE=/absolute/path/to/wisp' \
'' \
'Wisp image mode:' \
' Wisp tag defaults to the current Chen tracking branch' \
' make dev WISP_TAG=latest' \
' make dev WISP_IMAGE=registry/wisp:tag WISP_PULL_POLICY=always'

# Both spellings are supported, including one invocation written as
# `make dev run`. GNU Make updates their shared prerequisite only once.
dev run: dev-run
@:

dev-run:
@$(DEV_COMPOSE) up --build

dev-up:
@$(DEV_COMPOSE) up -d --build

dev-wisp:
@$(DEV_COMPOSE) up -d --build --no-deps wisp

dev-wisp-image:
@printf '%s\n' '$(WISP_IMAGE)'

dev-logs:
@$(DEV_COMPOSE) logs -f chen-backend wisp

dev-ps:
@$(DEV_COMPOSE) ps

dev-config:
@$(DEV_COMPOSE) config

dev-down:
@$(DEV_COMPOSE) down

proto-sync:
@./scripts/sync-wisp-proto.sh
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,81 @@ Chen is implemented in Java, and its name is derived from the Dota hero [Chen](h
- [x] SQL Server (X-Pack)
- [x] Oracle (X-Pack)
- [x] DB2 (X-Pack)

## Develop with Wisp

The default Chen image contains a released Wisp binary. The development
override separates Wisp into its own service, starts Chen's Java process
directly, and connects Chen to `wisp:9090` over the Compose network.

### Use a Wisp image

`make dev` defaults to `ghcr.io/jumpserver/wisp:<chen-branch>`. The branch is
resolved from the current branch's tracking branch first, then from the local
branch. JumpServer-style branches such as `pr@new_terminal@feat_ai` resolve to
their base branch (`new_terminal`), and characters that cannot appear in a
Docker tag are replaced with `-`. A detached checkout falls back to `latest`.

Check the result without starting containers:

```bash
make dev-wisp-image
```

The matching tag must have been published in the Wisp container registry. If
it is not available, select a known tag with `WISP_TAG`, use `WISP_SOURCE` as
described below, or set `WISP_IMAGE` to a private-registry or locally built
image:

```bash
make dev WISP_TAG=latest

make dev \
WISP_IMAGE=registry.example.com/wisp:my-branch \
WISP_PULL_POLICY=always
```

Use `WISP_BRANCH` to resolve a tag from a branch other than the checked-out
Chen branch. `WISP_IMAGE_REPOSITORY` changes only the registry/repository while
retaining automatic tag selection. For an image already built locally, set
`WISP_PULL_POLICY=never`.

Calling `docker compose` directly (without the Makefile) retains the Compose
file's `ghcr.io/jumpserver/wisp:latest` fallback.

### Build from Wisp source

Add `docker-compose.wisp-source.yml` and set `WISP_SOURCE` to any local checkout
path. It does not need to be `../wisp`:

```bash
make dev WISP_SOURCE=/absolute/path/to/wisp
```

`WISP_SOURCE` is a BuildKit named context, so it may also be a Git context URL
when the changes have been pushed to a branch. Uncommitted changes require a
local directory.

After a Go-only Wisp change, rebuild just Wisp; the Java container can stay up
and its gRPC channel will reconnect:

```bash
make dev-wisp WISP_SOURCE=/absolute/path/to/wisp
```

If a Wisp `.proto` file changes, regenerate both Go and Java outputs in Wisp,
then synchronize the Java output before rebuilding Chen:

```bash
make -C /absolute/path/to/wisp proto-go proto-java
make proto-sync WISP_SOURCE=/absolute/path/to/wisp
make dev-up WISP_SOURCE=/absolute/path/to/wisp
```

Use `make dev-up` for detached startup, `make dev-logs` to follow both service
logs, and `make dev-down` to stop the environment. Run `make help` for all
development commands. `make dev run` is accepted as an alias of `make dev`.

The build and runtime limits can be adjusted with `WISP_BUILD_PROCS`,
`WISP_BUILD_MEMORY`, `WISP_CPUS`, `WISP_MEMORY_LIMIT`, `CHEN_CPUS`, and
`CHEN_MEMORY_LIMIT`.
9 changes: 7 additions & 2 deletions backend/framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@
<artifactId>framework</artifactId>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.freva</groupId>
<artifactId>ascii-table</artifactId>
<version>1.8.0</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<groupId>com.jumpserver</groupId>
<artifactId>druid</artifactId>
<version>1.2.18</version>
<version>${druid.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.jumpserver.chen.framework.datasource.Datasource;
import org.jumpserver.chen.framework.console.component.Logger;
import org.jumpserver.chen.framework.console.component.Messager;
import org.jumpserver.chen.framework.console.context.ConsoleContext;
import org.jumpserver.chen.framework.ws.io.PacketIO;
import org.jumpserver.chen.framework.console.entity.request.Connect;
import org.springframework.web.socket.WebSocketSession;
Expand All @@ -20,18 +21,25 @@ public abstract class AbstractConsole implements Console {
private final PacketIO packetIO;
private final Messager messager;
private String title;
private String nodeKey;
private final ConsoleContext context;

public String getTitle() {
return this.title;
}

public void onInit(Connect connect) {
this.packetIO.sendPacket("init", Map.of("title", this.title));
this.packetIO.sendPacket("init", Map.of(
"title", this.title,
"consoleId", this.packetIO.getWsSession().getId()
));
}

protected AbstractConsole(Datasource datasource, WebSocketSession ws, String nodeKey) {
this.nodeKey = nodeKey;
public String getNodeKey() {
return this.context.nodeKey();
}

protected AbstractConsole(Datasource datasource, WebSocketSession ws, ConsoleContext context) {
this.context = context;
this.datasource = datasource;
this.packetIO = new PacketIO(ws);
this.consoleLogger = new Logger(this.packetIO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

import org.jumpserver.chen.framework.ws.io.Packet;
import org.jumpserver.chen.framework.console.entity.request.Connect;
import org.jumpserver.chen.framework.console.context.ConsoleContext;

public interface Console {
String getTitle();
String getNodeKey();
ConsoleContext getContext();
void onInit(Connect connect);

void handle(Packet packet);
Expand Down
Loading