refactor: 修改 JumpServer 依赖数据库

This commit is contained in:
wanghe-fit2cloud 2023-08-02 23:29:35 +08:00
parent 46f1b74d4d
commit 1c393fc1d6
3 changed files with 61 additions and 144 deletions

View File

@ -1,23 +1,3 @@
<p align="center">
<a href="https://jumpserver.org"><img src="https://download.jumpserver.org/images/jumpserver-logo.svg" alt="JumpServer" width="300" /></a>
</p>
<h3 align="center">广受欢迎的开源堡垒机</h3>
<p align="center">
<a href="https://www.gnu.org/licenses/gpl-3.0.html"><img src="https://img.shields.io/github/license/jumpserver/jumpserver" alt="License: GPLv3"></a>
<a href="https://hub.docker.com/u/jumpserver"><img src="https://img.shields.io/docker/pulls/jumpserver/jms_all.svg" alt="Docker pulls"></a>
<a href="https://github.com/jumpserver/jumpserver/releases/latest"><img src="https://img.shields.io/github/v/release/jumpserver/jumpserver" alt="Latest release"></a>
<a href="https://github.com/jumpserver/jumpserver"><img src="https://img.shields.io/github/stars/jumpserver/jumpserver?color=%231890FF&style=flat-square" alt="Stars"></a>
</p>
<p align="center">
JumpServer <a href="https://github.com/jumpserver/jumpserver/releases/tag/v3.0.0">v3.0</a> 正式发布。
<br>
9 年时间,倾情投入,用心做好一款开源堡垒机。
</p>
JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统。JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型的资产,包括: JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统。JumpServer 堡垒机帮助企业以更安全的方式管控和登录各种类型的资产,包括:
- **SSH**: Linux / Unix / 网络设备 等; - **SSH**: Linux / Unix / 网络设备 等;

View File

@ -1,12 +1,5 @@
additionalProperties: additionalProperties:
formFields: formFields:
- default: ./data
edit: true
envKey: VOLUME_DIR
labelEn: Data directory
labelZh: 数据目录
required: true
type: text
- default: vYneAbsXUhe4BghEeedNL7nfWLwaTTmhnwQMvjYOIG25Ofzghk - default: vYneAbsXUhe4BghEeedNL7nfWLwaTTmhnwQMvjYOIG25Ofzghk
edit: true edit: true
envKey: SECRET_KEY envKey: SECRET_KEY
@ -49,71 +42,65 @@ additionalProperties:
value: "ERROR" value: "ERROR"
- label: CRITICAL - label: CRITICAL
value: "CRITICAL" value: "CRITICAL"
- default: jms_mysql - default: ""
disabled: true envKey: PANEL_DB_HOST
envKey: DB_HOST key: mysql
labelEn: Database host labelEn: Database Service
labelZh: 数据库主机 labelZh: 数据库服务
type: text
- default: 3306
disabled: true
envKey: DB_PORT
labelEn: Database port
labelZh: 数据库端口
rule: paramPort
type: number
- default: root
disabled: true
envKey: DB_USER
labelEn: Database user
labelZh: 数据库用户
type: text
- default: Np2qgqtiUayA857GpuVI0Wtg
edit: true
envKey: DB_PASSWORD
labelEn: Database password
labelZh: 数据库密码
required: true required: true
type: password type: service
- default: jumpserver - default: jumpserver
envKey: DB_NAME envKey: PANEL_DB_NAME
labelEn: Database name labelEn: Database
labelZh: 数据库名称 labelZh: 数据库名
random: true
required: true required: true
rule: paramCommon
type: text type: text
- default: jms_redis - default: jumpserver
disabled: true envKey: PANEL_DB_USER
envKey: REDIS_HOST labelEn: Database User
labelEn: Redis host labelZh: 数据库用户
labelZh: Redis 主机 random: true
type: text
- default: 6379
disabled: true
envKey: REDIS_PORT
labelEn: Redis port
labelZh: Redis 端口
rule: paramPort
type: number
- default: KoJqlTDu1d5HwfXgJ4QTbZQt
edit: true
envKey: REDIS_PASSWORD
labelEn: Redis password
labelZh: Redis 密码
required: true required: true
rule: paramCommon
type: text
- default: jumpserver
envKey: PANEL_DB_USER_PASSWORD
labelEn: Database User Password
labelZh: 数据库用户密码
random: true
required: true
rule: paramComplexity
type: password type: password
- default: 80 - default: ""
edit: true edit: true
envKey: HTTP_PORT envKey: REDIS_HOST
labelEn: JumpServer Web port key: redis
labelZh: JumpServer Web 端口 labelEn: Redis Service
labelZh: 缓存服务服务
required: true
type: service
- default: ""
edit: true
envKey: REDIS_PASS
labelEn: Redis Service Password
labelZh: 缓存服务服务密码
required: true
rule: paramCommon
type: password
- default: 8080
envKey: PANEL_APP_PORT_HTTP
labelEn: Web Port
labelZh: Web 端口
required: true required: true
rule: paramPort rule: paramPort
type: number type: number
- default: 2222 - default: 2222
edit: true edit: true
envKey: SSH_PORT envKey: SSH_PORT
labelEn: JumpServer SSH port labelEn: SSH port
labelZh: JumpServer SSH 端口 labelZh: SSH 端口
required: true required: true
rule: paramPort rule: paramPort
type: number type: number

