Skip to content

Commit

Permalink
Merge pull request #34 from jumpserver/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Halo1236 committed Dec 1, 2023
2 parents 8c894cc + bcecb4e commit 309ec33
Show file tree
Hide file tree
Showing 28 changed files with 519 additions and 109 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# build.yml

name: Auto Build

on:
workflow_dispatch:
push:
branches:
- master
- release-test



env:
ELECTRON_OUTPUT_PATH: interface/dist_electron
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}


jobs:
release:
name: build and release electron app
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11, windows-latest]

steps:
- name: Check out git repository
uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: 1.18

- name: build go client
run: make build-client
working-directory: go-client

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install system deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils
- name: Yarn install
run: |
yarn
yarn global add xvfb-maybe
- name: Build & release app
run: |
yarn build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XCODE_APP_TEAM_ID: ${{ secrets.XCODE_APP_TEAM_ID }}
XCODE_APP_LOADER_EMAIL: ${{ secrets.XCODE_APP_LOADER_EMAIL }}
XCODE_APP_LOADER_PASSWORD: ${{ secrets.XCODE_APP_LOADER_PASSWORD }}
BUILD_CERTIFICATE_BASE64: ${{ secrets.CSC_LINK }}
P12_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Jumpserve Clients
# Jumpserve Client

JumpServer 客户端,支持本地本地客户端拉起。
## 概览
Expand Down
58 changes: 58 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Jumpserve Client

JumpServer client, supports local client pull up.

## Overview

![windows](static/windows.png)


## Install

### Mac

Download the Mac installation package, install JumpServer.dmg and put JumpServer.app into Applications. Double-click to open JumpServer.app to complete the custom protocol.


### Win

Download the Win installation package and double-click the JumpServer installation package file (you need to wait for 10 seconds).


### Linux

Download the Linux installation package, double-click the Deb installation package file, and open the installation package manager to install it. Or install it using the command

```
sudo dpkg -i <package_file>
```


## uninstall

### Windows

Just uninstall the control panel directly.


### Mac

Remove JumpServer.app.


### Linux

Click to open Software Manager to uninstall. Or use the command to uninstall

```
sudo dpkg --purge <package_file>
```


## package

