跳到主要内容

Luna 环境部署

1 Luna 组件概述​

Luna 是 JumpServer 的前端 UI 项目,主要使用 Angular CLI 完成。

1.1 环境要求​

表 1 Luna 环境要求
NameLunaNode
Versionv4.10.1716.5

1.2 选择部署方式​

源代码部署​

  • 下载源代码。
  • 可以从 Github 网站上获取最新的 Release 副本。这些版本是最新代码的稳定快照,从项目网站下载 Source code.tar.gz 源代码,通过命令行中提取该存档:
cd /opt
mkdir /opt/luna-v4.10.17
wget -O /opt/luna-v4.10.17.tar.gz https://github.com/jumpserver/luna/archive/refs/tags/v4.10.17.tar.gz
tar -xf luna-v4.10.17.tar.gz -C /opt/luna-v4.10.17 --strip-components 1
  • 安装 Node。
  • 从 Node 官方网站参考文档部署 Node.js,请根据 环境要求,通过命令行中判断是否安装完成:
node -v

v16.5

  • 安装依赖。
cd /opt/luna-v4.10.17
yarn install
  • 修改配置文件。
sed -i "s@[0-9].[0-9].[0-9]@@g" src/environments/environment.prod.ts
vi proxy.conf.json
{
"/koko": {
"target": "http://localhost:5000", # KoKo 地址
"secure": false,
"ws": true
},
"/media/": {
"target": "http://localhost:8080", # Core 地址
"secure": false,
"changeOrigin": true
},
"/api/": {
"target": "http://localhost:8080", # Core 地址
"secure": false, # https ssl 需要开启
"changeOrigin": true
},
"/core": {
"target": "http://localhost:8080", # Core 地址
"secure": false,
"changeOrigin": true
},
"/static": {
"target": "http://localhost:8080", # Core 地址
"secure": false,
"changeOrigin": true
},
"/lion": {
"target": "http://localhost:9529", # Lion 地址
"secure": false,
"pathRewrite": {
"^/lion/monitor": "/monitor"
},
"ws": true,
"changeOrigin": true
},
"/omnidb": {
"target": "http://localhost:8082",
"secure": false,
"ws": true,
"changeOrigin": true
}
}
  • 运行 Luna。
./node_modules/.bin/ng serve
  • 构建 Luna。
yarn build
cp -R src/assets/i18n luna/
cp -rf luna luna-v4.10.17
tar -czf luna-v4.10.17.tar.gz luna-v4.10.17

使用 Release​

  • 下载 Release 文件,从 Github 网站上获取最新的 Release 副本。
  • 这些版本是最新代码的稳定快照。
表 2 Luna 下载包
OSArchName
AllAllluna-v4.10.17.tar.gz
cd /opt
wget https://github.com/jumpserver/luna/releases/download/v4.10.17/luna-v4.10.17.tar.gz
tar -xf luna-v4.10.17.tar.gz