View File

@ -1,44 +1,6 @@
version: '3.8' version: '3'
services: services:
jms_mysql: jumpserver:
image: mariadb:10.6
restart: always
labels:
createdBy: "Apps"
environment:
MARIADB_ROOT_PASSWORD: ${DB_PASSWORD}
MARIADB_DATABASE: ${DB_NAME}
healthcheck:
test: "mysql -h127.0.0.1 -uroot -p$$MARIADB_ROOT_PASSWORD -e 'SHOW DATABASES;'"
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
volumes:
- ${VOLUME_DIR}/mariadb/data:/var/lib/mysql
networks:
- 1panel-network
jms_redis:
image: redis:6.2
restart: always
labels:
createdBy: "Apps"
command: redis-server --requirepass ${REDIS_PASSWORD} --maxmemory-policy allkeys-lru
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
healthcheck:
test: "redis-cli -h 127.0.0.1 -a $$REDIS_PASSWORD info Replication"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
- ${VOLUME_DIR}/redis/data:/data
networks:
- 1panel-network
jms_all:
image: jumpserver/jms_all:v3.4.3 image: jumpserver/jms_all:v3.4.3
container_name: ${CONTAINER_NAME} container_name: ${CONTAINER_NAME}
privileged: true privileged: true
@ -50,43 +12,31 @@ services:
BOOTSTRAP_TOKEN: ${BOOTSTRAP_TOKEN} BOOTSTRAP_TOKEN: ${BOOTSTRAP_TOKEN}
DEBUG: ${DEBUG:-FALSE} DEBUG: ${DEBUG:-FALSE}
LOG_LEVEL: ${LOG_LEVEL} LOG_LEVEL: ${LOG_LEVEL}
DB_HOST: ${DB_HOST} DB_HOST: ${PANEL_DB_HOST}
DB_PORT: ${DB_PORT} DB_PORT: 3306
DB_USER: ${DB_USER} DB_USER: ${PANEL_DB_USER}
DB_PASSWORD: ${DB_PASSWORD} DB_PASSWORD: ${PANEL_DB_USER_PASSWORD}
DB_NAME: ${DB_NAME} DB_NAME: ${PANEL_DB_NAME}
REDIS_HOST: ${REDIS_HOST} REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT} REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD} REDIS_PASSWORD: ${REDIS_PASS}
MAGNUS_MYSQL_PORT: ${MAGNUS_MYSQL_PORT} MAGNUS_MYSQL_PORT: ${MAGNUS_MYSQL_PORT}
MAGNUS_MARIADB_PORT: ${MAGNUS_MARIADB_PORT} MAGNUS_MARIADB_PORT: ${MAGNUS_MARIADB_PORT}
MAGNUS_REDIS_PORT: ${MAGNUS_REDIS_PORT} MAGNUS_REDIS_PORT: ${MAGNUS_REDIS_PORT}
ports: ports:
- ${HTTP_PORT}:80 - ${PANEL_APP_PORT_HTTP}:80
- ${SSH_PORT}:2222 - ${SSH_PORT}:2222
- ${MAGNUS_MYSQL_PORT}:33061 - ${MAGNUS_MYSQL_PORT}:33061
- ${MAGNUS_MARIADB_PORT}:33062 - ${MAGNUS_MARIADB_PORT}:33062
- ${MAGNUS_REDIS_PORT}:63790 - ${MAGNUS_REDIS_PORT}:63790
depends_on:
jms_mysql:
condition: service_healthy
jms_redis:
condition: service_healthy
healthcheck:
test: "curl -fsL http://localhost/api/health/ > /dev/null"
interval: 10s
timeout: 5s
retries: 3
start_period: 90s
volumes: volumes:
- ${VOLUME_DIR}/core/data:/opt/jumpserver/core/data - ./data/core/data:/opt/jumpserver/core/data
- ${VOLUME_DIR}/koko/data:/opt/jumpserver/koko/data - ./data/koko/data:/opt/jumpserver/koko/data
- ${VOLUME_DIR}/lion/data:/opt/jumpserver/lion/data - ./data/lion/data:/opt/jumpserver/lion/data
- ${VOLUME_DIR}/magnus/data:/opt/jumpserver/magnus/data - ./data/magnus/data:/opt/jumpserver/magnus/data
- ${VOLUME_DIR}/nginx/data:/var/log/nginx - ./data/nginx/data:/var/log/nginx
networks: networks:
- 1panel-network - 1panel-network
networks: networks:
1panel-network: 1panel-network:
external: true external: true