- [packaging scheme](https://github.com/jumpserver/apps/blob/master/README_PACK.md)
19 changes: 11 additions & 8 deletions go-client/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"download_url": "内置",
"type": "windows",
"path": "mstsc.exe",
"arg_format": "",
"arg_format": "{file}",
"match_first": [],
"is_internal": true,
"is_default": true,
Expand Down Expand Up @@ -169,7 +169,7 @@
"download_url": "https://github.com/FuckDoctors/rdm-builder/releases/download/2022.5.1/resp-2022.5.1.exe",
"type": "databases",
"path": "",
"arg_format": "--settings-dir {config_file}",
"arg_format": "--settings-dir*{config_file}",
"match_first": [],
"is_internal": false,
"is_default": false,
Expand All @@ -183,7 +183,8 @@
"name": "terminal",
"display_name": "Terminal",
"protocol": [
"ssh"
"ssh",
"telnet"
],
"comment": "Terminal是MacOS操作系统上的虚拟终端应用软件,位于“实用工具”文件夹内。",
"download_url": "内置",
Expand All @@ -199,7 +200,8 @@
"name": "iterm",
"display_name": "iTerm2",
"protocol": [
"ssh"
"ssh",
"telnet"
],
"comment": "iTerm2是MacOS操作系统上的虚拟终端应用软件。\n\n!!!手动下载安装,点击保存启用!!!",
"download_url": "https://iterm2.com/downloads.html",
Expand Down Expand Up @@ -240,7 +242,7 @@
"download_url": "内置",
"type": "windows",
"path": "/Applications/Microsoft Remote Desktop.app",
"arg_format": "",
"arg_format": "{file}",
"match_first": [],
"is_internal": true,
"is_default": true,
Expand Down Expand Up @@ -319,7 +321,8 @@
"name": "terminal",
"display_name": "Terminal",
"protocol": [
"ssh"
"ssh",
"telnet"
],
"comment": "Terminal是Linux操作系统上的虚拟终端应用软件。",
"download_url": "内置",
Expand All @@ -343,7 +346,7 @@
"download_url": "https://remmina.org/how-to-install-remmina/-内置",
"type": "windows",
"path": "remmina",
"arg_format": "",
"arg_format": "{file}",
"match_first": [],
"is_internal": true,
"is_default": false,
Expand All @@ -359,7 +362,7 @@
"download_url": "https://github.com/FreeRDP/FreeRDP-内置",
"type": "windows",
"path": "xfreerdp",
"arg_format": "",
"arg_format": "{file} /cert-ignore",
"match_first": [],
"is_internal": true,
"is_default": false,
Expand Down
2 changes: 1 addition & 1 deletion go-client/pkg/awaken/awaken.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (r *Rouse) Run() {
switch protocol {
case "rdp":
r.HandleRDP(&appConfig)
case "ssh", "sftp":
case "ssh", "sftp", "telnet":
r.HandleSSH(&appConfig)
case "mysql", "mariadb", "postgresql", "redis", "oracle", "sqlserver":
r.HandleDB(&appConfig)
Expand Down
3 changes: 2 additions & 1 deletion go-client/pkg/awaken/awaken_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func awakenSSHCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
var appItem *config.AppItem
var appLst []config.AppItem
switch r.Protocol {
case "ssh":
case "ssh", "telnet":
r.Protocol = "ssh"
appLst = cfg.MacOS.Terminal
case "sftp":
appLst = cfg.MacOS.FileTransfer
Expand Down
6 changes: 4 additions & 2 deletions go-client/pkg/awaken/awaken_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ func awakenRDPCommand(filePath string, cfg *config.AppConfig) *exec.Cmd {
if appItem == nil {
return nil
}
cmd := exec.Command(appItem.Name, filePath)
args := strings.Replace(appItem.ArgFormat, "{file}", filePath, 1)
cmd := exec.Command(appItem.Name, strings.Split(args, " ")...)
return cmd
}

func awakenSSHCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
var appItem *config.AppItem
var appLst []config.AppItem
switch r.Protocol {
case "ssh":
case "ssh", "telnet":
r.Protocol = "ssh"
appLst = cfg.Linux.Terminal
case "sftp":
appLst = cfg.Linux.FileTransfer
Expand Down
13 changes: 10 additions & 3 deletions go-client/pkg/awaken/awaken_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func handleSSH(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
var appItem *config.AppItem
var appLst []config.AppItem
switch r.Protocol {
case "ssh":
case "ssh", "telnet":
r.Protocol = "ssh"
appLst = cfg.Windows.Terminal
case "sftp":
appLst = cfg.Windows.FileTransfer
Expand Down Expand Up @@ -107,7 +108,7 @@ func handleDB(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
ss := make(map[string]string)
ss["host"] = r.Host
ss["port"] = strconv.Itoa(r.Port)
ss["name"] = r.Name
ss["name"] = r.getName()
ss["auth"] = r.Token.ID + "@" + r.Value
ss["ssh_agent_path"] = ""
ss["ssh_password"] = ""
Expand All @@ -130,7 +131,13 @@ func handleDB(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
connectMap["config_file"] = currentPath
}
commands := getCommandFromArgs(connectMap, appItem.ArgFormat)
return exec.Command(appPath, strings.Split(commands, " ")...)
if strings.Contains(commands, "*") {
commands := strings.Split(commands, "*")
return exec.Command(appPath, commands...)
} else {
commands := strings.Split(commands, " ")
return exec.Command(appPath, commands...)
}
}

func handleCommand(r *Rouse, cfg *config.AppConfig) *exec.Cmd {
Expand Down
8 changes: 8 additions & 0 deletions interface/build/win/installer.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
WriteRegStr HKCR "jms\shell" "" ""
WriteRegStr HKCR "jms\shell\open" "" ""
WriteRegStr HKCR "jms\shell\open\command" "" '"$INSTDIR\resources\bin\windows\JumpServerClient.exe" "%1"'

AccessControl::GrantOnFile \
"$INSTDIR\resources\bin" "(BU)" "GenericWrite + GenericRead"
Pop $R0
${If} $R0 == error
Pop $R0
MessageBox MB_OK `AccessControl error: $R0`
${EndIf}
!macroend

!macro customUnInstall
Expand Down
Binary file added interface/build/x86-ansi/AccessControl.dll
Binary file not shown.
Binary file added interface/build/x86-unicode/AccessControl.dll
Binary file not shown.
5 changes: 3 additions & 2 deletions interface/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jumpserver-client",
"author": "Fit2Cloud Technology Co., Ltd.; <[email protected]>",
"version": "v2.0.2",
"version": "v2.1.0",
"homepage": "https://jumpserver.org",
"private": true,
"scripts": {
Expand All @@ -22,6 +22,7 @@
"element-plus": "^2.3.0",
"fs-extra": "^11.1.1",
"vue": "^3.2.13",
"vue-i18n": "^9.6.5",
"vue-router": "^4.1.6"
},
"devDependencies": {
Expand All @@ -31,7 +32,7 @@
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"electron": "^23.1.3",
"electron": "^22.3.27",
"electron-devtools-installer": "^3.1.0",
"eslint": "^8.31.0",
"eslint-config-standard": ">=16.0.0",
Expand Down
9 changes: 7 additions & 2 deletions interface/src/background.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {app, BrowserWindow, ipcMain, protocol} from "electron";
import {app, shell, BrowserWindow, ipcMain, protocol} from "electron";
import {createProtocol} from "vue-cli-plugin-electron-builder/lib";
import installExtension, {VUEJS3_DEVTOOLS} from "electron-devtools-installer";
import path from 'path'
Expand Down Expand Up @@ -37,7 +37,12 @@ async function createWindow() {
},
});

if (process.env.WEBPACK_DEV_SERVER_URL) {
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: "deny" }
});

if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
await mainWindow.loadURL(process.env.WEBPACK_DEV_SERVER_URL);
// if (!process.env.IS_TEST) mainWindow.webContents.openDevTools()
Expand Down
17 changes: 17 additions & 0 deletions interface/src/i18n/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { createI18n } from 'vue-i18n'
import messages from './langs'


const browserLang = navigator.systemLanguage || navigator.language
let lang = browserLang || 'zh'
lang = localStorage.getItem('lang') || lang.slice(0, 2)
const i18n = createI18n({
locale: lang,
legacy: false,
fallbackLocale: 'en',
silentFallbackWarn: true,
silentTranslationWarn: true,
messages
})

export default i18n
Loading

0 comments on commit 309ec33

Please sign in to comment.